/* Noeto cabinet. Same tokens as the funnel and noetoiq.com. */
:root {
  --paper: #F6F7F4; --sheet: #FFFFFF; --ink: #1B2340; --ink-2: #4A5270; --ink-3: #7C839C;
  --rule: #DADFEA; --grid: #C9D6FF; --wash: #EDF2FF; --blue: #1A56FF; --blue-deep: #0E3FCC;
  --green: #0F8A5F; --green-wash: #E3F5EC; --red: #E5484D; --red-wash: #FDECEC; --amber: #B26A00;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --nav-h: 64px; --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); font-feature-settings: "tnum" 1; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; font-stretch: 112%; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: clamp(26px, 6vw, 34px); font-weight: 800; }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.fine { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- shell */
.shell { min-height: 100vh; }
.main { max-width: 680px; margin: 0 auto; padding: 20px 18px calc(var(--nav-h) + 40px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; font-stretch: 125%; font-size: 19px; }
.logo svg { width: 26px; height: 26px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--sheet); border-top: 1px solid var(--rule); }
.tab { display: grid; justify-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg .fill { fill: var(--blue); }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 232px 1fr; }
  .side { position: sticky; top: 0; height: 100vh; padding: 26px 18px; border-right: 1px solid var(--rule); background: var(--sheet); }
  .tabs { position: static; height: auto; display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 30px; border: 0; padding: 0; background: none; }
  .tab { grid-auto-flow: column; justify-content: start; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 15px; }
  .tab:hover { background: var(--wash); color: var(--ink); }
  .tab[aria-current="page"] { background: var(--wash); }
  .main { padding: 36px 32px 60px; margin: 0; }
  .topbar .logo { display: none; }
}
@media (max-width: 959px) { .side .logo { display: none; } .side { position: static; } }

/* ---------- buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 2px solid transparent; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn--block { display: flex; width: 100%; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-deep); }
.btn--primary:disabled { background: var(--rule); color: var(--ink-3); cursor: not-allowed; }
.btn--line { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn--quiet { background: transparent; color: var(--ink-2); min-height: 44px; padding: 0 10px; }
.btn--quiet:hover { color: var(--ink); }
.btn--danger { background: var(--red); color: #fff; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-deep); text-decoration: underline; cursor: pointer; font-size: inherit; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select { width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px solid var(--rule); border-radius: 14px; background: var(--sheet); }
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--wash); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* ---------- surfaces */
.card { background: var(--sheet); border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.card + .card, .section + .section { margin-top: 16px; }
.paper { background-color: var(--sheet); background-image: linear-gradient(var(--wash) 1px, transparent 1px), linear-gradient(90deg, var(--wash) 1px, transparent 1px);
  background-size: 20px 20px; border: 2px solid var(--ink); border-radius: 22px; padding: 20px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--sheet); border: 1.5px solid var(--rule); font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip svg { width: 16px; height: 16px; }
.chip--hot { border-color: var(--ink); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--wash); color: var(--blue-deep); }
.badge--done { background: var(--green-wash); color: var(--green); }
.badge--muted { background: var(--paper); color: var(--ink-3); }
.notice { padding: 14px 16px; border-radius: 14px; background: var(--wash); font-size: 15px; }
.notice--warn { background: #FFF4E0; }
.notice--bad { background: var(--red-wash); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px); transform: translateX(-50%); z-index: 50; max-width: 90vw; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 15px; box-shadow: 0 8px 24px rgba(27,35,64,.25); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ---------- journey */
.hello { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }
.plan-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.ring { width: 76px; height: 76px; }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--wash); }
.ring .bar { stroke: var(--blue); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s ease; }
.ring text { font: 800 19px var(--font); fill: var(--ink); }
.tasks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.task { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; width: 100%; padding: 12px 14px; border-radius: 16px;
  background: var(--sheet); border: 1.5px solid var(--rule); text-align: left; cursor: pointer; text-decoration: none; color: var(--ink); }
.task:hover { border-color: var(--ink); }
.task .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--wash); color: var(--blue); }
.task .ico svg { width: 24px; height: 24px; }
.task .t { font-weight: 700; display: block; }
.task .m { font-size: 14px; color: var(--ink-2); display: block; }
.task .go { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--rule); display: grid; place-items: center; }
.task.is-done { background: var(--paper); }
.task.is-done .t { color: var(--ink-2); }
.task.is-done .ico { background: var(--green-wash); color: var(--green); }
.task.is-done .go { background: var(--green); border-color: var(--green); color: #fff; }
.iq-big { font-size: 56px; font-weight: 800; font-stretch: 125%; line-height: 1; letter-spacing: -.02em; }
.iq-range { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.chart { width: 100%; height: auto; margin-top: 14px; overflow: visible; }
.chart .band { fill: var(--wash); }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--sheet); stroke: var(--blue); stroke-width: 2.5; }
.chart .dot.last { fill: var(--blue); }
.chart .tick { font: 600 11px var(--font); fill: var(--ink-3); }
.chart .gl { stroke: var(--rule); stroke-dasharray: 2 4; }

