/* Semantic dark surfaces, keeping category and role identity accents. */
html[data-theme=dark]{color-scheme:dark;--paper:#101722;--white:#1b2635;--ink:#edf2f8;--muted:#bcc9d9;--line:#435267;--green:#79b6ff;--red:#ffadaf}
html[data-theme=dark] body{background:var(--paper);color:var(--ink)}
html[data-theme=dark] body::before{opacity:.16}
html[data-theme=dark] header{background:#102c50;color:#fff}
html[data-theme=dark] header :is(a,.quiet,.brand small){color:#fff}
html[data-theme=dark] :is(h1,h2,h3,h4,legend,label,summary,td,th){color:var(--ink)}
html[data-theme=dark] :is(.panel,.event-card,.settings-section,.settings-shell,.settings-content,.event-subsection,.event-summary-strip,.event-key-grid>div,.event-facts,.leader-summary,.calendar-scroll,.calendar-day,.calendar-cell,.day,.view-tabs,.work-tabs,.nav-dropdown,.mobile-menu,.person-result,.people-results,.picked-user,.selection-chips954,.duty-card954,.event-section954,.duty-options954,.report-summary953,.mail-help,.resource-row,.discussion article,.comment,.message-card,dialog,.modal-content,.action-dialog,.event-tools,.context-menu){background:var(--white)!important;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea,option){background:#111d2b!important;color:var(--ink)!important;border-color:#65778f}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#aabbd0}
html[data-theme=dark] :is(a,.quiet){color:#91c5ff}
html[data-theme=dark] :is(button,.button){background:#285f98;color:#fff;border-color:#7eaddf}
html[data-theme=dark] :is(.secondary,.quiet,.work-tabs a,.view-tabs a,.segmented a){background:#22354c;color:#e4f0ff}
html[data-theme=dark] :is([aria-current=page],.view-tabs a[aria-current],.work-tabs a[aria-current],.segmented .active){background:#3276b9;color:white}
html[data-theme=dark] :is(.muted,.helptext,small){color:var(--muted)}
html[data-theme=dark] :is(.category-option,.category-filter label,.report-categories label){background:#1b293b!important;color:#edf2f8!important;border-color:var(--category,#829bbb)}
html[data-theme=dark] .event-card[class*=cat-]{background:linear-gradient(var(--category-bg),#1b2635 210px)!important}
html[data-theme=dark] :is(.event-card h2 a,.event-facts strong,.leader-summary,.calendar-event){color:var(--ink)}
html[data-theme=dark] :is(.person-badge,.role-label){background:#192739!important;color:#f1f5fa!important}
html[data-theme=dark] .person-badge small{color:#c8d7e9}
html[data-theme=dark] :is(table,thead,tbody,tr,th,td){border-color:var(--line)}
html[data-theme=dark] :is(th,thead,tr:nth-child(even)){background:#223145}
html[data-theme=dark] :is(.message,.attention,.soft-attention954,.publication-choice,.section-publish,.form-section-title,.leader-section,.booking-status954){background:#283b50!important;color:#f1f5fc;border-color:#7398bc}
html[data-theme=dark] :is(.errorlist,.error,.danger){color:#ffc3c3}
html[data-theme=dark] :is(.danger,button.danger,.button.danger,.booking-rejected){background:#6a2630!important;color:#fff;border-color:#fa8c94}
html[data-theme=dark] :is(.success,.booking-approved){background:#173e32!important;color:#c8f8df}
html[data-theme=dark] .metric-grid>div{background:#143d68;color:#fff}
html[data-theme=dark] .metric-grid>div :is(small,strong,span){color:#fff}
html[data-theme=dark] :is(.tag[class*=cat-],.date-tile,.detail-date,.rank-number){color:var(--category-contrast,#fff)}
html[data-theme=dark] .detail-date{color:#172538}
html[data-theme=dark] :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #ffd75d;outline-offset:3px}
html[data-theme=dark] :is(button:disabled,.button[aria-disabled=true]){background:#374151;color:#bfc9d5;border-color:#667180;opacity:1}
html[data-theme=dark] dialog::backdrop{background:#000b}
.setup-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:16px}.setup-grid .panel{margin:0}.setup-grid p{overflow-wrap:anywhere}
@media print{html[data-theme=dark]{--paper:white;--white:white;--ink:black;--muted:#444;--line:#bbb;--green:#14345e;color-scheme:light}html[data-theme=dark] body,html[data-theme=dark] main *{background:white!important;color:black!important;box-shadow:none!important}}
html[data-theme=dark] :is(.feature-group,.feature-card,.stat-cards>div,.ride-event-summary,.calendar-day,.calendar-cell,.calendar-head,.calendar-weekday,.calendar-week,.modal,.dialog-body){background:var(--white)!important;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.event-place,.event-place small,.duty-name,.person-badge small,.message-card time,.stat-cards strong,table[data-sort-report] th button){color:#d2e5ff!important}
html[data-theme=dark] :is(.switch-state,.module-status){color:#ffb1ba}
html[data-theme=dark] .switch-control:has(:checked) .switch-state,html[data-theme=dark] .module-status.on{color:#96e6b9}
html[data-theme=dark] .add-duty954{color:#ffda78}
html[data-theme=dark] .detail-date{color:#172538!important}
html[data-theme=dark] :is(.weekday,.week-number,.calendar-capacity,.calendar-status){background:#223145;color:#dce9fa}
html[data-theme=dark] .calendar-event{background:#203148!important;color:#edf2f8!important}
html[data-theme=dark] .calendar-day.today{outline:2px solid #ffd75d;outline-offset:-2px}
html[data-theme=dark] .calendar-day.outside{opacity:.65}
html[data-theme=dark] :is(.event-context-menu,.copy-calendar-dialog,.copy-calendar-dialog td,.copy-calendar-dialog th){background:var(--white)!important;color:var(--ink);border-color:var(--line)}
.event-subsection .tag{display:inline-flex;max-width:100%;white-space:normal;margin:3px 5px 3px 0;overflow-wrap:normal}
html[data-theme=dark] .friend-indicator{background:#233e5d;color:#d6eaff}
@media(max-width:600px){.calendar-grid.numbered-calendar{grid-template-columns:2.6rem repeat(7,minmax(165px,1fr))}.calendar-event{overflow-wrap:normal;word-break:normal}.calendar-event strong,.calendar-event span{overflow-wrap:normal;word-break:normal}}
