/* =====================================================================
   SFZ BRAND LAB — Clean minimal UI
   Palette: SFZ Navy / Purple / Cyan / White only (screen approximations,
   see js/brand.js). Neutrals are Navy at low opacity on white.
   Red #EE242C (from the manual's incorrect-usage page) marks errors only.
   No gradients, patterns, glass or decorative shapes.
   ===================================================================== */
:root {
  --navy: #111227;
  --navy-hover: #26284a;
  --purple: #662E8C;
  --cyan: #19C2F2;
  --white: #FFFFFF;
  --red: #EE242C;

  --bg: #F7F7F9;            /* page: navy 3% on white */
  --surface: #FFFFFF;       /* cards */
  --subtle: #F1F1F4;        /* inputs, tracks, secondary fills */
  --line: #E3E3E8;          /* hairline borders */
  --line-strong: #CFCFD7;
  --ink: #111227;           /* primary text = SFZ Navy */
  --ink-2: #4A4B5E;         /* secondary text */
  --ink-3: #7B7C8C;         /* tertiary text */
  --ok-bg: #E8F8FE;         /* cyan 10% */
  --ok-ink: #0B6E8C;        /* darkened cyan for text on light bg */
  --bad-bg: #FDECEC;

  --r: 8px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(17, 18, 39, .06);
  --t: .16s ease;
  --font: 'Cairo', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --gap: 24px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
a { color: var(--purple); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.3; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(26px, 2.4vw, 34px); }
h2 { font-size: clamp(22px, 1.9vw, 28px); }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; padding: 0 clamp(16px, 3vw, 48px); background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-brand { display: flex; align-items: center; gap: 16px; color: var(--ink); text-decoration: none; }
.topbar-logo { width: 196px; min-width: 186px; flex: none; height: auto; display: block; }   /* ≥ 182 px digital minimum (manual p.9) */
.topbar-divider { width: 1px; height: 28px; background: var(--line-strong); }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.demo-ribbon { background: var(--purple); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 6px 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background var(--t), border-color var(--t), color var(--t); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--navy-hover); }
.btn-ghost, .btn-ghost-dark { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not([disabled]), .btn-ghost-dark:hover:not([disabled]) { border-color: var(--ink); }
.btn-link { background: none; border: 0; color: var(--purple); padding: 6px 4px; min-height: 0; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-ghost { background: var(--surface); border-color: #F3B7B9; color: #C4151C; }
.btn-danger-ghost:hover { border-color: var(--red); }
.btn-lg { min-height: 52px; padding: 12px 28px; font-size: 16px; }
.btn-sm, .btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.arr { display: inline-block; }
[dir=rtl] .arr { transform: scaleX(-1); }

/* ---------- chips / status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 4px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); background: var(--subtle); white-space: nowrap; vertical-align: middle; line-height: 1.7; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-mode::before { display: none; }
.chip-mode { background: var(--surface); }
.chip-mode.is-demo { background: var(--purple); border-color: var(--purple); color: #fff; }
.st-waiting, .rs-open { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.st-waiting::before, .rs-open::before { background: var(--cyan); }
.st-playing, .rs-running { color: var(--ok-ink); background: var(--ok-bg); border-color: #BDEBFA; }
.st-playing::before, .rs-running::before { background: var(--cyan); }
.st-submitted { color: #fff; background: var(--navy); border-color: var(--navy); }
.st-submitted::before { background: var(--cyan); }
.st-timeout, .rs-finished { color: var(--purple); background: #F3EDF7; border-color: #DCCBE8; }
.st-queued { color: var(--ink-3); border-style: dashed; background: var(--surface); }
.st-archived { opacity: .6; }
.tag-sample { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: #F3EDF7; color: var(--purple); vertical-align: middle; line-height: 1.7; }

/* ---------- layout ---------- */
.app { outline: none; padding: clamp(24px, 3.5vw, 56px) clamp(16px, 3vw, 48px) 120px; max-width: 1440px; margin: 0 auto; }
.screen { animation: fadeIn .2s ease; }
.screen.center { min-height: calc(100vh - 260px); display: grid; place-items: center; }
@keyframes fadeIn { from { opacity: 0; } }
.reveal { animation: fadeIn .2s ease; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--purple); margin-bottom: 8px; }
[lang=ar] .kicker { letter-spacing: 0; font-size: 14px; }
.lead { font-size: clamp(17px, 1.3vw, 19px); color: var(--ink-2); max-width: 60ch; }
.lead.sm { font-size: 16px; }
.muted { color: var(--ink-2); }
.fine { font-size: 13px; color: var(--ink-3); margin: 14px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 2.6vw, 36px); box-shadow: var(--shadow); }
.card-narrow { width: min(500px, 100%); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.panel h3 { font-size: 16px; margin-bottom: 16px; }
.note { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--subtle); color: var(--ink-2); font-size: 13.5px; }
.warn-line { color: var(--ink-2); font-weight: 600; margin: -8px 0 20px; }

/* ---------- forms ---------- */
.field { display: block; margin: 20px 0 6px; }
.field span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input { width: 100%; font-size: 17px; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); transition: border-color var(--t), box-shadow var(--t); }
.field input:hover { border-color: var(--ink-3); }
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(25, 194, 242, .35); }
.field input[aria-invalid=true] { border-color: var(--red); }
.field-err { min-height: 22px; color: #C4151C; font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 20px; font-weight: 600; color: var(--ink-2); }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.select { font-size: 14px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); min-height: 44px; }

/* loader — functional "waiting" indicator */
.loader { display: block; width: 120px; height: 3px; border-radius: 2px; background: var(--subtle); position: relative; overflow: hidden; margin: 0 auto 24px; }
.loader::after { content: ''; position: absolute; inset-block: 0; width: 40%; background: var(--navy); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { left: -40%; } to { left: 100%; } }
.network { display: block; width: 100%; height: 100%; }

/* ---------- welcome ---------- */
.welcome { min-height: calc(100vh - 230px); display: grid; align-items: center; }
.wel-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.wel-title { font-size: clamp(40px, 5vw, 68px); font-weight: 700; line-height: 1.08; margin-bottom: 20px; letter-spacing: -.01em; }
.wel-stats { display: flex; margin: 32px 0 36px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); width: fit-content; max-width: 100%; }
.wel-stats div { padding: 14px 28px; }
.wel-stats div + div { border-inline-start: 1px solid var(--line); }
.wel-stats b { display: block; font-size: 28px; line-height: 1.15; font-weight: 700; }
.wel-stats span { font-size: 13px; color: var(--ink-3); }
.wel-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.wel-foot { margin-top: 28px; font-size: 13.5px; color: var(--ink-3); }
.wel-foot a { font-weight: 600; }
.wel-visual { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 28px 12px; }
.wel-list-title { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; }
.wel-chs { list-style: none; margin: 0; padding: 0; }
.wel-ch { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.wel-ch-n { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--subtle); color: var(--ink); }
.wel-ch b { display: block; font-size: 16px; font-weight: 600; }
.wel-ch small { color: var(--ink-3); font-size: 14px; }

