/* Muted rose-to-violet palette shared by light-theme brand panels. */
html:not([data-theme=dark]){--brand-rose:#a34b8e;--brand-middle:#8c4fa4;--brand-violet:#7051ad}
html:not([data-theme=dark]) .sidebar{background:linear-gradient(160deg,var(--brand-rose) 0%,var(--brand-middle) 42%,var(--brand-violet) 100%);color:#fff;border-right:0}
html:not([data-theme=dark]) :is(.model-hero,.dispatch-preview){background:linear-gradient(110deg,var(--brand-rose),var(--brand-middle) 48%,var(--brand-violet));color:#fff}
html:not([data-theme=dark]) :is(.model-hero p,.model-hero .hero-kicker,.model-hero .hero-tag,.dispatch-preview p){color:#fff}
html:not([data-theme=dark]) .model-hero .hero-tag{background:#ffffff12;border-color:#ffffff40}
html:not([data-theme=dark]) .sidebar .brand{color:#fff}
html:not([data-theme=dark]) .sidebar .brand-name{border-color:#ffffff55}
html:not([data-theme=dark]) .sidebar .wordmark>span{color:#fff}
html:not([data-theme=dark]) .sidebar .nav button{color:#fff}
html:not([data-theme=dark]) .sidebar .nav button:hover{background:#ffffff20;color:#fff}
html:not([data-theme=dark]) .sidebar .nav button.active{background:#ffffff26;color:#fff;border-color:#ffffff55;box-shadow:inset 3px 0 #fff}
html:not([data-theme=dark]) .sidebar-bottom{border-color:#ffffff40}
html:not([data-theme=dark]) .sidebar-bottom strong{color:#fff}
html:not([data-theme=dark]) .sidebar-bottom p{color:#fff}
html:not([data-theme=dark]) .team-avatar{background:#ffffff20;color:#fff;border-color:#ffffff55}
html:not([data-theme=dark]) #export-button{background:linear-gradient(110deg,var(--brand-rose),var(--brand-middle) 42%,var(--brand-violet));color:#fff;border-color:transparent;box-shadow:none}
html:not([data-theme=dark]) #export-button:hover{background:linear-gradient(110deg,var(--brand-rose),var(--brand-middle) 42%,var(--brand-violet));filter:brightness(.95)}

/* Dark surfaces retain the same typography and semantic status colors. */
:root[data-theme=dark]{color-scheme:dark;--bg:#111114;--surface:#1c1c21;--ink:#f0edf4;--muted:#bcb5c6;--line:#39353f;--blue:#c88aef;--blue-soft:#32243e;--shadow:none}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] .sidebar{background:linear-gradient(160deg,#57304e 0%,#362442 48%,#211b31 100%);border-color:var(--line)}
html[data-theme=dark] .topbar{background:linear-gradient(110deg,#2d202d,#241d30 55%,#19171f);border-color:var(--line)}
html[data-theme=dark] :is(.panel,.stat,.transport-metrics article,.schedule-card,.overview-filters,.locked,.picker-pop,dialog,.playback,.route-list-panel thead,.observation-panel #route-observations>div){background:var(--surface);border-color:var(--line);box-shadow:none}
html[data-theme=dark] :is(.timing,.shift-detail,.shift-controls,.chart-foot,.dashboard-note,.filter-bottom,.scenario-note,.plan-toggle,.search,.observation-panel,.range-filter-hint,.chart-hint,.picker-chip,.overview-link){background:#25212b;border-color:var(--line)}
html[data-theme=dark] :is(.button,.setting input,.field select,.overview-filters input,.overview-filters select,.dashboard-context select,.playback select,.picker-pop input){background:#242128;color:var(--ink);border-color:#494150}
html[data-theme=dark] input::placeholder{color:#a69cac}
html[data-theme=dark] :is(.button:hover,.routes-table tbody tr:hover,.picker-list label:hover){background:#352a40}
html[data-theme=dark] .button.primary{background:#8530b8;color:#fff;border-color:transparent}
html[data-theme=dark] .button.primary:hover{background:#9741c8}
html[data-theme=dark] :is(.plan-toggle button.active,.dashboard-tabs button[aria-selected=true],.routes-table tr.selected,.compare-table tr.selected td,.picker-chip.primary){background:#382547;color:#ebc7ff;border-color:#79518f}
html[data-theme=dark] :is(.stat-top,.stat-value,.network-stats .stat-value,.transport-metrics strong,.timing strong,.shift-numbers strong,.setting,.filter-time legend,.range-filter>span b,.route-button,td,.routes-table td,.panel-head h2,.signal strong,.shift-detail h3,.breadcrumb strong,.observation-panel #route-observations strong,.picker-list label,.recommendation-number){color:var(--ink)}
html[data-theme=dark] :is(p,.subtitle,.stat-note,.stat-value small,.transport-metrics span,.transport-metrics small,.timing span,.recommendation-label,.shift-numbers span,.settings-label,.picker-label,.filter-explanation,.filter-bottom,.filter-bottom>span:first-child,.filter-group-title,.filter-details>summary,.range-filter-hint,.shift-legend,.shift-tick,.shift-axis span,.shift-chart-hint,.shift-top-label,.shift-detail-kicker,.shift-route small,.chart-legend,.chart-foot,.checkbox,.dashboard-note,.dashboard-note summary,.route-sub,.table-foot,.export-note,.export-foot,.export-open,.subline,.muted,.schedule-next,.recommendation-copy,.breadcrumb,.version-chip,th,.route-list-panel th,.plan-toggle button,.observation-panel summary,.observation-panel #route-observations span,.export-panel summary){color:var(--muted)}
html[data-theme=dark] :is(.shift-route,.picker-chip){background:#29222f;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(th,td,.routes-table th,.routes-table td,.filter-details,.filter-bottom,.scene-heading,.compare-wrap,.filter-group-title.derived,.dashboard-tabs){border-color:var(--line)}
html[data-theme=dark] :is(.badge.gray,#filter-condition-count,.avatar){background:#302936;color:#d6c9e0;border-color:var(--line)}
html[data-theme=dark] .badge.blue{background:#382547;color:#e3b5ff}
html[data-theme=dark] .badge.green{background:#183b30;color:#87d8b8}
html[data-theme=dark] .badge.orange{background:#40321e;color:#f3c37e}
html[data-theme=dark] .badge.red{background:#482730;color:#ffa5b7}
html[data-theme=dark] :is(.validation-error,.network-error,.shift-numbers .has-shortage){color:#ff9cb0}
html[data-theme=dark] .positive{color:#87d8b8}
html[data-theme=dark] :is(.recommendation-number span,.link-button,#filter-summary){color:#dca8fa}
html[data-theme=dark] .chart svg text{fill:var(--muted)}
html[data-theme=dark] .chart svg line{stroke:#514659}
html[data-theme=dark] .shift-axis span:before{background:var(--surface)}
html[data-theme=dark] .shift-fleet-line>span{background:#28212f;color:#e3b5ff}
html[data-theme=dark] .shift-value{color:#e3b5ff}
html[data-theme=dark] .shift-column.overloaded .shift-value{color:#ff9cb0}
html[data-theme=dark] :is(.model-hero p,.dispatch-preview p){color:#eee1f3}
html[data-theme=dark] dialog::backdrop{background:#0009}
html[data-theme=dark] input:disabled{background:#222027;color:#a69cac}
html[data-theme=dark] :is(.model-hero,.dispatch-preview){background:linear-gradient(110deg,#633451,#4b305f 48%,#35305b);color:var(--ink)}
html[data-theme=dark] .button.primary{background:linear-gradient(110deg,#914772,#72509a);color:#fff}
html[data-theme=dark] .button.primary:hover{background:linear-gradient(110deg,#a45382,#835daf)}
html[data-theme=dark] .sidebar .nav button.active{background:linear-gradient(105deg,#ad5a9a40,#8b64b526);border-color:#b77dc34d;box-shadow:inset 3px 0 #d58bc9}
html[data-theme=dark] #export-button{background:linear-gradient(110deg,#57304e,#362442 48%,#211b31);color:#fff;border-color:#79516f;box-shadow:none}
html[data-theme=dark] #export-button:hover{background:linear-gradient(110deg,#57304e,#362442 48%,#211b31);filter:brightness(1.1)}
