/* UI theme changes panels only; recorded scene lighting remains unchanged. */
:root{--surface:#fff;--surface-alt:#f1f3f4;--ui-hover:#e6eff5;--ui-border:#d7dcdf;--ui-text:#37444d;--ui-muted:#71808b}
#theme-toggle{flex:0 0 32px;width:32px;height:32px;padding:0;border:1px solid var(--ui-border);border-radius:4px;background:var(--surface);color:var(--ui-text);font:22px Arial,sans-serif;line-height:1}
#initial-equipment{color:var(--ui-text);background:var(--surface-alt);border:1px solid var(--ui-border);border-radius:3px;padding:8px}
#initial-equipment summary{color:inherit;font-weight:600}#initial-equipment p{color:var(--ui-muted);line-height:1.4}#initial-equipment>div{padding:4px 0;border-top:1px solid var(--ui-border)}
#inspector.object-popup #initial-equipment{color:#e2e9ed;background:#23323b;border-color:#53616b}#inspector.object-popup #initial-equipment p{color:#b9c7d0}#inspector.object-popup #initial-equipment>div{border-color:#53616b}
html[data-theme=dark]{color-scheme:dark;--bg:#141b22;--panel:#202a33f5;--surface:#202a33;--surface-alt:#18212a;--ui-hover:#2d3d4b;--ui-border:#3a4855;--ui-text:#d5dfe6;--ui-muted:#a0aeba;--text:#d5dfe6;--muted:#a0aeba;--border:#3a4855}
html[data-theme=dark] body{background:var(--bg);color:var(--text)}
html[data-theme=dark] :is(header,footer,.sidebar,#filters,.table-wrap,.weekly-cards section,dialog,#loading,.event-card,.mission-jump-menu,#mission-summary){background:var(--surface);color:var(--text);border-color:var(--border)}
html[data-theme=dark] :is(input,select,:is(header,footer,.sidebar,dialog,#filters,.pagination,.results-heading,#inspector,#cluster-panel) button:not(.primary):not(.watch):not(.death-jump):not(.active):not([data-side]),#language,.tool,.zoom-tools button){background:var(--surface-alt);color:var(--text);border-color:var(--border)}
html[data-theme=dark] :is(th,details,.coordinates,.stat-box){background:var(--surface-alt);border-color:var(--border)}
html[data-theme=dark] :is(td,.entity-row,.crew-member,.group-heading){border-color:var(--border)}
html[data-theme=dark] :is(td strong,.panel-title h2,.settings-body summary,.operation h1,.brand,.logo,.clock b,.entity-row,.mission-jump-menu button,dialog h2){color:var(--text)}
html[data-theme=dark] :is(label,.note,.series-note,td small,.eyebrow,.state-line,.event-filter,.event-card time,.event-card .weapon,.entity-row .sub,.entity-row .state,#selected-class,#mission-source,.clock,#event-summary,dialog p,dialog li,.weekly-cards h3){color:var(--muted)}
html[data-theme=dark] :is(tbody tr:hover,.entity-row:hover,.entity-row.selected,.crew-member:hover,.mission-jump-menu button:hover){background:var(--ui-hover)}
html[data-theme=dark] :is(#inspector,#cluster-panel):not(.object-popup){background:var(--surface);color:var(--text)}
html[data-theme=dark] .side-tabs button{border:1px solid var(--border)}
html[data-theme=dark] .entity-row .name[style*="color:#000"],html[data-theme=dark] .crew-member[style*="color:#000"]{color:#9ba2aa!important;text-shadow:none}
html[data-theme=dark] .watch{background:#173747;color:#74c4ed;border-color:#347292}
@media(max-width:600px){html[data-theme=dark] tbody tr{background:var(--surface)}#theme-toggle{flex-basis:28px;width:28px;height:30px}}
@media(prefers-reduced-motion:no-preference){.event-card.new-event{animation:event-arrive .22s ease-out}@keyframes event-arrive{from{opacity:.3;transform:translateY(6px)}to{opacity:1;transform:none}}}

/* Dead names remain muted grey, but readable in dark anchored cards. */
:is(#inspector,#cluster-panel).object-popup .dead-name{color:#a0a6ad!important;text-shadow:0 1px 1px #0008;font-weight:600}
html[data-theme=dark] .dead-name{color:#a0a6ad!important;text-shadow:0 1px 1px #0008}

#roster .entity-row .kill-badge{color:#f2f5f7!important;background:#383d41;text-shadow:none}
html[data-theme=dark] #roster .entity-row.dead-row :is(.symbol,.name,.sub,.state){color:#a0a6ad!important}
