@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
/* The Session's visual language, with the Lab's four appearance choices intact. */
:root {
  --bg:#080b14; --bg-deep:#080b14; --surface:#101521; --surface-2:#151c2b; --surface-3:#1d2738; --surface-soft:#151d2e;
  --line:#263044; --line-strong:#43516a; --text:#f6f7fb; --muted:#a4adbf; --muted-2:#95a2b8;
  --ice:#36dbe8; --ice-strong:#36dbe8; --pink:#f25ad4; --lavender:#c3a6f4; --green:#70dda8; --yellow:#f5d07a; --orange:#ffb184; --red:#ff9cbd;
  --on-accent:#07111a; --shadow:0 16px 40px #0005; --rank-better:#70dda8; --rank-worse:#ff9cbd; --rank-same:#b4c0d5;
  --font:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; --head:'Manrope',var(--font);
  --radius-xl:10px; --radius-lg:8px; --radius-md:7px; --radius-sm:5px;
}
html[data-theme="daylight"] {
  color-scheme:light; --bg:#f5f7fc; --bg-deep:#edf1f8; --surface:#ffffff; --surface-2:#edf1f8; --surface-3:#dfe7f2; --surface-soft:#edf3f8;
  --line:#d0d9e6; --line-strong:#8293aa; --text:#172438; --muted:#44566f; --muted-2:#52647a;
  --ice:#00647b; --ice-strong:#00647b; --pink:#a32370; --lavender:#63479a; --green:#146546; --yellow:#805700; --orange:#994800; --red:#a52642;
  --on-accent:#ffffff; --shadow:0 16px 40px #17243812; --rank-better:#146546; --rank-worse:#a52655; --rank-same:#435b6c;
}
html[data-theme="plum"] {
  color-scheme:dark; --bg:#12101c; --bg-deep:#0d0b15; --surface:#1c1729; --surface-2:#251e34; --surface-3:#30263f; --surface-soft:#251e34;
  --line:#3c304f; --line-strong:#78628e; --text:#f7f2fb; --muted:#c2b4d0; --muted-2:#ad9fbd;
  --ice:#7ce3ef; --ice-strong:#7ce3ef; --pink:#f58cdb; --lavender:#cba9f5; --green:#8ce0b5; --yellow:#f5d294; --orange:#ffbb8f; --red:#ffa3bc;
  --rank-better:#8ce0b5; --rank-worse:#ffa3bc; --rank-same:#d0c3d8;
}
html[data-theme="evergreen"] {
  color-scheme:dark; --bg:#0b1718; --bg-deep:#081213; --surface:#112326; --surface-2:#192e32; --surface-3:#223b40; --surface-soft:#192e32;
  --line:#2c484e; --line-strong:#577e83; --text:#eef7f7; --muted:#b2c7ca; --muted-2:#9bb8bc;
  --ice:#66ddd4; --ice-strong:#66ddd4; --pink:#f3a0d6; --lavender:#c6baf0; --green:#9ce1b7; --yellow:#ead59b; --orange:#efbf96; --red:#ffa1b3;
  --rank-better:#9ce1b7; --rank-worse:#ffa1b3; --rank-same:#c3d6d6;
}
/* Keep paper protocols white; apply theme surfaces only to the working UI. */
@media screen {
  html body { background:var(--bg); }
  html :is(.site-header,.site-footer,.nav-dropdown,.toast) { background:var(--surface); }
  html :is(.card,.method-card,.source-status-card,.profile-rules-card,.saved-card,.rule-card,.source-card,.guide-dialog) { background:var(--surface); }
  html :is(.profile-summary>div,.component-card,.validation-item,.rules-profile-strip,.element-table tbody tr) { background:var(--surface-2); }
  html .notice:not(.warning):not(.info) { background:var(--surface-2); }
  html :is(.field>span,.requirement-cell strong,.profile-rules-list li,.rule-content,.values-table td) { color:var(--text); }
  html .source-tag { color:var(--lavender); }
  html :is(input,textarea)::placeholder { color:var(--muted-2); }
  html th { background:var(--surface-2); }
  html .button.primary { background:var(--ice); }
  html .summary-chip.error { color:var(--red); }
  html .summary-chip.warning { color:var(--yellow); }
  html .summary-chip.info { color:var(--ice); }
  html .summary-chip.pass { color:var(--green); }
  html :is(.season-banner,.score-card,.judging-bar) { background:var(--surface-2); }
  html :is(input,select,textarea):not([type="radio"]):not([type="checkbox"]):not([type="range"]) { background:var(--surface); color:var(--text); }
  html .comparison-matrix :is(th:first-child,thead th) { background:var(--surface-2); }
  html .comparison-matrix thead .comparison-selected { background:var(--surface-3); }
  html[data-theme="daylight"] :is(.button.primary,.goe-choice.selected,.toast-icon,.skip-link) { color:#fff; }
  html[data-theme="daylight"] .validation-item .validation-icon { color:#fff; }
  html[data-theme="daylight"] .validation-item.error .validation-icon { background:var(--red); }
  html[data-theme="daylight"] :is(code,kbd) { background:var(--surface-2); color:var(--ice); }
  html .protocol-paper :is(h2,h3,th,td) { color:#172332; }
  html .protocol-paper th { background:#eaf0f5; }
}
.appearance-menu { position:relative; margin-left:auto; flex:0 0 auto; }
.appearance-menu>summary { list-style:none; display:flex; align-items:center; gap:.5rem; min-height:44px; padding:.5rem .7rem; border:1px solid var(--line-strong); border-radius:var(--radius-sm); cursor:pointer; font-size:.875rem; color:var(--text); }
.appearance-menu>summary::-webkit-details-marker { display:none; }
.appearance-menu>summary:focus-visible { outline:3px solid var(--ice); outline-offset:3px; }
.appearance-symbol { font-size:1.3rem; line-height:1; }
.appearance-panel { position:absolute; right:0; top:calc(100% + 10px); width:300px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 100px); overflow:auto; padding:1rem; background:var(--surface); color:var(--text); border:1px solid var(--line-strong); border-radius:var(--radius-md); box-shadow:var(--shadow); z-index:120; }
.appearance-panel fieldset { margin:0; border:0; padding:0; min-width:0; }
.appearance-panel legend { font-weight:750; padding:0 0 .6rem; }
.theme-option { display:flex; align-items:center; gap:.6rem; min-height:46px; padding:.4rem; border-radius:6px; cursor:pointer; font-size:.9375rem; }
.theme-option:has(input:checked) { background:var(--surface-2); outline:1px solid var(--line-strong); }
.theme-option input { width:18px; height:18px; margin:0; accent-color:var(--ice); }
.theme-swatch { width:18px; height:18px; flex:none; border-radius:50%; border:1px solid #8195a4; }
.theme-swatch.midnight { background:#080b14; }.theme-swatch.daylight { background:#f5f7fc; }.theme-swatch.plum { background:#1c1729; }.theme-swatch.evergreen { background:#112326; }
.appearance-divider { border-top:1px solid var(--line); margin-top:.7rem; padding-top:.7rem; }
.appearance-panel .muted { font-size:.875rem; }
.appearance-panel .button { width:100%; }
.appearance-panel #site-update-status { margin:.6rem 0 0; font-size:.875rem; }
.theme-photo { flex:0 0 min(30%,300px); margin:0; min-width:0; }
.theme-photo img { width:100%; height:160px; object-fit:cover; border-radius:var(--radius-md); }
html[data-theme="midnight"] .theme-photo img { object-position:50% 100%; }
html[data-theme="daylight"] .theme-photo img { object-position:50% 85%; }
html[data-theme="plum"] .theme-photo img { object-position:50% 55%; }
html[data-theme="evergreen"] .theme-photo img { object-position:50% 42%; }
.theme-photo figcaption { font-size:.75rem; color:var(--muted); margin-top:.3rem; text-align:right; }
.theme-photo a { color:var(--muted); text-decoration:none; }
.theme-photo a:hover { text-decoration:underline; }
.context-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.context-heading>div { min-width:0; }
.context-photo { display:none; flex:0 1 224px; max-width:224px; }
.context-photo img { height:96px; }
#panel-results:has(#results-content>.results-competition-grid) .context-photo,
#panel-shared:has(#shared-content>:is(.competition-list,.competition-empty)) .context-photo { display:block; }
.source-heading-art { width:208px; max-width:28%; height:88px; object-fit:cover; border-radius:var(--radius-md); opacity:.75; }
.panel-score-total { border-left:2px solid var(--line-strong); }
@media(max-width:900px) { .context-photo { flex-basis:180px; max-width:180px; }.context-photo img { height:80px; }.source-heading-art { width:160px; height:72px; } }
@media(max-width:640px) { .context-heading { flex-wrap:wrap; }.context-photo { flex:1 1 100%; max-width:none; width:100%; }.context-photo img { height:64px!important; }.source-heading-art { display:none; } }
.learn-art { width:100%; height:110px; object-fit:cover; margin:0 0 1.25rem; border-radius:var(--radius-md); opacity:.75; }
html[data-imagery="off"] .decorative-imagery { display:none!important; }
.country-label { display:inline-flex; align-items:center; gap:.35em; white-space:nowrap; }
.country-flag { display:inline-block; font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; font-size:1.15em; line-height:1; margin-right:.25em; vertical-align:-.05em; }
.country-label .country-flag { margin-right:0; }
.rank-badge { display:inline-flex; align-items:center; gap:.2em; border:1px solid currentColor; border-radius:5px; padding:.1em .4em; margin:.3em 0 0; font-size:.875rem; font-weight:650; line-height:1.45; white-space:nowrap; font-variant-numeric:tabular-nums; }
.rank-better { color:var(--rank-better)!important; }.rank-worse { color:var(--rank-worse)!important; }.rank-same { color:var(--rank-same)!important; }
.rank-unavailable,.rank-uncompared { color:var(--muted); border-color:var(--line-strong); }
.rank-legend { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem .65rem; font-size:.875rem; color:var(--muted); }
.rank-legend .rank-badge { margin:0; }
.judge-comparison td>.rank-badge { display:flex; width:max-content; margin-left:auto; }
.site-update-notice { margin:0; border-bottom:1px solid var(--line-strong); padding:.6rem 1rem; background:var(--surface-2); color:var(--text); font-size:.9375rem; }
.site-update-notice .button { margin-left:.5rem; }
@media(max-width:1040px) { .header-shell { gap:12px; }.header-shell .brand { width:auto; flex:1; }.appearance-menu { margin-left:0; }.primary-nav { flex-basis:100%; } }
@media(max-width:640px) { .home-intro { flex-wrap:wrap; gap:1rem; }.theme-photo { flex:1 1 100%; }.theme-photo img { height:112px; }.theme-photo figcaption { font-size:.75rem; }.learn-art { height:80px; } }
@media(max-width:420px) { .appearance-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }.appearance-menu>summary { width:44px; justify-content:center; }.brand small { font-size:.8rem; }.appearance-panel { right:0; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; } }
@media print { .appearance-menu,.decorative-imagery,.site-update-notice { display:none!important; }.rank-badge { color:#222!important; }.rank-legend { color:#222; } }

/* Contextual artwork belongs to the heading; scoring tables remain clear. */
.scene-heading { position:relative; isolation:isolate; overflow:hidden; min-height:138px; padding:1.15rem 0; border-bottom:1px solid var(--line); margin-bottom:1.1rem; }
.scene-heading>div { position:relative; z-index:1; width:60%; }
.scene-heading h1 { margin-bottom:.35rem; }
.context-scene { position:absolute; z-index:0; right:0; inset-block:0; width:50%; height:100%; object-fit:cover; object-position:82% 58%; mask-image:linear-gradient(90deg,transparent,#000 38%); opacity:.75; pointer-events:none; }
.scene-controls { display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin:0 0 1.25rem; }
.scene-controls .rules-tools { width:100%; }
.scene-controls .season-banner-actions { display:flex;flex-wrap:wrap;gap:.6rem; }
.scene-shared .context-scene { object-position:90% 76%; }
html[data-theme="daylight"] .context-scene,html[data-theme="daylight"] .learn-art { opacity:.85; filter:brightness(1.18) saturate(.7); }
html[data-theme="plum"] .context-scene,html[data-theme="plum"] .learn-art { filter:sepia(.12) hue-rotate(305deg) saturate(.8); }
html[data-theme="evergreen"] .context-scene,html[data-theme="evergreen"] .learn-art { filter:sepia(.13) hue-rotate(110deg) saturate(.75); }
.learn-art { height:130px; object-position:82% 64%; border-radius:0; mask-image:linear-gradient(90deg,transparent,#000 28%); margin-top:-.25rem; opacity:.8; }
html[data-imagery="off"] .scene-heading { min-height:0; }
@media(max-width:640px) { .scene-heading { min-height:112px; padding:.8rem 0; }.scene-heading>div { width:76%; }.context-scene { width:42%; opacity:.45; mask-image:linear-gradient(90deg,transparent,#000 70%); }.scene-shared .context-scene { opacity:.3; }.learn-art { height:96px; } }
.scene-learn .context-scene { object-position:88% 55%; }

html[data-imagery="off"] .scene-heading>div { width:100%; }
@media print { .scene-heading { min-height:0; }.scene-heading>div { width:100%; } }

/* Shared visual treatment stays outside print and preserves the dense scoring grid. */
@media screen {
  h1,h2,h3,.brand strong,.home-shortcut>strong { font-family:var(--head); }
  h1,h2,h3 { letter-spacing:-.025em; }
  .home-intro h1 { font-weight:800; letter-spacing:-.045em; }
  .brand strong { font-weight:700; }
  .eyebrow,.section-kicker { letter-spacing:.14em; font-weight:700; }
  html :is(.site-header,.site-footer) { background:var(--bg); }
  .brand-mark { border-radius:8px; border-color:var(--line-strong); background:var(--surface-2); box-shadow:none; }
  html :is(.card,.method-card,.source-status-card,.profile-rules-card,.saved-card,.home-shortcut) { box-shadow:none; }
  html :is(.season-banner,.score-card) { background:linear-gradient(130deg,color-mix(in srgb,var(--ice) 7%,var(--surface)),color-mix(in srgb,var(--pink) 5%,var(--surface))); box-shadow:none; border-color:var(--line-strong); }
  .season-banner::before,.score-card::after { display:none; }
  .home-shortcut { border-color:var(--line); padding:1.5rem; }
  .home-shortcut:hover { border-color:var(--ice); }
  .button,.icon-button { border-radius:5px; }
  html .button.primary { background:var(--ice); border-color:var(--ice); color:var(--on-accent); box-shadow:none; font-weight:700; }
  html .button.primary:hover { background:color-mix(in srgb,var(--ice) 88%,var(--text)); }
  .button.secondary { background:transparent; border-color:var(--line-strong); color:var(--text); }
  .button.secondary:hover { background:var(--surface-2); border-color:var(--ice); }
  .button.ghost:hover { border-color:var(--ice); }
  :is(button,a,input,select,textarea,summary):focus-visible { outline:2px solid var(--ice); outline-offset:3px; }
  html :is(input,select,textarea):not([type="radio"]):not([type="checkbox"]):not([type="range"]):focus { background:var(--surface-2); border-color:var(--ice); box-shadow:0 0 0 3px color-mix(in srgb,var(--ice) 12%,transparent); }
  .pill,.competition-type { border-color:color-mix(in srgb,var(--ice) 28%,var(--line)); background:color-mix(in srgb,var(--ice) 8%,var(--surface)); }
  .competition-type.domestic { color:var(--yellow); border-color:color-mix(in srgb,var(--yellow) 30%,var(--line)); background:color-mix(in srgb,var(--yellow) 8%,var(--surface)); }
  .results-table,.element-table,.comparison-matrix { font-variant-numeric:tabular-nums; }
  html .element-table tbody tr:hover { background:var(--surface-3); }
  .protocol-paper :is(h1,h2,h3) { font-family:Arial,sans-serif; letter-spacing:normal; }
  .session-return { display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:10px max(16px,calc((100% - var(--max))/2));border-bottom:1px solid var(--line);background:var(--bg);color:var(--muted);font:13px/1.5 var(--font); }
  .session-return a { color:var(--ice);text-decoration:none; }
  .session-return a:hover { text-decoration:underline; }
  .session-return .session-fantasy-link { margin-left:auto;color:var(--pink); }
}
@media print { .session-return { display:none; } }

/* Direct page boot: match the requested section before deferred scripts load. */
html[data-lab-panel] [data-tab-panel]{display:none!important}
html[data-lab-panel="home"] [data-tab-panel="home"]{display:block!important}
html[data-lab-panel="judging"] [data-tab-panel="judging"]{display:block!important}
html[data-lab-panel="results"] [data-tab-panel="results"]{display:block!important}
html[data-lab-panel="results-home"] [data-tab-panel="results-home"]{display:block!important}
html[data-lab-panel="learn-home"] [data-tab-panel="learn-home"]{display:block!important}
html[data-lab-panel="builder"] [data-tab-panel="builder"]{display:block!important}
html[data-lab-panel="judging-replay"] [data-tab-panel="judging-replay"]{display:block!important}
html[data-lab-panel="competitions"] [data-tab-panel="competitions"]{display:block!important}
html[data-lab-panel="shared"] [data-tab-panel="shared"]{display:block!important}
html[data-lab-panel="saved"] [data-tab-panel="saved"]{display:block!important}
html[data-lab-panel="learn"] [data-tab-panel="learn"]{display:block!important}
html[data-lab-panel="rules"] [data-tab-panel="rules"]{display:block!important}
html[data-lab-panel="values"] [data-tab-panel="values"]{display:block!important}
html[data-lab-panel="qualification"] [data-tab-panel="qualification"]{display:block!important}
html[data-lab-panel="worlds-places"] [data-tab-panel="worlds-places"]{display:block!important}
html[data-lab-panel="sources"] [data-tab-panel="sources"]{display:block!important}

/* The parent wordmark and the Lab identity remain separate, visible waypoints. */
.session-return{padding-top:14px;padding-bottom:14px;gap:22px;background:var(--surface);border-bottom:1px solid var(--line)}
.session-return .lab-parent-brand{display:flex;flex-direction:column;gap:0;line-height:1;text-decoration:none;color:var(--text);flex-shrink:0}
.lab-parent-the{font:700 9px/1.4 var(--font);letter-spacing:.36em}
.lab-parent-name{font:700 25px/1.05 Georgia,serif;letter-spacing:-.05em}
.lab-parent-name em{color:var(--pink);font-style:italic;font-size:1.1em;letter-spacing:-.06em}
.lab-parent-context{padding-left:22px;border-left:1px solid var(--line);font-size:13px}
.session-return .lab-parent-home{margin-left:auto;color:var(--text);font-weight:650}
.session-return .session-fantasy-link{margin-left:0;font-weight:650}
.brand,.nav-tab{text-decoration:none}
a.nav-tab{display:flex;align-items:center}
.nav-dropdown a.nav-tab{display:block}
@media(max-width:720px){.session-return{gap:12px;padding:12px 16px}.lab-parent-name{font-size:22px}.lab-parent-context{display:none}.session-return .lab-parent-home{font-size:12px}.session-return .session-fantasy-link{font-size:12px}}
@media(max-width:420px){.session-return .lab-parent-home{display:none}.session-return .session-fantasy-link{margin-left:auto}}
