/* Brand tokens: brand-guidelines.md sections 2, 3 and 6. No colours outside this list. */
:root {
  --brand-green: #0f6e51;
  --brand-yellow: #ffdd00;
  --brand-white: #ffffff;
  --accent-green: #26ffbe;
  --gradient-light: #004d3f;
  --gradient-dark: #013329;
  --grey-1: #24282a;
  --grey-2: #474645;
  --grey-3: #7c7f80;
  --grey-4: #bcbcbc;
  --gradient: linear-gradient(135deg, var(--gradient-light) 0%, var(--gradient-dark) 100%);
  --font-brand: "Futura PT", "Futura", "Trebuchet MS", sans-serif;
  --font-ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-cond: "Futura PT Cond", "Futura PT", "Futura", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grey-1); color: var(--brand-white); font-family: var(--font-ui); overflow: hidden; }
button { font-family: var(--font-ui); }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 3px; }

/* ---------- App chrome (mirrors product UX: greys + white, brand green accent) ---------- */
#app { position: fixed; inset: 0; display: grid; grid-template-rows: 56px 1fr auto auto; grid-template-columns: minmax(0, 1fr); }
#topbar { display: flex; align-items: center; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--grey-2); background: var(--grey-1); }
#topbar .course { font-family: var(--font-brand); font-weight: 700; font-size: 18px; letter-spacing: .01em; white-space: nowrap; }
#topbar .where { color: var(--grey-4); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#progress { flex: 1; display: flex; gap: 4px; align-items: center; min-width: 120px; }
#progress .seg { flex: 1; height: 6px; border-radius: 3px; background: var(--grey-2); position: relative; overflow: hidden; cursor: pointer; border: 0; padding: 0; }
#progress .seg.check { flex: .35; }
#progress .seg i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--brand-green); }
#progress .seg.done i { transform: scaleX(1); }
#progress .seg.current { outline: 2px solid var(--grey-4); outline-offset: 1px; }
#progress .seg.current i { background: var(--accent-green); }

#viewport { position: relative; overflow: hidden; background: var(--grey-1); }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; background: var(--brand-white); color: var(--grey-1); }
.layer { position: absolute; inset: 0; }

#captions { min-height: 64px; padding: 10px 24px 6px; text-align: center; font-size: 20px; line-height: 1.4; color: var(--grey-3); background: var(--grey-1); }
#captions.off { visibility: hidden; min-height: 0; height: 0; padding: 0; }
#captions .w.said { color: var(--brand-white); }
#captions .w.now { color: var(--brand-white); box-shadow: inset 0 -3px 0 var(--brand-yellow); }

#controls { display: flex; align-items: center; gap: 10px; padding: 10px 16px 14px; background: var(--grey-1); border-top: 1px solid var(--grey-2); }
.cbtn { height: 44px; min-width: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--grey-2); background: transparent; color: var(--brand-white); font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cbtn:hover { border-color: var(--grey-4); }
.cbtn[disabled] { color: var(--grey-3); border-color: var(--grey-2); cursor: default; }
.cbtn svg { width: 20px; height: 20px; }
.cbtn.primary { background: var(--brand-green); border-color: var(--brand-green); font-weight: 700; }
.cbtn.primary:hover { border-color: var(--accent-green); }
.cbtn.pulse { box-shadow: 0 0 0 0 rgba(38, 255, 190, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(38, 255, 190, 0); } 100% { box-shadow: 0 0 0 0 rgba(38, 255, 190, 0); } }
.cbtn.on { border-color: var(--grey-4); }
#scrub { flex: 1; min-width: 60px; accent-color: var(--brand-green); height: 24px; }
#time { font-variant-numeric: tabular-nums; color: var(--grey-4); font-size: 14px; min-width: 88px; text-align: center; }
.spacer { flex: 1; }
@media (max-width: 720px) {
  #topbar .where, #progress { display: none; }
  #controls { gap: 6px; padding: 8px; }
  .cbtn { padding: 0 10px; }
  #time { display: none; }
  .cbtn .lbl { display: none; }
  #captions { font-size: 16px; }
}

