/* Quiz B (long quiz). Every rule is scoped under body.quiz-b, which is only
   set while quiz B is on screen. Tokens: quiz B spec section 4. */
body.quiz-b{
  --qb-bg:#EEF1EF; --qb-surface:#FFFFFF; --qb-ink:#17394F; --qb-ink-2:#506B7B; --qb-line:#D3DCDD;
  --qb-accent:#E3A857; --qb-sel-bg:#FBF1E1; --qb-cta-bg:#17394F; --qb-cta-ink:#FFFFFF;
  --qb-night-bg:#17394F; --qb-night-ink:#EEF1EF; --qb-night-ink-2:#A9BCC6; --qb-night-line:#2E5470;
  --qb-night-cta-ink:#102433;
  background:var(--qb-bg);color:var(--qb-ink);
  font-family:"Poppins",-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:16px;line-height:1.5;color-scheme:light;
  transition:background-color .35s
}
@media (prefers-color-scheme:dark){
  body.quiz-b{
    --qb-bg:#0F2433; --qb-surface:#173246; --qb-ink:#E8EEEF; --qb-ink-2:#9DB1BC; --qb-line:#2A4A5E;
    --qb-accent:#E9B467; --qb-sel-bg:#3A3426; --qb-cta-bg:#E9B467; --qb-cta-ink:#102433;
    --qb-night-bg:#08151F; --qb-night-line:#1E3A4E;
    color-scheme:dark
  }
}
body.quiz-b.quiz-b-night{background:var(--qb-night-bg);color:var(--qb-night-ink)}

/* Page chrome from the hero is not part of the quiz. */
body.quiz-b .brand,body.quiz-b .hero-photo,body.quiz-b footer{display:none}
body.quiz-b .shell{padding:0 20px}
body.quiz-b #quizWrap{min-height:100dvh;padding:0 0 calc(132px + env(safe-area-inset-bottom) + var(--qb-banner-offset,0px))}

/* Header: back · brand · spacer, then the three section segments. */
body.quiz-b .qb-head{padding-top:env(safe-area-inset-top)}
body.quiz-b .qb-bar{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;height:56px}
body.quiz-b .qb-slot{display:block;width:44px;height:44px}
body.quiz-b .qb-back{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;color:inherit;background:none;margin-left:-8px}
body.quiz-b .qb-brand{text-align:center;font-weight:700;letter-spacing:.01em;font-size:16px}
body.quiz-b .qb-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:8px}
body.quiz-b .qb-seg{font-size:12px;line-height:1.3;color:var(--qb-ink-2);min-width:0}
body.quiz-b .qb-seg.is-on{color:inherit;font-weight:600}
body.quiz-b .qb-track{display:block;height:4px;border-radius:2px;background:var(--qb-line);overflow:hidden;margin-bottom:5px}
body.quiz-b .qb-fill{display:block;height:100%;width:0;background:var(--qb-accent);transition:width .35s}
body.quiz-b.quiz-b-night .qb-seg{color:var(--qb-night-ink-2)}
body.quiz-b.quiz-b-night .qb-seg.is-on{color:var(--qb-night-ink)}
body.quiz-b.quiz-b-night .qb-track{background:var(--qb-night-line)}

/* Screens */
body.quiz-b .qb-screen{padding:18px 0 0;animation:qb-in .28s ease-out}
@keyframes qb-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
body.quiz-b .qb-title{margin:6px 0 10px;max-width:none;font-family:inherit;font-weight:700;font-size:clamp(23px,6.2vw,28px);line-height:1.25;letter-spacing:-.01em;color:inherit}
body.quiz-b .qb-sub{margin:0 0 22px;color:var(--qb-ink-2);font-size:16px}
body.quiz-b .qb-type-single .qb-title,body.quiz-b .qb-type-grid .qb-title,body.quiz-b .qb-type-likert .qb-title{margin-bottom:22px}

