.theme-toggle{width:32px;height:32px;flex-shrink:0;display:grid;place-items:center;padding:0;margin-left:5px;border:1px solid var(--line);border-radius:7px;background:transparent;color:inherit;cursor:pointer;touch-action:manipulation}
.theme-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle:hover{background:#e9e9e9;color:#222}
.theme-toggle:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.theme-toggle .theme-moon,[data-bs-theme=dark] .theme-toggle .theme-sun{display:none}
[data-bs-theme=dark] .theme-toggle .theme-moon{display:block}
@media(pointer:coarse){.theme-toggle{width:44px;height:44px}}
@media(max-width:550px){.topbar,.mobile-mode .topbar{height:auto;min-height:56px;flex-wrap:wrap;padding-block:6px;gap:4px 12px}.connection{margin-left:auto}.top-date{display:none}}

/* Neutral charcoal surfaces, with color reserved for operational status. */
:root[data-bs-theme=dark]{color-scheme:dark;--ink:#ededed;--muted:#b5b5b5;--green:#dedede;--lime:#dedede;--line:#404040;--paper:#1c1c1c;--bs-body-bg:#1c1c1c;--bs-body-color:#ededed;--bs-emphasis-color:#fff;--bs-secondary-color:#b5b5b5;--bs-secondary-bg:#303030;--bs-tertiary-bg:#292929;--bs-border-color:#404040;--bs-link-color:#dedede;--bs-link-hover-color:#fff}
:root[data-bs-theme=dark] body{color:var(--ink)}
:root[data-bs-theme=dark] :is(.topbar,.sidebar,.login-story){background:#222;color:#ddd}
:root[data-bs-theme=dark] :is(.board-panel,.stat-card,.wall-card,dialog,.login-form-area){background:#262626;border-color:var(--line);color:var(--ink)}
:root[data-bs-theme=dark] :is(.sheet-hint,.defect-table th,.downtime-check){background:#2c2c2c;color:#bcbcbc}
:root[data-bs-theme=dark] :is(.defect-table td,.history-event,.top-date,.entry-control){border-color:var(--line)}
:root[data-bs-theme=dark] .defect-table tbody tr:hover{background:#2b2b2b}
:root[data-bs-theme=dark] :is(.breadcrumb-label,.breadcrumb-label strong,.connection,.top-date,.page-heading .eyebrow,.page-heading p,.stat-card>span,.stat-card small,.cell-date,.team-route,.status-by,.timer-meta,.sheet-hint,.board-footer,.page-footer,.page-footer strong,.shift-select,.correction-note,.dialog-heading .eyebrow,.history-event small,.downtime-check small,.empty-state p,.empty-state>span,.session-note,.sidebar-label,.user-box small,.story-content p,.login-story>small,.brand-tag){color:#b5b5b5}
:root[data-bs-theme=dark] :is(.record-id,.timer,.timer-toggle,.entry-control,.detail-btn,.close-dialog,.add-photo,.title-dot,.settings-panel #settings-status){color:#ddd}
:root[data-bs-theme=dark] :is(.brand-icon,.avatar,.nav-item.active,.filter-tab.active){background:#414141;color:#f5f5f5}
:root[data-bs-theme=dark] :is(.nav-item,.filter-tab,.logout,.user-box strong,.story-route strong){color:#d2d2d2}
:root[data-bs-theme=dark] .nav-item:hover{background:#363636;color:#fff}
:root[data-bs-theme=dark] :is(.sidebar-toggle,.empty-icon){background:#303030;border-color:#484848;color:#ccc}
:root[data-bs-theme=dark] .theme-toggle:hover{background:#3a3a3a;color:#fff}
:root[data-bs-theme=dark] .btn-primary{--bs-btn-color:#191919;--bs-btn-bg:#dedede;--bs-btn-border-color:#dedede;--bs-btn-hover-color:#111;--bs-btn-hover-bg:#fff;--bs-btn-hover-border-color:#fff;--bs-btn-active-color:#111;--bs-btn-active-bg:#ccc;--bs-btn-active-border-color:#ccc;--bs-btn-disabled-color:#222;--bs-btn-disabled-bg:#999;--bs-btn-disabled-border-color:#999}
:root[data-bs-theme=dark] :is(.btn-outline-primary,.btn-outline-secondary,.btn-light){background:transparent;--bs-btn-color:#ddd;--bs-btn-bg:#303030;--bs-btn-border-color:#505050;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#414141;--bs-btn-hover-border-color:#777;--bs-btn-active-color:#fff;--bs-btn-active-bg:#484848;--bs-btn-active-border-color:#777;--bs-btn-disabled-color:#999;--bs-btn-disabled-bg:#292929;--bs-btn-disabled-border-color:#404040}
:root[data-bs-theme=dark] :is(.btn-outline-primary,.btn-outline-secondary,.btn-light):hover{background:#414141}
:root[data-bs-theme=dark] :is(.form-control,.form-select,.cell-input){background-color:#303030;color:#ededed;border-color:#505050}
:root[data-bs-theme=dark] .search-box input{color:#ededed}
:root[data-bs-theme=dark] :is(input,textarea)::placeholder{color:#aaa;opacity:1}
:root[data-bs-theme=dark] :is(.form-control,.form-select,.cell-input):focus{background-color:#353535;color:#fff;border-color:#aaa;outline-color:#aaa;box-shadow:0 0 0 3px #ffffff18}
:root[data-bs-theme=dark] .cell-input.unsaved{background:#393939;border-color:#e6af5c}
:root[data-bs-theme=dark] .form-check-input{background-color:#333;border-color:#777}
:root[data-bs-theme=dark] .form-check-input:checked{background-color:#737373;border-color:#aaa}
:root[data-bs-theme=dark] .form-check-input:focus{border-color:#aaa;box-shadow:0 0 0 3px #ffffff18}
:root[data-bs-theme=dark] :is(.stat-mark,.kind-pill,.badge-status,.shift-badge){background:#363636;border-color:#555;color:#d5d5d5}
:root[data-bs-theme=dark] :is(.amber,.badge-status.open,.kind-pill){color:#f0c477}
:root[data-bs-theme=dark] :is(.blue,.badge-status.acknowledged){color:#b5cde5}
:root[data-bs-theme=dark] :is(.green,.badge-status.closed){color:#bcda9c}
:root[data-bs-theme=dark] :is(.red,.shift-badge.red,.kind-pill.wrong,.delete-control){color:#f0ac98}
:root[data-bs-theme=dark] .timer.running{color:#ffb866}
:root[data-bs-theme=dark] .wall-mode .downtime-card{background:#2c2c2c;border-color:#db8d3c;box-shadow:inset 4px 0 #ed8b25}
:root[data-bs-theme=dark] .wall-mode .downtime-card :is(.total-downtime,.stat-mark){color:#ffb866}
:root[data-bs-theme=dark] .wall-mode .downtime-card>span{color:#ffb866}
:root[data-bs-theme=dark] .wall-mode .downtime-card small{color:#c8c8c8}
:root[data-bs-theme=dark] .wall-mode .downtime-card .stat-mark{background:#3b3b3b}
:root[data-bs-theme=dark] .mobile-mode #defect-rows{background:#1c1c1c}
:root[data-bs-theme=dark] .mobile-mode .defect-table tr{background:#262626;border-color:#404040}
:root[data-bs-theme=dark] .mobile-mode .defect-table td::before{color:#b5b5b5}
:root[data-bs-theme=dark] .mobile-mode .actions-cell{border-top-color:#404040!important}
:root[data-bs-theme=dark] .table{--bs-table-bg:#262626;--bs-table-color:#ededed;--bs-table-border-color:#404040}
:root[data-bs-theme=dark] dialog::backdrop{background:#000a}
:root[data-bs-theme=dark] .photo-button:focus-visible{outline-color:#ccc}