/* ---------- Start screen ---------- */
#start { position: absolute; inset: 0; display: grid; grid-template-columns: 58% 42%; background: var(--brand-white); }
#start .l { background: var(--gradient); color: var(--brand-white); padding: 150px 110px 110px 130px; position: relative; display: flex; flex-direction: column; }
#start .kicker { font-family: var(--font-brand); font-weight: 700; color: var(--accent-green); font-size: 30px; letter-spacing: .08em; text-transform: uppercase; }
#start h1 { font-family: var(--font-brand); font-weight: 700; font-size: 128px; line-height: .98; margin: 34px 0 40px; letter-spacing: -.01em; }
#start p { font-size: 34px; line-height: 1.4; color: var(--brand-white); max-width: 820px; margin: 0; }
#start .go { margin-top: auto; align-self: flex-start; font-size: 34px; font-weight: 700; padding: 26px 56px; border-radius: 60px; border: 3px solid var(--accent-green); background: var(--brand-green); color: var(--brand-white); cursor: pointer; display: inline-flex; gap: 20px; align-items: center; }
#start .go:hover { background: var(--gradient-light); }
#start .go svg { width: 34px; height: 34px; }
#start .r { position: relative; }
#start .r img { position: absolute; left: 50%; top: 50%; width: 88%; transform: translate(-50%, -46%); }
#start .rule { position: absolute; left: 130px; bottom: 70px; width: 160px; height: 8px; background: var(--brand-yellow); }

/* ---------- Scene building blocks ---------- */
.abs { position: absolute; }
.brand { font-family: var(--font-brand); font-weight: 700; }
.cond { font-family: var(--font-cond); font-weight: 800; }
.grad { background: var(--gradient); }
.panel { position: absolute; top: 0; bottom: 0; left: 0; background: var(--gradient); overflow: hidden; }
.h1 { font-family: var(--font-brand); font-weight: 700; font-size: 104px; line-height: 1.02; letter-spacing: -.005em; }
.h2 { font-family: var(--font-brand); font-weight: 700; font-size: 72px; line-height: 1.06; }
.h3 { font-family: var(--font-brand); font-weight: 700; font-size: 48px; line-height: 1.12; }
.body { font-family: var(--font-ui); font-size: 34px; line-height: 1.35; }
.small { font-family: var(--font-ui); font-size: 26px; line-height: 1.35; }
.muted { color: var(--grey-3); }
.onDark { color: var(--brand-white); }
.onDark .muted, .onDark.muted { color: var(--grey-4); }
.w { display: inline-block; white-space: pre; }
.mk { background-image: linear-gradient(var(--brand-yellow), var(--brand-yellow)); background-repeat: no-repeat; background-position: 0 88%; background-size: 0% 38%; padding: 0 4px; margin: 0 -4px; }
.mkfull { background-position: 0 72%; }
.secnum { font-family: var(--font-cond); font-weight: 800; font-size: 360px; line-height: .8; color: transparent; -webkit-text-stroke: 3px var(--accent-green); }
.chip { display: inline-flex; align-items: center; gap: 16px; padding: 18px 30px; border-radius: 48px; font-size: 34px; font-family: var(--font-ui); background: var(--brand-white); color: var(--grey-1); border: 2px solid var(--grey-4); white-space: nowrap; }
.chip.dark { background: transparent; color: var(--brand-white); border-color: var(--accent-green); }
.chip .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-green); flex: none; }
.chip.dark .dot { background: var(--brand-yellow); }
.card { background: var(--brand-white); border: 2px solid var(--grey-4); border-radius: 24px; }
.row { display: flex; align-items: center; gap: 22px; }
.ico { width: 56px; height: 56px; flex: none; }
.ico.sm { width: 40px; height: 40px; }
.ill { position: absolute; pointer-events: none; user-select: none; }
.line { position: absolute; background: var(--accent-green); height: 6px; transform-origin: left; }
.stroke-mint { stroke: var(--accent-green); }