/* ---------- skills */
.skills { display: grid; gap: 12px; }
.skill { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; }
.skill .glyph { width: 36px; height: 36px; border-radius: 10px; background: var(--wash); color: var(--ink); display: grid; place-items: center; }
.skill .glyph svg { width: 20px; height: 20px; }
.skill .name { font-weight: 700; font-size: 15px; }
.skill .lvl { font-weight: 800; font-size: 15px; }
.meter { height: 8px; border-radius: 9px; background: var(--wash); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--blue); border-radius: 9px; }

/* ---------- library */
.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--sheet);
  border: 1.5px solid var(--rule); color: var(--ink); text-decoration: none; text-align: left; width: 100%; cursor: pointer; }
a.item:hover, button.item:hover { border-color: var(--ink); }
.item.locked { cursor: default; background: var(--paper); color: var(--ink-3); }
.item .t { font-weight: 700; }
.item .m { font-size: 14px; color: var(--ink-2); }
.item .score { font-weight: 800; font-size: 20px; font-stretch: 112%; }
.course { margin-top: 18px; }
.course h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

/* ---------- games */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.game-card { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--sheet); border: 1.5px solid var(--rule); color: var(--ink); text-decoration: none; }
.game-card:hover { border-color: var(--ink); }
.game-card .art { height: 92px; border-radius: 12px; background: var(--wash); display: grid; place-items: center; }
.game-card .art svg { width: 72px; height: 72px; }
.game-card .t { font-weight: 800; font-size: 17px; font-stretch: 112%; }
.game-card .m { font-size: 14px; color: var(--ink-2); }
.play { max-width: 560px; margin: 0 auto; }
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-weight: 700; }
.play-head .stat { font-size: 15px; color: var(--ink-2); }
.play-head .stat b { color: var(--ink); font-size: 18px; }
.timer { height: 5px; border-radius: 9px; background: var(--wash); overflow: hidden; margin-bottom: 18px; }
.timer i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; }
.board { position: relative; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.pad { display: grid; gap: 10px; }
.pad--3 { grid-template-columns: repeat(3, 1fr); }
.pad--4 { grid-template-columns: repeat(4, 1fr); }
.pad--5 { grid-template-columns: repeat(5, 1fr); }
.pad--6 { grid-template-columns: repeat(6, 1fr); }
.cell { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--rule); background: var(--sheet); font-weight: 800; font-size: clamp(18px, 5vw, 26px);
  cursor: pointer; display: grid; place-items: center; transition: background .12s, border-color .12s, transform .08s; }