/* Options */
body.quiz-b .qb-opts{display:flex;flex-direction:column;gap:10px}
body.quiz-b .qb-opt{display:flex;align-items:center;gap:14px;width:100%;min-height:44px;text-align:left;font:inherit;font-size:16px;line-height:1.4;color:var(--qb-ink);background:var(--qb-surface);border:1.5px solid var(--qb-line);border-radius:14px;padding:16px 18px;cursor:pointer;touch-action:manipulation;transition:border-color .15s,background-color .15s}
body.quiz-b .qb-opt[aria-pressed="true"]{border-color:var(--qb-accent);background:var(--qb-sel-bg)}
body.quiz-b .qb-opt-text{min-width:0}
body.quiz-b .qb-opt-t{display:block;font-weight:600}
body.quiz-b .qb-opt-s{display:block;margin-top:2px;font-size:14px;font-weight:400;color:var(--qb-ink-2)}
body.quiz-b .qb-box{flex:none;width:22px;height:22px;margin-left:auto;border-radius:6px;border:1.5px solid var(--qb-line);display:grid;place-items:center}
body.quiz-b .qb-opt[aria-pressed="true"] .qb-box{background:var(--qb-accent);border-color:var(--qb-accent)}
body.quiz-b .qb-opt[aria-pressed="true"] .qb-box::after{content:"";width:6px;height:11px;border:solid #102433;border-width:0 2px 2px 0;transform:rotate(45deg) translate(-1px,-1px)}
body.quiz-b .qb-grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
body.quiz-b .qb-grid2 .qb-opt{flex-direction:column;align-items:flex-start;justify-content:center;min-height:84px}
body.quiz-b .qb-opt:focus-visible,body.quiz-b .qb-cta:focus-visible,body.quiz-b .qb-back:focus-visible{outline:3px solid var(--qb-accent);outline-offset:2px}
@media (hover:hover){body.quiz-b .qb-opt:hover{border-color:var(--qb-ink-2)}}

/* Likert */
body.quiz-b .qb-statement{margin:4px 0 24px;padding:22px;border-radius:16px;border-left:4px solid var(--qb-accent);background:var(--qb-surface);font-size:21px;line-height:1.38;font-weight:600}
body.quiz-b .qb-likert{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
body.quiz-b .qb-likert .qb-opt{justify-content:center;padding:16px 0;font-weight:700;font-size:18px}
body.quiz-b .qb-likert .qb-opt-text{text-align:center}
body.quiz-b .qb-ends{display:flex;justify-content:space-between;gap:12px;margin-top:8px;font-size:13px;color:var(--qb-ink-2)}

/* Body map */
body.quiz-b .qb-bodymap{display:grid;grid-template-columns:clamp(104px,34vw,150px) minmax(0,1fr);gap:14px;align-items:start}
body.quiz-b .qb-figure svg{display:block;width:100%;height:auto}
body.quiz-b .qb-zone{fill:var(--qb-accent);opacity:.1;cursor:pointer;transition:opacity .2s,filter .2s}
body.quiz-b .qb-zone:hover{opacity:.25}
body.quiz-b .qb-zone.on{opacity:.55;filter:drop-shadow(0 0 10px var(--qb-accent))}
body.quiz-b .qb-photo{display:block;width:100%;aspect-ratio:3/2;object-fit:cover;object-position:50% 35%;border-radius:20px;margin:0 0 22px}
body.quiz-b .qb-chips{display:flex;flex-direction:column;gap:8px}
body.quiz-b .qb-chips .qb-opt{padding:11px 12px;gap:10px;font-size:15px}

/* Message screens ("lights off") */
body.quiz-b .qb-type-info{padding-top:4vh}
body.quiz-b .qb-pulse{position:relative;width:120px;height:120px;margin:0 0 22px}
body.quiz-b .qb-pulse span{position:absolute;inset:0;border-radius:50%;border:1.5px solid var(--qb-accent);opacity:0;animation:qb-ring 3.6s ease-out infinite}
body.quiz-b .qb-pulse span:nth-child(2){animation-delay:1.2s}
body.quiz-b .qb-pulse span:nth-child(3){animation-delay:2.4s}
@keyframes qb-ring{0%{transform:scale(.45);opacity:.9}100%{transform:scale(1);opacity:0}}
body.quiz-b .qb-big{margin:0 0 16px;font-family:inherit;font-weight:700;font-size:clamp(27px,7.4vw,34px);line-height:1.18;letter-spacing:-.015em;color:inherit}
body.quiz-b .qb-copy{margin:0 0 14px;max-width:38ch;color:var(--qb-night-ink-2)}
body.quiz-b .qb-copy b{color:var(--qb-night-ink);font-weight:600}
body.quiz-b .qb-list{margin:22px 0 0;padding:0;list-style:none;border-top:1px solid var(--qb-night-line)}
body.quiz-b .qb-list li{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid var(--qb-night-line);color:var(--qb-night-ink)}
body.quiz-b .qb-num{flex:none;width:22px;color:var(--qb-accent);font-size:22px;line-height:1}

/* Sticky CTA */
body.quiz-b .qb-cta-wrap{position:fixed;left:0;right:0;bottom:var(--qb-banner-offset,0px);z-index:5;padding:14px 20px calc(16px + env(safe-area-inset-bottom));background:linear-gradient(to top,var(--qb-bg) 70%,transparent)}
body.quiz-b.quiz-b-night .qb-cta-wrap{background:linear-gradient(to top,var(--qb-night-bg) 70%,transparent)}
body.quiz-b .qb-cta-inner{max-width:440px;margin:0 auto}
body.quiz-b .qb-cta{display:block;width:100%;min-height:44px;border:0;border-radius:999px;padding:17px 22px;font:inherit;font-weight:700;font-size:17px;background:var(--qb-cta-bg);color:var(--qb-cta-ink);cursor:pointer;touch-action:manipulation;transition:opacity .15s,transform .1s}
body.quiz-b .qb-cta:active{transform:scale(.99)}
body.quiz-b .qb-cta:disabled{opacity:.35;cursor:not-allowed}
body.quiz-b.quiz-b-night .qb-cta{background:var(--qb-accent);color:var(--qb-night-cta-ink)}

/* Analysis screen: three bars, filled by quiz-b.js with requestAnimationFrame. */
body.quiz-b .qb-analysis{padding:18px 0 0;animation:qb-in .28s ease-out}
body.quiz-b .qb-analysis .qb-sub{margin-bottom:30px}
body.quiz-b .qb-load-row{margin:0 0 22px}
body.quiz-b .qb-load-top{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px;font-weight:600;font-size:15px}
body.quiz-b .qb-load-pct{flex:none;font-variant-numeric:tabular-nums;color:var(--qb-ink-2)}
body.quiz-b .qb-load-track{display:block;height:8px;border-radius:4px;background:var(--qb-line);overflow:hidden}
body.quiz-b .qb-load-fill{display:block;height:100%;width:0;border-radius:4px;background:var(--qb-accent)}

/* Pop-up: bottom sheet over a dimmed backdrop; no close button. */
body.quiz-b .qb-sheet-back{position:fixed;inset:0;z-index:10;display:grid;place-items:end center;padding:20px 20px calc(20px + env(safe-area-inset-bottom) + var(--qb-banner-offset,0px));background:rgba(8,21,31,.55);animation:qb-fade .2s ease-out}
@keyframes qb-fade{from{opacity:0}to{opacity:1}}
body.quiz-b .qb-sheet{width:100%;max-width:440px;padding:24px;border-radius:20px;background:var(--qb-surface);color:var(--qb-ink);box-shadow:0 12px 40px rgba(8,21,31,.25);animation:qb-up .24s ease-out}
@keyframes qb-up{from{transform:translateY(16px)}to{transform:none}}
body.quiz-b .qb-sheet-title{margin:0 0 16px;font-family:inherit;font-weight:700;font-size:21px;line-height:1.2;color:inherit}
body.quiz-b .qb-sheet-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
body.quiz-b .qb-sheet .qb-opt{justify-content:center;text-align:center;background:var(--qb-bg)}
body.quiz-b .qb-sheet .qb-opt[aria-pressed="true"]{background:var(--qb-sel-bg)}

@media (prefers-reduced-motion:reduce){
  body.quiz-b,body.quiz-b .qb-screen,body.quiz-b .qb-opt,body.quiz-b .qb-fill,body.quiz-b .qb-zone,body.quiz-b .qb-cta,
  body.quiz-b .qb-analysis,body.quiz-b .qb-sheet-back,body.quiz-b .qb-sheet{animation:none;transition:none}
  body.quiz-b .qb-pulse span{animation:none;opacity:.55}
  body.quiz-b .qb-pulse span:nth-child(1){transform:scale(.45)}
  body.quiz-b .qb-pulse span:nth-child(2){transform:scale(.72);opacity:.35}
  body.quiz-b .qb-pulse span:nth-child(3){opacity:.2}
}
