/* Midnight: shared semantic colours, readable surfaces and quiet blue light. */
.stagehead--detail .stagehead__title,.detail__title,.detail-head h1,.detail h1 { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; -webkit-line-clamp:unset; }
.admin-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px; }
.admin-grid .panel { margin:0; }
.admin-hero { padding:30px;border:1px solid var(--rule);border-radius:16px;margin-bottom:24px; }
.admin-hero h1 { font-size:clamp(28px,3vw,42px);letter-spacing:-.035em;margin:8px 0; }
.admin-hero p { max-width:75ch;color:var(--ink-soft); }
.admin-section { border-top:1px solid var(--rule);padding:18px 0; }
.team-review-tabs { overflow-x:auto;display:flex;gap:8px;padding:8px 0 20px; }
.team-review-tabs a { white-space:nowrap;padding:9px 15px;border:1px solid var(--rule);border-radius:9px;text-decoration:none;color:var(--ink-soft); }
.team-review-tabs a[aria-current] { color:var(--live);background:var(--live-soft);border-color:var(--live); }
html[data-theme="dark"] {
  color-scheme:dark;
  --ground:#090f1c;--paper:#121c2e;--ink:#e8eefb;--ink-soft:#b3c1d8;--ink-faint:#96a8c5;
  --rule:#2b3b56;--rule-soft:#223149;--live:#97b5ff;--live-soft:#203456;
  --alert:#f6bf79;--alert-soft:#392c23;--good:#73dbb8;--good-soft:#153c35;
  --shadow:0 12px 38px #02061030;
}
html[data-theme="dark"] body { background:radial-gradient(ellipse at 80% 0%,#162c4e70,transparent 48%),var(--ground);color:var(--ink); }
html[data-theme="dark"] :is(.panel,.entry,.masthead,.mini,.workflow-map,.wk-kpis>div,.score-context,.score-explainer,.score-method,.participant-card,.dashboard-card,.chart-card,.metric-card,.form-review,.library-card,.stat,.file-card,.dialog__body,.ai-panel,.ai-chat,.ai-answer) { background:var(--paper);color:var(--ink);border-color:var(--rule); }
html[data-theme="dark"] .panel { border-radius:12px;box-shadow:var(--shadow); }
html[data-theme="dark"] .masthead { background:#0d1728;box-shadow:0 1px 0 var(--rule); }
html[data-theme="dark"] .process { background:linear-gradient(180deg,#101e34,#0b1424);border-right:1px solid #25334c; }
html[data-theme="dark"] :is(input,textarea,select,.field__input) { background:#0c1627;color:var(--ink);border-color:#425775; }
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder { color:#8fa2bf; }
html[data-theme="dark"] :is(.btn,.tab,.tag,.chip,.pill,.filter,.wk-tabs a) { background:#19263d;color:#cbdafa;border-color:#3a4c69; }
html[data-theme="dark"] :is(.btn--primary,.tab.is-active,.wk-tabs a[aria-current]) { color:#fff;background:#325fd1;border-color:#7399f8; }
html[data-theme="dark"] .btn:hover { background:#2c4266; }
html[data-theme="dark"] .btn--primary:hover { background:#416fe5; }
html[data-theme="dark"] :is(.notice,.callout,.aside-note,.wk-learning,.form__intro,.entry__foot,.mini__meta,.score-context,.bar__track,.meter__track,th) { background:#1a2941;color:var(--ink-soft);border-color:var(--rule); }
html[data-theme="dark"] :is(.notice--warn,.tag--warn) { background:var(--alert-soft);color:var(--alert); }
html[data-theme="dark"] :is(.notice--ok,.tag--good) { background:var(--good-soft);color:var(--good); }
html[data-theme="dark"] :is(td,th,tr) { border-color:var(--rule); }
html[data-theme="dark"] :is(.panel__title,.entry__title,.detail__title,.standing__team,.stage__title,.masthead__wordmark,.wk-kpis strong) { color:var(--ink); }
html[data-theme="dark"] :is(.panel__note,.entry__muted,.field__hint,.eyebrow,.bar__label,.kv dt,.wk-freshness) { color:var(--ink-soft); }
html[data-theme="dark"] :is(.dashboard-grid svg text,.chart svg text) { fill:var(--ink-soft); }
html[data-theme="dark"] .admin-hero { background:radial-gradient(ellipse at right top,#305ca74d,transparent 65%),linear-gradient(120deg,#15253e,#111b2d); }
html[data-theme="dark"] .admin-hero .eyebrow { color:#9ec0ff;letter-spacing:.16em; }
html[data-theme="dark"] :is(a,button,input,select,textarea,summary):focus-visible { outline-color:#a3c2ff; }
@media(max-width:760px){.admin-grid{grid-template-columns:1fr}.admin-hero{padding:20px}.theme-switch{font-size:12px}.masthead__right{flex-wrap:wrap}}
@media print { html[data-theme="dark"] {color-scheme:light;--ground:#fff;--paper:#fff;--ink:#111;--ink-soft:#333;--ink-faint:#444;--rule:#bbb;--rule-soft:#ddd;--live:#234ba0;--live-soft:#eef2ff;} html[data-theme="dark"] body,html[data-theme="dark"] .panel{background:white;color:#111;box-shadow:none}.theme-switch{display:none} }

html[data-theme="dark"] :is(.workflow-map a[aria-current],.skip-link,.ai__chip,.ai__out,.round-shortcuts,.quick-views a,.form--wide .form__actions,.play-primary,.stagehead .btn--add) { background:#203456;color:#e5edff;border-color:#4d6da4; }
html[data-theme="dark"] .eyebrow {color:#9ec0ff!important}
html[data-theme="dark"] .meter__fill {background:#8baefe}
html[data-theme="dark"] .ai__chip:hover {background:#2c4266}
