/* Shared, readable controls; the existing responsive court grid owns geometry. */
:root{--gold:#e8c88d;--text:#f6f4ed;--muted:#c2ced9;--border:#496174}
button,select,input,textarea{font-family:inherit}button,select{min-height:44px}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,textarea:focus-visible{outline:3px solid #ffe2a6;outline-offset:3px}
button.primary,.learn-actions>button:first-child{background:#e8c88d;color:#102131;border-color:#f6dda9;font-weight:700}
button:disabled{opacity:.55;cursor:not-allowed}button:not(:disabled):hover{border-color:#e8c88d}
.app-header nav{gap:8px}.app-header nav button{font-size:13px}.mobile-header-actions{display:flex;align-items:center;gap:6px}
#mobile-quality{display:none}#mobile-menu{min-width:64px}.app-header .preview-tag{color:#e8c88d}
#learning,#practice,#court-day{background:#14283b;color:#f6f4ed}
.learn-intro,.practice-intro,.learn-meta,.learn-scope,.role-note,.small,.voice-small{color:#c9d4de;line-height:1.55}
#learning h1,#practice h1,#court-day h1{color:#fff7e6;letter-spacing:-.02em}
.learn-selectors label{color:#e3e9ee}.learn-selectors select{background:#0d1e2e;color:#f7f6f1;border-color:#526b7d;font-size:15px}
.learn-actions button{font-size:15px;line-height:1.45;padding:12px 15px;text-align:left}.learn-actions button span{color:inherit;opacity:.88}
.learn-advanced{margin:8px 0 18px!important}.learn-advanced summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:#e8c88d}.learn-advanced .learn-selectors{padding-top:10px}
.learn-bottom{border-top:1px solid #496174;padding-top:14px}.learn-bottom button{font-size:13px}
#scene-toolbar{border-color:#3e5468}#scene-toolbar button{min-height:40px}.scene-label{color:#c2cdd6}
dialog{background:#12273a;color:#f5f3ec;border:1px solid #577083;border-radius:12px}dialog p{line-height:1.6}dialog .small{font-size:14px}dialog summary{cursor:pointer;color:#f0d09a;min-height:44px;padding:8px 0}
.settings-tabs button[aria-selected=true]{background:#e8c88d;color:#102131}.settings-volume label{color:#f6f4ed}.settings-saved{color:#bdcbd7}
.start-settings{display:inline-flex;align-items:center;min-height:44px;margin:10px 12px 0 0;background:transparent;border:0;padding:0 12px 0 0;color:#e8c88d;font-size:15px}
.start-audio-option{display:flex;align-items:center;gap:10px;min-height:44px}body[data-boot=ready] .start-audio-option{display:none}
#title-ad-area{max-width:760px;flex-shrink:0;margin:0 0 16px}.court-ad{position:relative;display:block;box-sizing:border-box;background:#eef1f3;color:#14283b;border:1px solid #b4c1cc;border-radius:5px;padding:12px 16px;overflow:hidden;text-align:left;isolation:isolate;flex-shrink:0}
#learning .court-ad,#practice .court-ad{margin:30px 0 0}.court-ad-label{margin:0 0 8px;font-size:10px;line-height:1.4;letter-spacing:.14em;color:#425563}.court-ad-link{display:grid;gap:4px;color:#14283b;text-decoration:none;min-height:64px}.court-ad-link strong{font-size:17px}.court-ad-link span{font-size:14px;line-height:1.4}.court-ad-link .court-ad-visit{font-size:12px;text-decoration:underline;text-underline-offset:3px;margin-top:4px}.court-ad small{display:block;color:#435664;margin-top:8px;font-size:11px;line-height:1.4}.court-ad a:focus-visible{outline-color:#14283b}.court-ad-frame{display:block;width:100%;height:100px;border:0;background:transparent}
/* Defense in depth: ad-bearing nodes are never in the live court grid. */
body[data-boot=loading] .court-ad,body[data-boot=error] .court-ad,body.voice-rehearsing .court-ad{display:none!important}
@media(min-width:901px){#game-start:has(.court-ad) .start-content{padding:24px 0}#game-start:has(.court-ad) h1{font-size:clamp(42px,5.5vw,76px)}}
@media(max-width:900px){.app-header nav{display:none}.mobile-header-actions{margin-left:auto}.learn-actions button{min-height:48px;font-size:15px}.learn-intro{font-size:15px}.learn-selectors{gap:10px}#game-start .start-footer{font-size:11px!important}.court-ad{padding:10px 12px}#title-ad-area{margin-top:20px}#game-start:has(.court-ad) .start-content{padding:24px 0}.start-footer a{min-height:44px!important}}
@media(max-height:560px) and (min-width:601px){.start-settings{grid-column:2;grid-row:3;margin:0}.start-course{grid-column:2;grid-row:4}#title-ad-area:has(.court-ad){margin-top:24px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Daylight theme. Layout remains owned by court-layout.css; the scene is never
   tinted by UI filters, and the brighter panels stay outside the canvas. */
:root{color-scheme:light;--ink:#162b43;--panel:#f8fafc;--raised:#edf3fb;--text:#172e48;--muted:#4d657c;--subtle:#536d84;--gold:#965800;--line:#c9d7e4;--border:#93abc0;--blue:#215dd3;--blue-deep:#1649aa;--sun:#f6bc43}
html,body{background:#edf3f8;color:var(--text)}a{color:var(--blue-deep)}
button,select{background:#fff;color:var(--text);border-color:#adbed0}
button:not(:disabled):hover{background:#e8f0ff;border-color:var(--blue)}
button.primary,.learn-actions>button:first-child,#learning[data-screen=home] .learn-actions button:first-child,#learning[data-screen=case_setup] .learn-actions button:first-child{background:var(--blue);color:#fff;border-color:var(--blue);font-weight:700}
button.primary:not(:disabled):hover,.learn-actions>button:first-child:not(:disabled):hover{background:var(--blue-deep);border-color:var(--blue-deep)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,textarea:focus-visible{outline-color:var(--blue)}
.app-header,body.court-layout .app-header{background:#fff;border-color:var(--line)}
.brand strong{color:#163353}.brand strong span{color:#bd7600}.product-name,.header-context{color:#526a80}
.app-header .preview-tag{color:#1858bd}.app-header nav button{color:#1b4f98}
body.court-layout #workspace{background:#edf3f8}
body.court-layout #workspace>:is(#learning,#practice,#court-day,#voice-rehearsal),body.court-layout.court-menu #workspace>#learning,#learning,#practice,#court-day{background:#f8fafc;color:var(--text);border-color:var(--line);scrollbar-color:#90aac2 #f8fafc}
#learning h1,#practice h1,#court-day h1,.voice-rehearsal h1{color:#163353}
.learn-intro,.practice-intro,.practice-context,.learn-meta,.learn-scope,.role-note,.small,.voice-small,.voice-rehearsal .voice-small,body.court-layout .learn-intro{color:var(--muted)}
.eyebrow,.learn-kicker,.practice-kicker,.voice-kicker,body.court-layout :is(.learn-kicker,.practice-kicker){color:#2458a3}
#learning :is(summary,a),#court-day a,dialog summary,.learn-advanced summary{color:#1757b5}
.learn-selectors label,.day-field,.settings-volume label{color:var(--text)}
.learn-selectors select,.setting select,#practice-state,#court-day :is(select,textarea),.voice-rehearsal :is(select,textarea),.objection-lab select{background:#fff;color:var(--text);border-color:#8fa9c2}
.learn-actions button,.practice-choices button{background:#fff;color:var(--text);border-color:#a9bed2}
.learn-actions button span,#learning[data-screen=home] .learn-actions button:first-child span,#learning[data-screen=case_setup] .learn-actions button:first-child span{color:inherit;opacity:1}
.learn-actions button:not(:disabled):hover,.practice-choices button:not(:disabled):hover{background:#e8f0ff;border-color:var(--blue)}
body.court-layout .practice-choices button.objection-action,.practice-choices button.objection-action{background:var(--sun);color:#172e48;border-color:#bc830a}
.practice-choices button:is([data-practice-command="question"],[data-practice-command="next"]){background:var(--blue);color:#fff;border-color:var(--blue)}
.practice-steps span.current{background:var(--blue)}.practice-steps span.done,.live-dot{background:#d99113}
.key{color:#1a55ab;border-color:#a5bfdf}.objection-action .key{color:#172e48;border-color:#936409}
.learn-bottom{border-color:var(--line)}.learn-bottom button{background:#fff;color:#194e99;border-color:#adbed0}
#court-day .day-feedback{background:#eaf2ff;border-left-color:var(--blue);color:#1c3c61}
.jurisdiction-scope{background:#fff6df;color:#5a4a29;border-color:#d89b28}.jurisdiction-scope strong{color:#61400c}
.objection-lab{background:#eef4ff;border-color:#9cb8df}.objection-lab button{background:var(--blue);color:#fff}
body.court-layout #scene-toolbar{background:#eef4fb;border-color:#c6d7e6}
body.court-layout #scene-toolbar button{background:#fff;color:#1b4776;border-color:#a9bfd3}
body.court-layout #scene-toolbar button:not(:disabled):hover{background:#e0edff;border-color:var(--blue)}
body.court-layout #courtroom-focus[aria-pressed=true]{background:var(--blue);color:#fff}
.scene-label{color:#4b6278}
body.court-layout #workspace>footer,footer{background:#fff;color:var(--text);border-color:var(--line)}
#caption{color:#172e48}.status-row #pause{background:#edf3fb;border-color:#acbfd3;color:#234d80}
dialog,#settings{background:#fff;color:var(--text);border-color:#9db5cb;box-shadow:0 20px 70px #17395b40}
dialog::backdrop{background:#152d4559}dialog p,dialog dd,.settings-saved,.settings-help{color:var(--muted)}
dialog h2,dialog label{color:var(--text)}.settings-tabs{background:#fff;border-color:var(--line)}
.settings-tabs button[aria-selected=true]{background:var(--blue);color:#fff;border-color:var(--blue)}
.settings-volume output{color:#1956b5}.settings-volume input,.mobile-settings-row input,.learn-checklist input{accent-color:var(--blue)}
.voice-launch{background:#e8f0ff;color:#174fac;border-color:#98b4db!important}
.voice-primary{background:var(--blue)!important;color:#fff!important}.voice-message,.voice-rehearsal .voice-replay{color:#245080}
#audio-alert{background:#fff7e4;color:var(--text);border-color:#c79227}
#entry-gate{background:#eaf2f5ee}.entry-card p,.entry-card small{color:var(--muted)}
.edition-summary{color:var(--muted);border-color:var(--line)}.edition-summary summary{color:#2159b0}
/* Keep the actual courtroom photograph visible across the title screen. */
#game-start{--start-gold:#f6bc43;color:#17324d;background-color:#d8dce0}
.start-shade{background:linear-gradient(90deg,#f9fbfcfa 0%,#f8fafbf0 27%,#f5f8fac2 42%,#f5f8fa24 66%,transparent 100%),linear-gradient(0deg,#f9fbfce8,transparent 18%)}
.start-brand{color:#163353}.start-brand small{color:#35536f}.start-four{color:#ba7400}
#game-start h1{color:#143a63;text-shadow:none}.start-kicker{color:#205db5}.start-intro{color:#2b4a67}.start-note{color:#3d5972}
#game-start .start-play{background:#215dd3;border-color:#215dd3;color:#fff;box-shadow:0 6px 20px #154b9a30}
#game-start .start-play:hover{background:#1649aa!important;border-color:#1649aa}
#game-start :focus-visible{outline-color:#144da9}
#game-start .start-footer{color:#264966;border-color:#7994ad70;background:#f7fafcd9;padding:12px 14px;border-radius:6px}
#game-start .start-footer a{color:#154e9d}
#game-start #loadtext{color:#234665}#game-start #load-hint{color:#35536c}#game-start #loading a{color:#164fa5}
#game-start #progress{accent-color:#215dd3}#game-start #progress::-webkit-progress-bar{background:#b5c8df}#game-start #progress::-webkit-progress-value{background:#215dd3}
@media(max-width:600px){
 #game-start{--title-art-height:clamp(220px,36svh,300px);background-color:#f8fafc;background-size:auto var(--title-art-height);background-position:center top}
 .start-shade{background:linear-gradient(180deg,#f8fafcde,transparent 90px,transparent calc(var(--title-art-height) - 100px),#f8fafc calc(var(--title-art-height) - 25px))}
 .start-content{margin:calc(var(--title-art-height) - 115px) 0 12px;padding:0 0 12px}
 .start-brand{font-size:17px}#game-start h1{font-size:clamp(38px,10.5vw,58px)}.start-intro{max-width:290px}
 #game-start .start-footer{padding:10px;gap:6px 12px}.start-footer a{font-size:11px}
}
@media(max-height:560px) and (min-width:601px){.start-shade{background:linear-gradient(90deg,#f8fafcf7 0%,#f8fafce3 50%,#f8fafc11 85%)}#game-start .start-footer{padding:6px 12px}}

body:not(.court-layout)>header{background:#fff;color:#163353;border-color:#c9d7e4}body:not(.court-layout)>header small{color:#4d657c}body:not(.court-layout)>header a{color:#1755ad}body:not(.court-layout) main :is(input:not([type=checkbox]),select,textarea){background:#fff;color:#172e48;border-color:#93abc0}body:not(.court-layout) .intro{color:#4d657c}

/* Keep the next action clear; optional reading stays in one expandable area. */
#learning[data-screen=case_setup] .learn-selectors:not(.learn-advanced .learn-selectors){grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}
#learning[data-screen=case_setup] .learn-selectors>label{grid-column:auto}
#learning .learn-extras{margin-top:24px;border-top:1px solid #c9d7e4;padding-top:8px}
#learning .learn-extras>summary{font-size:14px;min-height:48px;display:list-item;padding:12px 0;cursor:pointer}
#learning .learn-extras>details{margin-left:16px}
#learning .learn-extras .learn-actions{margin-top:16px}
#learning .learn-extras .learn-actions button{background:#fff;color:#19334e;border-color:#adbed0}
#learning[data-screen=home]>.learn-actions{max-width:960px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
#learning[data-screen=home]>.learn-actions button{min-height:126px;text-align:left;padding:22px}
@media(max-width:700px){#learning[data-screen=case_setup] .learn-selectors:not(.learn-advanced .learn-selectors),#learning[data-screen=home]>.learn-actions{grid-template-columns:1fr}#learning[data-screen=home]>.learn-actions button{min-height:84px;padding:18px}}

/* Accessibility changes preserve the scene grid and scroll only the active panel. */
.settings-tabs{flex-wrap:wrap}.settings-tabs button{flex:1 1 110px}.mobile-settings-row{min-height:48px;gap:12px;align-items:center}.mobile-settings-row input{min-width:22px;min-height:22px}
html[data-text-size=large] :is(#learning,#practice,#court-day,dialog,.transcript) :is(p,small,li,dd,label,select,button,summary,blockquote,textarea){font-size:max(17px,1.08em)!important;line-height:1.5!important}
html[data-text-size=larger] :is(#learning,#practice,#court-day,dialog,.transcript) :is(p,small,li,dd,label,select,button,summary,blockquote,textarea){font-size:max(20px,1.12em)!important;line-height:1.5!important}
html[data-text-size]:not([data-text-size=standard]) :is(#learning,#practice,#court-day,dialog){overflow-wrap:anywhere}
html[data-high-contrast=true]{--text:#101010;--muted:#222;--subtle:#222;--blue:#003fa3;--blue-deep:#002968;--line:#111}
html[data-high-contrast=true] :is(dialog,#settings,#learning,#practice,#court-day,#scene-toolbar,footer){background:#fff!important;color:#111!important;border-color:#111!important}
html[data-high-contrast=true] :is(dialog,#learning,#practice,#court-day,footer) :is(p,small,label,dd,dt,h1,h2,h3,blockquote,.learn-meta,.practice-timer,.practice-detail){color:#111!important}
html[data-high-contrast=true] :is(button,select,input,textarea){border:2px solid #111!important}
html[data-high-contrast=true] button{background:#fff!important;color:#111!important}
html[data-high-contrast=true] :is(button.primary,button[aria-selected=true],.objection-action){background:#003fa3!important;color:#fff!important}
html[data-high-contrast=true] :is(a,summary){color:#003fa3!important;text-decoration:underline}
html[data-high-contrast=true] :focus-visible{outline:4px solid #003fa3!important;outline-offset:3px}
html[data-reduced-motion=true] *,html[data-reduced-motion=true] *::before,html[data-reduced-motion=true] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media(prefers-reduced-motion:reduce){html:not([data-reduced-motion=false]) *,html:not([data-reduced-motion=false]) *::before,html:not([data-reduced-motion=false]) *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:600px){.settings-tabs button{flex-basis:88px}.settings-tabs{gap:6px}}
html[data-text-size]:not([data-text-size=standard]) .settings-tabs button{flex-basis:165px;overflow-wrap:normal;word-break:normal}
@media(max-width:600px){html[data-text-size]:not([data-text-size=standard]) .settings-tabs button{flex-basis:100px;font-size:16px!important;overflow-wrap:normal}}
