:root {
    --bg: #f3f4f1;
    --surface: #ffffff;
    --ink: #17211d;
    --muted: #708078;
    --line: #dbe2dc;
    --green: #174c3c;
    --green-2: #2d9a6e;
    --gold: #b47a19;
    --red: #b84b40;
    --purple: #7256a8;
    --blue: #347a9a;
    --shadow: 0 8px 30px rgba(31, 58, 47, .06);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
label:has(input[required]) > span:first-child::after,
label:has(select[required]) > span:first-child::after,
.required-text::after { content: " *"; color: #d33f32; font-weight: 900; }

.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: rgba(248, 250, 247, .94); backdrop-filter: blur(16px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(1540px, calc(100% - 32px)); margin: auto; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 190px; }
.brand-icon, .brand-mark { display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, #1d5a47, #123c30); box-shadow: 0 8px 18px rgba(23, 76, 60, .2); }
.brand-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 21px; font-weight: 850; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.account-menu { position: relative; }
.account-menu > summary { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 9px 4px 5px; border: 1px solid #ccd8d0; border-radius: 10px; color: #334a40; background: #fff; cursor: pointer; list-style: none; font-size: 11px; font-weight: 800; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover, .account-menu[open] > summary { border-color: #8eaa9b; background: #f7faf8; }
.account-menu > summary > i { width: 7px; height: 7px; margin: -3px 2px 0 1px; border-right: 1.5px solid #708078; border-bottom: 1.5px solid #708078; transform: rotate(45deg); transform-origin: center; transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.account-menu[open] > summary > i { transform: translateY(3px) rotate(225deg); }
.account-avatar { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: #fff; background: var(--green); font-size: 10px; }
.account-menu-panel { position: absolute; top: calc(100% + 9px); right: 0; z-index: 50; display: grid; width: 278px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 20px 55px rgba(24, 53, 43, .18); }
.account-menu[open] .account-menu-panel { animation: account-menu-in .2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes account-menu-in { from { opacity: 0; transform: translateY(-5px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.account-menu-user { display: flex; flex-direction: column; padding: 9px 10px 11px; border-bottom: 1px solid #e7ece8; }
.account-menu-user strong { font-size: 11px; }.account-menu-user small { margin-top: 2px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; font-size: 9px; }
.account-menu-panel > a { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; padding: 9px; border-radius: 9px; }
.account-menu-panel > a:hover { background: #f1f6f3; }
.account-menu-panel > a > span:first-child { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--green); background: #e8f3ed; font-size: 12px; }
.account-menu-panel > a > span:last-child { display: flex; flex-direction: column; }.account-menu-panel > a strong { font-size: 10px; }.account-menu-panel > a small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.account-menu-panel > a.account-menu-logout { margin-top: 4px; border-top: 1px solid #e7ece8; border-radius: 0 0 9px 9px; color: #a24037; }.account-menu-panel > a.account-menu-logout > span:first-child { color: #a24037; background: #fff0ed; }

.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border: 0; border-radius: 9px; font-size: 12px; font-weight: 750; transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease; }
.button { padding: 7px 12px; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: #123d31; }
.button-gold { color: #fff; background: var(--gold); }
.button-gold:hover { background: #966311; }
.button-outline { color: #334a40; border: 1px solid #ccd8d0; background: #fff; }
.button-outline:hover { border-color: #97b2a3; background: #f7faf8; }
.button-ghost { color: #53655c; background: transparent; }
.button-ghost:hover { background: #e9efeb; }
.button-danger { color: #9a362d; border: 1px solid #efc6c0; background: #fff1ef; }
.button-danger:hover { color: #fff; border-color: #a94238; background: #a94238; }
.button-block { width: 100%; }
.icon-button { width: 38px; height: 38px; padding: 0; color: #385148; border: 1px solid #ccd8d0; background: #fff; font-size: 24px; line-height: 1; }

.save-state, .user-chip { display: inline-flex; align-items: center; max-width: 190px; min-height: 30px; padding: 5px 9px; overflow: hidden; border-radius: 999px; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 800; }
.save-state { color: #52675d; background: #eaf0ec; }
.save-state.dirty { color: #795817; background: #fff3d5; }
.save-state.saving { color: #795817; background: #fff3d5; }
.save-state.saved { color: #126844; background: #e4f5eb; }
.save-state.error { color: #9b342b; background: #ffebe8; }
.user-chip { color: #355247; border: 1px solid var(--line); background: #fff; }

.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; width: min(1540px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 48px; }
.workspace, .summary-column { min-width: 0; }
.workspace { display: flex; flex-direction: column; gap: 16px; }
.summary-column { display: flex; flex-direction: column; gap: 16px; align-self: start; position: sticky; top: 86px; }
.surface { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }

.period-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px; }
.period-picker { display: flex; align-items: center; gap: 8px; }
.period-picker > div { display: flex; flex-direction: column; min-width: 155px; text-align: center; }
.period-picker small { color: #89958f; font-size: 10px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.period-picker strong { margin-top: 2px; font-size: 18px; }
.quick-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.quick-actions > small { margin-right: 3px; color: var(--muted); font-size: 10px; font-weight: 750; }

.calendar-surface { overflow: hidden; }
.calendar-header { padding: 16px; border-bottom: 1px solid #e3e8e4; }
.calendar-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.calendar-heading h2, .config-card h2, .calculation-card h2, .adjustment-card h2 { margin: 0; font-size: 14px; }
.calendar-heading p { margin: 3px 0 0; color: #7a8881; font-size: 11px; }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 13px; flex-wrap: wrap; color: #68766f; font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 999px; }
.dot-off { background: #df6b5d; }.dot-work { background: #2d9a6e; }.dot-leave { background: #347a9a; }.dot-holiday { background: #7256a8; }.dot-makeup { background: #d08a22; }

.selection-empty, .selection-editor { margin-top: 13px; border: 1px dashed #cdd8d1; border-radius: 13px; background: #f7f9f7; }
.selection-empty { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #7a8881; }
.selection-empty > span:last-child, .selection-editor-title > span:nth-child(2) { display: flex; flex-direction: column; }
.selection-empty strong, .selection-editor-title strong { color: #34473f; font-size: 11px; }
.selection-empty small, .selection-editor-title small { margin-top: 2px; font-size: 10px; }
.selection-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #edf1ee; font-weight: 900; }
.selected-icon { color: #fff; background: var(--green); }
.selection-editor { overflow: hidden; border-style: solid; }
.selection-editor-title { display: flex; align-items: center; gap: 9px; padding: 8px; border-bottom: 1px solid #e1e7e2; }
.selection-close { display: grid; place-items: center; width: 29px; height: 29px; margin-left: auto; border: 0; border-radius: 8px; color: #65756d; background: transparent; font-size: 20px; }
.selection-close:hover { background: #e7ece8; }
.selection-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: stretch; gap: 7px; padding: 10px; background: #fbfcfb; }
.compact-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 7px; min-height: 49px; padding: 7px 9px; border: 1px solid #d7e0d9; border-radius: 10px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.compact-field:focus-within { border-color: #83aa97; box-shadow: 0 0 0 3px rgba(45, 154, 110, .09); }
.compact-field > span:first-child { grid-column: 1 / -1; color: #718078; font-size: 8px; font-weight: 800; letter-spacing: .02em; }
.compact-field input, .compact-field select, .compact-field textarea { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: #263a31; background: transparent; font-size: 12px; font-weight: 800; }
.compact-field em { color: #8a9690; font-size: 9px; font-style: normal; }
.status-field { position: relative; grid-column: span 3; }
.status-field select { grid-column: 1 / -1; padding-right: 24px; appearance: none; cursor: pointer; }
.status-field > i { position: absolute; right: 11px; bottom: 15px; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.status-field:has(select[data-status="off"]) { color: #a5483e; border-color: #edc6c0; background: #fff7f5; }
.status-field:has(select[data-status="work"]) { color: #18704d; border-color: #b7dcc8; background: #f2fbf6; }
.status-field:has(select[data-status="paid_leave"]) { color: #2e718e; border-color: #b9d7e5; background: #f1f8fb; }
.status-field:has(select[data-status="holiday"]) { color: #684d98; border-color: #d3c6eb; background: #f8f4ff; }
.status-field:has(select[data-status="makeup_workday"]) { color: #936014; border-color: #edce9d; background: #fff8e9; }
.work-hours-field { grid-column: span 2; }.onsite-field { grid-column: span 3; }.ot-field { grid-column: span 2; }.ot-multiplier-field { grid-column: span 2; }
.compact-field.note-field { grid-column: 1 / -1; display: block; min-height: 70px; }
.compact-field.note-field > span:first-child { display: block; margin-bottom: 5px; }
.compact-field.note-field textarea { display: block; height: 36px; line-height: 18px; resize: none; font-weight: 650; }
.onsite-segmented { display: grid; grid-column: 1 / -1 !important; grid-template-columns: 1fr 1fr 25px; gap: 3px; }
.onsite-segmented button { min-height: 23px; padding: 2px 6px; border: 1px solid #dbe2dc; border-radius: 7px; color: #68786f; background: #f7f9f7; font-size: 9px; font-weight: 850; }
.onsite-segmented button:hover { border-color: #c69339; background: #fff8e8; }.onsite-segmented button.active { color: #fff; border-color: #b47a19; background: #b47a19; }
.onsite-segmented button.onsite-clear { padding: 0; color: #96665e; border-color: #eadbd7; background: #fff; font-size: 14px; }.onsite-segmented button.onsite-clear:hover { color: #fff; border-color: #b84b40; background: #b84b40; }

.calendar-scroll { overflow-x: auto; padding: 14px; scrollbar-width: thin; }
.weekday-grid, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(88px, 1fr)); min-width: 680px; gap: 7px; }
.weekday-grid { position: sticky; top: 0; z-index: 4; margin-bottom: 7px; padding: 4px 0; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.weekday-grid > div { padding: 3px; color: #7b8982; text-align: center; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.weekday-grid .weekend-label { color: #a26d67; }
.day-card { position: relative; min-width: 0; min-height: clamp(104px, 8.3vw, 128px); padding: 11px; overflow: hidden; border: 1px solid #e0e6e1; border-radius: 13px; background: #fff; cursor: pointer; text-align: left; user-select: none; outline: 0; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.day-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: transparent; }
.day-card.type-work::before { background: #2d9a6e; }.day-card.type-off::before { background: #df6b5d; }.day-card.type-paid_leave::before { background: #347a9a; }.day-card.type-holiday::before { background: #7256a8; }.day-card.type-makeup_workday::before { background: #d08a22; }
.day-card:hover { z-index: 1; border-color: #9fb9ab; box-shadow: 0 9px 20px rgba(31, 58, 47, .09); transform: translateY(-1px); }
.day-card:focus-visible { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45, 154, 110, .15); }
.day-card.empty { visibility: hidden; pointer-events: none; }
.day-card.weekend { background: #faf8f6; }
.day-card.unrecorded { color: #89958f; background: #fff; }
.day-card.unrecorded.weekend { background: #faf8f6; }
.day-card.type-work { border-color: #b7dcc8; background: linear-gradient(145deg, #f6fcf9, #edf8f2); }
.day-card.type-off { border-color: #edc6c0; background: #fff7f5; }
.day-card.type-paid_leave { border-color: #b9d7e5; background: #f1f8fb; }
.day-card.type-holiday { border-color: #d3c6eb; background: #f8f4ff; }
.day-card.type-makeup_workday { border-color: #edce9d; background: linear-gradient(145deg, #fffaf0, #fff3dc); }
.day-card.selected { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green), 0 8px 18px rgba(23, 76, 60, .1); }
.day-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; }
.day-card-top b { font-size: 13px; font-weight: 900; }
.day-card-top em { color: #65776e; font-size: 8px; font-style: normal; font-weight: 800; }
.day-tags { display: flex; min-height: 20px; margin-top: 15px; gap: 4px; flex-wrap: wrap; }
.day-tag { padding: 3px 5px; border-radius: 999px; font-size: 8px; font-weight: 850; }
.work-tag { color: #176342; background: #dff3e8; }
.onsite-tag { color: #785516; background: #fff0cf; }
.ot-tag { color: #5f438e; background: #eee7fb; }
.day-card .day-note { display: block; }
.day-card .holiday-note { color: #684d98; font-weight: 800; }
.day-card .makeup-note { color: #946010; font-weight: 800; }
.day-card .personal-override-note { color: #b84b40; font-weight: 800; }
.day-money { display: block; margin-top: 8px; padding-top: 6px; border-top: 1px dashed rgba(99, 119, 108, .22); color: var(--green); text-align: right; font-size: 9px; font-weight: 850; }
.calendar-blank { min-height: clamp(104px, 8.3vw, 128px); border-radius: 12px; background: #f8faf8; }
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.day-number { font-size: 13px; font-weight: 900; }
.day-name { margin-left: 5px; color: #7b8982; font-size: 9px; font-weight: 800; }
.selected-check { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 999px; color: #fff; background: var(--green); font-size: 10px; font-weight: 900; }
.status-chip { display: inline-flex; margin-top: 14px; padding: 3px 6px; border: 1px solid rgba(97, 117, 106, .14); border-radius: 999px; color: #42554b; background: rgba(255, 255, 255, .78); font-size: 9px; font-weight: 800; }
.day-unset { display: inline-block; margin-top: 15px; color: #a1aaa5; font-size: 9px; }
.day-meta { display: flex; justify-content: space-between; gap: 6px; min-height: 17px; margin-top: 9px; color: #68776f; font-size: 8px; font-weight: 750; }
.day-income { display: flex; align-items: end; justify-content: space-between; gap: 4px; margin-top: 3px; padding-top: 6px; border-top: 1px dashed rgba(99, 119, 108, .22); color: #7a8881; font-size: 8px; }
.day-income strong { color: var(--green); font-size: 9px; }
.day-note { margin: 5px 0 0; overflow: hidden; color: #7c8982; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.net-card { overflow: hidden; padding: 20px; border-radius: 16px; color: #fff; background: radial-gradient(circle at 92% 0, rgba(255,255,255,.17), transparent 37%), linear-gradient(135deg, #173e33, #174c3c); box-shadow: 0 15px 40px rgba(23, 62, 51, .18); }
.net-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.net-card-head > div { display: flex; flex-direction: column; }
.net-card-head small { color: #a9c7bb; font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.net-card-head strong { margin-top: 7px; font-size: 27px; letter-spacing: -.04em; }
.wallet-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: 22px; font-weight: 900; }
.net-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); text-align: center; }
.net-metrics div { display: flex; flex-direction: column; }
.net-metrics strong { font-size: 16px; }.net-metrics small { margin-top: 2px; color: #a9c7bb; font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.config-card, .calculation-card, .adjustment-card { padding: 18px; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title-row > span { padding: 4px 7px; border-radius: 999px; color: #126844; background: #e7f6ed; font-size: 9px; font-weight: 800; }
.card-title-row > div small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.card-head-actions { display: flex; align-items: center; gap: 6px; }
.card-head-actions > span { padding: 4px 7px; border-radius: 999px; color: #126844; background: #e7f6ed; font-size: 9px; font-weight: 800; }
.collapse-toggle { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; padding: 0; border: 1px solid #d1dcd5; border-radius: 10px; color: var(--green); background: linear-gradient(180deg, #fff, #f3f7f4); box-shadow: 0 2px 6px rgba(31,58,47,.06); transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease; }
.collapse-toggle::before { content: ""; width: 7px; height: 7px; margin-top: 4px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(225deg); transition: transform .3s cubic-bezier(.2,.8,.2,1), margin .3s ease; }
.collapse-toggle:hover { border-color: #8eaa9b; background: #eef5f1; box-shadow: 0 5px 12px rgba(31,58,47,.1); transform: translateY(-1px); }
.collapsible-card.is-collapsed .card-title-row { margin-bottom: 0; }
.collapsible-card.is-collapsed .collapse-toggle::before { margin-top: -3px; transform: rotate(45deg); }
.collapsible-body { max-height: 3000px; overflow: hidden; opacity: 1; transform: translateY(0); transition: max-height .42s cubic-bezier(.2,.8,.2,1), opacity .22s ease, transform .32s cubic-bezier(.2,.8,.2,1), margin .32s ease; }
.collapsible-card.is-collapsed .collapsible-body { max-height: 0; margin: 0; opacity: 0; transform: translateY(-6px); pointer-events: none; }
.config-grid { display: grid; gap: 10px; }
.config-grid label:not(.toggle-field) { display: block; }
.config-grid label > span { display: block; margin-bottom: 5px; color: #68766f; font-size: 10px; font-weight: 750; }
.config-grid input, .adjustment-row input, .adjustment-row select { width: 100%; height: 36px; padding: 7px 10px; border: 1px solid #cfd9d2; border-radius: 9px; color: #263a31; background: #fff; outline: 0; font-size: 12px; font-weight: 650; }
.config-grid input:focus, .adjustment-row input:focus, .adjustment-row select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45, 154, 110, .12); }
.config-grid input:disabled { color: #8d9992; background: #f0f2f0; }
.config-grid .field-warning { display: block; margin-top: 4px; color: #b84b40; font-size: 9px; font-weight: 750; line-height: 1.35; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 34px; }
.input-suffix em { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: #839088; font-size: 10px; font-style: normal; font-weight: 800; pointer-events: none; }
.config-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.toggle-field { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f7f9f7; }
.toggle-field > span { display: flex !important; flex-direction: column; margin: 0 !important; }
.toggle-field strong { color: #394d44; font-size: 10px; }.toggle-field small { margin-top: 2px; color: #7a8881; font-size: 9px; line-height: 1.35; }
.toggle-field input { appearance: none; position: relative; width: 32px; height: 18px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 999px; background: #cbd5ce; cursor: pointer; transition: background .15s ease; }
.toggle-field input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); transition: transform .15s ease; }
.toggle-field input:checked { background: var(--green); }.toggle-field input:checked::after { transform: translateX(14px); }
.config-note { margin-top: 12px; padding: 10px; border-radius: 11px; color: #64736b; background: #f2f6f3; font-size: 10px; line-height: 1.55; }
.config-note p { margin: 0; }.config-note small { display: block; margin-top: 3px; color: #87938c; font-size: 9px; }
.config-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.adjustment-list { display: grid; gap: 8px; }
.adjustment-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 7px; padding: 10px 48px 10px 10px; border: 1px solid #dbe2dc; border-radius: 11px; background: #f8faf8; }
.adjustment-row > [data-adjustment-field="label"] { grid-column: 1 / -1; }
.adjustment-row > [data-adjustment-field="adjustment_type"] { grid-column: 1; }
.adjustment-row > [data-adjustment-field="amount"] { grid-column: 2; }
.adjustment-row .money-input { text-align: right; }
.adjustment-taxable { display: inline-flex; grid-column: 1; align-items: center; gap: 4px; color: #65746d; white-space: nowrap; font-size: 9px; }
.adjustment-taxable input { width: 14px; height: 14px; }
.adjustment-delete { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: #9b4037; background: #ffedea; font-size: 17px; }
.adjustment-empty { margin: 0; padding: 12px; border: 1px dashed #d4ddd6; border-radius: 10px; color: #7b8982; text-align: center; font-size: 10px; }

.calculation-card .card-title-row { margin-bottom: 12px; }
.money-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; font-size: 11px; }
.money-row span { color: #637169; }.money-row strong { white-space: nowrap; }
.money-row.positive strong { color: #187654; }.money-row.negative strong { color: #b54f42; }.money-row.muted { opacity: .62; }.money-row.emphasis { font-weight: 850; }
.divider { margin: 8px 0; border-top: 1px dashed #d6ddd8; }
.net-total { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 11px; padding: 11px 12px; border-radius: 11px; color: #785516; background: #fff5de; }
.net-total span { font-size: 11px; font-weight: 750; }.net-total strong { color: #61420c; font-size: 18px; }
.zero-note { margin: 10px 0 0; color: #718078; font-size: 9px; line-height: 1.5; }
.calculation-warning { margin: 9px 0 0; padding: 8px 9px; border-radius: 9px; color: #875d16; background: #fff3d6; font-size: 9px; line-height: 1.45; }

.alert { padding: 10px 12px; border-radius: 11px; font-size: 11px; }
.alert-error { color: #8a3229; border: 1px solid #efc3bc; background: #fff4f2; }.alert-success { color: #126844; border: 1px solid #b5dec7; background: #eaf8f0; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; max-width: min(360px, calc(100% - 36px)); padding: 10px 13px; border-radius: 11px; color: #fff; background: #193f34; box-shadow: 0 16px 40px rgba(20, 48, 39, .25); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease; font-size: 11px; font-weight: 700; }
.toast.show { opacity: 1; transform: translateY(0); }

.modal { width: min(680px, calc(100% - 28px)); max-height: 82vh; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 25px 70px rgba(18, 46, 37, .28); }
.modal::backdrop { background: rgba(15, 29, 24, .48); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.modal-close { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; color: #67756e; background: #eef2ef; font-size: 20px; }
.default-config-modal { width: min(920px, calc(100% - 28px)); }
.default-config-modal form { margin: 0; }
.default-config-content { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; padding: 16px; background: #f6f8f6; }
.default-config-section { min-width: 0; padding: 15px; border: 1px solid #dce4de; border-radius: 13px; background: #fff; }
.modal-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modal-section-title h3 { margin: 0; font-size: 13px; }.modal-section-title p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.modal-section-title > span { padding: 4px 7px; border-radius: 999px; color: #126844; background: #e7f6ed; white-space: nowrap; font-size: 8px; font-weight: 800; }
.default-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.default-config-grid > label > span { display: block; margin-bottom: 5px; color: #66756d; font-size: 9px; font-weight: 750; }
.default-config-grid input, .tax-bracket-table input { width: 100%; height: 36px; padding: 7px 10px; border: 1px solid #cfd9d2; border-radius: 9px; outline: 0; color: #263a31; background: #fff; font-size: 11px; font-weight: 700; }
.default-config-grid input:focus, .tax-bracket-table input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,154,110,.1); }
.default-config-section > .toggle-field { margin-top: 10px; }
.deduction-grid { margin-bottom: 12px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.history-list { display: grid; gap: 9px; padding: 16px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; }
.history-item:hover { border-color: #8eb3a1; background: #f8fbf9; }
.history-item > span { display: flex; flex-direction: column; }.history-item strong { font-size: 12px; }.history-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.history-empty { padding: 28px; border: 1px dashed #d4ddd6; border-radius: 11px; color: #7b8982; text-align: center; font-size: 11px; }

.auth-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, #dff0e7, transparent 32%), radial-gradient(circle at 90% 80%, #fff0cc, transparent 28%), #f3f4f1; }
.auth-shell { width: min(430px, 100%); }
.auth-card { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 28px 80px rgba(31, 58, 47, .13); }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; font-size: 25px; font-weight: 900; }
.eyebrow { margin: 20px 0 5px; color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.auth-card h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }.auth-copy { margin: 9px 0 19px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.auth-form { display: grid; gap: 12px; margin-top: 15px; }.auth-form label span { display: block; margin-bottom: 5px; color: #5f6e66; font-size: 10px; font-weight: 750; }
.auth-form input { width: 100%; height: 41px; padding: 9px 11px; border: 1px solid #cfd9d2; border-radius: 10px; outline: 0; }.auth-form input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,154,110,.12); }
.auth-form .button { margin-top: 4px; min-height: 41px; }.auth-footnote { margin: 16px 0 0; color: #7c8982; text-align: center; font-size: 9px; }.auth-footnote code { color: var(--green); }
.auth-secondary-link { display: block; margin-top: 15px; color: var(--green); text-align: center; font-size: 11px; font-weight: 800; }
.auth-secondary-link:hover { text-decoration: underline; }

.admin-layout { display: grid; gap: 18px; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 50px; }
.admin-create-card { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(520px, 1.6fr); align-items: end; gap: 30px; padding: 22px; }
.admin-create-card .eyebrow { margin-top: 0; }.admin-create-card h1 { margin: 4px 0; font-size: 23px; }.admin-create-card p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.admin-create-form { display: grid; grid-template-columns: 1fr 1.2fr 1fr auto; align-items: end; gap: 9px; }
.admin-create-form label span { display: block; margin-bottom: 5px; color: #66756d; font-size: 10px; font-weight: 750; }
.admin-create-form input, .admin-create-form select { width: 100%; height: 38px; padding: 8px 10px; border: 1px solid #cfd9d2; border-radius: 9px; color: #263a31; background: #fff; outline: 0; }
.admin-create-form input:focus, .admin-create-form select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,154,110,.12); }
.admin-create-form .button { min-height: 38px; white-space: nowrap; }
.admin-users-card { overflow: hidden; }
.admin-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.admin-section-title h2 { margin: 0; font-size: 15px; }.admin-section-title span { color: var(--muted); font-size: 10px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 11px; }
.admin-table th, .admin-table td { padding: 13px 16px; border-bottom: 1px solid #e5eae6; text-align: left; vertical-align: middle; }
.admin-table th { color: #718078; background: #f7f9f7; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.admin-table td:first-child strong, .admin-table td:first-child small { display: block; }.admin-table td:first-child small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.role-badge, .status-badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.role-badge { color: #4d6258; background: #eef2ef; }.role-badge.admin { color: #644995; background: #efe8fb; }
.status-badge.active { color: #126844; background: #e4f5eb; }.status-badge.inactive { color: #9a3d34; background: #ffebe8; }
.table-actions { display: flex; align-items: center; gap: 6px; }.table-actions form { margin: 0; }.table-actions .button { min-height: 29px; padding: 5px 8px; font-size: 9px; }
.admin-protected { color: #7d8983; font-size: 9px; font-weight: 750; }
.holiday-create-form { grid-template-columns: 170px 150px minmax(210px, 1fr) auto; }
.year-picker { display: flex; align-items: center; gap: 6px; }.year-picker input { width: 88px; height: 33px; padding: 6px 8px; border: 1px solid #cfd9d2; border-radius: 8px; }
.holiday-table { min-width: 680px; }.holiday-table form { margin: 0; }.holiday-table .button { min-height: 29px; padding: 5px 8px; font-size: 9px; }
.admin-empty { padding: 28px !important; color: var(--muted); text-align: center !important; }

.settings-layout { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(520px, 1.35fr); gap: 18px; width: min(1050px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.settings-intro, .settings-card { padding: 24px; }
.settings-intro .eyebrow { margin-top: 0; }.settings-intro h1 { margin: 6px 0 10px; font-size: 27px; letter-spacing: -.035em; }.settings-intro > p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.7; }
.settings-rule { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 11px; border: 1px solid #dce5df; border-radius: 11px; background: #f6f9f7; }.settings-rule strong { font-size: 10px; }.settings-rule span { color: #6c7a72; font-size: 10px; line-height: 1.5; }
.settings-card h2 { margin: 0; font-size: 16px; }
.settings-form { display: grid; gap: 15px; }.settings-money-grid, .settings-number-grid { display: grid; gap: 10px; }.settings-money-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.settings-number-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-form label:not(.toggle-field) > span { display: block; margin-bottom: 5px; color: #64736b; font-size: 10px; font-weight: 750; }
.settings-form input:not([type="checkbox"]) { width: 100%; height: 39px; padding: 8px 10px; border: 1px solid #cfd9d2; border-radius: 9px; outline: 0; }.settings-form input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,154,110,.12); }
.settings-toggle { margin-top: 2px; }.settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 4px; border-top: 1px solid #e7ece8; }
.settings-section { padding: 14px; border: 1px solid #dce5df; border-radius: 12px; background: #f8faf8; }
.settings-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.settings-section-head h3 { margin: 0; font-size: 13px; }.settings-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.settings-section-head > span { padding: 4px 7px; border-radius: 999px; color: #126844; background: #e2f3e9; white-space: nowrap; font-size: 8px; font-weight: 800; }
.tax-deduction-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tax-bracket-table { overflow: hidden; border: 1px solid #d9e1db; border-radius: 11px; background: #fff; }
.tax-bracket-head, .tax-bracket-row { display: grid; grid-template-columns: 70px minmax(180px, 1fr) minmax(100px, .42fr); align-items: center; gap: 9px; padding: 8px 10px; }
.tax-bracket-head { color: #718078; border-bottom: 1px solid #dfe6e1; background: #f0f5f2; font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.tax-bracket-row + .tax-bracket-row { border-top: 1px solid #e7ece8; }
.tax-bracket-row strong { font-size: 10px; }.tax-bracket-row .input-suffix input { height: 34px; }.tax-open-ended { color: #6c7a72; font-size: 9px; font-weight: 700; }
.compact-tax-table .tax-bracket-head, .compact-tax-table .tax-bracket-row { grid-template-columns: 48px minmax(150px, 1fr) minmax(86px, .45fr); padding: 7px 8px; }

@media (max-width: 1180px) {
    .app-layout { grid-template-columns: 1fr; }
    .summary-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: static; }
    .net-card, .calculation-card { grid-column: span 1; }
    .config-card, .adjustment-card { grid-column: span 1; }
}

@media (max-width: 900px) {
    .settings-layout { grid-template-columns: 1fr; }.settings-money-grid { grid-template-columns: 1fr 1fr; }
    .default-config-content { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar-inner, .app-layout { width: min(100% - 20px, 1540px); }
    .topbar-inner { align-items: flex-start; flex-direction: column; gap: 9px; }
    .topbar-actions { width: 100%; justify-content: flex-start; }
    .brand small, .save-state, .user-chip { display: none; }
    .topbar-actions { gap: 5px; }.topbar-actions .button { min-height: 31px; padding: 6px 8px; font-size: 10px; }
    .app-layout { padding-top: 10px; }
    .period-toolbar { align-items: stretch; flex-direction: column; }
    .period-picker { justify-content: center; }.quick-actions { justify-content: center; }
    .calendar-heading { flex-direction: column; }.legend { justify-content: flex-start; }
    .summary-column { display: flex; }
    .selection-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .status-field { grid-column: 1 / -1; }.work-hours-field, .onsite-field, .ot-field, .ot-multiplier-field { grid-column: span 1; }.compact-field.note-field { grid-column: 1 / -1; }
    .calendar-scroll { padding: 8px; overflow-x: hidden; }
    .weekday-grid, .calendar-grid { width: 100%; min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
    .weekday-grid { padding-block: 3px; }.day-card, .calendar-blank { min-height: clamp(66px, 13vw, 88px); }.day-card { padding: 7px 5px 5px; border-radius: 9px; }
    .day-card:hover { transform: none; }.day-card-top b { font-size: 11px; }.day-card-top em { display: none; }
    .day-tags { min-height: 7px; margin-top: 12px; gap: 3px; }.day-tag { width: 6px; height: 6px; padding: 0; overflow: hidden; border-radius: 999px; font-size: 0; }
    .day-note, .day-money { display: none !important; }
    .day-card.selected::after { content: "✓"; position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 999px; color: #fff; background: var(--green); font-size: 8px; font-weight: 900; }
    .adjustment-row { grid-template-columns: minmax(0, 1fr) 105px; }
    .admin-layout { width: min(100% - 20px, 1180px); }.admin-create-card { grid-template-columns: 1fr; }.admin-create-form, .holiday-create-form { grid-template-columns: 1fr; }
    .settings-layout { width: min(100% - 20px, 1050px); padding-top: 14px; }.settings-money-grid, .settings-number-grid { grid-template-columns: 1fr; }.settings-actions { align-items: stretch; flex-direction: column-reverse; }.settings-actions .button { width: 100%; }
    .default-config-grid { grid-template-columns: 1fr; }.modal-actions { flex-wrap: wrap; }.tax-deduction-grid { grid-template-columns: 1fr; }
}

/* v1.13 — unified identity, calm dark palette and reusable disclosure groups. */
.brand-icon, .brand-mark { padding: 0; overflow: hidden; background: transparent; }
.brand-icon img, .brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-icon img { border-radius: 12px; }
.brand-mark img { border-radius: 14px; }
.auth-shell { position: relative; }
.auth-theme { position: absolute; top: 12px; right: 12px; z-index: 2; }
.auth-theme .theme-toggle { background: rgba(255,255,255,.82); backdrop-filter: blur(10px); }
.disclosure-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.settings-section-head .disclosure-actions > span { padding: 4px 7px; border-radius: 999px; color: #126844; background: #e2f3e9; white-space: nowrap; font-size: 8px; font-weight: 800; }
.disclosure-toggle { position: relative; flex: 0 0 auto; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); cursor: pointer; }
.disclosure-toggle::before { content: ""; position: absolute; top: 10px; left: 11px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease, top .2s ease; }
.disclosure-toggle:hover { color: var(--green); border-color: color-mix(in srgb,var(--green-2) 45%,var(--line)); }
.disclosure-section.is-collapsed .disclosure-toggle::before { top: 12px; transform: rotate(-135deg); }
.disclosure-body { max-height: 2600px; opacity: 1; transition: max-height .36s cubic-bezier(.2,.8,.2,1), opacity .2s ease, margin .3s ease; }
.disclosure-section.is-collapsed .disclosure-body { max-height: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; overflow: hidden; opacity: 0; pointer-events: none; }
.admin-card-copy { position: relative; padding-right: 44px; }
.admin-card-copy > .disclosure-toggle { position: absolute; top: 0; right: 0; }
.admin-create-card.is-collapsed { grid-template-columns: 1fr; }
.holiday-section-head > .disclosure-toggle { margin-left: auto; }

html[data-theme="dark"] {
    --bg: #0f1417;
    --surface: #181f23;
    --ink: #eef3f1;
    --muted: #9aa7a3;
    --line: #303b3f;
    --green: #3fa27d;
    --green-2: #58bf95;
    --gold: #d0a052;
    --red: #e17e75;
    --purple: #ad94d4;
    --blue: #78b2cb;
    --shadow: 0 12px 38px rgba(0,0,0,.24);
}

/* v1.14 — closed-by-default long regions and stronger dark brand contrast. */
.calendar-heading { align-items: center; }
.calendar-heading .legend { margin-left: auto; }
.calendar-collapse-toggle { flex: 0 0 auto; }
.calendar-collapsible-body { max-height: 5000px; }
.calendar-surface.is-collapsed .calendar-header { border-bottom: 0; }
.calendar-surface.is-collapsed .calendar-header > :not(.calendar-heading) { display: none; }
.calendar-surface.is-collapsed .calendar-heading .legend { display: none; }
.default-config-section.is-collapsed { align-self: start; }
.default-config-section .modal-section-title { margin-bottom: 12px; }
.default-config-section.is-collapsed .modal-section-title { margin-bottom: 0; }
html[data-theme="dark"] .brand strong { color: #f5faf7; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
html[data-theme="dark"] .brand small { color: #b3c0bb; }

@media (max-width: 760px) {
    .calendar-heading { display: grid; grid-template-columns: minmax(0,1fr) 40px; }
    .calendar-heading .legend { grid-column: 1 / -1; margin-left: 0; }
}
html[data-theme="dark"] body { background: radial-gradient(circle at 15% -10%,rgba(63,162,125,.07),transparent 30%),var(--bg); }
html[data-theme="dark"] .topbar { background: rgba(15,20,23,.9); }
html[data-theme="dark"] .surface, html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .account-menu-panel, html[data-theme="dark"] .modal,
html[data-theme="dark"] .period-popover { color: var(--ink); border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); }
html[data-theme="dark"] .auth-page { background: radial-gradient(circle at 15% 15%,rgba(65,151,119,.16),transparent 32%),radial-gradient(circle at 90% 80%,rgba(208,160,82,.1),transparent 28%),#0f1417; }
html[data-theme="dark"] .auth-theme .theme-toggle { background: rgba(24,31,35,.88); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea,
html[data-theme="dark"] .admin-create-form input, html[data-theme="dark"] .holiday-year-control input,
html[data-theme="dark"] .holiday-editor-form input, html[data-theme="dark"] .holiday-editor-form select,
html[data-theme="dark"] .holiday-filter-form input, html[data-theme="dark"] .holiday-filter-form select {
    color: #eef3f1; border-color: #3a474b; background: #11181b;
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #6f7d79; }
html[data-theme="dark"] .settings-rule, html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .holiday-filter-form, html[data-theme="dark"] .config-note,
html[data-theme="dark"] .selection-empty, html[data-theme="dark"] .selection-editor,
html[data-theme="dark"] .selection-fields, html[data-theme="dark"] .compact-field { color: var(--ink); border-color: var(--line); background: #141b1f; }
html[data-theme="dark"] .settings-rule span, html[data-theme="dark"] .settings-form label:not(.toggle-field)>span,
html[data-theme="dark"] .auth-form label span, html[data-theme="dark"] .admin-create-form label span,
html[data-theme="dark"] .holiday-year-control label>span, html[data-theme="dark"] .holiday-editor-form label>span,
html[data-theme="dark"] .holiday-filter-form label>span { color: #aab5b1; }
html[data-theme="dark"] .admin-table th, html[data-theme="dark"] .holiday-data-table th { color: #9ca9a5; background: #141b1e; }
html[data-theme="dark"] .admin-table td, html[data-theme="dark"] .holiday-data-table td,
html[data-theme="dark"] .admin-section-title, html[data-theme="dark"] .holiday-table-wrap { border-color: var(--line); }
html[data-theme="dark"] .admin-table tbody tr:hover, html[data-theme="dark"] .holiday-data-table tbody tr:hover { background: #1c2629; }
html[data-theme="dark"] .holiday-name, html[data-theme="dark"] .holiday-stat strong { color: #e7efec; }
html[data-theme="dark"] .calendar-grid .day-card, html[data-theme="dark"] .calendar-grid .calendar-blank { color: var(--ink); border-color: #384448; background: #182024; }
html[data-theme="dark"] .calendar-grid .day-card.weekend, html[data-theme="dark"] .calendar-grid .calendar-blank.weekend { background: #211d20; }
html[data-theme="dark"] .calendar-grid .day-card.type-work { background: #172722; border-color: #386d59; }
html[data-theme="dark"] .calendar-grid .day-card.type-off { background: #281d1e; border-color: #784847; }
html[data-theme="dark"] .calendar-grid .day-card.type-paid_leave { background: #17242a; border-color: #416475; }
html[data-theme="dark"] .calendar-grid .day-card.type-holiday { background: #221f2b; border-color: #62527b; }
html[data-theme="dark"] .calendar-grid .day-card.type-makeup_workday { background: #292419; border-color: #756039; }
html[data-theme="dark"] .weekday-grid { background: rgba(24,31,35,.96); }
html[data-theme="dark"] .calendar-header { background: linear-gradient(180deg,#1b2427,#181f23); }
html[data-theme="dark"] .button-outline, html[data-theme="dark"] .button-ghost,
html[data-theme="dark"] .icon-button, html[data-theme="dark"] .disclosure-toggle,
html[data-theme="dark"] .account-menu>summary { color: #dce5e1; border-color: #3a474b; background: #1a2327; }
html[data-theme="dark"] .button-outline:hover, html[data-theme="dark"] .button-ghost:hover,
html[data-theme="dark"] .icon-button:hover, html[data-theme="dark"] .disclosure-toggle:hover { background: #233034; }
html[data-theme="dark"] .settings-section-head .disclosure-actions>span { color: #79cca9; background: #183329; }
html[data-theme="dark"] .role-badge, html[data-theme="dark"] .status-badge,
html[data-theme="dark"] .source-badge, html[data-theme="dark"] .calendar-kind,
html[data-theme="dark"] .confirmed-badge, html[data-theme="dark"] .provisional-badge { filter: brightness(.82) saturate(.8); }

@media (max-width: 760px) {
    .disclosure-toggle { width: 40px; height: 40px; }
    .disclosure-toggle::before { top: 13px; left: 14px; width: 9px; height: 9px; }
    .disclosure-section.is-collapsed .disclosure-toggle::before { top: 16px; }
    .auth-theme { top: 8px; right: 8px; }
    html[data-theme="dark"] .holiday-data-table tr { border-color: var(--line); background: var(--surface); }
}

@media (max-width: 440px) {
    .topbar-actions .button { padding-inline: 7px; font-size: 9px; }.quick-actions > small { width: 100%; text-align: center; }.account-menu > summary > span:nth-child(2) { display: none; }
    .calendar-heading .legend { gap: 7px; }.legend span { font-size: 8px; }
    .weekday-grid, .calendar-grid { gap: 2px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .weekday-grid > div { font-size: 8px; }.day-card, .calendar-blank { min-height: 58px; }.day-card { padding: 6px 4px 4px; }.day-tags { margin-top: 9px; }
    .selection-fields { grid-template-columns: 1fr; }.status-field, .work-hours-field, .onsite-field, .ot-field, .ot-multiplier-field, .compact-field.note-field { grid-column: 1; }
    .adjustment-row { grid-template-columns: 1fr; padding-right: 48px; }.adjustment-row > *:not(.adjustment-delete) { grid-column: 1 !important; }
    .tax-bracket-head, .tax-bracket-row, .compact-tax-table .tax-bracket-head, .compact-tax-table .tax-bracket-row { grid-template-columns: 42px minmax(120px, 1fr) 78px; gap: 5px; padding-inline: 6px; }
    .default-config-content { padding: 10px; }.default-config-section { padding: 11px; }.modal-actions .button { flex: 1 1 auto; }
}

/* v1.5 — compact controls, custom pickers and one natural page scroll */
html { scroll-behavior: auto; }
.summary-column { position: static; }
.button, .icon-button { min-height: 34px; font-size: 12px; }
.button { padding: 6px 11px; }
.quick-actions .button, .card-head-actions .button, .config-actions .button { min-height: 34px; padding: 6px 10px; }

.period-select-wrap { position: relative; min-width: 178px; }
.period-picker > .period-select-wrap { display: block; min-width: 178px; }
.period-select-button { display: grid; grid-template-columns: 1fr auto; width: 100%; min-height: 48px; padding: 7px 12px; border: 1px solid transparent; border-radius: 12px; color: var(--ink); background: transparent; text-align: center; }
.period-select-button:hover, .period-select-button[aria-expanded="true"] { border-color: #b9d4c5; background: rgba(255,255,255,.78); }
.period-select-button small, .period-select-button strong { grid-column: 1; }
.period-select-button i { grid-column: 2; grid-row: 1 / 3; align-self: center; width: 7px; height: 7px; margin-left: 6px; border-right: 1.5px solid #718078; border-bottom: 1.5px solid #718078; transform: rotate(45deg); }
.period-select-button[aria-expanded="true"] i { transform: rotate(225deg); }
.period-popover { position: absolute; top: calc(100% + 8px); left: 50%; z-index: 25; width: 294px; padding: 12px; border: 1px solid #cfddd5; border-radius: 15px; background: #fff; box-shadow: 0 20px 55px rgba(24,53,43,.18); transform: translateX(-50%); }
.period-year-row { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 7px; margin-bottom: 10px; }
.period-year-row button { height: 34px; border: 1px solid #d5e0da; border-radius: 9px; color: #385148; background: #f8faf9; font-size: 20px; }
.period-year-row strong { text-align: center; font-size: 16px; }
.period-month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.period-month-grid button { min-height: 36px; border: 1px solid transparent; border-radius: 9px; color: #53685e; background: #f4f7f5; font-size: 12px; font-weight: 800; }
.period-month-grid button:hover { border-color: #a8c8b7; background: #edf7f1; }
.period-month-grid button.active { color: #fff; background: var(--green); }
.period-current { width: 100%; margin-top: 9px; padding: 8px; border: 0; border-radius: 9px; color: var(--green); background: #eaf6ef; font-size: 11px; font-weight: 800; }

.visually-hidden-select { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 !important; }
.status-select { position: relative; grid-column: 1 / -1; }
.selection-editor { overflow: visible; }
.selection-fields { border-radius: 0 0 13px 13px; }
.status-select > button { display: grid; grid-template-columns: 10px 1fr 8px; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 2px 0; border: 0; color: inherit; background: transparent; text-align: left; }
.status-select > button .status-dot { width: 9px; height: 9px; border-radius: 50%; background: #7a8981; box-shadow: 0 0 0 3px rgba(122,137,129,.12); }
.status-select > button b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.status-select > button i { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.status-select > button[aria-expanded="true"] i { transform: rotate(225deg); }
.status-select > button[data-status="work"] .status-dot { background: #2e9f70; }.status-select > button[data-status="off"] .status-dot { background: #d05c50; }.status-select > button[data-status="paid_leave"] .status-dot { background: #317fa3; }.status-select > button[data-status="holiday"] .status-dot { background: #7653b3; }.status-select > button[data-status="makeup_workday"] .status-dot { background: #c28118; }
.status-select-menu { position: absolute; top: calc(100% + 8px); left: -11px; z-index: 30; display: grid; width: min(330px, calc(100vw - 44px)); padding: 6px; border: 1px solid #d4e0d9; border-radius: 14px; background: #fff; box-shadow: 0 20px 55px rgba(24,53,43,.2); }
.status-select-menu button { display: grid; grid-template-columns: 11px 1fr; gap: 2px 9px; padding: 9px 10px; border: 0; border-radius: 9px; color: #263a31; background: transparent; text-align: left; }
.status-select-menu button:hover, .status-select-menu button.selected { background: #f0f6f2; }
.status-select-menu button > span { grid-row: 1 / 3; align-self: center; width: 9px; height: 9px; border-radius: 50%; background: #7a8981; }
.status-select-menu button[data-status-option="work"] > span { background: #2e9f70; }.status-select-menu button[data-status-option="off"] > span { background: #d05c50; }.status-select-menu button[data-status-option="paid_leave"] > span { background: #317fa3; }.status-select-menu button[data-status-option="holiday"] > span { background: #7653b3; }.status-select-menu button[data-status-option="makeup_workday"] > span { background: #c28118; }
.status-select-menu b { font-size: 12px; }.status-select-menu small { color: #718078; font-size: 10px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pagination button { min-height: 32px; padding: 6px 10px; border: 1px solid #ccd8d0; border-radius: 8px; color: #385148; background: #fff; font-size: 11px; font-weight: 800; }
.pagination button:disabled { cursor: default; opacity: .45; }
.pagination span { color: var(--muted); font-size: 11px; font-weight: 700; }
.pagination label { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--muted); font-size: 10px; font-weight: 750; }
.pagination select { min-width: 62px; height: 32px; padding: 4px 24px 4px 8px; border: 1px solid #ccd8d0; border-radius: 8px; color: #385148; background: #fff; font-size: 11px; font-weight: 800; }
.pagination-history { grid-column: 1 / -1; margin: 2px -16px -16px; }
.pagination-adjustments { margin-top: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf8; }

@media (max-width: 560px) {
    .pagination { flex-wrap: wrap; gap: 7px; }
    .pagination label { width: 100%; margin-right: 0; justify-content: center; }
}

@media (max-width: 760px) {
    .period-popover { position: fixed; top: 50%; left: 50%; width: min(330px, calc(100% - 28px)); transform: translate(-50%, -50%); box-shadow: 0 0 0 100vmax rgba(15,29,24,.42), 0 24px 70px rgba(15,29,24,.28); }
    .period-picker > .period-select-wrap { flex: 1; }
    .quick-actions .button { min-height: 32px; padding: 6px 9px; font-size: 11px; }
}

/* v1.6 — touch-first mobile calendar and stable mobile menus */
body { overflow-x: hidden; }
.day-weekday, .touch-selection-help, .touch-selection-bar { display: none; }
.period-picker { flex: 0 0 auto; }
.period-nav-button { width: 42px; height: 42px; border-color: #bcd3c6; border-radius: 50%; color: #176447; background: linear-gradient(145deg, #fff, #edf7f1); box-shadow: 0 5px 14px rgba(23,100,71,.10); font-size: 17px; }
.period-nav-button:hover { border-color: #78aa91; color: #fff; background: var(--green); box-shadow: 0 7px 18px rgba(23,100,71,.22); }
.period-select-button { min-height: 44px; padding-block: 8px; border-color: #c5dbcf; background: rgba(255,255,255,.76); }
.period-select-button strong { grid-row: 1; align-self: center; font-size: 17px; }
.period-select-button i { grid-row: 1; }
.adjustment-body-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #e5ebe7; }
.adjustment-body-actions .button { min-width: 148px; }

@media (max-width: 760px) and (any-pointer: coarse) {
    body:has(.mobile-net-dock) { padding-bottom: 70px; }
    body:has(.account-menu[open]) { overflow: hidden; }
    .topbar { backdrop-filter: none; }
    .account-menu[open]::before { content: ""; position: fixed; inset: 0; z-index: 80; background: rgba(15,29,24,.48); backdrop-filter: blur(2px); }
    .account-menu-panel { position: fixed; inset: auto 10px 10px; z-index: 90; width: auto; max-height: calc(100dvh - 20px); padding: 9px; overflow-y: auto; border-radius: 18px; box-shadow: 0 24px 80px rgba(15,29,24,.32); }
    .account-menu[open] .account-menu-panel { animation: mobile-menu-in .2s cubic-bezier(.2,.8,.2,1) both; }
    .account-menu-user { padding: 12px 11px 14px; }
    .account-menu-panel > a { min-height: 54px; padding: 10px; }
    .account-menu-panel > a > span:first-child { width: 32px; height: 32px; }
    @keyframes mobile-menu-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

    .period-toolbar { gap: 12px; }
    .period-picker { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 9px; width: 100%; }
    .period-picker > .period-select-wrap { min-width: 0; }
    .period-nav-button { width: 44px; height: 44px; }
    .period-select-button { min-height: 44px; }
    .period-select-button strong { font-size: 18px; }

    .desktop-selection-help { display: none; }
    .touch-selection-help { display: inline; }
    .touch-selection-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px 12px; border-bottom: 1px solid #dfe8e2; background: #f7faf8; }
    .touch-selection-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 10px; border: 1px solid #cbdad2; border-radius: 11px; color: #355247; background: #fff; font-size: 11px; }
    .touch-selection-bar button.active { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 6px 16px rgba(23,100,71,.20); }
    .touch-selection-bar button span { font-size: 14px; }
    .touch-selection-bar small { grid-column: 1 / -1; color: #64776d; text-align: center; font-size: 10px; }
}

@media (max-width: 640px) and (any-pointer: coarse) {
    .calendar-scroll { padding: 10px; overflow: visible; }
    .weekday-grid { display: none; }
    .calendar-grid { width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .calendar-blank { display: none; }
    .day-card { min-height: 116px; padding: 11px; border-radius: 13px; }
    .day-card-top > span:first-child { display: flex; align-items: baseline; gap: 6px; }
    .day-card-top b { font-size: 18px; }
    .day-weekday { display: inline; color: #7a8981; font-size: 9px; font-weight: 750; }
    .day-card-top em { display: inline; max-width: 72px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
    .day-tags { min-height: 24px; margin-top: 14px; gap: 4px; }
    .day-tag { width: auto; height: auto; padding: 3px 5px; overflow: visible; border-radius: 999px; font-size: 8px; }
    .day-note { display: block !important; max-width: 100%; font-size: 8px; }
    .day-money { display: block !important; margin-top: 7px; font-size: 9px; }
    .day-card.selected { box-shadow: inset 0 0 0 2px var(--green), 0 8px 18px rgba(23,76,60,.12); }
    .day-card.selected::after { right: 8px; bottom: 8px; width: 20px; height: 20px; font-size: 10px; }
    .adjustment-body-actions .button { width: 100%; min-height: 40px; }
}

/* v1.9 — make calendar status colors and entered-data markers unambiguous */
.calendar-data-key {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 13px;
    padding: 10px 14px;
    border-bottom: 1px solid #dfe8e2;
    color: #5f7168;
    background: #fbfcfb;
}
.calendar-data-key strong { color: #30483d; font-size: 11px; }
.calendar-data-key span { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.calendar-data-key small { margin-left: auto; color: #7b8982; font-size: 9px; }
.state-color-key i { width: 15px; height: 13px; border: 2px solid #56a985; border-radius: 4px; background: #eef9f3; }
.input-data-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor; }
.work-input-dot { color: #5da77d; background: #8fd9b2; }
.onsite-input-dot { color: #b58525; background: #f0c66a; }
.ot-input-dot { color: #8964ae; background: #c9a2e9; }

@media (max-width: 640px) and (any-pointer: coarse) {
    .calendar-data-key { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 16px; padding: 10px 12px; }
    .calendar-data-key strong, .calendar-data-key .state-color-key, .calendar-data-key small { grid-column: 1 / -1; }
    .calendar-data-key strong { font-size: 10px; }
    .calendar-data-key span { font-size: 9px; }
    .calendar-data-key small { margin: 0; font-size: 8px; }
}

/* v1.7 — compact touch calendar and always-visible salary summary */
.mobile-net-card, .mobile-net-dock { display: none; }

@media (max-width: 760px) and (any-pointer: coarse) {
    .topbar { background: #fff !important; backdrop-filter: none !important; }
    .topbar-inner { gap: 8px; }
    .topbar-actions { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .topbar-actions::-webkit-scrollbar { display: none; }
    .topbar-actions .button, .account-menu > summary { flex: 0 0 auto; white-space: nowrap; }

    .mobile-net-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 15px; color: #fff; background: linear-gradient(130deg, #164f3c, #24785a); box-shadow: 0 12px 28px rgba(23,90,65,.18); }
    .mobile-net-card > div:first-child { display: grid; }
    .mobile-net-card small { color: #b8d9cc; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    .mobile-net-card strong { margin-top: 3px; font-size: 22px; letter-spacing: -.025em; }
    .mobile-net-metrics { display: grid; gap: 4px; color: #c9e3d9; text-align: right; font-size: 9px; }
    .mobile-net-metrics b { color: #fff; font-size: 11px; }
    .summary-column > .net-card { display: none; }

    .mobile-net-dock { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; z-index: 70; display: grid; grid-template-columns: 1fr auto 24px; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; color: #fff; background: rgba(20,79,59,.96); box-shadow: 0 16px 40px rgba(15,48,37,.28); backdrop-filter: blur(12px); text-align: left; }
    .mobile-net-dock.hidden { display: none; }
    .mobile-net-dock span { color: #b9d8cc; font-size: 10px; }
    .mobile-net-dock strong { font-size: 16px; }
    .mobile-net-dock i { font-size: 16px; font-style: normal; text-align: center; }
}

@media (max-width: 640px) and (any-pointer: coarse) {
    .calendar-scroll { padding: 8px !important; overflow: visible !important; }
    .weekday-grid { display: none !important; }
    .calendar-grid { width: 100% !important; min-width: 0 !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 6px !important; }
    .calendar-blank { display: none !important; }
    .day-card { min-height: 78px !important; padding: 8px 7px !important; border-radius: 11px !important; }
    .day-card-top { display: grid !important; gap: 2px !important; }
    .day-card-top > span:first-child { display: flex !important; align-items: baseline !important; gap: 4px !important; }
    .day-card-top b { font-size: 16px !important; }
    .day-weekday { display: inline !important; color: #7a8981; font-size: 8px !important; font-weight: 750; }
    .day-card-top em { display: block !important; max-width: 100% !important; overflow: hidden; font-size: 8px !important; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
    .day-tags { min-height: 9px !important; margin-top: 9px !important; gap: 3px !important; }
    .day-tag { width: 7px !important; height: 7px !important; padding: 0 !important; overflow: hidden !important; border-radius: 50% !important; font-size: 0 !important; }
    .calendar-grid .day-note, .calendar-grid .day-money { display: none !important; }
    .day-card.selected { border-color: var(--green) !important; box-shadow: inset 0 0 0 1px var(--green), 0 5px 12px rgba(23,76,60,.10) !important; }
    .day-card.selected::after { right: 5px !important; bottom: 5px !important; width: 17px !important; height: 17px !important; font-size: 8px !important; }
}

@media (max-width: 380px) and (any-pointer: coarse) {
    .calendar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    .day-card { min-height: 76px !important; }
}

@media (any-pointer: coarse) {
    .desktop-selection-help { display: none; }
    .touch-selection-help { display: inline; }
    .touch-selection-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px 12px; border-bottom: 1px solid #dfe8e2; background: #f7faf8; }
    .touch-selection-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 10px; border: 1px solid #cbdad2; border-radius: 11px; color: #355247; background: #fff; font-size: 11px; }
    .touch-selection-bar button.active { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 6px 16px rgba(23,100,71,.20); }
    .touch-selection-bar small { grid-column: 1 / -1; color: #64776d; text-align: center; font-size: 10px; }
    .selection-editor { scroll-margin-top: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* v1.4 — friendlier palette, readable type and clearer status controls */
:root {
    --bg: #f4f8f5;
    --surface: #ffffff;
    --ink: #183229;
    --muted: #60756b;
    --line: #d6e4dc;
    --green: #176447;
    --green-2: #2e9f70;
    --gold: #c28118;
    --red: #c34f43;
    --purple: #7653b3;
    --blue: #317fa3;
    --shadow: 0 10px 34px rgba(24, 75, 56, .075);
}

body {
    font-size: 14px;
    line-height: 1.5;
    background:
        radial-gradient(circle at 4% 2%, rgba(46, 159, 112, .10), transparent 24rem),
        radial-gradient(circle at 96% 16%, rgba(194, 129, 24, .09), transparent 21rem),
        var(--bg);
}

.topbar { border-bottom-color: #cfe0d6; background: rgba(250, 253, 251, .93); }
.surface { border-color: #d7e5dd; box-shadow: var(--shadow); }
.app-layout { grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; padding-top: 24px; }
.workspace, .summary-column { gap: 18px; }

.period-toolbar {
    border-color: #cce1d5;
    background: linear-gradient(115deg, #f5fcf8 0%, #ffffff 52%, #fffaf0 100%);
}
.calendar-header { padding: 20px; background: linear-gradient(180deg, #fff, #fbfdfb); }
.calendar-heading h2, .config-card h2, .calculation-card h2, .adjustment-card h2 { font-size: 16px; }
.calendar-heading p { margin-top: 5px; font-size: 12px; line-height: 1.55; }
.legend { padding: 7px 9px; border: 1px solid #e0e9e3; border-radius: 999px; background: #fff; font-size: 11px; }
.dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(71, 97, 84, .12); }

.button, .icon-button { min-height: 38px; font-size: 13px; }
.button { padding: 8px 14px; }
.save-state, .user-chip { font-size: 11px; }
.brand small, .account-menu > summary, .account-menu-user strong { font-size: 12px; }
.account-menu-user small, .account-menu-panel > a strong { font-size: 11px; }
.account-menu-panel > a small { font-size: 10px; }

.selection-empty { padding: 12px 14px; }
.selection-empty strong, .selection-editor-title strong { font-size: 13px; }
.selection-empty small, .selection-editor-title small { font-size: 11px; }
.selection-fields { gap: 9px; padding: 12px; background: #f8fbf9; }
.compact-field { min-height: 60px; padding: 9px 11px; border-radius: 12px; }
.compact-field > span:first-child { font-size: 10px; }
.compact-field input, .compact-field select, .compact-field textarea { font-size: 14px; }
.compact-field em { font-size: 11px; }
.status-field select { min-height: 26px; font-weight: 850; }
.status-field option { padding: 9px 12px; color: var(--ink); background: #fff; font-weight: 750; }
.status-field option[value="default"] { color: #617269; background: #f7f9f8; }
.status-field option[value="work"] { color: #16734e; background: #effaf4; }
.status-field option[value="off"] { color: #ad463c; background: #fff3f1; }
.status-field option[value="paid_leave"] { color: #286f90; background: #eef8fc; }
.status-field option[value="holiday"] { color: #694a9e; background: #f7f2ff; }
.status-field option[value="makeup_workday"] { color: #966013; background: #fff7e7; }
.status-field:has(select[data-status="default"]), .status-field:has(select[data-status="mixed"]) { background: #f8faf9; }
.ot-multiplier-field { border-color: #d9cbed; background: #fbf8ff; }
.ot-multiplier-field > span:first-child, .ot-multiplier-field input { color: #654a96; }
.onsite-segmented button { min-height: 29px; font-size: 11px; }

.weekday-grid > div { font-size: 11px; }
.day-card { min-height: clamp(118px, 8.8vw, 142px); padding: 12px; }
.day-card-top b { font-size: 15px; }
.day-card-top em, .day-tag, .day-note, .day-money { font-size: 10px; }
.day-tags { margin-top: 17px; }

.net-card {
    padding: 23px;
    background:
        radial-gradient(circle at 92% 0, rgba(255, 206, 112, .24), transparent 38%),
        linear-gradient(135deg, #164f3c, #24785a);
}
.net-card-head small { font-size: 11px; }
.net-card-head strong { font-size: clamp(28px, 3vw, 34px); }
.net-metrics strong { font-size: 18px; }
.net-metrics small { font-size: 10px; }

.card-title-row > div small, .card-head-actions > span, .card-title-row > span { font-size: 11px; }
.config-grid label > span, .toggle-field strong, .config-note, .money-row, .net-total span { font-size: 12px; }
.config-grid input, .adjustment-row input, .adjustment-row select { height: 40px; font-size: 14px; }
.config-grid .field-warning, .toggle-field small, .config-note small, .zero-note, .calculation-warning { font-size: 11px; }
.money-row { padding-block: 8px; }
.net-total { padding: 14px; background: linear-gradient(110deg, #fff3d7, #fff9eb); }
.net-total strong { font-size: 21px; }

.modal-head p, .modal-section-title p, .default-config-grid > label > span,
.history-item small, .settings-form label:not(.toggle-field) > span,
.settings-rule strong, .settings-rule span { font-size: 11px; }
.default-config-grid input, .tax-bracket-table input { height: 40px; font-size: 13px; }

@media (max-width: 1180px) {
    .app-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    body { font-size: 15px; }
    .topbar-inner { padding-block: 11px; }
    .topbar-actions .button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
    .period-toolbar, .calendar-header { padding: 14px; }
    .legend { border-radius: 12px; }
    .compact-field { min-height: 62px; }
    .weekday-grid > div { font-size: 10px; }
    .day-card, .calendar-blank { min-height: clamp(70px, 14vw, 94px); }
    .day-card-top b { font-size: 13px; }
}

@media (max-width: 440px) {
    .topbar-actions .button { font-size: 11px; }
    .legend { display: grid; grid-template-columns: repeat(3, auto); width: 100%; gap: 6px 10px; }
    .legend span { font-size: 10px; }
    .weekday-grid > div { font-size: 9px; }
    .day-card, .calendar-blank { min-height: 62px; }
}

/* v1.5 final sizing overrides must follow the v1.4 typography layer. */
.button, .icon-button { min-height: 34px; font-size: 12px; }
.button { padding: 6px 11px; }
.quick-actions .button, .card-head-actions .button, .config-actions .button { min-height: 34px; padding: 6px 10px; }
@media (max-width: 760px) {
    .topbar-actions .button { min-height: 34px; padding: 6px 9px; font-size: 11px; }
    .quick-actions .button { min-height: 32px; padding: 6px 9px; font-size: 11px; }
}

/* v1.6 final layer */
.period-nav-button { width: 42px; height: 42px; min-height: 42px; border-color: #bcd3c6; border-radius: 50%; color: var(--green); background: linear-gradient(145deg, #fff, #edf7f1); box-shadow: 0 5px 14px rgba(23,100,71,.10); font-size: 17px; }
.period-nav-button:hover { border-color: #78aa91; color: #fff; background: var(--green); box-shadow: 0 7px 18px rgba(23,100,71,.22); }
.period-select-button { min-height: 44px; padding-block: 8px; border-color: #c5dbcf; background: rgba(255,255,255,.76); }
.period-select-button strong { grid-row: 1; align-self: center; font-size: 17px; }
.period-select-button i { grid-row: 1; }
.adjustment-body-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #e5ebe7; }
.adjustment-body-actions .button { min-width: 148px; }

@media (max-width: 760px) {
    .period-picker { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 9px; width: 100%; }
    .period-picker > .period-select-wrap { min-width: 0; }
    .period-nav-button { width: 44px; height: 44px; min-height: 44px; }
    .period-select-button { min-height: 44px; }
    .period-select-button strong { font-size: 18px; }
}

@media (max-width: 760px) and (any-pointer: coarse) {
    body:has(.account-menu[open]) { overflow: hidden; }
    .account-menu[open]::before { content: ""; position: fixed; inset: 0; z-index: 80; background: rgba(15,29,24,.48); backdrop-filter: blur(2px); }
    .account-menu-panel { position: fixed; inset: auto 10px 10px; z-index: 90; width: auto; max-height: calc(100dvh - 20px); padding: 9px; overflow-y: auto; border-radius: 18px; box-shadow: 0 24px 80px rgba(15,29,24,.32); }
    .account-menu-panel > a { min-height: 54px; padding: 10px; }
    .desktop-selection-help { display: none; }
    .touch-selection-help { display: inline; }
    .touch-selection-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px 12px; border-bottom: 1px solid #dfe8e2; background: #f7faf8; }
    .touch-selection-bar button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 10px; border: 1px solid #cbdad2; border-radius: 11px; color: #355247; background: #fff; font-size: 11px; }
    .touch-selection-bar button.active { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 6px 16px rgba(23,100,71,.20); }
    .touch-selection-bar small { grid-column: 1 / -1; color: #64776d; text-align: center; font-size: 10px; }
}

@media (max-width: 640px) and (any-pointer: coarse) {
    .calendar-scroll { padding: 10px; overflow: visible; }
    .weekday-grid { display: none; }
    .calendar-grid { width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .calendar-blank { display: none; }
    .day-card { min-height: 116px; padding: 11px; border-radius: 13px; }
    .day-card-top > span:first-child { display: flex; align-items: baseline; gap: 6px; }
    .day-card-top b { font-size: 18px; }
    .day-weekday { display: inline; color: #7a8981; font-size: 9px; font-weight: 750; }
    .day-card-top em { display: inline; max-width: 72px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
    .day-tags { min-height: 24px; margin-top: 14px; gap: 4px; }
    .day-tag { width: auto; height: auto; padding: 3px 5px; overflow: visible; border-radius: 999px; font-size: 8px; }
    .day-note { display: block !important; max-width: 100%; font-size: 8px; }
    .day-money { display: block !important; margin-top: 7px; font-size: 9px; }
    .day-card.selected { box-shadow: inset 0 0 0 2px var(--green), 0 8px 18px rgba(23,76,60,.12); }
    .day-card.selected::after { right: 8px; bottom: 8px; width: 20px; height: 20px; font-size: 10px; }
    .adjustment-body-actions .button { width: 100%; min-height: 40px; }
}

/* v1.10.1 final layer — touch weeks start with T7 and CN in the first two slots. */
@media (max-width: 640px) and (any-pointer: coarse) {
    .calendar-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
        grid-auto-rows: auto;
        column-gap: 3px !important;
        row-gap: 6px !important;
    }
    .calendar-grid .day-card {
        grid-column: var(--touch-week-column) / span 2;
        grid-row: var(--touch-week-row);
    }
    .calendar-grid .day-card[data-weekday="3"],
    .calendar-grid .day-card[data-weekday="4"],
    .calendar-grid .day-card[data-weekday="5"] { margin-bottom: 4px; }
}

/* v1.11.1 — month grid: status by border, entered values by dots. */
.calendar-scroll { padding: 14px; overflow-x: auto; }
.weekday-grid, .calendar-grid {
    width: 100%;
    min-width: 630px;
    grid-template-columns: repeat(7, minmax(78px, 1fr));
    gap: 0;
}
.weekday-grid {
    margin: 0;
    padding: 0;
    border: 1px solid #e2e8e4;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}
.weekday-grid > div {
    display: grid;
    place-items: center;
    min-height: 46px;
    padding: 0;
    border-right: 1px solid #e7ebe8;
    color: #697a72;
    background: #fff;
    font-size: 12px;
}
.weekday-grid > div:last-child { border-right: 0; }
.weekday-grid > div:nth-child(6) { color: #3378a0; background: #f2f8fc; }
.weekday-grid > div:nth-child(7) { color: #bd5158; background: #fff5f4; }
.calendar-grid {
    border: 1px solid #e2e8e4;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    background: #e7ebe8;
}
.calendar-grid .day-card,
.calendar-grid .calendar-blank {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: clamp(82px, 8vw, 112px);
    margin: 0 !important;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e7ebe8;
}
.calendar-grid .day-card::before { display: none; }
.calendar-grid .day-card.weekend,
.calendar-grid .calendar-blank.weekend { background: #fbf7f5; }
.calendar-grid .day-card.unrecorded { color: #1e2d27; }
.calendar-grid .day-card.type-work { background: #fff; box-shadow: inset 0 0 0 2px #55a982; }
.calendar-grid .day-card.type-off { background: #fff; box-shadow: inset 0 0 0 2px #df6b5d; }
.calendar-grid .day-card.type-paid_leave { background: #fff; box-shadow: inset 0 0 0 2px #4c91b0; }
.calendar-grid .day-card.type-holiday { background: #fff; box-shadow: inset 0 0 0 2px #8064b5; }
.calendar-grid .day-card.type-makeup_workday { background: #fff; box-shadow: inset 0 0 0 2px #d08a22; }
.calendar-grid .day-card.type-work.weekend,
.calendar-grid .day-card.type-off.weekend,
.calendar-grid .day-card.type-paid_leave.weekend,
.calendar-grid .day-card.type-holiday.weekend,
.calendar-grid .day-card.type-makeup_workday.weekend { background: #fbf7f5; }
.calendar-grid .day-card.selected {
    z-index: 2;
    background: #f5fbf8;
    box-shadow: inset 0 0 0 3px var(--green), 0 7px 18px rgba(23, 76, 60, .14);
}
.calendar-grid .day-card:hover { z-index: 3; transform: none; }
.calendar-grid .day-card-top {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
}
.calendar-grid .day-card-top b {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 10px;
    color: #17241f;
    font-size: 15px;
}
.calendar-grid .day-card.selected .day-card-top b { color: #fff; background: var(--green); }
.calendar-grid .day-weekday { display: none !important; }
.calendar-grid .day-tags {
    display: flex;
    align-items: center;
    min-height: 11px;
    margin: 8px 0 0 5px;
    gap: 7px;
}
.calendar-grid .day-tag {
    display: block;
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px currentColor;
    font-size: 0;
}
.calendar-grid .work-tag { color: #5da77d; background: #8fd9b2; }
.calendar-grid .onsite-tag { color: #b58525; background: #f0c66a; }
.calendar-grid .ot-tag { color: #8964ae; background: #c9a2e9; }
.calendar-grid .day-note,
.calendar-grid .day-money { display: none !important; }
.calendar-grid .calendar-blank {
    display: block !important;
    color: #aeb7b2;
    font-size: 14px;
    font-weight: 850;
}
.calendar-grid .calendar-blank span { display: block; padding: 7px; }
.calendar-grid .day-card.selected::after { display: none !important; }

@media (max-width: 640px) {
    .calendar-scroll { padding: 8px; overflow-x: hidden; }
    .weekday-grid, .calendar-grid {
        display: grid !important;
        min-width: 0 !important;
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 0 !important;
    }
    .weekday-grid { display: grid !important; }
    .weekday-grid > div { min-height: 38px; font-size: 10px; }
    .calendar-grid .day-card,
    .calendar-grid .calendar-blank {
        min-width: 0;
        min-height: clamp(58px, 18vw, 76px) !important;
        padding: 5px !important;
        border-radius: 0 !important;
    }
    .calendar-grid .day-card-top b {
        width: 27px;
        height: 27px;
        border-radius: 9px;
        font-size: 13px !important;
    }
    .calendar-grid .day-tags { min-height: 8px !important; margin: 6px 0 0 5px !important; gap: 5px !important; }
    .calendar-grid .day-tag { width: 6px !important; height: 6px !important; }
    .calendar-grid .calendar-blank { font-size: 12px; }
    .calendar-grid .calendar-blank span { padding: 6px 3px; }
}

@media (max-width: 380px) {
    .calendar-scroll { padding-inline: 5px; }
    .weekday-grid > div { min-height: 34px; font-size: 9px; }
    .calendar-grid .day-card,
    .calendar-grid .calendar-blank { min-height: 56px !important; padding: 3px !important; }
    .calendar-grid .day-card-top b { width: 24px; height: 24px; font-size: 12px !important; }
}

/* v1.11.3 — mobile-only calmer calendar cards and single-layer data dots. */
@media (max-width: 640px) {
.calendar-scroll { padding: 16px; }
.weekday-grid {
    margin-bottom: 8px;
    border: 0;
    border-radius: 12px;
    background: #f4f7f5;
    box-shadow: none;
}
.weekday-grid > div {
    min-height: 42px;
    border: 0;
    background: transparent;
}
.weekday-grid > div:nth-child(6) { background: #eef6fa; }
.weekday-grid > div:nth-child(7) { background: #fff3f2; }
.calendar-grid {
    gap: 6px;
    padding: 6px;
    border: 1px solid #e3eae6;
    border-radius: 16px;
    background: #f3f6f4;
}
.calendar-grid .day-card,
.calendar-grid .calendar-blank {
    border-radius: 11px;
    background: #fff;
    box-shadow: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.calendar-grid .day-card.weekend,
.calendar-grid .calendar-blank.weekend { background: #fdf9f7; }
.calendar-grid .day-card.type-work { border: 1px solid #9ed3b8; box-shadow: none; }
.calendar-grid .day-card.type-off { border: 1px solid #efb5ae; box-shadow: none; }
.calendar-grid .day-card.type-paid_leave { border: 1px solid #a9cddd; box-shadow: none; }
.calendar-grid .day-card.type-holiday { border: 1px solid #c4b4df; box-shadow: none; }
.calendar-grid .day-card.type-makeup_workday { border: 1px solid #e6c48e; box-shadow: none; }
.calendar-grid .day-card.type-work.weekend,
.calendar-grid .day-card.type-off.weekend,
.calendar-grid .day-card.type-paid_leave.weekend,
.calendar-grid .day-card.type-holiday.weekend,
.calendar-grid .day-card.type-makeup_workday.weekend { background: #fdf9f7; }
.calendar-grid .day-card.unrecorded { border: 1px solid transparent; }
.calendar-grid .day-card:hover {
    border-color: #7da997;
    background: #fbfdfc;
    box-shadow: 0 6px 16px rgba(30, 73, 56, .08);
}
.calendar-grid .day-card.selected,
.calendar-grid .day-card.selected:hover {
    z-index: 2;
    border: 2px solid #155f47;
    background: #fff;
    box-shadow: 0 5px 14px rgba(21, 95, 71, .13);
}
.calendar-grid .day-card.selected.weekend { background: #fdf9f7; }
.calendar-grid .day-card-top b,
.calendar-grid .day-card.selected .day-card-top b {
    width: auto;
    height: auto;
    padding: 3px 5px;
    border-radius: 0;
    color: #1b2e26;
    background: transparent;
    font-size: 15px;
}
.calendar-grid .day-tags {
    min-height: 8px;
    margin: 11px 0 0 5px;
    gap: 6px;
}
.calendar-grid .day-tag {
    width: 7px;
    height: 7px;
    border: 0;
    box-shadow: none;
}
.calendar-grid .work-tag { color: transparent; background: #45ad7b; }
.calendar-grid .onsite-tag { color: transparent; background: #d89a24; }
.calendar-grid .ot-tag { color: transparent; background: #8b61ba; }
.calendar-grid .calendar-blank {
    border: 1px solid transparent;
    background: rgba(255,255,255,.58);
}
.calendar-grid .calendar-blank.weekend { background: rgba(253,249,247,.78); }

@media (max-width: 640px) {
    .calendar-scroll { padding: 10px; }
    .weekday-grid { margin-bottom: 5px; border-radius: 10px; }
    .weekday-grid > div { min-height: 36px; }
    .calendar-grid { gap: 3px !important; padding: 3px; border-radius: 13px; }
    .calendar-grid .day-card,
    .calendar-grid .calendar-blank {
        min-height: clamp(57px, 17vw, 72px) !important;
        padding: 7px 5px !important;
        border-radius: 8px !important;
    }
    .calendar-grid .day-card.selected,
    .calendar-grid .day-card.selected:hover { border-width: 2px; }
    .calendar-grid .day-card-top b,
    .calendar-grid .day-card.selected .day-card-top b {
        width: auto;
        height: auto;
        padding: 1px 3px;
        font-size: 13px !important;
    }
    .calendar-grid .day-tags { min-height: 7px !important; margin: 9px 0 0 3px !important; gap: 4px !important; }
    .calendar-grid .day-tag { width: 6px !important; height: 6px !important; box-shadow: none !important; }
}

@media (max-width: 380px) {
    .calendar-scroll { padding-inline: 6px; }
    .calendar-grid { gap: 2px !important; padding: 2px; }
    .calendar-grid .day-card,
    .calendar-grid .calendar-blank { min-height: 54px !important; padding: 5px 3px !important; }
}
}

/* v1.11.4 — restore the v1.3.2 calendar cards on tablet/desktop only. */
@media (min-width: 641px) {
    .calendar-data-key { display: none; }
    .calendar-scroll { overflow-x: auto; padding: 14px; scrollbar-width: thin; }
    .weekday-grid,
    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, minmax(88px, 1fr));
        width: auto;
        min-width: 680px;
        gap: 7px;
        padding: 0;
        border: 0;
        border-radius: 0;
        overflow: visible;
        background: transparent;
    }
    .weekday-grid {
        position: sticky;
        top: 0;
        z-index: 4;
        margin-bottom: 7px;
        padding: 4px 0;
        background: rgba(255,255,255,.96);
        box-shadow: none;
        backdrop-filter: blur(8px);
    }
    .weekday-grid > div,
    .weekday-grid > div:nth-child(6),
    .weekday-grid > div:nth-child(7) {
        display: block;
        min-height: 0;
        padding: 3px;
        border: 0;
        color: #7b8982;
        background: transparent;
        text-align: center;
        font-size: 10px;
        font-weight: 850;
        letter-spacing: .08em;
    }
    .weekday-grid .weekend-label { color: #a26d67; }
    .calendar-grid .day-card,
    .calendar-grid .calendar-blank {
        position: relative;
        min-width: 0;
        min-height: clamp(104px, 8.3vw, 128px);
        margin: 0;
        padding: 11px;
        overflow: hidden;
        border: 1px solid #e0e6e1;
        border-radius: 13px;
        background: #fff;
        box-shadow: none;
    }
    .calendar-grid .day-card { cursor: pointer; text-align: left; user-select: none; outline: 0; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
    .calendar-grid .day-card::before { display: block; content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: transparent; }
    .calendar-grid .day-card.type-work::before { background: #2d9a6e; }
    .calendar-grid .day-card.type-off::before { background: #df6b5d; }
    .calendar-grid .day-card.type-paid_leave::before { background: #347a9a; }
    .calendar-grid .day-card.type-holiday::before { background: #7256a8; }
    .calendar-grid .day-card.type-makeup_workday::before { background: #d08a22; }
    .calendar-grid .day-card:hover { z-index: 1; border-color: #9fb9ab; box-shadow: 0 9px 20px rgba(31,58,47,.09); transform: translateY(-1px); }
    .calendar-grid .day-card:focus-visible { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,154,110,.15); }
    .calendar-grid .day-card.weekend { background: #faf8f6; }
    .calendar-grid .day-card.unrecorded { color: #89958f; background: #fff; border-color: #e0e6e1; }
    .calendar-grid .day-card.unrecorded.weekend { background: #faf8f6; }
    .calendar-grid .day-card.type-work { border-color: #b7dcc8; background: linear-gradient(145deg,#f6fcf9,#edf8f2); }
    .calendar-grid .day-card.type-off { border-color: #edc6c0; background: #fff7f5; }
    .calendar-grid .day-card.type-paid_leave { border-color: #b9d7e5; background: #f1f8fb; }
    .calendar-grid .day-card.type-holiday { border-color: #d3c6eb; background: #f8f4ff; }
    .calendar-grid .day-card.type-makeup_workday { border-color: #edce9d; background: linear-gradient(145deg,#fffaf0,#fff3dc); }
    .calendar-grid .day-card.selected,
    .calendar-grid .day-card.selected:hover { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green),0 8px 18px rgba(23,76,60,.1); }
    .calendar-grid .day-card-top { display: flex !important; align-items: flex-start; justify-content: space-between; gap: 5px; }
    .calendar-grid .day-card-top b,
    .calendar-grid .day-card.selected .day-card-top b {
        display: inline;
        width: auto;
        height: auto;
        padding: 0;
        border-radius: 0;
        color: inherit;
        background: transparent;
        font-size: 13px;
        font-weight: 900;
    }
    .calendar-grid .day-card-top em { display: inline; color: #65776e; font-size: 8px; font-style: normal; font-weight: 800; }
    .calendar-grid .day-tags { display: flex; min-height: 20px; margin: 15px 0 0; gap: 4px; flex-wrap: wrap; }
    .calendar-grid .day-tag {
        display: inline-block;
        width: auto;
        height: auto;
        padding: 3px 5px;
        border-radius: 999px;
        box-shadow: none;
        font-size: 8px;
        font-weight: 850;
    }
    .calendar-grid .work-tag { color: #176342; background: #dff3e8; }
    .calendar-grid .onsite-tag { color: #785516; background: #fff0cf; }
    .calendar-grid .ot-tag { color: #5f438e; background: #eee7fb; }
    .calendar-grid .day-note { display: block !important; }
    .calendar-grid .holiday-note { color: #684d98; font-weight: 800; }
    .calendar-grid .makeup-note { color: #946010; font-weight: 800; }
    .calendar-grid .personal-override-note { color: #b84b40; font-weight: 800; }
    .calendar-grid .day-money { display: block !important; margin-top: 8px; padding-top: 6px; border-top: 1px dashed rgba(99,119,108,.22); color: var(--green); text-align: right; font-size: 9px; font-weight: 850; }
    .calendar-grid .calendar-blank { border: 0; border-radius: 12px; color: transparent; background: #f8faf8; }
    .calendar-grid .calendar-blank span { display: none; }
    .calendar-grid .day-card.selected::after { display: none !important; }
}

/* v1.12 — UX audit polish, information hierarchy, accessibility and dark mode. */
.brand-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-icon svg path:last-child { stroke: #f2cb78; }
.theme-toggle { width: 34px; height: 34px; font-size: 16px; }
.salary-confidence { display: block; margin-top: 8px; color: rgba(255,255,255,.68); font-size: 9px; font-weight: 700; }
.primary-metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 18px -4px 0; padding: 12px 4px 0; border-top: 1px solid rgba(255,255,255,.14); }
.primary-metrics > div { display: grid; gap: 3px; padding: 0 12px; }
.primary-metrics > div + div { border-left: 1px solid rgba(255,255,255,.14); }
.primary-metrics small { color: rgba(255,255,255,.65); font-size: 9px; font-weight: 750; }
.primary-metrics strong { color: #fff; font-size: 11px; }
.primary-metrics b { font-size: 20px; font-variant-numeric: tabular-nums; }
.month-health { display: flex; align-items: center; gap: 7px; margin: 0 16px 16px; padding: 9px 10px; border-radius: 9px; font-size: 9px; }
.month-health span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.month-health.ok { color: #14704c; background: #e6f5ed; }
.month-health.pending { color: #8a6419; background: #fff5dc; }
.month-health.warning { color: #a64137; background: #fff0ed; }
.day-card.today .day-card-top b { color: #fff !important; background: var(--green) !important; border-radius: 999px !important; }
:where(button, input, select, textarea, summary):focus-visible { outline: 3px solid color-mix(in srgb, var(--green-2) 38%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

html[data-theme="dark"] {
    --bg: #0d1411; --surface: #151e1a; --ink: #edf4f0; --muted: #9aaba2; --line: #2a3831;
    --green: #2f8f6b; --green-2: #54bd8d; --gold: #c89338; --red: #df7469; --purple: #a98bd6; --blue: #70aeca;
    --shadow: 0 10px 34px rgba(0,0,0,.22); color-scheme: dark;
}
html[data-theme="dark"] body, html[data-theme="dark"] .topbar { background: var(--bg); }
html[data-theme="dark"] .topbar { border-color: var(--line); background: rgba(13,20,17,.92); }
html[data-theme="dark"] .surface, html[data-theme="dark"] .account-menu-panel, html[data-theme="dark"] .period-popover,
html[data-theme="dark"] .modal, html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea,
html[data-theme="dark"] .button-outline, html[data-theme="dark"] .icon-button, html[data-theme="dark"] .account-menu > summary { color: var(--ink); border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] .calendar-header { border-color: var(--line); background: linear-gradient(180deg,#17211c,#141d19); }
html[data-theme="dark"] .selection-empty, html[data-theme="dark"] .selection-editor, html[data-theme="dark"] .selection-fields,
html[data-theme="dark"] .compact-field, html[data-theme="dark"] .touch-selection-bar, html[data-theme="dark"] .config-note,
html[data-theme="dark"] .money-row, html[data-theme="dark"] .adjustment-row { color: var(--ink); border-color: var(--line); background: #111a16; }
html[data-theme="dark"] .weekday-grid { background: rgba(21,30,26,.96); }
html[data-theme="dark"] .calendar-grid .day-card, html[data-theme="dark"] .calendar-grid .calendar-blank { color: var(--ink); border-color: #34443c; background: #18221d; }
html[data-theme="dark"] .calendar-grid .day-card.weekend, html[data-theme="dark"] .calendar-grid .calendar-blank.weekend { background: #211c1b; }
html[data-theme="dark"] .calendar-grid .day-card.type-work { background: #14271f; border-color: #356c54; }
html[data-theme="dark"] .calendar-grid .day-card.type-off { background: #291b1a; border-color: #78423c; }
html[data-theme="dark"] .calendar-grid .day-card.type-paid_leave { background: #15242a; border-color: #3c6577; }
html[data-theme="dark"] .calendar-grid .day-card.type-holiday { background: #211c2c; border-color: #604b7c; }
html[data-theme="dark"] .calendar-grid .day-card.type-makeup_workday { background: #292216; border-color: #755b2f; }
html[data-theme="dark"] .calendar-grid .day-card.selected { border-color: #67c79a; box-shadow: inset 0 0 0 1px #67c79a,0 8px 18px rgba(0,0,0,.25); }
html[data-theme="dark"] .calendar-grid .day-card-top em, html[data-theme="dark"] .calendar-heading p,
html[data-theme="dark"] .selection-empty, html[data-theme="dark"] .compact-field > span:first-child { color: var(--muted); }
html[data-theme="dark"] .status-select-menu, html[data-theme="dark"] .status-select-menu button { color: var(--ink); border-color: var(--line); background: #18221d; }
html[data-theme="dark"] .status-select-menu button:hover { background: #223129; }
html[data-theme="dark"] .button-ghost:hover, html[data-theme="dark"] .account-menu-panel > a:hover { background: #223129; }
html[data-theme="dark"] .save-state { color: #b9c8c0; background: #24312b; }
html[data-theme="dark"] .month-health.ok { color: #77d3a7; background: #173326; }
html[data-theme="dark"] .month-health.pending { color: #e2bd6d; background: #332a17; }
html[data-theme="dark"] .month-health.warning { color: #ed9288; background: #39201e; }

@media (max-width: 760px) {
    .topbar-inner { width: calc(100% - 20px); padding: 9px 0; }
    .brand small, .save-state, #history-button, #export-button { display: none; }
    .brand { min-width: 0; }
    .brand-icon { width: 36px; height: 36px; }
    .theme-toggle { display: inline-grid; }
    .selection-editor { scroll-margin-top: 72px; }
    .compact-field { min-height: 56px; }
    .onsite-segmented button, .touch-selection-bar button, .selection-close { min-height: 44px; }
}