.cell:active { transform: scale(.97); }
.cell.lit { background: var(--blue); border-color: var(--blue); }
.cell.ok { background: var(--green-wash); border-color: var(--green); }
.cell.bad { background: var(--red-wash); border-color: var(--red); }
.cell.found { background: var(--paper); color: var(--ink-3); border-color: var(--paper); }
.cell:disabled { cursor: default; }
.prompt-box { min-height: 120px; display: grid; place-items: center; text-align: center; padding: 18px; border-radius: 18px; background: var(--wash);
  font-size: clamp(26px, 8vw, 38px); font-weight: 800; font-stretch: 112%; letter-spacing: .03em; margin-bottom: 16px; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answers button { min-height: 64px; border-radius: 16px; border: 2px solid var(--rule); background: var(--sheet); font-size: 22px; font-weight: 800; cursor: pointer; }
.answers button:hover { border-color: var(--ink); }
.answers button.ok { background: var(--green-wash); border-color: var(--green); }
.answers button.bad { background: var(--red-wash); border-color: var(--red); }
.answers .k { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.rot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.rot-pair .shape { background: var(--wash); border-radius: 18px; padding: 14px; display: grid; place-items: center; aspect-ratio: 1; }
.rot-pair svg { width: 100%; max-width: 170px; height: auto; }
.tap-zone { height: min(56vh, 380px); border-radius: 22px; background: var(--wash); display: grid; place-items: center; cursor: pointer; border: 0; width: 100%; }
.tap-zone .disc { width: 140px; height: 140px; border-radius: 50%; }
.tap-zone .msg { font-weight: 700; color: var(--ink-2); font-size: 18px; }
.flash-ok { animation: fok .25s; }
.flash-bad { animation: fbad .3s; }
@keyframes fok { 50% { box-shadow: 0 0 0 6px var(--green-wash); } }
@keyframes fbad { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.result { text-align: center; }
.result .score { font-size: 64px; font-weight: 800; font-stretch: 125%; line-height: 1; }
.result .xp { display: inline-block; margin-top: 12px; padding: 6px 14px; border-radius: 999px; background: var(--wash); color: var(--blue-deep); font-weight: 800; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.result-grid div { background: var(--sheet); border: 1.5px solid var(--rule); border-radius: 14px; padding: 12px 8px; }
.result-grid b { display: block; font-size: 20px; }
.result-grid span { font-size: 13px; color: var(--ink-2); }

/* ---------- test runner (shared with the funnel) */
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); min-height: 22px; }
.clock { font-weight: 700; color: var(--ink); }
.clock.low { color: var(--red); }
.progress { height: 4px; border-radius: 9px; background: var(--rule); overflow: hidden; margin: 0 0 18px; }
.progress i { display: block; height: 100%; background: var(--ink); }
.drain { height: 4px; border-radius: 9px; background: var(--wash); margin-top: 10px; overflow: hidden; }
.drain i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; }
.qprompt { font-size: 19px; font-weight: 700; margin: 14px 0 16px; line-height: 1.35; }
.stim { margin: 0 0 16px; }
.stim--svg svg { display: block; width: 100%; max-width: 270px; height: auto; margin: 0 auto; }
.stim--small svg { max-width: 140px; }
.stim--wide svg { max-width: 100%; }
.stim--text { white-space: pre-wrap; text-align: center; font-size: 30px; font-weight: 800; font-stretch: 112%; letter-spacing: .06em; padding: 18px 12px; background: var(--wash); border-radius: 14px; }
.stim--letters { font-size: 25px; line-height: 1.55; text-align: center; letter-spacing: .22em; background: var(--wash); border-radius: 14px; padding: 12px; font-weight: 600; }
.stim--rows { background: var(--wash); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; font-family: var(--mono); font-size: 19px; letter-spacing: .12em; }
.stim--rows b { font-family: var(--font); letter-spacing: 0; font-size: 13px; color: var(--ink-3); display: inline-block; width: 46px; }
.stim--mono { background: var(--wash); border-radius: 14px; padding: 16px 8px; font-family: var(--mono); font-size: 20px; text-align: center; letter-spacing: .22em; line-height: 1.6; overflow-wrap: anywhere; }
.opts { display: grid; gap: 10px; }
.opts--4 { grid-template-columns: repeat(4, 1fr); }
.opts--2 { grid-template-columns: 1fr 1fr; }
.opts--1 { grid-template-columns: 1fr; }
.opt { display: grid; justify-items: center; align-content: center; gap: 8px; padding: 12px 8px 10px; background: var(--sheet); border: 1.5px solid var(--rule); border-radius: 14px; cursor: pointer; text-align: center; min-height: 56px; }
.opt:hover { border-color: var(--ink); }
.opts--1 .opt { grid-template-columns: 26px 1fr; justify-items: start; text-align: left; padding: 14px 16px; }
.opt svg { width: 100%; max-width: 96px; height: auto; }
.opts--4 .opt svg { max-width: 52px; }
.opt .lbl { font-weight: 700; font-size: 17px; }
.opt .mono { font-family: var(--mono); font-size: 16px; font-weight: 600; white-space: pre; }
.bub { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--ink-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.opt.picked { border-color: var(--blue); background: var(--wash); }
.opt.picked .bub { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt.is-right { border-color: var(--green); background: var(--green-wash); }
.opt.is-wrong { border-color: var(--red); background: var(--red-wash); }
.opts.locked .opt { pointer-events: none; }
.cue-word { margin: 20px 0 6px; text-align: center; font-size: clamp(44px, 14vw, 68px); font-weight: 800; font-stretch: 125%; letter-spacing: .04em; color: var(--blue); }

/* ---------- report */
.bars { display: grid; gap: 12px; }
.bar-row .spread { font-size: 15px; font-weight: 600; }
.review { display: grid; gap: 10px; }
.review details { background: var(--sheet); border: 1.5px solid var(--rule); border-radius: 14px; }
.review summary { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.review summary::-webkit-details-marker { display: none; }
.review .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.review .mark.y { background: var(--green); }
.review .mark.n { background: var(--red); }
.review .body { padding: 0 14px 16px; }
.review .expl { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--paper); font-size: 15px; }

/* ---------- lesson */
.lesson-card { min-height: 300px; display: grid; align-content: start; gap: 14px; }
.lesson-card .n { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.lesson-card p { font-size: 18px; line-height: 1.55; }
.lesson-card .try { padding: 14px 16px; border-radius: 14px; background: var(--wash); font-size: 16px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 16px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.dots i.on { background: var(--ink); width: 22px; border-radius: 9px; }

/* ---------- auth */
.auth { max-width: 420px; margin: 0 auto; padding: 48px 20px; }
.auth .logo { margin-bottom: 36px; }
.auth h1 { margin-bottom: 8px; }
.auth .card { margin-top: 22px; }
.auth-links { display: grid; gap: 8px; margin-top: 18px; font-size: 15px; }

/* ---------- dialogs */
.dialog-back { position: fixed; inset: 0; z-index: 60; background: rgba(27,35,64,.45); display: grid; place-items: center; padding: 18px; }
.dialog { width: 100%; max-width: 440px; background: var(--sheet); border-radius: 20px; padding: 22px; }
.dialog h2 { margin-bottom: 8px; }
.dialog .actions { display: grid; gap: 8px; margin-top: 20px; }

/* ---------- demo bar (demo build only) */
.demo-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; background: var(--ink); color: #fff; font-size: 13px; }
.demo-bar button, .demo-bar select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.demo-bar select option { color: var(--ink); }
.demo-bar .sp { flex: 1; }
@media (max-width: 520px) { .demo-bar .demo-note { display: none; } }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