/* Email mock (product-like UI in greys) */
.mail { position: absolute; background: var(--brand-white); border: 2px solid var(--grey-4); border-radius: 20px; overflow: hidden; font-family: var(--font-ui); color: var(--grey-1); box-shadow: 0 30px 60px -30px rgba(36, 40, 42, .45); }
.mail .bar { height: 54px; background: var(--grey-1); display: flex; align-items: center; gap: 12px; padding: 0 22px; }
.mail .bar i { width: 14px; height: 14px; border-radius: 50%; background: var(--grey-2); display: block; }
.mail .hd { padding: 26px 36px 18px; border-bottom: 2px solid var(--grey-4); }
.mail .subj { font-size: 34px; font-weight: 700; line-height: 1.25; margin-bottom: 18px; }
.mail .from { font-size: 26px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.mail .from b { font-weight: 700; }
.mail .from span { color: var(--grey-2); }
.mail .bd { padding: 26px 36px 30px; font-size: 28px; line-height: 1.5; }
.mail .lnk { display: inline-block; margin: 14px 0 6px; padding: 14px 28px; border-radius: 10px; background: var(--brand-green); color: var(--brand-white); font-weight: 700; }
.mail .att { display: inline-flex; gap: 14px; align-items: center; margin-top: 16px; padding: 12px 20px; border: 2px solid var(--grey-4); border-radius: 12px; font-size: 24px; }
.mail .att small { color: var(--grey-3); font-size: 20px; }
.tip { position: absolute; background: var(--grey-1); color: var(--brand-white); font-family: var(--font-ui); font-size: 26px; padding: 14px 20px; border-radius: 10px; white-space: nowrap; }
.tip::after { content: ""; position: absolute; left: 36px; top: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: var(--grey-1); }
.badge { position: absolute; width: 54px; height: 54px; border-radius: 50%; background: var(--brand-yellow); color: var(--grey-1); font-family: var(--font-brand); font-weight: 700; font-size: 32px; display: flex; align-items: center; justify-content: center; }
.key { display: inline-flex; align-items: center; justify-content: center; min-width: 120px; height: 120px; padding: 0 34px; border-radius: 22px; background: var(--brand-white); color: var(--grey-1); border: 3px solid var(--grey-4); box-shadow: 0 10px 0 var(--grey-4); font-family: var(--font-ui); font-weight: 700; font-size: 38px; }
.plus { font-family: var(--font-brand); font-size: 60px; color: var(--grey-3); margin: 0 18px; }

/* ---------- Knowledge checks ---------- */
.kc { position: absolute; inset: 0; background: var(--brand-white); color: var(--grey-1); }
.kc .side { position: absolute; left: 0; top: 0; bottom: 0; width: 560px; background: var(--gradient); color: var(--brand-white); padding: 90px 64px; display: flex; flex-direction: column; }
.kc .side .tag { font-family: var(--font-brand); font-weight: 700; color: var(--accent-green); font-size: 26px; letter-spacing: .1em; text-transform: uppercase; }
.kc .side h2 { font-family: var(--font-brand); font-weight: 700; font-size: 76px; line-height: 1.02; margin: 26px 0 30px; }
.kc .side p { font-size: 30px; line-height: 1.42; margin: 0; }
.kc .side .oc { margin-top: auto; font-size: 22px; color: var(--grey-4); line-height: 1.4; }
.kc .side .oc b { color: var(--brand-white); font-weight: 700; display: block; font-size: 24px; }
.kc .main { position: absolute; left: 560px; right: 0; top: 0; bottom: 0; padding: 64px 90px 60px; display: flex; flex-direction: column; gap: 30px; }
.opt { display: flex; align-items: center; gap: 26px; width: 100%; text-align: left; background: var(--brand-white); color: var(--grey-1); border: 3px solid var(--grey-4); border-radius: 20px; padding: 28px 34px; font-size: 33px; line-height: 1.3; cursor: pointer; transition: border-color .15s, transform .15s; }
.opt:hover:not([disabled]) { border-color: var(--brand-green); transform: translateX(6px); }
.opt .lt { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--grey-4); display: flex; align-items: center; justify-content: center; font-family: var(--font-brand); font-weight: 700; font-size: 26px; color: var(--grey-3); }
.opt.sel { border-color: var(--brand-yellow); box-shadow: inset 0 0 0 2px var(--brand-yellow); }
.opt.right { border-color: var(--brand-green); background: var(--brand-white); box-shadow: inset 0 0 0 3px var(--brand-green); }
.opt.right .lt { background: var(--brand-green); border-color: var(--brand-green); color: var(--brand-white); }
.opt.wrong { border-color: var(--grey-3); color: var(--grey-3); }
.opt.wrong .lt { background: var(--grey-3); border-color: var(--grey-3); color: var(--brand-white); }
.opt[disabled] { cursor: default; }
.kbtn { font-size: 30px; font-weight: 700; padding: 22px 48px; border-radius: 50px; border: 0; background: var(--brand-green); color: var(--brand-white); cursor: pointer; }
.kbtn[disabled] { background: var(--grey-4); color: var(--brand-white); cursor: default; }
.kbtn.ghost { background: transparent; color: var(--brand-green); border: 3px solid var(--brand-green); }
.fb { position: absolute; left: 0; top: 0; bottom: 0; width: 560px; background: var(--grey-1); color: var(--brand-white); padding: 90px 60px 70px; display: flex; flex-direction: column; gap: 28px; transform: translateX(-105%); transition: transform .55s cubic-bezier(.2, 1.2, .4, 1); z-index: 5; }
.fb.show { transform: translateX(0); }
.fb .mark { flex: none; width: 110px; height: 110px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.fb .mark.ok { background: var(--accent-green); }
.fb .mark.no { background: var(--grey-2); }
.fb .mark svg { width: 64px; height: 64px; }
.fb h3 { font-family: var(--font-brand); font-weight: 700; font-size: 64px; margin: 0 0 18px; }
.fb p { font-size: 29px; line-height: 1.42; margin: 0; color: var(--brand-white); }
.fb .txt { flex: 1; }
.fb .kbtn { align-self: stretch; border: 3px solid var(--accent-green); }
.hot { cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: 0 -6px; outline: 3px dashed transparent; text-decoration: underline dotted var(--grey-3); text-underline-offset: 8px; text-decoration-thickness: 3px; transition: outline-color .15s, background-color .15s; }
.hot:hover { outline-color: var(--grey-4); }
.hot.sel { background: var(--brand-yellow); outline-color: var(--brand-yellow); text-decoration-color: transparent; }
.hot.res-ok { outline: 4px solid var(--brand-green); }
.hot.res-miss { outline: 4px dashed var(--brand-green); }
.hot.res-bad { outline: 4px solid var(--grey-3); background: transparent; text-decoration: line-through; text-decoration-color: var(--grey-3); }
.why { font-size: 24px; line-height: 1.35; color: var(--grey-2); margin-top: 10px; }
.bin { border: 3px dashed var(--grey-4); border-radius: 22px; background: var(--brand-white); display: flex; flex-direction: column; align-items: center; padding: 18px 14px; gap: 10px; transition: border-color .15s, background-color .15s; }
.bin.over, .bin.target { border-color: var(--brand-green); border-style: solid; }
.bin h4 { margin: 0; font-family: var(--font-brand); font-weight: 700; font-size: 34px; }
.item { background: var(--brand-white); border: 3px solid var(--grey-4); border-radius: 16px; padding: 18px 22px; font-size: 26px; line-height: 1.25; cursor: grab; user-select: none; touch-action: none; }
.item.picked { border-color: var(--brand-yellow); box-shadow: inset 0 0 0 2px var(--brand-yellow); }
.item.dragging { cursor: grabbing; box-shadow: 0 20px 40px -18px rgba(36, 40, 42, .5); z-index: 5; }
.item.ok { border-color: var(--brand-green); }
.item.bad { border-color: var(--grey-3); color: var(--grey-3); }

/* ---------- Results ---------- */
.res { position: absolute; inset: 0; display: grid; grid-template-columns: 760px 1fr; background: var(--brand-white); color: var(--grey-1); }
.res .l { background: var(--gradient); color: var(--brand-white); padding: 110px 80px; display: flex; flex-direction: column; }
.res .score { font-family: var(--font-cond); font-weight: 800; font-size: 300px; line-height: .85; color: var(--brand-white); }
.res .score small { font-size: 120px; color: var(--accent-green); }
.res .r { padding: 100px 90px; }
.res .oc { display: flex; align-items: center; gap: 26px; padding: 22px 0; border-bottom: 2px solid var(--grey-4); font-size: 30px; }
.res .oc .n { font-family: var(--font-brand); font-weight: 700; width: 120px; color: var(--grey-3); }
