/* Shared theme. Document exports and uploaded files keep their own colours. */
.theme-header-actions{display:flex;align-items:center;gap:20px}
body header nav{align-items:center}
body .theme-toggle{display:inline-grid!important;place-items:center;flex:0 0 40px;width:40px!important;min-width:40px;max-width:40px;height:40px;min-height:40px;padding:8px!important;margin:0!important;border:1px solid #bdcbbd!important;border-radius:50%;background:#edf2e8;color:#31553c;cursor:pointer;box-shadow:none!important;line-height:1}
.theme-toggle svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle:focus-visible{outline:3px solid #83b99a;outline-offset:3px}
.theme-toggle-floating{position:fixed;top:16px;right:20px;z-index:20}
html[data-theme=dark]{color-scheme:dark;--theme-bg:#080c14;--theme-panel:#101721;--theme-raised:#19222d;--theme-input:#0c131d;--theme-ink:#edf3f5;--theme-muted:#aab6c4;--theme-line:#303b49;--green:#2e6547;--accent:#2e6547;--ink:#edf3f5;--muted:#aab6c4;--line:#303b49;--border:#303b49;--soft:#19222d;--control-edge:#465261;--control-shadow:#0005;--control-shadow-hover:#0007;background:var(--theme-bg);color:var(--theme-ink)}
html[data-theme=dark] body{background:var(--theme-bg);color:var(--theme-ink)}
html[data-theme=dark] :is(header,footer,.library,.section-head,.files-section,.selectors,.file-row,.deletion-note,.output-card,.si-row,.person,.day-entry){border-color:var(--theme-line)}
html[data-theme=dark] :is(.brand,h1,h2,h3,label,legend,.employee-name,.si-caption,.file-name-text,.tool-content){color:var(--theme-ink)}
html[data-theme=dark] :is(p,small,.intro,.lead,.eyebrow,.count,.back-link,.quiet,.helper,.status,.source-info,.matrix-legend,.matrix-footer,.base-note,.base-check,.si-message,.si-info,.si-details summary,.si-type,.si-check,.si-filter-count,.employee-shift,.brand-caption,.file-size,.file-time,.list-description,.access-tag,.privacy,.output-card p,.tool-content p,.explanation li p,.deletion-note,.base-tools label,#base-message,#base-shown,#base-stats,#status,#count,#book-info,#selection-status){color:var(--theme-muted)}
html[data-theme=dark] a{color:#a9d8b9}
html[data-theme=dark] :is(.panel,.base-panel,.tool-card,.workspace,.results,.settings,.person,.month-panel,.file-table,.single-panel,dialog,.base-dialog,.day-editor){background:var(--theme-panel);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme=dark] :is(aside,.drop,.dropzone,.empty-state,.file-table-head,.tool-icon,.data-note,.pill,.retention-pill,.file-icon,.step,.day-passages,.parent-row,.section-row th,.parent-row:has(.expand-assembly) td){background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-line)}
html[data-theme=dark] :is(.drop:hover,.drop.drag,.dropzone.dragging,.mini-month:hover){background:#34343a;border-color:#83b99a}
html[data-theme=dark] :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea){background:var(--theme-input);color:var(--theme-ink);border-color:#465261}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#8d9aaa;opacity:1}
html[data-theme=dark] input[type=file]{background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-line)}
html[data-theme=dark] input::file-selector-button{background:var(--theme-raised);color:var(--theme-ink);border-color:var(--theme-line)}
html[data-theme=dark] :is(input[type=checkbox],input[type=radio],progress){accent-color:#86bf97}
html[data-theme=dark] :is(td,th,.table-wrap,.base-table-wrap,.table-scroll){border-color:var(--theme-line)}
html[data-theme=dark] th,html[data-theme=dark] .base-table th{background:#1d2733;color:#d1dbe5}
html[data-theme=dark] .base-table td{background:var(--theme-panel);color:var(--theme-ink)}
html[data-theme=dark] tbody tr:hover td{background:#1d2733}
html[data-theme=dark] :is(button,.button,.primary,.primary-button,.download){background:#306b49;color:#f1fff5;border-color:#5d8568}
html[data-theme=dark] :is(.secondary,.secondary-button,.choose-button,.refresh-button,.download-button,.settings-actions button,.base-table .si-actions button,.si-retry,.si-edit,.si-filter-tab,.supplies button,.ok-filters button,.selection-bar button,.multi-ok-mode,.day-editor .secondary){background:var(--theme-raised);color:#dbe4eb;border-color:#465261}
html[data-theme=dark] :is(button[aria-pressed=true],.si-filter-tab[aria-pressed=true],.supplies button[aria-pressed=true],.ok-filters button[aria-pressed=true],.multi-ok-mode[aria-pressed=true]){background:#366f4b;color:#fff;border-color:#87ad90}
html[data-theme=dark] :is(.si-mark,.expand-assembly,.copy-position,.mini-month-browser>button,.text-button,.close-dialog){background:transparent;color:#c6d2df}
html[data-theme=dark] :is(.mini-month,.mini-weekday){background:transparent;color:var(--theme-muted)}
html[data-theme=dark] .mini-month[aria-pressed=true]{background:#222e3b;color:#e1ebf2;border-color:#526173}
html[data-theme=dark] :is(.mini-rest,.mini-month-grid .mini-rest){color:#d7a597}
html[data-theme=dark] .mini-month-grid .mini-today{background:#487d54;color:#fff}
html[data-theme=dark] :is(.month-matrix th,.month-matrix .employee-col){background:#17212d;color:var(--theme-ink)}
html[data-theme=dark] .month-matrix .day-cell{border-color:#465366;box-shadow:inset 0 1px 0 #ffffff0a,0 2px 2px #0004}
html[data-theme=dark] :is(.month-matrix .state-work,.key-work){background:#263f2d;color:#b8dfc1}
html[data-theme=dark] :is(.month-matrix .state-weekend,.key-weekend){background:#302f29;color:#c1b6a3}
html[data-theme=dark] :is(.month-matrix .state-ОТ,.key-vacation){background:#443044;color:#efb9de}
html[data-theme=dark] :is(.month-matrix .state-МО,.month-matrix .state-Б,.key-medical){background:#273c50;color:#b8d9f5}
html[data-theme=dark] :is(.month-matrix .state-К,.key-trip){background:#39314e;color:#d4c1ef}
html[data-theme=dark] :is(.month-matrix .state-ОГ,.key-timeoff){background:#463a22;color:#f0cf87}
html[data-theme=dark] :is(.month-matrix .state-НН,.month-matrix .state-unknown,.key-unexplained){background:#4a2b30;color:#ffb6bd}
html[data-theme=dark] .month-matrix .state-restored{background:#403a20;color:#e7d68c}
html[data-theme=dark] .month-matrix .calendar-weekend{border-color:#a3977c}
html[data-theme=dark] .month-matrix .day-cell small{color:inherit}
html[data-theme=dark] :is(.si-days.good,.si-status-fit){background:#2b4932;color:#b9e3c0}
html[data-theme=dark] :is(.si-days.soon,.si-status-expiring,.warning){background:#4b3d20;color:#f4d889}
html[data-theme=dark] :is(.si-days.bad,.si-status-unfit,.si-status-expired){background:#562e31;color:#ffb9bb}
html[data-theme=dark] .base-table .si-unfit td{background:#432a2d;color:#ffc2c4}
html[data-theme=dark] :is(.si-unfit small,.si-unfit .si-days.bad){background:transparent;color:#ffc2c4}
html[data-theme=dark] :is(.si-danger,.si-danger .si-message,.si-danger .si-caption,.si-danger .si-number,.si-danger .si-mark,.si-danger .si-info){color:#ffadb2!important}
html[data-theme=dark] :is(.error,.status.error,#base-message.error,#warnings){color:#ffc293}
html[data-theme=dark] :is(.si-mark.si-good,.si-good){color:#9dd8ad}
html[data-theme=dark] tr.setup-position td{background:#213e55;color:#b8dcff}
html[data-theme=dark] :is(tr.setup-position .expand-assembly,tr.setup-position .copy-position){color:#b8dcff!important}
html[data-theme=dark] .theme-toggle{background:#1e2936!important;color:#f4d58a!important;border-color:#4b5b6e!important}
html[data-theme=dark] dialog::backdrop{background:#0009}
@media(max-width:640px){.theme-header-actions{gap:10px}body header nav{gap:12px;flex-wrap:wrap;justify-content:flex-end}body .theme-toggle{flex-basis:36px;width:36px!important;min-width:36px;max-width:36px;height:36px;min-height:36px}.theme-toggle-floating{top:12px;right:12px}}
@media print{.theme-toggle{display:none!important}}

html[data-theme=dark] a.tool-card{border-color:#303b49;box-shadow:inset 0 1px 0 #ffffff0c,0 3px 5px #0004}
html[data-theme=dark] .brand-emblem{filter:brightness(1.8) saturate(.75)}
html[data-theme=dark] .month-matrix .day-cell{background:#18222d;color:#d2dfe9}
html[data-theme=dark] .month-matrix .state-work{background:#263f2d;color:#b8dfc1}
html[data-theme=dark] .month-matrix .state-weekend{background:#302f29;color:#c1b6a3}
html[data-theme=dark] .month-matrix .state-ОГ{background:#463a22;color:#f0cf87}
html[data-theme=dark] .month-matrix .state-ОТ{background:#443044;color:#ffb1b9}
html[data-theme=dark] .month-matrix .state-МО,html[data-theme=dark] .month-matrix .state-Б{background:#273c50;color:#b8d9f5}
html[data-theme=dark] .month-matrix .state-К{background:#39314e;color:#ffb1b9}
html[data-theme=dark] .month-matrix .state-НН,html[data-theme=dark] .month-matrix .state-unknown,html[data-theme=dark] .month-matrix .state-ДО{background:#4a2b30;color:#ffb6bd}
html[data-theme=dark] .month-matrix .state-МО,html[data-theme=dark] .month-matrix .special-work,html[data-theme=dark] .month-matrix .special-work small{color:#ffb1b9}
html[data-theme=dark] .month-matrix .state-restored{background:#403a20;color:#e7d68c}
html[data-theme=dark] .month-matrix .workday-total{background:#1d2733;color:#dce7ef;box-shadow:-1px 0 #303b49}
html[data-theme=dark] .month-scroll{border-color:#303b49}
html[data-theme=dark] .base-table .si-fit td{background:#101721}
html[data-theme=dark] .base-table .si-expired td{background:#101721}
html[data-theme=dark] .base-table .si-away td,html[data-theme=dark] .base-table .si-muted td{background:#101721}
html[data-theme=dark] .si-status-calibration{background:#283e50;color:#b6d9f1;border-color:#5a7b92}
html[data-theme=dark] .si-status-away,html[data-theme=dark] .si-status-unknown{background:#303b3c;color:#c7d1d4;border-color:#617278}

html[data-theme=dark] :is(.product-options,.converter .file-drop,.converter .si-editor){background:#19222d;color:#dce7ef;border-color:#3d4b5e}
html[data-theme=dark] .product-option>span{color:#b5c2d0}
html[data-theme=dark] .product-option:hover>span{background:#263546;color:#edf3f5}
html[data-theme=dark] .product-option input:checked+span{background:#2b3b4c;color:#edf3f5;border-color:#677d96;box-shadow:none}
html[data-theme=dark] .converter .file-drop:hover,html[data-theme=dark] .converter .file-drop.is-dragging{background:#263546;border-color:#91a4bb}
html[data-theme=dark] .converter .file-drop strong{color:#dee9f1}
html[data-theme=dark] .converter .si-base-choice{color:transparent;background-color:#1c2937;background-image:linear-gradient(45deg,transparent 50%,#c5d5e4 50%),linear-gradient(135deg,#c5d5e4 50%,transparent 50%)}
html[data-theme=dark] .converter .si-base-choice option{background:#101721;color:#edf3f5}
html[data-theme=dark] .converter .si-remove{background:#432c30;color:#ffb6bb;border-color:#84535b}

html[data-theme=dark] .explanation{background:transparent}

html[data-theme=dark] .file-browse{color:#b4e4c3}
html[data-theme=dark] .file-selection,html[data-theme=dark] .file-drop.has-file .file-selection{color:#b5c2d0}
html[data-theme=dark] .converter .file-drop .file-icon{background:transparent}

/* Neutral SI card surfaces: colour belongs to badges, never the grid gaps. */
html[data-theme=dark] .base-table,html[data-theme=dark] .base-table tbody{background:var(--theme-panel)}
html[data-theme=dark] .base-table tbody tr,html[data-theme=dark] .base-table tbody tr:is(.si-fit,.si-expired,.si-away,.si-muted,.si-unfit){background:var(--theme-panel)}
html[data-theme=dark] .base-table tbody tr td,html[data-theme=dark] .base-table tbody tr:is(.si-fit,.si-expired,.si-away,.si-muted,.si-unfit) td{background:transparent;border-color:#273444}
html[data-theme=dark] .base-table tbody tr:hover{background:#172230}
@media(max-width:700px){
 html[data-theme=dark] .base-table{background:transparent}
 html[data-theme=dark] .base-table tbody{background:transparent}
 html[data-theme=dark] .base-table tbody tr{margin-bottom:10px;border:1px solid #303b49;border-radius:8px;overflow:hidden;gap:6px;padding:10px}
 html[data-theme=dark] .base-table tbody tr:last-child{margin-bottom:0}
 html[data-theme=dark] .base-table tbody tr td{border:0}
 html[data-theme=dark] .base-table-wrap{border:0}
}