/* ---------- lobby ---------- */
.lobby-card { text-align: center; width: min(560px, 100%); padding: 48px clamp(20px, 4vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.lobby-card .status-line { justify-content: center; }
.lobby-card .lead { margin-inline: auto; }
.lobby-count { display: inline-flex; align-items: baseline; gap: 10px; padding: 10px 20px; border-radius: var(--r-sm); background: var(--subtle); margin: 8px 0 20px; }
.lobby-count b { font-size: 26px; line-height: 1; }
.lobby-count span { color: var(--ink-2); font-size: 14px; }
.tip { color: var(--ink-2); font-size: 14.5px; border-top: 1px solid var(--line); padding-top: 20px; }
.starting-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(247, 247, 249, .96); animation: fadeIn .15s; }
.starting-overlay div { display: grid; justify-items: center; font-size: 22px; font-weight: 600; }

/* ---------- play ---------- */
.play-head { display: flex; gap: 16px; align-items: stretch; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); flex: 1 1 560px; overflow: hidden; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--ink-3); min-width: 0; border-bottom: 3px solid transparent; transition: border-color var(--t), color var(--t); }
.stepper li + li { border-inline-start: 1px solid var(--line); }
.stepper li.current { color: var(--ink); border-bottom-color: var(--navy); }
.stepper li.done { color: var(--ink-2); }
.st-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid var(--line-strong); }
.stepper li.current .st-n { background: var(--navy); color: #fff; border-color: var(--navy); }
.stepper li.done .st-n { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.st-t { display: grid; line-height: 1.3; min-width: 0; }
.st-t b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-t small { font-size: 12px; }
.play-meters { display: flex; gap: 12px; }
.meter { padding: 10px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; align-content: center; min-width: 136px; position: relative; overflow: hidden; }
.meter span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.meter b { font-size: 26px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }
.meter b em { font-style: normal; }
.meter b small { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.time-bar { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--subtle); }
.time-bar i { display: block; height: 100%; background: var(--navy); transition: width .25s linear; }
[dir=rtl] .time-bar i { margin-inline-start: auto; }
.meter-time.warn { border-color: var(--purple); }
.meter-time.warn b { color: var(--purple); }
.meter-time.warn .time-bar i { background: var(--purple); }

.ch-intro, .ch-done { max-width: 640px; margin: 4vh auto; text-align: center; padding: 48px clamp(20px, 4vw, 48px); }
.ch-intro .lead, .ch-done .lead { margin-inline: auto; }
.ch-intro .btn, .ch-done .btn { margin-top: 8px; }
.done-ring { --p: 0; width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 20px; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 88%, transparent 89%), conic-gradient(var(--navy) calc(var(--p) * 1%), var(--subtle) 0); }
.done-ring b { font-size: 40px; line-height: 1; font-weight: 700; }
.done-ring small { color: var(--ink-3); }

.item-card { padding: clamp(20px, 2.4vw, 36px); }
.item-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.item-top .kicker { margin: 0; }
.dots { display: flex; gap: 6px; }
.dots i { width: 24px; height: 4px; border-radius: 2px; background: var(--subtle); }
.dots i.cur { background: var(--navy); }
.dots i.ok { background: var(--cyan); }
.dots i.bad { background: var(--red); }
.item-prompt { font-size: clamp(19px, 1.6vw, 23px); margin-bottom: 24px; font-weight: 600; }
.item-preview { margin-bottom: 20px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); max-width: 760px; }
.item-actions { margin-top: 20px; }
.item-nav { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.item-nav:empty { display: none; }

/* options */
.opts { display: grid; gap: 16px; }
.opts-cards.n4 { grid-template-columns: repeat(4, 1fr); }
.opts-cards.n3 { grid-template-columns: repeat(3, 1fr); }
.opts-list { grid-template-columns: 1fr 1fr; max-width: 900px; gap: 12px; }
.opt { position: relative; display: grid; gap: 10px; text-align: start; padding: 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; transition: border-color var(--t), background var(--t), opacity var(--t); }
.opts-list .opt { grid-template-columns: auto 1fr; align-items: center; padding: 14px 16px; }
.opt:hover:not([disabled]) { border-color: var(--ink); }
.opt.is-selected { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.opt.is-correct { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); background: var(--ok-bg); }
.opt.is-wrong { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: var(--bad-bg); }
.opt.is-dim { opacity: .5; }
.opt[disabled] { cursor: default; }
.opt-letter { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--subtle); color: var(--ink-2); }
.opts-cards .opt-letter { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; }
.opt.is-selected .opt-letter { background: var(--navy); color: #fff; }
.opt-visual { display: block; border-radius: var(--r-sm); overflow: hidden; background: var(--bg); }
.opt-label { font-weight: 600; font-size: 16px; line-height: 1.45; }
.opt-mark { position: absolute; top: 10px; inset-inline-end: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; z-index: 3; }
.opts-list .opt-mark { top: 50%; margin-top: -13px; }
.opt-mark.ok { background: var(--cyan); color: var(--navy); }
.opt-mark.bad { background: var(--red); color: #fff; }

/* feedback */
.feedback { border-radius: var(--r); padding: 16px 18px; border: 1px solid; border-inline-start-width: 4px; max-width: 900px; animation: fadeIn .2s; }
.feedback.ok { border-color: #BDEBFA; border-inline-start-color: var(--cyan); background: var(--ok-bg); }
.feedback.bad { border-color: #F6C9CA; border-inline-start-color: var(--red); background: var(--bad-bg); }
.fb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 16px; }
.fb-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.ok .fb-icon { background: var(--cyan); color: var(--navy); }
.bad .fb-icon { background: var(--red); color: #fff; }
.fb-pts { margin-inline-start: auto; font-weight: 700; color: var(--ink-2); }
.feedback p { margin: 0 0 6px; color: var(--ink-2); }
.fb-src { font-size: 13px; color: var(--ink-3) !important; }
.fb-src span { font-weight: 600; }

/* ---------- mock-ups inside options (challenge content) ---------- */
.mock { position: relative; width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mock-wide { aspect-ratio: 3 / 1; justify-content: space-between; padding: 0 5%; gap: 4%; }
.mock-logo { display: block; }
.mock-copy { display: grid; gap: 8px; flex: 1; max-width: 46%; }
.mock-copy b { color: var(--navy); font-size: clamp(14px, 1.6vw, 22px); }
.mock-copy span { display: block; height: 8px; border-radius: 4px; background: #E6E6EB; }
.mock-copy span.short { width: 60%; }
.mock-copy.narrow { max-width: 26%; }
.lv { position: relative; width: 100%; display: grid; place-items: center; }
.lv-img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.lv-rel { aspect-ratio: auto !important; display: block; }
.lv-rel-word { width: 66%; display: block; margin-top: 30%; }
.lv-rel-sym { position: absolute; top: 0; right: 4%; width: 24%; }
.lv-font { display: flex !important; align-items: center; gap: 4%; }
.lv-font-text { flex: 1; display: grid; text-align: right; color: var(--navy); line-height: 1.15; }
.lv-font-text .ar { font-size: clamp(8px, .8vw, 12px); }
.lv-font-text .en { font-size: clamp(12px, 1.35vw, 21px); font-weight: 400; }
.lv-font-text .tg { font-size: clamp(6px, .6vw, 9px); color: var(--cyan); }
.lv-font-sym { width: 27%; }
.lv-outline { display: flex !important; align-items: center; gap: 4%; }
.lv-outline-word { width: 66%; }
.lv-outline-sym { width: 27%; }
.sw-row { display: flex; gap: 8px; width: 80%; }
.sw { flex: 1; aspect-ratio: 1; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(17, 18, 39, .15); }
.mb { width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: space-between; padding: 6%; gap: 6%; }
.mb-text { display: grid; gap: 8px; flex: 1; justify-items: start; }
.mb-text b { font-size: clamp(12px, 1.25vw, 18px); line-height: 1.2; }
.mb-text i { display: block; width: 40px; height: 4px; border-radius: 2px; }
.mb-btn { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 4px; }
.mb-logo { width: 46%; }
.cs { display: block; }
.cs-logo { position: absolute; }
.cs-copy { position: absolute; left: 12%; right: 12%; bottom: 10%; height: 18%; background: repeating-linear-gradient(#E6E6EB 0 6px, transparent 6px 14px); }
.cs-head { position: absolute; font-weight: 700; color: var(--navy); font-size: clamp(12px, 1.4vw, 19px); background: #fff; line-height: 1.1; width: 46%; }
.cs-photo { position: absolute; right: -4%; bottom: -6%; width: 52%; height: 60%; background-size: cover; background-position: center; border-radius: 4px; }
.mock-swatch-label { color: var(--navy); font-weight: 700; font-size: 20px; }
.minsize .ms-wrap { display: grid; gap: 6px; }
.minsize .ms-logo { width: 150px; }
.ms-ruler { width: 150px; border-top: 2px solid var(--navy); position: relative; text-align: center; font-size: 12px; font-weight: 700; color: var(--navy); padding-top: 2px; }
.ms-ruler::before, .ms-ruler::after { content: ''; position: absolute; top: -7px; width: 2px; height: 12px; background: var(--navy); }
.ms-ruler::before { left: 0; } .ms-ruler::after { right: 0; }

/* ---------- Logo Lab stage ---------- */
.stage { position: relative; width: 100%; max-width: 1000px; overflow: hidden; border-radius: var(--r); background: #fff; border: 1px solid var(--line-strong); touch-action: none; }
.stage-inner { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.ll-banner { position: absolute; inset: 0; background: #fff; }
.ll-zone { position: absolute; border: 2px dashed var(--cyan); border-radius: 4px; }
.ll-zone span { position: absolute; top: -32px; left: 0; font-size: 18px; font-weight: 600; color: var(--ok-ink); }
.ll-min { position: absolute; height: 18px; border-top: 3px solid var(--purple); }
.ll-min::before, .ll-min::after { content: ''; position: absolute; top: -10px; width: 3px; height: 18px; background: var(--purple); }
.ll-min::before { left: 0; } .ll-min::after { right: 0; }
.ll-min span { position: absolute; left: 50%; transform: translateX(-50%); top: 2px; font-size: 16px; font-weight: 700; color: var(--purple); }
.ll-copy { position: absolute; width: 420px; display: grid; gap: 14px; }
.ll-copy b { font-size: 40px; color: var(--navy); line-height: 1.1; }
.ll-copy span { display: block; height: 14px; border-radius: 7px; background: #E6E6EB; }
.ll-copy span.short { width: 60%; }
.ll-logo { position: absolute; outline: 2px solid var(--line-strong); outline-offset: 4px; transition: outline-color var(--t); }
.ll-logo img { width: 100%; height: 100%; display: block; user-select: none; pointer-events: none; }
.ll-logo.is-ok { outline-color: var(--cyan); }
.ll-logo.locked { outline-style: dotted; }
.ll-logo.locked .ll-h { display: none; }
.ll-h { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); border: 4px solid #fff; box-shadow: 0 0 0 1px var(--navy); touch-action: none; z-index: 2; }
.ll-h:hover { background: var(--cyan); }
.ll-h-br { right: -18px; bottom: -18px; cursor: nwse-resize; }
.ll-h-r { right: -18px; top: 50%; margin-top: -14px; cursor: ew-resize; }
.ll-h-b { bottom: -18px; left: 50%; margin-left: -14px; cursor: ns-resize; }
.ll-h::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
.ll-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin-top: 18px; }
.ll-slider { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.ll-slider input { width: 220px; accent-color: var(--navy); }
.readout { font-size: 15px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-variant-numeric: tabular-nums; }
.readout b { color: var(--ink); }
.rd-flags { display: inline-flex; gap: 8px; }
.rd-flags i { font-style: normal; font-weight: 600; font-size: 13px; padding: 1px 8px; border-radius: 4px; }
.rd-flags i.ok { background: var(--ok-bg); color: var(--ok-ink); }
.rd-flags i.bad { background: var(--bad-bg); color: #C4151C; }
.rd-meter { display: inline-block; width: 120px; height: 6px; border-radius: 3px; background: var(--subtle); overflow: hidden; }
.rd-meter i { display: block; height: 100%; background: var(--purple); transition: width .15s; }
.rd-meter i.ok { background: var(--cyan); }
.lock-chip { font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--subtle); padding: 3px 10px; border-radius: 4px; }

/* ---------- Poster challenge ---------- */
.item-poster { padding: clamp(16px, 2vw, 28px); }
.pz { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
.pz-side { display: grid; gap: 16px; }
.pz-panel { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.pz-panel h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.pz-brief { margin: 0; padding-inline-start: 18px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 6px; }
.pz-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pz-sw { width: 36px; height: 36px; border-radius: var(--r-sm); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; transition: box-shadow var(--t); }
.pz-sw:hover { box-shadow: 0 0 0 1px var(--ink); }
.pz-sw.is-on { box-shadow: 0 0 0 2px var(--navy); }
.pz-sw.sm { width: 26px; height: 26px; border-radius: 4px; }
.pz-tray { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tray-item { display: grid; gap: 6px; justify-items: center; padding: 10px 8px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); cursor: grab; font-size: 12.5px; font-weight: 600; color: var(--ink-2); touch-action: none; user-select: none; transition: border-color var(--t); }
.tray-item:hover { border-color: var(--ink); }
.tray-item img { height: 26px; width: auto; }
.tray-item .icon { width: 30px; height: 30px; }
.tray-item .network { width: 70px; height: 30px; }
.tt-photo { width: 56px; height: 30px; border-radius: 3px; background-size: cover; background-position: center; }
.tt-band { width: 56px; height: 14px; border-radius: 2px; background: var(--purple); }
.tt-text { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 30px; }
.tray-ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%); border-color: var(--navy); opacity: .92; }
.pz-main { min-width: 0; }
.pz-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 48px; padding: 6px 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); margin-bottom: 12px; }
.pz-hint { font-size: 13px; color: var(--ink-3); padding: 0 6px; }
.pz-sel-name { font-weight: 700; font-size: 13px; padding: 0 8px; color: var(--ink); }
.tbtn { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color var(--t); }
.tbtn:hover { border-color: var(--ink); }
.tbtn[data-danger] { color: #C4151C; border-color: #F3B7B9; }
.tbtn[data-danger]:hover { border-color: var(--red); }
.tgroup { display: inline-flex; gap: 5px; padding: 0 6px; border-inline: 1px solid var(--line); margin-inline: 2px; }
.poster-wrap { width: 100%; display: flex; justify-content: center; background: var(--subtle); border-radius: var(--r); padding: 24px; touch-action: none; }
.poster-scale { position: relative; flex: none; box-shadow: 0 0 0 1px var(--line-strong); }
.poster-inner { position: absolute; top: 0; left: 0; transform-origin: 0 0; overflow: hidden; user-select: none; }
.pe { position: absolute; cursor: grab; touch-action: none; }
.pe:active { cursor: grabbing; }
.pe.is-sel { outline: 2px solid var(--cyan); outline-offset: 3px; }
.pz.is-locked .pe { cursor: default; }
.pe-h { position: absolute; right: -13px; bottom: -13px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); border: 4px solid #fff; box-shadow: 0 0 0 1px var(--navy); cursor: nwse-resize; z-index: 5; }
.pe-photo { width: 100%; height: 100%; background-size: cover; background-position: center; pointer-events: none; }
.pe-band { width: 100%; height: 100%; }
.pe-type-graphic .network, .pe-type-icon .icon { width: 100%; height: 100%; pointer-events: none; }
/* deliberately off-brand element the participant must remove */
.pe-sticker { width: 100%; height: 100%; display: grid; place-items: center; background: #F5D90A; border: 5px dashed #E94E9B; border-radius: 50%; font-family: 'Comic Sans MS', 'Comic Sans', cursive; font-weight: 900; font-size: 26px; color: #C8102E; text-align: center; line-height: 1; pointer-events: none; }
.pe-text { font-weight: 400; line-height: 1.25; pointer-events: none; }
.pe-headline { font-weight: 700; line-height: 1.15; }
.pe-cta { display: inline-block; padding: .55em 1.2em; border-radius: 4px; font-weight: 700; pointer-events: none; }
.pe img { pointer-events: none; display: block; }
.snap-guide { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; border-left: 1px dashed var(--cyan); z-index: 999; pointer-events: none; }
.pz-actions { display: flex; justify-content: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.poster-static { position: relative; overflow: hidden; border-radius: 2px; box-shadow: 0 0 0 1px var(--line-strong); flex: none; }
.poster-static .poster-inner { position: relative; }

.rubric { border-radius: var(--r); border: 1px solid var(--line); padding: 16px 18px; background: var(--surface); }
.rubric-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rubric-score { font-size: 30px; font-weight: 700; line-height: 1; }
.rubric-score small { font-size: 14px; color: var(--ink-3); }
.rubric ul { list-style: none; margin: 0; padding: 0; }
.rubric li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; color: var(--ink-2); padding: 7px 0; border-top: 1px solid var(--line); }
.rubric li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rb-i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.rubric li.ok .rb-i { background: var(--cyan); color: var(--navy); }
.rubric li.bad .rb-i { background: var(--red); color: #fff; }
.rubric-note { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; }

/* ---------- result ---------- */
.res-grid { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: var(--gap); align-items: start; }
.res-hero { text-align: center; }
.donut { --p: 0; width: 200px; aspect-ratio: 1; border-radius: 50%; margin: 20px auto 24px; display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--surface) 88%, transparent 89%), conic-gradient(var(--navy) calc(var(--p) * 1%), var(--subtle) 0); }
.donut div { display: grid; line-height: 1.1; }
.donut b { font-size: 50px; font-weight: 700; }
.donut small { color: var(--ink-3); font-size: 15px; }
.donut span { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.res-facts { display: grid; grid-template-columns: 1fr 1fr; text-align: start; border: 1px solid var(--line); border-radius: var(--r); }
.res-facts div { padding: 12px 16px; display: grid; gap: 2px; }
.res-facts div:nth-child(even) { border-inline-start: 1px solid var(--line); }
.res-facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
.res-facts b { font-size: 22px; line-height: 1.25; }
.res-facts b.sm { font-size: 16px; }
.res-facts span { font-size: 12.5px; color: var(--ink-3); }
.res-detail h3 { margin-top: 8px; }
.rbars { display: grid; gap: 12px; margin-bottom: 16px; }
.rbar { display: grid; grid-template-columns: 150px 1fr 44px; gap: 14px; align-items: center; font-size: 14px; font-weight: 600; }
.rbar > i { display: block; height: 8px; border-radius: 4px; background: var(--subtle); overflow: hidden; }
.rbar > i > i { display: block; height: 100%; width: var(--w); border-radius: 4px; background: var(--navy); animation: grow .5s ease both; }
.rbar b { text-align: end; font-variant-numeric: tabular-nums; }
@keyframes grow { from { width: 0; } }
.res-poster { display: flex; gap: 20px; align-items: flex-start; margin: 12px 0 20px; }
.res-poster .rubric { flex: 1; }

/* ---------- supervisor ---------- */
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.adm-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.adm-head .lead { margin: 0; }
.adm-clock { padding: 12px 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: center; min-width: 170px; }
.adm-clock span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.adm-clock b { font-size: 40px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-3); direction: ltr; display: inline-block; }
.adm-clock.running { border-color: var(--navy); }
.adm-clock.running b { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.kpi { padding: 18px 22px; }
.kpi + .kpi { border-inline-start: 1px solid var(--line); }
.kpi span { display: block; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.kpi b { font-size: 30px; line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi b.sm { font-size: 18px; line-height: 2.1; }
.kpi b small { font-size: 15px; color: var(--ink-3); }
.adm-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.adm-grid > *, .sum-grid > *, .res-grid > *, .pz > * { min-width: 0; }
.adm-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--gap); align-items: start; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: start; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--bg); }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .end { text-align: end; white-space: nowrap; }
.tbl td.empty { color: var(--ink-2); text-align: center; padding: 32px; }
.mini-prog { display: inline-flex; gap: 3px; }
.mini-prog i { width: 16px; height: 4px; border-radius: 2px; background: var(--subtle); }
.mini-prog i.on { background: var(--navy); }
.qlist { list-style: none; margin: 0; padding: 0; }
.qlist li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qlist li span { margin-inline-start: auto; font-size: 12.5px; color: var(--ink-3); }
.muted.light { color: var(--ink-3); }

/* ---------- summary ---------- */
.sum-tools { display: flex; gap: 10px; align-items: center; }
.live-dot { color: var(--ok-ink); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; margin: 0; }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.podium-panel { display: grid; align-items: end; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; min-height: 240px; padding-top: 8px; }
.pod { display: grid; justify-items: center; gap: 4px; width: 30%; max-width: 170px; }
.pod-name { font-weight: 600; text-align: center; line-height: 1.3; font-size: 14.5px; }
.pod-score { font-size: 22px; font-weight: 700; }
.pod-block { width: 100%; border-radius: 4px 4px 0 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; background: var(--subtle); color: var(--ink-2); border: 1px solid var(--line); border-bottom: 0; }
.pod-1 .pod-block { height: 140px; background: var(--navy); border-color: var(--navy); color: #fff; }
.pod-2 .pod-block { height: 100px; }
.pod-3 .pod-block { height: 70px; }
.rank .rk { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--subtle); font-weight: 700; font-size: 13px; }
.rank tr.top:nth-child(1) .rk { background: var(--navy); color: #fff; }

/* ---------- modal / toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(17, 18, 39, .45); display: grid; place-items: center; padding: 16px; animation: fadeIn .15s; }
.modal { background: var(--surface); border-radius: var(--r); padding: 28px; width: min(460px, 100%); box-shadow: 0 8px 24px rgba(17, 18, 39, .16); max-height: 90vh; overflow: auto; }
.modal-wide { width: min(760px, 100%); }
.modal p { color: var(--ink-2); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.timeup { text-align: center; }
.timeup .modal-actions { justify-content: center; }
.timeup-clock { font-size: 48px; font-weight: 700; color: var(--purple); font-variant-numeric: tabular-nums; }
.toast-host { position: fixed; z-index: 90; bottom: 96px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(560px, 92vw); }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: var(--r-sm); font-weight: 600; font-size: 14.5px; opacity: 0; transition: opacity var(--t); border-inline-start: 4px solid var(--purple); }
.toast.ok { border-inline-start-color: var(--cyan); }
.toast.in { opacity: 1; }

/* ---------- demo presenter dock ---------- */
.demo-dock { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 70; width: min(1240px, calc(100vw - 24px)); background: var(--navy); border-radius: var(--r); padding: 6px 8px; }
.dock-inner { display: flex; align-items: center; gap: 8px; overflow-x: auto; }
.dock-title { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); white-space: nowrap; padding: 0 8px; }
.demo-dock ol { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.demo-dock li { display: flex; align-items: center; gap: 4px; }
.dock-step { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; transition: background var(--t), color var(--t); }
.dock-step i { font-style: normal; font-size: 11px; opacity: .7; }
.dock-step:hover { background: rgba(255,255,255,.1); color: #fff; }
.dock-step.on { background: #fff; color: var(--navy); }
.dock-step.reset { color: #F7A9AC; }
.dock-jump { display: inline-flex; gap: 2px; }
.dock-jump button { width: 24px; height: 24px; border-radius: 4px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.dock-jump button:hover { background: var(--cyan); color: var(--navy); border-color: var(--cyan); }
.dock-toggle { position: absolute; top: -28px; inset-inline-end: 12px; border: 0; background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: var(--r-sm) var(--r-sm) 0 0; cursor: pointer; }
.demo-dock.closed { padding: 0; background: transparent; }
.demo-dock.closed .dock-inner { display: none; }
.demo-dock.closed .dock-toggle { top: -22px; border-radius: var(--r-sm); }

/* ---------- large presentation screens ---------- */
@media (min-width: 1800px) {
  body { font-size: 17px; }
  .app { max-width: 1640px; }
  .opt-label { font-size: 17px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .opts-cards.n4 { grid-template-columns: repeat(2, 1fr); }
  .pz { grid-template-columns: 250px 1fr; }
  .stepper .st-t small { display: none; }
}
@media (max-width: 980px) {
  .wel-grid, .res-grid, .adm-grid, .sum-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-inline-start: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pz { grid-template-columns: 1fr; }
  .pz-main { order: -1; }
  .pz-side { grid-template-columns: 1fr 1fr; }
  .pz-side .pz-panel:first-child { grid-column: 1 / -1; }
  .pz-tray { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar { height: 64px; }
  .topbar-logo { width: 186px; }
  .topbar-divider, .topbar-title { display: none; }
  .adm-actions .btn { white-space: normal; }
  .tbl { font-size: 13px; }
  .opts-list { grid-template-columns: 1fr; }
  .opts-cards.n3 { grid-template-columns: 1fr 1fr; }
  .stepper .st-t { display: none; }
  .stepper li { justify-content: center; padding: 10px; }
  .stepper li.current .st-t { display: grid; }
  .play-meters { width: 100%; }
  .meter { flex: 1; min-width: 0; }
  .pz-side { grid-template-columns: 1fr; }
  .pz-tray { grid-template-columns: repeat(3, 1fr); }
  .res-poster { flex-direction: column; }
  .rbar { grid-template-columns: 100px 1fr 36px; }
  .ll-slider input { width: 150px; }
  .wel-stats div { padding: 12px 18px; }
  .kpi b { font-size: 24px; }
  .adm-clock b { font-size: 32px; }
  .dock-title { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* home page: approved kicker shown as written (not upper-cased) + caption under the entry button */
.wel-kicker { text-transform: none; letter-spacing: 0; font-size: 15px; }
.wel-caption { margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }
.wel-note { margin: 24px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--subtle); color: var(--ink-2); font-size: 14.5px; max-width: 60ch; }
