/* Route-local enhancement. Core reading and native answer details need no script. */
body[data-uti-lesson] { background:#101a2c; color:#f8f4ec; }
body[data-uti-lesson] .bwcr { box-sizing:border-box; max-width:74rem; width:auto; margin:0 auto; padding:1.25rem; color:#f8f4ec; font-size:1.125rem; line-height:1.75; overflow-wrap:anywhere; }
body[data-uti-lesson] .bwcr * { box-sizing:border-box; min-width:0; }
body[data-uti-lesson] .bwcr p, body[data-uti-lesson] .bwcr legend, body[data-uti-lesson] .bwcr li { max-width:76ch; }
body[data-uti-lesson] .bwcr p { margin-block:1rem; }
body[data-uti-lesson] .bwcr h1 { font-size:clamp(2rem,5vw,3.2rem); line-height:1.2; }
body[data-uti-lesson] .bwcr h2 { font-size:1.6rem; line-height:1.35; }
body[data-uti-lesson] .bwcr h3 { font-size:1.3rem; line-height:1.45; }
body[data-uti-lesson] .bwcr :is(h1,h2,h3,h4,strong,legend) { color:#fff8ee; }
body[data-uti-lesson] .bwcr a { color:#ded2ff; text-decoration:underline; text-underline-offset:.18em; }
body[data-uti-lesson] .bwcr :is(button,select,summary,.bwcr-options label,.bwcr-study-link) { min-height:44px; font:inherit; line-height:1.5; }
body[data-uti-lesson] .bwcr :is(button,select,.bwcr-study-link) { border:2px solid #d0c2ef; border-radius:.45rem; padding:.6rem .8rem; background:#192740; color:#fff8ee; max-width:100%; white-space:normal; }
body[data-uti-lesson] .bwcr button:disabled { opacity:.65; }
body[data-uti-lesson] .bwcr :is(button,summary,select,a,input,[tabindex]):focus-visible { outline:3px solid #ffe8a6; outline-offset:4px; box-shadow:0 0 0 7px #101a2c; }
body[data-uti-lesson] .bwcr [hidden] { display:none!important; }
body[data-uti-lesson] .bwcr section[data-lesson-section] { margin-block:3rem; padding-top:1rem; border-top:1px solid #52617b; }
body[data-uti-lesson] .bwcr :is(figure,.uti-model) { margin:1.5rem 0; }
body[data-uti-lesson] .bwcr .bwcr-svg-scroll { max-width:100%; overflow-x:auto; padding:.5rem; }
body[data-uti-lesson] .bwcr figure svg { display:block; width:100%; max-width:26rem; height:auto; margin:0 auto; }
body[data-uti-lesson] .bwcr figcaption { margin-top:.75rem; color:#e1e8f5; font-size:1rem; line-height:1.7; }
body[data-uti-lesson] .bwcr details { background:#18263c; border:1px solid #6f809d; border-radius:.5rem; margin:.8rem 0; padding:.35rem .8rem; color:#f8f4ec; }
body[data-uti-lesson] .bwcr summary { padding:.65rem .2rem; cursor:pointer; color:#fff8ee; }
body[data-uti-lesson] .bwcr [data-uti-reveal] { background:#142138; border-color:#6f809d; }
body[data-uti-lesson] .bwcr [data-uti-fact] { border-left:3px solid #d3c0fc; padding-left:.8rem; }
body[data-uti-lesson] .bwcr :is(.bwcr-study-tools,.bwcr-checkpoint,.uti-model) { border:1px solid #61738f; border-radius:.65rem; padding:1rem; background:#142138; }
body[data-uti-lesson] .bwcr .uti-controls { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr)); gap:1rem; margin-block:1rem; }
body[data-uti-lesson] .bwcr .uti-controls label { display:block; }
body[data-uti-lesson] .bwcr .uti-controls select { display:block; width:100%; margin-top:.35rem; }
body[data-uti-lesson] .bwcr [data-uti-output] { display:block; border-left:4px solid #d6c1fa; padding:.75rem; background:#24354e; color:#fff8ee; }
body[data-uti-lesson] .bwcr .uti-limit { color:#e1e8f5; font-size:1rem; }
body[data-uti-lesson] .bwcr .bwcr-options { padding-left:0; list-style:none; }
body[data-uti-lesson] .bwcr .bwcr-options label { display:flex; align-items:flex-start; gap:.6rem; padding:.85rem; margin-block:.55rem; background:#192740; color:#fff8ee; border:1px solid #8291aa; border-radius:.45rem; }
body[data-uti-lesson] .bwcr .bwcr-options input { flex:0 0 auto; width:1.2rem; height:1.2rem; margin:.25rem 0 0; accent-color:#d3b7ff; }
body[data-uti-lesson] .bwcr .bwcr-options span { flex:1; }
body[data-uti-lesson] .bwcr fieldset { border:0; padding:0; margin:0; }
body[data-uti-lesson] .bwcr legend { width:100%; white-space:normal; font-weight:400; padding:0; }
body[data-uti-lesson] .bwcr article[data-case] { margin-block:2rem; border-top:1px solid #6f809d; padding-top:1.1rem; }
body[data-uti-lesson] .bwcr .bwcr-rationales { padding-left:1.5rem; }
body[data-uti-lesson] .bwcr .bwcr-status { color:#fff2bf; min-height:1.5em; }
body[data-uti-lesson] .bwcr .bwcr-tool-row { display:flex; flex-wrap:wrap; gap:.65rem; }
body[data-uti-lesson] .bwcr .bwcr-tool-note { color:#e1e8f5; font-size:1rem; }
body[data-uti-lesson] .bwcr .bwcr-sources a { overflow-wrap:anywhere; }
body[data-uti-lesson] .bwcr table { width:100%; border-collapse:collapse; font-size:1rem; line-height:1.65; }
body[data-uti-lesson] .bwcr :is(td,th) { padding:.8rem; text-align:left; vertical-align:top; color:#f8f4ec; border:1px solid #6f809d; background:#18263c; }
body[data-uti-lesson] .bwcr th { background:#24354e; }
body[data-uti-lesson] .bwcr caption { text-align:left; padding:.6rem 0; color:#f8f4ec; }
@media(max-width:480px) { body[data-uti-lesson] .bwcr { padding:1rem; } body[data-uti-lesson] .bwcr :is(.uti-model,.bwcr-checkpoint,.bwcr-study-tools) { padding:.75rem; } body[data-uti-lesson] .bwcr .bwcr-rationales { padding-left:1.1rem; } }
@media(prefers-reduced-motion:reduce) { body[data-uti-lesson] .bwcr *, body[data-uti-lesson] .bwcr *::before, body[data-uti-lesson] .bwcr *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

@media(max-width:480px) { body[data-uti-lesson] .bwcr .uti-model { padding:.5rem; } body[data-uti-lesson] .bwcr .uti-model .bwcr-svg-scroll { padding:0; } }

/* Native macOS WebKit select rendering ignores the intended minimum otherwise. */
body[data-uti-lesson] .bwcr .uti-controls select { appearance:none; -webkit-appearance:none; min-height:3rem; padding-right:2.1rem; background-image:linear-gradient(45deg,transparent 50%,#fff8ee 50%),linear-gradient(135deg,#fff8ee 50%,transparent 50%); background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50%; background-size:5px 5px; background-repeat:no-repeat; }
body[data-uti-lesson] main.bwcr .bwcr-svg-scroll svg { max-width:26rem!important; }

/* Keep the continuous-reading title usable at narrow widths and enlarged text. */
body[data-uti-lesson] main.bwcr .bwcr-intro { padding:0; background:transparent; border-radius:0; }

/* R2: pair every selected/secondary foreground with its real background.
   The extra route/main specificity intentionally overrides shared light-theme states. */
body[data-uti-lesson] main.bwcr .bwcr-options label:has(input:checked) {
  color:#182338; background:#eee8f5; border-color:#d3b7ff;
  box-shadow:inset 0 0 0 1px #493568;
}
body[data-uti-lesson] main.bwcr .bwcr-options label:has(input:checked) :is(span,strong) { color:inherit; }
body[data-uti-lesson] main.bwcr button.bwcr-secondary {
  color:#fff8ee; background:#192740; border-color:#d0c2ef;
}
body[data-uti-lesson] main.bwcr button.bwcr-secondary[aria-pressed="true"] {
  color:#182338; background:#eee8f5; border-color:#d3b7ff;
}
body[data-uti-lesson] main.bwcr button.bwcr-secondary:focus-visible {
  outline:3px solid #ffe8a6; outline-offset:4px;
}
body[data-uti-lesson] main.bwcr .bwcr-activity-label { color:#ded2ff; font-size:1rem; }

/* Keep narrow-screen reading width when the reader enlarges text.
   Pixel insets stay modest while font sizes and vertical targets still scale. */
@media(max-width:360px) {
  body[data-uti-lesson] main.bwcr { padding-inline:12px; }
  body[data-uti-lesson] main.bwcr :is(.bwcr-checkpoint,.bwcr-study-tools) { padding-inline:8px; }
  body[data-uti-lesson] main.bwcr .bwcr-options label { padding-inline:10px; column-gap:8px; }
  body[data-uti-lesson] main.bwcr details { padding-inline:8px; }
}
