body { font-family: var(--display); font-size: 15.5px; background: var(--surface); }
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- welcome: split screen ---------- */
.welcome { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(380px, 44%) 1fr; }
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; padding: 44px 56px 40px;
  color: #fff;
  background:
    radial-gradient(700px 480px at 110% 0%, rgba(84, 132, 255, 0.35), transparent 60%),
    radial-gradient(600px 520px at -10% 110%, rgba(30, 190, 210, 0.22), transparent 60%),
    linear-gradient(160deg, #2b3a96 0%, #263486 40%, #141c55 100%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; right: -150px; bottom: -130px; width: 520px; height: 516px;
  background: url("/assets/symbol-white.png") center / contain no-repeat; opacity: 0.07;
}
.hero .logo { height: 40px; align-self: flex-start; }
.hero-mid { margin: auto 0; padding: 48px 0; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18); font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; }
.hero-tag i { width: 7px; height: 7px; border-radius: 50%; background: #7ee0c3; box-shadow: 0 0 0 4px rgba(126, 224, 195, 0.18); }
.hero h2 { margin-top: 22px; font-size: clamp(40px, 4.6vw, 62px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; }
.hero h2 span { display: block; color: rgba(255, 255, 255, 0.55); }
.hero p { margin-top: 20px; max-width: 420px; color: rgba(255, 255, 255, 0.78); font-size: 17px; line-height: 1.6; }
.hero-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 40px; padding-top: 26px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.hero-facts b { display: block; font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-facts span { display: block; margin-top: 8px; color: rgba(255, 255, 255, 0.66); font-size: 14px; }
.hero-foot { margin-top: 28px; color: rgba(255, 255, 255, 0.5); font-size: 13px; letter-spacing: 0.02em; }

.intro { display: flex; align-items: center; justify-content: center; padding: 56px 48px; background: var(--surface); }
.intro-in { width: min(560px, 100%); animation: rise 0.5s var(--ease); }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 14px; }
.intro h1 { font-family: var(--font); font-size: clamp(28px, 3vw, 36px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.intro .lead { margin-top: 14px; color: var(--ink-2); font-size: 17px; line-height: 1.65; font-weight: 500; }
.rules { list-style: none; margin: 30px 0 0; padding: 0; border-top: 1px solid var(--line); }
.rules li { display: grid; grid-template-columns: 44px 1fr; gap: 6px; padding: 15px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); line-height: 1.55; font-weight: 500; }
.rules li .n { color: var(--brand-text); font-size: 13px; font-weight: 700; padding-top: 2px; font-variant-numeric: tabular-nums; }
.rules li b { color: var(--ink); font-weight: 700; }

.consent { display: flex; gap: 12px; align-items: center; margin: 26px 0 18px; padding: 16px 18px; border-radius: 16px; background: var(--tint); cursor: pointer; user-select: none; -webkit-user-select: none; transition: background-color 0.15s, box-shadow 0.15s; color: var(--ink); font-weight: 500; }
.consent:hover { background: var(--tint-2); }
.consent input { position: absolute; opacity: 0; pointer-events: none; }
.consent .box { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; transition: all 0.15s var(--ease); }
.consent .box svg { width: 14px; height: 14px; color: var(--brand-ink); opacity: 0; transform: scale(0.6); transition: all 0.15s var(--ease); }
.consent input:checked + .box { background: var(--brand); border-color: var(--brand); }
.consent input:checked + .box svg { opacity: 1; transform: none; }
.consent input:focus-visible + .box { box-shadow: var(--ring); }
.consent:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand-soft-2); }
.fine { margin-top: 16px; color: var(--muted); font-size: 13.5px; text-align: center; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 28px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.steps.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.steps span { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.steps span + span::before { content: ''; position: absolute; top: 13px; left: calc(-50% + 21px); right: calc(50% + 21px); height: 1.5px; background: var(--line-2); }
.steps span.done + span::before { background: color-mix(in srgb, var(--ok) 45%, transparent); }
.steps i { position: relative; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12.5px; background: var(--tint); color: var(--muted); }
.steps i svg { width: 13px; height: 13px; }
.steps .on { color: var(--ink); }
.steps .on i { background: var(--brand); color: var(--brand-ink); }
.steps .done i { background: var(--ok-soft); color: var(--ok); }
.steps em { font-style: normal; white-space: nowrap; }
.q-set { margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
.q-set legend, .q-set .q-label { display: block; padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.q-set .q-label span { color: var(--muted); font-weight: 500; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.picks.row { display: flex; flex-wrap: wrap; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: flex; align-items: center; min-height: 44px; padding: 10px 16px; border-radius: 14px; background: var(--tint); font-weight: 600; font-size: 14.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px transparent; transition: background-color 0.15s, box-shadow 0.15s, color 0.15s; user-select: none; -webkit-user-select: none; }
.pick:hover span { background: var(--tint-2); }
.pick input:checked + span { background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 0 0 0 1.5px var(--brand); }
.pick input:focus-visible + span { box-shadow: var(--ring); }
.q-set textarea { width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--tint); font: 500 15px/1.55 var(--display); resize: vertical; outline: none; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow 0.15s, background-color 0.15s; }
.q-set textarea:focus { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.details { margin: 24px 0 0; padding: 6px 20px; border-radius: 18px; background: var(--tint); }
.details div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 11px 0; }
.details div + div { border-top: 1px solid var(--line-2); }
.details dt { color: var(--muted); font-weight: 600; font-size: 14px; }
.details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.details + .consent { margin-top: 12px; }
/* Scale header: the three anchor labels on one line over the five answer columns, the numbers under them. */
.ws-scale, .ws { --wc: 40px; --wg: 6px; }
.ws-scale { display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, var(--wc)); column-gap: var(--wg); row-gap: 4px; margin: 20px 0 8px; padding: 0 10px 0 16px; font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.ws-ends { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; white-space: nowrap; }
.ws-ends span:first-child { justify-self: start; }
.ws-ends span:last-child { justify-self: end; }
.ws-scale b { text-align: center; color: var(--ink); font-size: 12.5px; }
.ws-scale b:first-of-type { grid-column: 2; }
.ws { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ws li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 9px 10px 9px 16px; border-radius: 14px; background: var(--tint); transition: background-color 0.15s, box-shadow 0.15s; }
.ws li.done { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ws-t { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.ws-o { display: inline-grid; grid-template-columns: repeat(5, var(--wc)); column-gap: var(--wg); justify-items: center; }
/* Narrow desktop (the side panel takes room): tighter columns, end labels only. */
@media (min-width: 1021px) and (max-width: 1120px) {
  .ws-scale, .ws { --wc: 36px; --wg: 5px; }
  .ws-ends span:nth-child(2) { visibility: hidden; }
}
.ws-b { position: relative; cursor: pointer; }
.ws-b input { position: absolute; opacity: 0; pointer-events: none; }
.ws-b span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 700; font-size: 13.5px; color: var(--ink-2); transition: all 0.15s var(--ease); }
.ws-b:hover span { box-shadow: inset 0 0 0 1.5px var(--brand); }
.ws-b input:checked + span { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.ws-b input:focus-visible + span { box-shadow: var(--ring); }
.ws-count { text-align: left; margin-top: 12px; }
.part-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.level.part { color: var(--accent-text); font-weight: 700; }
.invisible { visibility: hidden; }
.pledges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.pledge { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); }
.pledge h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 10px; }
.pledge ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.pledge li { position: relative; padding-left: 18px; font-size: 14.5px; font-weight: 500; line-height: 1.5; color: var(--ink-2); }
.pledge li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.pledges + .consent { margin-top: 12px; }
.sign { margin-top: 20px; }
.sign label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.sign-field { display: flex; align-items: center; height: 56px; border-radius: 16px; background: var(--tint); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow 0.15s, background-color 0.15s; }
.sign-field:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.sign-field input { flex: 1; min-width: 0; height: 100%; padding: 0 18px; border: 0; background: none; outline: none; font: 600 18px var(--font); }
.sign-field input::placeholder { color: var(--muted); font-weight: 400; opacity: 0.6; }
.sign-ok { width: 28px; height: 28px; margin-right: 14px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; opacity: 0; transform: scale(0.6); transition: all 0.2s var(--ease); }
.sign-ok svg { width: 15px; height: 15px; }
.sign-field.ok .sign-ok { opacity: 1; transform: none; }
.sign-help { margin-top: 8px; font-size: 13px; color: var(--muted); min-height: 19px; }
.sign-help.bad { color: var(--danger); }
.step-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 22px; }

/* ---------- centered state pages ---------- */
.page {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: 32px 16px calc(32px + env(safe-area-inset-bottom)); position: relative; overflow: hidden;
  background: radial-gradient(900px 500px at 50% -10%, var(--brand-soft) 0%, transparent 65%), var(--bg);
}
.panel { width: min(500px, 100%); padding: 44px 40px 40px; text-align: center; border-radius: 28px; animation: rise 0.45s var(--ease); }
.panel .logo { height: 34px; margin: 0 auto 30px; }
.panel h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.panel h1 .name { font-weight: 700; }
.panel .lead { margin-top: 12px; color: var(--ink-2); font-size: 16.5px; line-height: 1.6; font-weight: 500; }
.panel .btn { margin-top: 26px; }
.state-ico { width: 68px; height: 68px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.state-ico svg { width: 30px; height: 30px; }
.state-ico.ok { background: var(--ok-soft); color: var(--ok); }
.state-ico.warn { background: var(--warn-soft); color: var(--warn); }
.state-ico.danger { background: var(--danger-soft); color: var(--danger); }
.done-check { width: 84px; height: 84px; margin: 0 auto 24px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; animation: pop-in 0.5s var(--ease); box-shadow: 0 0 0 10px color-mix(in srgb, var(--ok-soft) 50%, transparent); }
.done-check svg { width: 40px; height: 40px; }
.done-check path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.5s 0.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop-in { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
.done-meta { margin-top: 24px; padding: 14px 18px; border-radius: 16px; background: var(--tint); color: var(--ink-2); font-size: 14.5px; }

/* ---------- test chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: 72px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-l, .topbar-r { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-r { justify-content: flex-end; }
.topbar .logo { height: 34px; }
.topbar .sep { width: 1px; height: 24px; background: var(--line-2); }
.topbar .title { font-weight: 600; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.segs { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.segs-bar { display: flex; gap: 3px; }
.segs-bar i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); transition: background-color 0.25s var(--ease), transform 0.25s var(--ease); }
.segs-bar i.done { background: var(--brand); }
.segs-bar i.cur { background: var(--accent); transform: scaleY(1.5); }
.segs-bar i.gap { margin-left: 6px; }
.segs-label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); transition: background-color 0.2s; }
.save-state[data-s="saving"] i { background: var(--accent); animation: blink 1s infinite; }
.save-state[data-s="offline"] { color: var(--warn); }
.save-state[data-s="offline"] i { background: var(--warn); }
@keyframes blink { 50% { opacity: 0.3; } }

.timer {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px;
  border-radius: 999px; background: var(--tint); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
  transition: background-color 0.3s, color 0.3s;
}
.timer svg { width: 18px; height: 18px; color: var(--muted); }
.timer.warn { background: var(--warn-soft); color: var(--warn); }
.timer.warn svg, .timer.danger svg { color: currentColor; }
.timer.danger { background: var(--danger-soft); color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 16%, transparent); } }
.mprogress { display: none; }

.test-main { display: grid; grid-template-columns: minmax(0, 820px) 316px; justify-content: center; gap: 28px; width: 100%; margin: 0 auto; padding: 32px 28px 56px; align-items: start; }

.qwrap { position: relative; }
.wm { position: absolute; inset: 0; border-radius: 28px; pointer-events: none; background-repeat: repeat; }
.fs-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px; }
.fs-bar .btn { --h: 34px; }
@media print { body { display: none !important; } }
.qcard { position: relative; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; padding: 36px 40px 28px; min-height: min(660px, calc(100vh - 140px)); min-height: min(660px, calc(100dvh - 140px)); border-radius: 28px; box-shadow: none; }
.qcontent { flex: 1; outline: none; }
.qhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.qno { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.qno b { font-size: 48px; font-weight: 600; letter-spacing: -0.04em; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.qno span { font-size: 17px; color: var(--muted); font-weight: 600; }
.qtags { display: flex; align-items: center; padding-bottom: 6px; }
.level { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.bars { display: inline-flex; gap: 3px; align-items: flex-end; }
.bars i { width: 4px; border-radius: 2px; background: var(--line-2); }
.bars i:nth-child(1) { height: 7px; } .bars i:nth-child(2) { height: 9px; } .bars i:nth-child(3) { height: 11px; } .bars i:nth-child(4) { height: 13px; } .bars i:nth-child(5) { height: 15px; }
.bars i.on { background: var(--brand); }

.qbody { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.qprompt { font-size: 19px; line-height: 1.65; color: var(--ink); font-weight: 500; letter-spacing: -0.005em; }
.qprompt p + p { margin-top: 14px; }
.qprompt code, .opt code { font-size: 0.84em; }
.qcode { margin: 22px 0 0; padding: 18px 20px; border-radius: 16px; background: var(--code-bg); color: var(--code-ink); font: 14px/1.65 var(--mono); overflow-x: auto; white-space: pre; tab-size: 4; }
.qcode code { background: none; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.qhint { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; color: var(--muted); font-size: 14px; font-weight: 600; }
.qhint button { border: 0; background: none; padding: 4px 10px; margin: -4px -10px; border-radius: 999px; color: var(--muted); font: 600 13.5px var(--display); }
.qhint button:hover { color: var(--ink); background: var(--tint); }

.options { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; align-items: start; width: 100%;
  padding: 15px 18px 15px 14px; text-align: left; border: 0; border-radius: 18px; background: var(--tint);
  font: 500 16.5px/1.55 var(--display); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: background-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.opt:hover { background: var(--tint-2); }
.opt:active { transform: scale(0.995); }
.opt .key { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 700; box-shadow: 0 1px 2px rgba(12, 17, 48, 0.08); transition: all 0.15s var(--ease); }
.opt[data-multi] .key { border-radius: 10px; }
.opt .key svg { width: 16px; height: 16px; display: none; }
.opt .txt { padding-top: 5px; min-width: 0; overflow-wrap: anywhere; }
.qprompt { overflow-wrap: anywhere; }
.opt[aria-checked="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.opt[aria-checked="true"] .key { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.opt[data-multi][aria-checked="true"] .key span { display: none; }
.opt[data-multi][aria-checked="true"] .key svg { display: block; }

.numeric { max-width: 440px; }
.num-field { display: flex; align-items: center; height: 60px; border-radius: 18px; background: var(--tint); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow 0.15s, background-color 0.15s; }
.num-field:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.num-field.bad { box-shadow: inset 0 0 0 1.5px var(--danger); }
.num-field input { flex: 1; min-width: 0; height: 100%; padding: 0 20px; border: 0; background: none; outline: none; font: 600 20px var(--display); font-variant-numeric: tabular-nums; user-select: text; -webkit-user-select: text; }
.num-field input::placeholder { color: var(--muted); font-weight: 500; }
.num-field .unit { padding: 0 20px; color: var(--muted); font-weight: 700; border-left: 1px solid var(--line-2); height: 50%; display: grid; place-items: center; white-space: nowrap; }
.num-field input:focus-visible, .sign-field input:focus-visible { box-shadow: none; }
.num-help { margin-top: 10px; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.num-help.bad { color: var(--danger); }

.qnav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.qnav .btn { --h: 46px; }
.qnav #prevBtn { justify-self: start; }
.qnav #nextBtn { justify-self: end; }
.flag-btn[aria-pressed="true"] { background: var(--warn-soft); color: var(--warn); }
.flag-btn[aria-pressed="true"] svg { fill: currentColor; }

/* sidebar */
.sidebar { position: sticky; top: 104px; display: grid; gap: 14px; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto; scrollbar-width: thin; border-radius: 24px; }
.side-card { padding: 22px; border-radius: 24px; background: var(--tint); }
.who-top { display: flex; align-items: center; gap: 14px; }
.pace { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); color: var(--ink-2); font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.pace:empty { display: none; }
.kbd-hint { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kbd-hint kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 -1.5px 0 var(--line-2), inset 0 0 0 1px var(--line); font: 700 11.5px var(--display); color: var(--ink-2); }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, #4f7cf0, #263486); color: #fff; font: 700 15px var(--display); letter-spacing: 0.02em; }
.who-name { font-family: var(--font); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.who-sub { color: var(--muted); font-size: 13.5px; }
.side-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; font-weight: 700; font-size: 15px; }
.side-h span { color: var(--muted); font-weight: 600; font-size: 13px; }
.lvl-row + .lvl-row { margin-top: 14px; }
.lvl-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lvl-label .bars i { width: 3px; }
.qgrid { display: grid; grid-template-columns: repeat(7, 34px); gap: 6px; }
.qbtn {
  position: relative; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface);
  font: 700 13.5px var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px var(--line); transition: all 0.15s var(--ease); -webkit-tap-highlight-color: transparent;
}
.qbtn:hover { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
.qbtn.done { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.qbtn.cur { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.qbtn.flag::after { content: ""; position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: #f0a020; border: 2px solid var(--tint); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.legend i.done { background: var(--brand); box-shadow: none; }
.legend i.flag { background: #f0a020; box-shadow: none; width: 9px; height: 9px; }
.side-tips { padding: 16px 22px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.side-tips kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin: 0 1px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 -1.5px 0 var(--line-2), inset 0 0 0 1px var(--line); font: 700 11.5px var(--display); color: var(--ink-2); }

.nav-toggle, .drawer-close { display: none; }
.drawer-backdrop { display: none; }

/* review */
.review h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.review .lead { color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0 8px; }
.stat { padding: 18px 20px; border-radius: 18px; background: var(--tint); }
.stat b { display: block; font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.stat.warn b { color: var(--warn); }
.review-h { margin: 22px 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.review-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.review-item { min-width: 0; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px 12px 12px; border: 0; border-radius: 16px; background: var(--tint); text-align: left; transition: background-color 0.15s; }
.review-item:hover { background: var(--tint-2); }
.review-item .n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13.5px; }
.review-item .t { flex: 1; min-width: 0; color: var(--ink-2); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-item .tag { flex: none; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.review-item .tag.flagged { color: var(--warn); }
.all-done { margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }

/* overlay (time up, submitting, other tab) */
.overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade 0.2s var(--ease); }
.overlay .panel { box-shadow: var(--shadow-lg); }
.overlay .spinner { margin: 0 auto 20px; width: 34px; height: 34px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; }
  .segs { display: none; }
  .mprogress { display: block; position: sticky; top: 72px; z-index: 29; height: 3px; background: var(--line); }
  .mprogress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--brand)); transition: width 0.4s var(--ease); }
}
@media (max-width: 1020px) {
  .test-main { grid-template-columns: minmax(0, 1fr); padding: 22px 16px 110px; max-width: 780px; }
  .sidebar {
    border-radius: 28px 28px 0 0;
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; top: auto;
    max-height: min(80vh, 660px); overflow-y: auto; overscroll-behavior: contain;
    padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); gap: 10px;
    background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(105%); visibility: hidden; transition: transform 0.32s var(--ease), visibility 0s 0.32s;
  }
  .sidebar.open { transform: none; visibility: visible; transition: transform 0.32s var(--ease); }
  .sidebar::before { content: ""; display: block; width: 44px; height: 5px; margin: 2px auto 0; border-radius: 3px; background: var(--line-2); }
  .drawer-close { display: inline-flex; justify-self: end; margin: -26px 2px -6px 0; }
  .side-tips { display: none; }
  .qgrid { grid-template-columns: repeat(auto-fill, 38px); }
  .qbtn { width: 38px; height: 38px; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 13, 30, 0.42); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .drawer-backdrop.open { opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-flex; }
  .qnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .welcome { grid-template-columns: 1fr; }
  .hero { padding: 28px 24px 30px; }
  .hero .logo { height: 32px; }
  .hero-mid { padding: 34px 0 26px; }
  .hero h2 { font-size: 40px; }
  .hero p { font-size: 16px; }
  .hero-facts { gap: 28px; }
  .hero-facts b { font-size: 34px; }
  .hero-foot { display: none; }
  .intro { padding: 36px 24px 48px; align-items: flex-start; }
  .qcard { min-height: 0; }
  .qnav { padding-top: 12px; border-top: 1px solid var(--line); }
  .rules li { grid-template-columns: 34px 1fr; }
}
@media (max-width: 720px) {
  .topbar { height: 62px; padding: 0 12px; gap: 8px; }
  .mprogress { top: 62px; }
  .topbar .sep, .topbar .title, .save-state span { display: none; }
  .topbar .logo { height: 27px; }
  .topbar-r { gap: 8px; }
  .timer { height: 38px; padding: 0 12px 0 10px; font-size: 15.5px; }
  .timer svg { width: 16px; height: 16px; }
  .qcard { padding: 22px 18px 24px; min-height: 0; border-radius: 22px; }
  .qhead { padding-bottom: 16px; margin-bottom: 18px; }
  .qno b { font-size: 36px; }
  .qno span { font-size: 15px; }
  .qtags .chip { height: 26px; font-size: 12px; padding: 0 10px; }
  .level span:last-child { display: none; }
  .qprompt { font-size: 17px; }
  .opt { font-size: 15.5px; padding: 12px 14px 12px 12px; gap: 12px; border-radius: 16px; }
  .opt .txt { padding-top: 4px; }
  .qcode { font-size: 12.5px; padding: 14px; margin-left: -4px; margin-right: -4px; border-radius: 14px; }
  .panel { padding: 34px 22px 30px; }
  .qnav .btn-label { display: none; }
  .qnav .btn { padding: 0 18px; }
  .stats { gap: 8px; }
  .stat { padding: 14px; }
  .stat b { font-size: 28px; }
  .review h2 { font-size: 25px; }
  .pledges { grid-template-columns: 1fr; }
  .picks { grid-template-columns: 1fr; }
  .ws li { grid-template-columns: 1fr; gap: 8px; }
  .ws-o { display: flex; justify-content: space-between; }
  .ws-scale { display: block; padding: 0 4px; }
  .ws-scale b { display: none; }
  .steps em { visibility: hidden; }
  .steps .on em { visibility: visible; }
  .details div { grid-template-columns: 84px 1fr; }
  .step-actions .btn { padding: 0 18px; }
  .hero h2 { font-size: 34px; }
}
@media (max-width: 380px) {
  .finish-btn .btn-label { display: none; }
  .hero-facts { gap: 20px; }
}

/* ---------- camera ---------- */
.camcheck { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: center; margin-top: 24px; }
.cam-stage { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #0d1020; }
.cam-video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-guide { position: absolute; inset: 12% 28% 8%; z-index: 1; border: 2px dashed rgba(255, 255, 255, 0.5); border-radius: 50%; pointer-events: none; }
.cam-msg { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; color: #fff; font-size: 14px; font-weight: 600; text-align: center; background: rgba(13, 16, 32, 0.78); }
.cam-msg[hidden] { display: none; }
.cam-msg svg { width: 22px; height: 22px; flex: none; }
.cam-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.cam-list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cam-list i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: transparent; transition: background-color 0.2s, color 0.2s; }
.cam-list i svg { width: 13px; height: 13px; }
.cam-list li[data-s="ok"] { color: var(--ink); }
.cam-list li[data-s="ok"] i { background: var(--ok-soft); color: var(--ok); }
.cam-list li[data-s="bad"] { color: var(--danger); }
.cam-list li[data-s="bad"] i { background: var(--danger-soft); }
.cam-list li[data-s="warn"] { color: var(--warn); }
.cam-list li[data-s="warn"] i { background: var(--warn-soft); }
.cam-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--tint); color: var(--ink-2); font-size: 14px; font-weight: 500; line-height: 1.5; }
.cam-note[hidden] { display: none; }
.cam-note.bad { background: var(--danger-soft); color: var(--danger); }
.cam-note .btn { flex: none; }
.cam-pip { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #0d1020; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--line-2); transition: box-shadow 0.2s; }
.cam-pip[data-s="ok"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok); }
.cam-pip[data-s="warn"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--warn); }
.cam-pip[data-s="bad"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger); }
.qcard input { user-select: text; -webkit-user-select: text; }
.cover { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: clamp(48px, 14vh, 140px) 32px 32px; border-radius: inherit; background: var(--surface); text-align: center; animation: fade 0.2s var(--ease); }
.cover[hidden] { display: none; }
.cover .state-ico { margin-bottom: 18px; }
.cover h2 { font-size: 24px; letter-spacing: -0.02em; }
.cover p { max-width: 400px; margin-top: 10px; color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.cover .btn { margin-top: 22px; }
.qcard.covered .qcontent, .qcard.covered .qnav { visibility: hidden; }
@media (max-width: 720px) {
  .camcheck { grid-template-columns: 1fr; gap: 16px; }
  .cam-list { gap: 9px; }
  .cam-pip { width: 34px; height: 34px; }
}
.start-note { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600; line-height: 1.5; }
.start-note svg { width: 20px; height: 20px; }

/* Short labels never break onto a second line; long names get their own line on phones. */
.stat span, .pick span, .steps em, .details dt { white-space: nowrap; }
.picks { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
@media (max-width: 720px) {
  .hello-name { display: block; }
  .stat span { font-size: 12.5px; }
}
@media (max-width: 440px) {
  .details div { grid-template-columns: 1fr; gap: 2px; }
}
/* Small phones: the camera bubble takes the logo's place so the top bar fits on one row. */
@media (max-width: 480px) {
  .topbar:has(.cam-pip) { grid-template-columns: 1fr; }
  .topbar:has(.cam-pip) .topbar-l { display: none; }
  .topbar:has(.cam-pip) .cam-pip { order: -1; margin-right: auto; }
}

/* sample question on the instructions step */
.sample-link { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; margin: 4px 0 14px; padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: none; color: var(--brand-text); font: 600 15px var(--font); text-align: left; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.sample-link:hover { background: var(--brand-soft); border-color: var(--brand-soft-2); }
.sample-link svg { width: 20px; height: 20px; }
.sample-link em { font-style: normal; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.modal.sample { width: min(620px, calc(100vw - 32px)); }
.sample-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sample-tag { padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sample-q { margin-top: 16px; font-size: 18px; line-height: 1.6; font-weight: 500; color: var(--ink); }
.sample .qhint { margin: 16px 0 10px; }
.sample-note { min-height: 48px; margin-top: 14px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.sample-note kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 -1.5px 0 var(--line-2), inset 0 0 0 1px var(--line); font: 700 11.5px var(--display); color: var(--ink-2); }
@media (max-width: 480px) { .sample-link { grid-template-columns: 22px minmax(0, 1fr); } .sample-link em { display: none; } }
.cam-holder { position: fixed; left: -9999px; top: 0; width: 2px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ---------- visual QA pass ---------- */
/* Code in a question is never cut off: long lines wrap instead of hiding past the edge. */
.qcode { white-space: pre-wrap; overflow-wrap: anywhere; }
.qcode code { white-space: pre-wrap; }
/* Inline code stays visible on selected (tinted) options. */
.opt code { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
/* Brand panel stays in view while the steps scroll; the steps start at the same height on every step. */
@media (min-width: 1021px) {
  .welcome .hero { position: sticky; top: 0; height: 100vh; height: 100dvh; }
  .intro { align-items: flex-start; padding-top: clamp(40px, 10vh, 104px); }
}
/* A hidden question shows its message in the middle of what the candidate can see. */
.cover { justify-content: center; padding: 32px; }
.qcard.covered { max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); min-height: min(520px, calc(100dvh - 130px)); overflow: hidden; }
.qcard { min-height: min(600px, calc(100vh - 140px)); min-height: min(600px, calc(100dvh - 140px)); }
/* Camera checklist: a cross for failed checks, so status never depends on colour alone. */
.cam-list i .x { display: none; }
.cam-list li[data-s="bad"] i { color: var(--danger); }
.cam-list li[data-s="bad"] i .ok-ico { display: none; }
.cam-list li[data-s="bad"] i .x { display: block; }
.cam-list li[data-s="warn"] i { color: var(--warn); }
.cam-note.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- mobile and tablet QA pass ---------- */
.nw { white-space: nowrap; }
.sample-link { margin-top: 16px; }
/* Multi-select choices show a box, so they read differently from single choices. */
.pick input[type="checkbox"] + span { gap: 10px; }
.pick input[type="checkbox"] + span::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--line-2); background: var(--surface) center / 11px no-repeat; transition: background-color 0.15s, box-shadow 0.15s; }
.pick input[type="checkbox"]:checked + span::before { background-color: var(--brand); box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
/* Flagged stays amber even under the pointer. */
.btn.flag-btn[aria-pressed="true"], .btn.flag-btn[aria-pressed="true"]:hover { background: var(--warn-soft); color: var(--warn); }
/* Touch screens: no hover colour stuck after a tap. */
@media (hover: none) {
  .pick:hover span { background: var(--tint); }
  .opt:hover { background: var(--tint); }
  .opt[aria-checked="true"]:hover { background: var(--brand-soft); }
}
/* Camera unavailable: no face guide through the message. */
.cam-stage:has(.cam-msg:not([hidden])) .cam-guide { display: none; }
@media (max-width: 1020px) {
  .welcome { align-content: start; grid-template-rows: auto 1fr; }
  .hero { padding-inline: max(24px, calc((100% - 560px) / 2)); }
}
@media (max-width: 900px) {
  .save-state span { display: none; }
}
@media (max-width: 720px) {
  /* After the first step the brand panel shrinks to a slim header, so each step starts near the top. */
  .welcome:has(.steps .done) .hero-mid p, .welcome:has(.steps .done) .hero-facts, .welcome:has(.steps .done) .hero-foot { display: none; }
  .welcome:has(.steps .done) .hero { padding-top: 18px; padding-bottom: 18px; }
  .welcome:has(.steps .done) .hero h2 { margin-top: 12px; font-size: 24px; }
  .picks.row { display: grid; gap: 8px; }
  .picks.row[data-n="5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .picks.row[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picks.row[data-n="3"] { grid-template-columns: 1fr; }
  .picks.row .pick span { justify-content: center; }
  .picks.row[data-n="3"] .pick span { justify-content: flex-start; }
  textarea { resize: none; }
  .qgrid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .qgrid .qbtn { width: auto; aspect-ratio: 1; }
  .qnav .btn:not(.labelled) { width: var(--h); padding: 0; justify-content: center; }
  .qnav .btn.labelled .btn-label { display: inline; }
  .qnav .btn.labelled { padding: 0 20px; }
  .qnav .flag-btn { background: var(--tint); }
  .save-state[data-s="saved"] { display: none; }
  #navToggle { min-width: 76px; justify-content: center; }
}
@media (max-width: 480px) {
  .cam-note { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) { .welcome:has(.steps .done) .hero-mid { padding: 0; } }
.qcard:has(.review) { min-height: 0; }

/* ---------- test experience: pacing, notices, tools ---------- */
.toast.has-action { pointer-events: auto; max-width: min(560px, calc(100vw - 32px)); border-radius: 18px; padding: 12px 12px 12px 18px; line-height: 1.45; }
.toast.has-action button { flex: none; margin-left: 6px; padding: 7px 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #6b3d00; font: 700 13px var(--display); white-space: nowrap; cursor: pointer; }
.notices { display: grid; gap: 10px; }
.notices:empty { display: none; }
.notices:not(:empty) { margin-bottom: 14px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--tint); color: var(--ink-2); font-size: 14px; line-height: 1.45; animation: fade 0.25s var(--ease); }
.notice b { color: var(--ink); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.warn b { color: inherit; }
.notice .btn { --h: 34px; flex: none; }
/* Time plan in the sidebar: one segment per part, filled as time passes, with a marker for now. */
.plan { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.plan:empty { display: none; }
.plan-bar { position: relative; display: flex; gap: 3px; height: 8px; }
.plan-seg { position: relative; height: 100%; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.plan-seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, var(--brand) 55%, transparent); }
.plan-now { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.plan-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.plan-legend span { white-space: nowrap; }
.plan-legend em { font-style: normal; color: var(--ink-2); }
.plan + .pace { margin-top: 10px; padding-top: 0; border-top: 0; }
.pace.late { color: var(--warn); }
.next-open { margin-top: 14px; }
.next-open svg { width: 16px; height: 16px; }
/* Part introduction, shown once at the start of each part. */
.part-intro { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: -8px 0 22px; padding: 12px 12px 12px 14px; border-radius: 18px; background: var(--brand-soft); color: var(--ink-2); font-size: 14px; line-height: 1.5; transition: opacity 0.2s, transform 0.2s; }
.part-intro.out { opacity: 0; transform: translateY(-4px); }
.part-intro b { display: block; color: var(--brand-text); font-size: 15px; }
.pi-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface); color: var(--brand-text); font: 700 18px/1 var(--display); text-align: center; }
.pi-n em { display: block; margin-top: 2px; font: 600 10px/1 var(--font); font-style: normal; color: var(--muted); }
.pi-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pi-x:hover { background: var(--surface); color: var(--ink); }
.pi-x svg { width: 16px; height: 16px; }
/* Question tools: text size, calculator, notes. */
.qtags { gap: 14px; }
.qtools { display: inline-flex; gap: 4px; padding-left: 12px; border-left: 1px solid var(--line); }
.qt { position: relative; width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.qt:hover { background: var(--tint); color: var(--ink); }
.qt svg { width: 18px; height: 18px; }
.qt.has::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface); }
body.text-l .qprompt { font-size: 21px; }
body.text-l .opt .txt { font-size: 17.5px; }
body.text-l .qcode { font-size: 15.5px; }
body.text-xl .qprompt { font-size: 23.5px; }
body.text-xl .opt .txt { font-size: 19.5px; }
body.text-xl .qcode { font-size: 17px; }
.tools { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 320px; padding: 14px; border-radius: 22px; box-shadow: var(--shadow-lg); animation: fade 0.2s var(--ease); }
.tools[hidden] { display: none; }
.tools-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.tools-tabs { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--tint); }
.tools-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 13px var(--font); cursor: pointer; }
.tools-tabs button svg { width: 15px; height: 15px; }
.tools-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(12, 17, 48, 0.1); }
.tools-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.tools-x:hover { background: var(--tint); color: var(--ink); }
.tools-x svg { width: 16px; height: 16px; }
.calc-hist { display: grid; gap: 2px; min-height: 64px; align-content: end; padding: 8px 10px; border-radius: 12px; background: var(--tint); font: 500 13px var(--mono); color: var(--muted); }
.calc-hist div { display: flex; justify-content: space-between; gap: 10px; }
.calc-hist span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-hist b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.calc-hist b.err { color: var(--danger); font-family: var(--font); font-size: 12.5px; }
.calc-in { width: 100%; height: 44px; margin-top: 8px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); font: 600 16px var(--mono); text-align: right; }
.calc-in:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.calc-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.calc-keys button { height: 38px; border: 0; border-radius: 10px; background: var(--tint); color: var(--ink-2); font: 600 14px var(--display); cursor: pointer; transition: background-color 0.12s; }
.calc-keys button:hover { background: var(--tint-2); }
.calc-keys button.num { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.calc-keys button.eq { background: var(--brand); color: var(--brand-ink); }
.notes-l { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
#notesIn { width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); font: 500 14px/1.5 var(--font); resize: vertical; }
#notesIn:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
.notes-f { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }
/* Instructions: what to have ready. */
.ready { margin: 6px 0 4px; padding: 14px 16px; border-radius: 16px; background: var(--tint); }
.ready b { display: block; margin-bottom: 8px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ready ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.ready li { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.ready svg { flex: none; width: 17px; height: 17px; color: var(--brand-text); }
/* Done page feedback. */
.fb { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.fb-q { font-weight: 700; color: var(--ink); }
.fb-rate { display: flex; justify-content: center; gap: 6px; margin: 12px 0; }
.fb-rate label { position: relative; cursor: pointer; }
.fb-rate input { position: absolute; opacity: 0; pointer-events: none; }
.fb-rate span { display: grid; place-items: center; width: 64px; padding: 8px 0; border-radius: 14px; background: var(--tint); transition: background-color 0.15s, box-shadow 0.15s; }
.fb-rate b { font: 700 18px var(--display); color: var(--ink); }
.fb-rate em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.fb-rate input:checked + span { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.fb-rate input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.fb textarea { width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); font: 500 14px/1.5 var(--font); resize: none; }
.fb .btn { margin-top: 10px; }
.fb .fine { margin-top: 8px; }
.fb-done { color: var(--ok); font-weight: 700; }
@media (max-width: 720px) {
  .qtools { padding-left: 8px; }
  .qt { width: 32px; height: 32px; }
  .part-intro { grid-template-columns: auto minmax(0, 1fr); margin-top: -4px; }
  .part-intro .pi-x { display: none; }
  .tools { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); width: auto; }
  .ready ul { grid-template-columns: 1fr; }
  .fb-rate span { width: 56px; }
}
@media (max-width: 480px) { .qtags .level.part { display: none; } .qtools { border-left: 0; padding-left: 0; } }
.kbd-hint { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.kbd-hint span { white-space: nowrap; }
@media (max-width: 720px) { body:has(.qnav) .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); } }
.ready li span { white-space: nowrap; }

/* Environment notes on the first step (in-app browser, phone). */
.env-note { display: grid; gap: 6px; margin-bottom: 20px; padding: 12px 14px; border-radius: 14px; background: var(--tint); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.env-note b { color: var(--ink); }
.env-note.bad { background: var(--warn-soft); color: var(--warn); }
.env-note.bad b { color: inherit; }
.env-note .btn { justify-self: start; }
