/* Demo v1 package shell styles (package-own). Brand tokens are the settled
   product tokens: navy #16233F, demo teal #0E5A66, accent #2FA8A0,
   purple #2B1D4E, gold #E9C46A, cream #FAF6EC, card border #D9E4E6,
   radius 24px. Fonts: Baloo 2 headings, Nunito body. */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:Nunito,system-ui,sans-serif;color:#16233F;background:#FAF6EC;font-size:16.5px;line-height:1.45}
h1,h2,h3{font-family:"Baloo 2",Nunito,sans-serif;color:#16233F;margin:.2em 0 .35em}
a{color:#0E5A66}
.sr-header{display:flex;align-items:center;gap:12px;padding:8px 14px;background:rgba(255,255,255,.82);border-bottom:2px solid #D9E4E6;position:relative;z-index:50;flex-wrap:nowrap}
.sr-header .sr-logo{height:72px;width:auto;display:block}
.sr-header .sr-who{font-weight:800;color:#2B1D4E;white-space:nowrap}
.sr-header .sr-sparks{background:#E9C46A;color:#16233F;border-radius:999px;padding:7px 16px;font-weight:900;text-decoration:none;display:inline-flex;align-items:center;min-height:44px;white-space:nowrap}
/* v1.3 (BUG-127): the ONE nav pair — Back + Home pinned top-right in a
   single non-wrapping header row at every viewport. Back targets are
   deterministic (door pages -> the demo home "/"; in-run Back is
   intercepted by shell.js and lands on the door's entry page). The
   landing carries NO pair. Pair targets are >=44x44 everywhere. */
.sr-navpair{display:flex;gap:8px;align-items:center;margin-left:auto;flex:none}
.sr-header .sr-navbtn{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:8px 16px;border-radius:999px;border:2px solid #0E5A66;background:#fff;color:#0E5A66;font-weight:900;text-decoration:none;cursor:pointer;font:inherit;white-space:nowrap}
@media (max-width:640px){
  .sr-header{gap:6px;padding:8px 10px}
  .sr-header .sr-logo{height:38px}
  .sr-header .sr-who{display:none}
  .sr-header .sr-sparks{padding:5px 9px;font-size:.82rem;min-height:44px}
  .sr-navpair{gap:6px}
  .sr-header .sr-navbtn{padding:8px 10px;font-size:.88rem}
}
#main-wrap{max-width:1180px;margin:0 auto;padding:10px 14px 30px}
.sr-footer{border-top:2px solid #D9E4E6;background:rgba(255,255,255,.82);padding:14px;text-align:center;font-weight:700;color:#16233F}
.sr-footer nav{display:flex;gap:18px;justify-content:center;flex-wrap:wrap;margin-bottom:6px}
.sr-footer a{font-weight:800}
.sr-card{background:#fff;border:2px solid #D9E4E6;border-radius:24px;padding:20px;box-shadow:0 4px 18px rgba(22,35,63,.06)}
.sr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:14px}
.sr-door{display:block;background:#fff;border:2px solid #D9E4E6;border-radius:24px;padding:18px;text-decoration:none;color:#16233F;box-shadow:0 4px 18px rgba(22,35,63,.06)}
.sr-door:hover{border-color:#2FA8A0}
.sr-door h3{font-size:1.25rem;margin:.1em 0 .2em}
.sr-door p{margin:0;color:#3c4a63;font-weight:600}
.sr-door .sr-tag{display:inline-block;background:#0E5A66;color:#fff;border-radius:999px;padding:3px 12px;font-size:.82rem;font-weight:900;margin-bottom:8px}
.sr-btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:10px 24px;border-radius:999px;border:0;background:#0E5A66;color:#fff;font:inherit;font-weight:900;cursor:pointer;text-decoration:none}
.sr-btn.gold{background:#E9C46A;color:#16233F}
.sr-btn.purple{background:#2B1D4E;color:#FFEEC4}
.sr-btn.ghosty{background:#fff;color:#0E5A66;border:2px solid #0E5A66}
.sr-btn[disabled]{opacity:.55;cursor:default}
.sr-chips{display:flex;flex-wrap:wrap;gap:8px}
.sr-chip{display:inline-flex;align-items:center;gap:6px;background:#fff;border:2px solid #D9E4E6;border-radius:999px;padding:8px 14px;font-weight:800;min-height:44px;cursor:pointer;font:inherit;color:#16233F;text-align:left}
.sr-chip.locked{color:#5a6a86;background:#f4f6f8}
.sr-chip img{width:30px;height:30px;border-radius:8px}
.sr-gradebar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.sr-gradebar select{min-height:44px;font:inherit;font-weight:800;border:2px solid #0E5A66;border-radius:12px;padding:6px 10px;background:#fff;color:#16233F}
.sr-explain{max-width:640px;margin:26px auto}
.sr-mute-capsule{position:absolute;right:14px;bottom:14px;background:#0E5A66;color:#fff;border:0;border-radius:999px;min-height:48px;padding:10px 22px;font-family:Nunito,sans-serif;font-weight:800;cursor:pointer;z-index:5}
.sr-hero{position:relative;border-radius:24px;overflow:hidden;border:2px solid #D9E4E6;background:#16233F}
.sr-hero video{display:block;width:100%;height:auto;max-height:62vh;object-fit:cover;background:#16233F}
.sr-hero .sr-hero-cta{position:absolute;left:14px;bottom:14px;display:flex;gap:10px;flex-wrap:wrap;z-index:5}
/* v1.1 (WS3-05 rendered contrast census): the ghost sheet's generic
   link tint (teal) lands on the demo bar's purple Unlock pill —
   measured 1.93:1 rendered. The bar's own settled colours are cream
   on purple (11.4:1); restore them for the bar link specifically. */
#sr-demo-bar a{color:#FFEEC4 !important}
/* v1.1 (WS3-09): on narrow phones the hero CTA row wraps to two rows
   and reaches the mute capsule in the hero's bottom-right corner
   (measured overlap at 375px). The capsule moves to the hero's
   top-right on small screens; the CTA keeps the bottom-left. */
@media (max-width:640px){.sr-mute-capsule{bottom:auto;top:14px}}
/* v1.1 (WS6): stimulus reading panel — mirrors Logic's .sr-lcr-stimulus
   (cream card, amber edge, "Read this first"); long stimuli scroll with
   the page, never cropped. Contrast: label #b45309 on #fff7e0 = 5.9:1;
   text #2B1D4E on #fff7e0 = 13.9:1. */
.sr-lcr-stimulus{background:#fff7e0;border:2px solid #f59e0b;border-left:8px solid #f59e0b;border-radius:14px;padding:14px 16px;margin:0 0 12px;box-shadow:0 3px 10px rgba(43,29,78,.10);text-align:left}
.sr-lcr-stimulus-label{font-weight:900;font-size:1.05rem;color:#b45309;margin-bottom:6px}
.sr-lcr-stimulus-text{font-size:1.25rem;line-height:1.55;font-weight:700;color:#2B1D4E}
/* v1.1 (WS6): Grades figure zone — the .gmq-figure pattern: centred,
   capped height, full width available; the SVG itself is never cropped. */
.sr-run-figure{display:flex;justify-content:center;margin:2px 0 14px}
.sr-run-figure svg{max-width:100%;height:auto;max-height:30dvh;display:block}
/* Question run (package-own run component) — v1.3 (BUG-090): rebuilt
   to the standard Grades geometry measured in WS-RUNUI-DIFF §2:
   card radius 18px / padding 14px 16px; stem "Baloo 2" 30.4px/700
   CENTRED (20px on phone); options "Baloo 2" 24px/800 centred,
   radius 16px, padding 14px 8px, 2x2 grid ON PHONE TOO; feedback =
   the standard FULL fills (correct #0e7c5b / border #0a5c44, wrong
   #d94f30 / border #c23324, white text); progress = HUD pill + pips;
   PiPal dock = framed dock with speech bubble + caption (the locked
   Ask PiPal pill stays demo.js's separate element); Previous
   bottom-left / Next bottom-right, both >=44px. The whole run fits
   390x844 with question + all four options + nav visible without
   scrolling: compact phone metrics below are sized for that. */
.sr-run{display:grid;grid-template-columns:1fr 216px;gap:14px;align-items:start}
.sr-run-main{background:#fff;border:2px solid #D9E4E6;border-radius:18px;padding:14px 16px;box-shadow:0 4px 18px rgba(22,35,63,.06)}
.sr-run-q{font-family:"Baloo 2",Nunito,sans-serif;font-size:30.4px;font-weight:700;line-height:1.25;margin:6px 0 14px;text-align:center;color:#16233F}
.sr-run-q .op{color:#0E5A66;padding:0 .15em}
.sr-run-opts{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.sr-opt{min-height:64px;border-radius:16px;border:3px solid #0E5A66;background:#FAF6EC;font-family:"Baloo 2",Nunito,sans-serif;font-size:24px;font-weight:800;color:#16233F;cursor:pointer;padding:14px 8px;text-align:center}
.sr-opt:hover{border-color:#2FA8A0}
.sr-opt.correct{background:#0e7c5b;background-color:#0e7c5b;border-color:#0a5c44;color:#fff}
.sr-opt.wrong{background:#d94f30;background-color:#d94f30;border-color:#c23324;color:#fff}
.sr-opt[disabled]{cursor:default;opacity:1}
.sr-run-nav{display:flex;justify-content:space-between;gap:12px;margin-top:14px}
.sr-run-nav .sr-btn{min-height:48px}
.sr-run-meta{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.sr-hintbox{background:#fdf0d5;border:2px solid #E9C46A;border-radius:16px;padding:12px 16px;font-weight:700;margin-top:14px}
.sr-explainbox{background:#eef7f6;border:2px solid #2FA8A0;border-radius:16px;padding:12px 16px;font-weight:700;margin-top:14px}
.sr-dock{display:flex;flex-direction:column;align-items:center;gap:8px;background:#fff;border:2px solid #D9E4E6;border-radius:24px;padding:12px}
.sr-dock img{width:100%;max-width:216px;height:auto;border-radius:18px}
.sr-dock .sr-dock-bubble{font-weight:700;color:#16233F;font-size:.95rem;text-align:center;background:#eef7f6;border:2px solid #2FA8A0;border-radius:16px;padding:10px 12px}
.sr-dock span{font-weight:900;color:#2B1D4E;font-size:.9rem;text-align:center}
.sr-prog{display:flex;align-items:center;gap:10px;margin:10px 0}
.sr-prog-pill{background:#2B1D4E;color:#FFEEC4;border-radius:999px;padding:6px 14px;font-weight:900;font-size:.9rem;white-space:nowrap}
.sr-prog-pips{display:flex;gap:5px;flex-wrap:wrap}
.sr-prog-pips i{width:12px;height:12px;border-radius:50%;background:#e7edf0;border:2px solid #D9E4E6;display:block}
.sr-prog-pips i.on{background:#2FA8A0;border-color:#0E5A66}
@media (max-width:640px){
  .sr-run{grid-template-columns:1fr;gap:8px}
  .sr-run-main{padding:8px 10px}
  .sr-run-q{font-size:19px;margin:3px 0 7px}
  .sr-run-opts{gap:8px}
  .sr-opt{min-height:48px;font-size:17.6px;padding:7px 6px;border-width:2px}
  .sr-run-nav{margin-top:8px}
  .sr-run-nav .sr-btn{min-height:48px;padding:8px 16px}
  .sr-dock{flex-direction:row;padding:6px 10px}
  .sr-dock img{width:52px;max-width:52px}
  .sr-dock .sr-dock-bubble{flex:1;text-align:left;font-size:.88rem;padding:7px 10px}
  .sr-dock span{display:none}
  .sr-prog{margin:4px 0}
  /* Stimulus runs (Logic & CR) carry a reading panel above the stem;
     it compacts on phone so stem + 2x2 options + nav still fit
     390x844 without scrolling (long stimuli keep their full text —
     the panel is compact, never cropped). */
  .sr-lcr-stimulus{padding:7px 9px;margin-bottom:7px}
  .sr-lcr-stimulus-label{font-size:.95rem;margin-bottom:3px}
  .sr-lcr-stimulus-text{font-size:1rem;line-height:1.35}
  .sr-run-figure{margin-bottom:8px}
  .sr-run-figure svg{max-height:18dvh}
}
.sr-lesson figure{margin:10px 0}
.sr-lesson figcaption{font-weight:700;color:#3c4a63}
.sr-menu-item{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;text-align:left;background:#fff;border:2px solid #D9E4E6;border-radius:16px;padding:12px 16px;font:inherit;font-weight:800;color:#16233F;cursor:pointer;min-height:52px;margin:0 0 8px}
.sr-menu-item.locked{color:#5a6a86;background:#f4f6f8}
body.sr-demo-session #sr-pipal-lock-pill{display:none!important}
/* v1.3 (no-overlap rule; BUG-040 pattern): while a question run is
   mounted, the demo's floating locked PiPal pill is suppressed — it
   otherwise paints over the run's Next button at phone size. The
   run's own PiPal dock is the PiPal surface for the run's duration;
   the pill returns at finish. */
body.sr-run-live #sr-demo-pipal-pill{display:none !important}
/* v1.4 (BUG-128): the ONE run loading state + the Start busy state.
   The loading element lives in the run stage from mount until Q1;
   navy text on the card white clears 4.5:1 by a wide margin. */
.sr-run-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:34px 10px;text-align:center}
.sr-run-loading p{margin:0;font-weight:800;font-size:1.05rem;color:#16233F}
.sr-run-spinner{width:38px;height:38px;border-radius:50%;border:4px solid #D9E4E6;border-top-color:#0E5A66;animation:sr-run-spin .8s linear infinite}
@keyframes sr-run-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){.sr-run-spinner{animation-duration:2.4s}}
.sr-btn.sr-busy{opacity:.75;cursor:wait}
