:root {
  --blue: #0057b8;
  --blue-dark: #00458f;
  --blue-soft: #e8f2fd;
  --red: #d52b1e;
  --yellow: #f9d648;
  --green: #128a56;
  --green-soft: #e7f6ee;
  --ink: #14202b;
  --muted: #637180;
  --line: #d9e2e9;
  --paper: #f6fafd;
  --white: #fff;
  --display: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shadow: 0 18px 48px rgba(20, 32, 43, 0.1);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(0, 87, 184, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 87, 184, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
main:focus { outline: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; transform: translateY(-150%); padding: 10px 14px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; overflow: hidden; }
.topbar {
  width: min(1240px, calc(100% - 56px));
  height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.brand-mark { width: 40px; height: 40px; display: grid; grid-template-rows: 1fr 1fr 1fr; overflow: hidden; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(20,32,43,.08); }
.brand-mark i:nth-child(1) { background: var(--red); }
.brand-mark i:nth-child(2) { background: white; }
.brand-mark i:nth-child(3) { background: var(--blue); }
.brand strong { display: block; font-family: var(--display); font-size: 21px; line-height: .95; letter-spacing: -.02em; text-transform: uppercase; }
.brand small { display: block; margin-top: 4px; color: var(--blue); font: 700 9px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.memory-button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.memory-button:hover { color: var(--blue); border-color: var(--blue); transform: translateY(-2px); }
.memory-button i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(18,138,86,.1); }
.memory-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; transition: .2s ease; }
.icon-button:hover { border-color: var(--blue); transform: translateY(-2px); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.view { width: min(1180px, calc(100% - 56px)); margin: 0 auto; animation: view-in .36s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.hero-grid { min-height: 525px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 74px; align-items: center; padding: 68px 0 54px; }
.eyebrow, .kicker { margin: 0; color: var(--blue); font: 800 10px/1.2 var(--mono); letter-spacing: .15em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 26px; height: 2px; background: var(--red); }
.hero-copy h1, .library-head h1, .results-card h1 {
  margin: 19px 0 22px;
  font-family: var(--display);
  font-size: clamp(54px, 6vw, 84px);
  font-weight: 800;
  line-height: .88;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.hero-copy h1 em { color: var(--blue); font-style: normal; }
.hero-intro { max-width: 465px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 30px; }
.button { min-height: 50px; padding: 0 20px; border: 0; border-radius: 13px; font-weight: 750; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .memory-button:focus-visible, .icon-button:focus-visible, .mode-card:focus-visible, .answer-button:focus-visible, .sign-tile:focus-visible { outline: 3px solid rgba(0,87,184,.28); outline-offset: 3px; }
.button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 14px; color: white; background: var(--blue); box-shadow: 0 10px 24px rgba(0,87,184,.22); }
.button-primary:hover { background: var(--blue-dark); box-shadow: 0 14px 30px rgba(0,87,184,.28); }
.button-primary svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.button-quiet { border: 1px solid var(--line); background: rgba(255,255,255,.75); }
.button-quiet:hover { border-color: #aebdc8; background: white; }

.route-card { position: relative; min-height: 390px; overflow: hidden; padding: 28px 30px 20px; border: 1px solid var(--line); border-radius: 32px; background: linear-gradient(150deg, #fff 10%, #edf5fb 100%); box-shadow: var(--shadow); }
.route-card::before { content: ""; position: absolute; width: 190px; height: 190px; right: -86px; top: -91px; border: 26px solid rgba(249,214,72,.26); border-radius: 50%; }
.route-card-head { position: relative; z-index: 1; display: flex; justify-content: space-between; font: 750 12px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.route-card-head strong { color: var(--blue); }
.route-map { width: 100%; margin: 10px 0 0; overflow: visible; }
.map-street { fill: none; stroke: white; stroke-width: 33; stroke-linecap: round; opacity: .85; }
.map-street.minor { stroke-width: 18; opacity: .6; }
.route-shadow, .route-progress { fill: none; stroke-linecap: round; }
.route-shadow { stroke: #c5d3dd; stroke-width: 8; stroke-dasharray: 2 16; }
.route-progress { stroke: var(--blue); stroke-width: 8; stroke-dasharray: 0 100; transition: stroke-dasharray .7s cubic-bezier(.2,.8,.2,1); }
.route-stops circle { fill: white; stroke: #aebdca; stroke-width: 4; }
.route-stops circle.done { fill: var(--yellow); stroke: var(--ink); }
.route-marker circle:first-child { fill: var(--red); stroke: white; stroke-width: 4; }
.route-marker path, .route-marker circle:last-child { fill: none; stroke: white; stroke-width: 3; stroke-linecap: round; }
.route-map text { fill: var(--muted); font: 800 9px var(--mono); letter-spacing: .12em; }
.route-marker { transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.route-nudge { position: relative; margin: -3px 0 0; text-align: center; color: var(--muted); font-size: 12px; }

.pulse-strip { display: grid; grid-template-columns: repeat(3, 1fr) 1.35fr; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.8); box-shadow: 0 8px 28px rgba(20,32,43,.05); }
.pulse-strip > div { display: flex; align-items: center; gap: 13px; min-height: 91px; padding: 18px 23px; border-right: 1px solid var(--line); }
.pulse-strip > div:last-child { border: 0; }
.pulse-strip p { display: flex; flex-direction: column; margin: 0; }
.pulse-strip strong { font-family: var(--display); font-size: 28px; line-height: 1; }
.pulse-strip small { margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; font-weight: 850; }
.stat-blue { color: var(--blue); background: var(--blue-soft); }
.stat-yellow { color: #7d6700; background: #fff7cb; }
.stat-red { color: var(--red); background: #fdecea; }
.coverage-meter { display: grid !important; grid-template-columns: auto 1fr; }
.coverage-meter > span { height: 6px; overflow: hidden; border-radius: 6px; background: #e5ebef; }
.coverage-meter > span i { display: block; width: 0; height: 100%; background: var(--blue); border-radius: inherit; transition: width .5s ease; }

.section-block { padding: 92px 0 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 26px; }
.section-heading h2 { margin: 8px 0 0; font-family: var(--display); font-size: clamp(31px, 3vw, 43px); line-height: 1; letter-spacing: -.035em; text-transform: uppercase; }
.section-heading > p { max-width: 340px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: right; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.mode-card { position: relative; min-height: 260px; overflow: hidden; padding: 25px; border: 1px solid var(--line); border-radius: 22px; background: white; text-align: left; cursor: pointer; box-shadow: 0 10px 28px rgba(20,32,43,.04); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.mode-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -65px; top: -50px; border-radius: 50%; background: var(--blue-soft); opacity: .7; transition: transform .3s ease; }
.mode-card:hover { transform: translateY(-5px); border-color: #b8c8d5; box-shadow: var(--shadow); }
.mode-card:hover::after { transform: scale(1.08); }
.mode-number { position: relative; z-index: 2; color: var(--muted); font: 700 10px var(--mono); }
.mini-sign { position: absolute; z-index: 2; top: 37px; right: 40px; display: grid; place-items: center; width: 72px; height: 72px; background: white; font: 850 23px var(--body); }
.mini-sign.speed { border: 9px solid var(--red); border-radius: 50%; }
.mini-sign.priority { transform: rotate(45deg); border: 8px solid white; outline: 6px solid var(--yellow); background: var(--yellow); box-shadow: 0 0 0 8px var(--ink); font-size: 0; }
.mini-sign.warning { clip-path: polygon(50% 0, 100% 91%, 0 91%); padding-top: 18px; color: var(--ink); background: var(--yellow); filter: drop-shadow(0 0 0 var(--red)); font-size: 33px; }
.mini-sign.recall { color: var(--blue); border: 8px solid var(--blue); border-radius: 50%; background: white; font-size: 34px; line-height: 1; }
.mode-copy { position: absolute; z-index: 2; left: 25px; right: 25px; bottom: 24px; display: flex; flex-direction: column; }
.mode-copy small { color: var(--blue); font: 800 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.mode-copy strong { margin-top: 8px; font-family: var(--display); font-size: 27px; line-height: 1; text-transform: uppercase; }
.mode-copy em { margin-top: 7px; color: var(--muted); font-size: 12px; font-style: normal; }
.round-arrow { position: absolute; z-index: 3; right: 22px; bottom: 21px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--blue); }
.mode-repair::after { background: #fff6c9; }

.section-heading.compact { align-items: center; }
.text-button { border: 0; background: none; color: var(--blue); font-size: 12px; font-weight: 750; cursor: pointer; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.category-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; min-height: 115px; padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.45); }
.category-letter { display: grid; place-items: center; width: 38px; height: 38px; color: var(--blue); border: 2px solid var(--blue); border-radius: 50%; font-family: var(--display); font-size: 20px; font-weight: 800; }
.category-item p { margin: 0; font-size: 12px; line-height: 1.3; font-weight: 750; }
.category-item small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.category-bar { grid-column: 1 / -1; height: 4px; overflow: hidden; background: #e3eaf0; border-radius: 4px; }
.category-bar i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.source-note { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin: 90px 0 55px; padding: 24px 27px; color: white; background: var(--ink); border-radius: 18px; }
.source-badge { display: grid; place-items: center; width: 53px; height: 53px; border: 2px solid var(--yellow); border-radius: 50%; color: var(--yellow); font: 800 10px/1.1 var(--mono); text-align: center; }
.source-note strong { font-size: 12px; }
.source-note p { margin: 4px 0 0; color: #b9c5cf; font-size: 12px; }
.source-note a { color: white; font-size: 12px; font-weight: 750; text-decoration: none; }
.source-note a span { color: var(--yellow); }
footer { width: min(1180px, calc(100% - 56px)); margin: 0 auto; padding: 0 0 max(32px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 10px; text-align: center; }

/* Quiz */
#quiz-view { min-height: calc(100vh - 92px); padding: 32px 0 50px; }
.quiz-topline { display: grid; grid-template-columns: 1fr minmax(260px, 420px) 1fr; align-items: center; gap: 20px; }
.back-button { justify-self: start; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 750; cursor: pointer; }
.back-button:hover { color: var(--blue); }
.quiz-progress-wrap > div { display: flex; justify-content: space-between; color: var(--muted); font: 750 10px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.quiz-progress-wrap strong { color: var(--ink); }
.quiz-progress { display: block; height: 5px; margin-top: 9px; overflow: hidden; background: #dce5ec; border-radius: 5px; }
.quiz-progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .35s ease; }
.quiz-score { justify-self: end; color: var(--green); font: 750 10px var(--mono); text-transform: uppercase; }
.quiz-layout { display: grid; grid-template-columns: 40px minmax(0, 760px); justify-content: center; gap: 35px; margin-top: 34px; }
.quiz-rail { display: flex; flex-direction: column; align-items: center; padding: 20px 0; color: var(--muted); font: 700 8px var(--mono); letter-spacing: .1em; writing-mode: vertical-rl; }
.quiz-rail i { width: 2px; height: 180px; margin: 10px 0; background: repeating-linear-gradient(to bottom, #aebdca 0 5px, transparent 5px 12px); }
.quiz-rail b { width: 14px; height: 14px; margin: -108px 0 -86px; z-index: 1; border: 3px solid white; border-radius: 50%; background: var(--red); box-shadow: 0 2px 8px rgba(20,32,43,.25); transition: transform .35s ease; }
.question-card { position: relative; overflow: hidden; padding: 30px 38px 22px; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.question-card::before { content: ""; position: absolute; top: 0; left: 0; width: 7px; height: 100%; background: var(--blue); }
.question-meta { display: flex; justify-content: space-between; color: var(--muted); font: 750 9px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.question-meta span:first-child { color: var(--blue); }
.sign-stage { position: relative; display: grid; place-items: center; width: 220px; height: 180px; margin: 14px auto 4px; border-radius: 22px; background: radial-gradient(circle, white 25%, #eef5f9 100%); }
.sign-stage::before, .sign-stage::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid #dbe6ed; }
.sign-stage::before { width: 146px; height: 146px; }
.sign-stage::after { width: 190px; height: 190px; opacity: .6; }
.sign-stage img { position: relative; z-index: 1; max-width: 132px; max-height: 135px; filter: drop-shadow(0 8px 8px rgba(20,32,43,.14)); }
.sign-code { position: absolute; z-index: 2; top: 10px; left: -8px; padding: 6px 9px; color: white; background: var(--ink); border-radius: 5px; font: 750 10px var(--mono); }
.question-copy { margin: 12px auto 22px; text-align: center; }
.question-copy p { margin: 0; color: var(--blue); font: 800 9px var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.question-copy h2 { max-width: 610px; margin: 8px auto 0; font-family: var(--display); font-size: clamp(25px, 3vw, 34px); line-height: 1.05; letter-spacing: -.025em; }
.answer-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer-button { display: grid; grid-template-columns: 29px 1fr 20px; align-items: center; gap: 11px; min-height: 63px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; text-align: left; cursor: pointer; transition: border .15s, background .15s, transform .15s; }
.answer-button:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.answer-button .choice-key { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); background: #edf2f5; font: 750 10px var(--mono); }
.answer-button .choice-copy { font-size: 12px; font-weight: 650; line-height: 1.35; }
.answer-button .choice-mark { font-size: 18px; font-weight: 800; text-align: center; }
.answer-button.correct { border-color: var(--green); background: var(--green-soft); }
.answer-button.correct .choice-key { color: white; background: var(--green); }
.answer-button.correct .choice-mark { color: var(--green); }
.answer-button.wrong { border-color: var(--red); background: #fdf0ef; }
.answer-button.wrong .choice-key { color: white; background: var(--red); }
.answer-button.wrong .choice-mark { color: var(--red); }
.answer-button:disabled { cursor: default; }
.feedback { display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: start; margin: 15px 0 0; padding: 15px; border-radius: 14px; background: var(--green-soft); }
.feedback.incorrect { background: #fdf0ef; }
.feedback-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: white; background: var(--green); font-weight: 800; }
.incorrect .feedback-icon { background: var(--red); }
.feedback strong { font-size: 13px; }
.feedback p { color: #475664; font-size: 11px; line-height: 1.45; }
.feedback-answer { margin: 3px 0 0; font-weight: 650; }
.feedback-note { margin-top: 9px; padding: 9px 11px; border-left: 3px solid var(--red); border-radius: 3px 9px 9px 3px; background: rgba(255,255,255,.72); }
.feedback-note span { display: block; margin-bottom: 4px; color: var(--red); font: 800 8px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.feedback-note p { margin: 0; }
.feedback .feedback-recall { margin: 8px 0 0; color: var(--blue); font: 750 9px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.feedback small { display: block; margin-top: 7px; color: var(--muted); font: 700 8px var(--mono); text-transform: uppercase; }
.button-next { align-self: end; min-height: 43px; padding: 0 16px; color: white; background: var(--ink); font-size: 11px; }
.keyboard-hint { margin: 14px 0 0; color: #8a97a2; font-size: 9px; text-align: center; }
kbd { padding: 2px 5px; border: 1px solid #c8d2da; border-bottom-width: 2px; border-radius: 4px; background: #f5f8fa; font: 700 8px var(--mono); }

/* Results */
#results-view { min-height: calc(100vh - 92px); display: grid; place-items: center; padding: 55px 0; }
.results-card { position: relative; width: min(720px, 100%); overflow: hidden; padding: 52px; border: 1px solid var(--line); border-radius: 30px; background: white; box-shadow: var(--shadow); text-align: center; }
.results-card > *:not(.results-road) { position: relative; z-index: 1; }
.results-card .eyebrow { justify-content: center; }
.results-card h1 { margin: 16px 0 12px; font-size: clamp(48px, 7vw, 76px); }
.results-summary { max-width: 510px; margin: 0 auto; color: var(--muted); line-height: 1.5; }
.results-score { display: flex; flex-direction: column; margin: 32px auto; }
.results-score strong { color: var(--blue); font-family: var(--display); font-size: 68px; line-height: 1; }
.results-score span { color: var(--muted); font: 750 9px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.result-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.result-insight { padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.result-insight small { color: var(--muted); font: 750 8px var(--mono); text-transform: uppercase; }
.result-insight strong { display: block; margin-top: 5px; font-family: var(--display); font-size: 19px; text-transform: uppercase; }
.results-actions { display: flex; justify-content: center; gap: 10px; margin-top: 25px; }
.results-road { position: absolute; z-index: 0; top: -44px; right: -14px; transform: rotate(22deg); width: 140px; height: 220px; background: #eef5f9; }
.results-road i { position: absolute; left: 50%; width: 4px; height: 100%; background: repeating-linear-gradient(to bottom, white 0 16px, transparent 16px 30px); }
.results-road span { position: absolute; left: 50%; top: 96px; display: grid; place-items: center; width: 42px; height: 42px; transform: translateX(-45%); border: 5px solid white; border-radius: 50%; color: white; background: var(--green); font-weight: 800; }

/* Library */
#library-view { padding: 54px 0 70px; }
.library-head { text-align: center; }
.library-head .back-button { margin-bottom: 42px; }
.library-head h1 { margin: 15px 0 10px; font-size: clamp(52px, 7vw, 80px); }
.library-head > p { margin: 0 auto; max-width: 560px; color: var(--muted); }
.search-box { display: flex; align-items: center; gap: 10px; width: min(520px, 100%); margin: 29px auto 18px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(20,32,43,.05); }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,87,184,.12); }
.search-box svg { width: 19px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-box input { width: 100%; height: 50px; border: 0; outline: 0; background: none; }
.filter-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.filter-button { min-width: 37px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 17px; background: white; color: var(--muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.filter-button.active { color: white; border-color: var(--blue); background: var(--blue); }
.library-count { display: flex; justify-content: space-between; margin: 46px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font: 750 10px var(--mono); text-transform: uppercase; }
.library-count span { color: var(--muted); }
.sign-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.sign-tile { position: relative; min-width: 0; min-height: 202px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: white; text-align: left; cursor: pointer; transition: transform .17s, border .17s, box-shadow .17s; }
.sign-tile:hover { z-index: 1; transform: translateY(-3px); border-color: #aec0cf; box-shadow: 0 12px 28px rgba(20,32,43,.1); }
.sign-tile.done::after { content: "✓"; position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: white; background: var(--green); font-size: 10px; font-weight: 800; }
.sign-tile img { width: 100%; height: 100px; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(20,32,43,.1)); }
.sign-tile small { display: block; margin-top: 10px; color: var(--blue); font: 750 9px var(--mono); }
.sign-tile strong { display: -webkit-box; overflow: hidden; margin-top: 5px; font-size: 10px; line-height: 1.4; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.empty-state { padding: 70px; text-align: center; color: var(--muted); }
.sign-dialog { width: min(500px, calc(100% - 30px)); padding: 30px; border: 0; border-radius: 24px; box-shadow: 0 30px 90px rgba(20,32,43,.3); }
.sign-dialog::backdrop { background: rgba(20,32,43,.65); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 22px; cursor: pointer; }
.dialog-visual { position: relative; display: grid; place-items: center; height: 230px; margin: -30px -30px 26px; border-radius: 24px 24px 0 0; background: radial-gradient(circle, white, #e8f2f8); }
.dialog-visual img { max-width: 170px; max-height: 170px; filter: drop-shadow(0 8px 8px rgba(20,32,43,.16)); }
.dialog-visual span { position: absolute; left: 20px; top: 20px; padding: 6px 9px; border-radius: 5px; color: white; background: var(--ink); font: 750 10px var(--mono); }
.sign-dialog h2 { margin: 8px 0; font-family: var(--display); font-size: 31px; line-height: 1.05; text-transform: uppercase; }
.sign-dialog > p:not(.kicker) { color: var(--muted); font-size: 12px; }
.dialog-actions { margin-top: 20px; }
.dialog-actions .button { width: 100%; }
.memory-dialog { width: min(590px, calc(100% - 30px)); padding: 34px; border: 0; border-radius: 24px; box-shadow: 0 30px 90px rgba(20,32,43,.3); }
.memory-dialog::backdrop { background: rgba(20,32,43,.65); backdrop-filter: blur(5px); }
.memory-dialog h2 { max-width: 460px; margin: 13px 0 10px; font-family: var(--display); font-size: 38px; line-height: .98; letter-spacing: -.03em; text-transform: uppercase; }
.memory-intro { max-width: 500px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.memory-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 25px 0 14px; }
.memory-stats div { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.memory-stats strong { display: block; overflow: hidden; color: var(--blue); font-family: var(--display); font-size: 27px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.memory-stats small { display: block; margin-top: 6px; color: var(--muted); font: 750 8px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.memory-storage-card { display: grid; grid-template-columns: 12px 1fr; align-items: start; gap: 12px; padding: 15px 16px; border-radius: 13px; color: white; background: var(--ink); }
.memory-storage-card > span { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: #35c982; box-shadow: 0 0 0 5px rgba(53,201,130,.13); }
.memory-storage-card strong { font-size: 12px; }
.memory-storage-card p { margin: 4px 0 0; color: #bdc8d1; font-size: 10px; line-height: 1.45; }
.memory-scheduled { margin: 12px 2px 0; color: var(--muted); font-size: 10px; }
.memory-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.memory-actions .button { width: 100%; }
.memory-note { display: block; margin-top: 14px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 150%); padding: 12px 17px; border-radius: 10px; color: white; background: var(--ink); box-shadow: 0 12px 32px rgba(20,32,43,.25); font-size: 11px; font-weight: 700; opacity: 0; transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 35px; padding-top: 52px; }
  .hero-copy { text-align: center; }
  .eyebrow, .hero-actions { justify-content: center; }
  .hero-intro { margin-inline: auto; }
  .route-card { min-height: 350px; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .mode-card:last-child { grid-column: 1 / -1; min-height: 210px; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .sign-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  :root { --radius: 18px; }
  body { background-size: 28px 28px; }
  .topbar, .view, footer { width: calc(100% - 32px); }
  .topbar { height: 72px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 17px; }
  .memory-button { display: grid; place-items: center; width: 39px; min-height: 39px; padding: 0; border-radius: 50%; }
  .memory-button span, .memory-button i { display: none; }
  .memory-button svg { width: 18px; }
  .icon-button { width: 39px; height: 39px; }
  .hero-grid { min-height: 0; padding: 43px 0 32px; gap: 30px; }
  .hero-copy h1 { font-size: 52px; margin: 16px 0 18px; }
  .hero-intro { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { width: 100%; }
  .route-card { min-height: 273px; padding: 21px 18px 10px; border-radius: 22px; }
  .route-map { margin-top: 0; }
  .route-nudge { margin-top: -14px; }
  .pulse-strip { grid-template-columns: 1fr 1fr; }
  .pulse-strip > div { min-height: 76px; padding: 14px; border-bottom: 1px solid var(--line); }
  .pulse-strip > div:nth-child(2) { border-right: 0; }
  .pulse-strip > div:nth-child(n+3) { border-bottom: 0; }
  .pulse-strip strong { font-size: 24px; }
  .pulse-strip small { font-size: 8px; }
  .coverage-meter { grid-template-columns: auto !important; align-content: center; gap: 8px !important; }
  .section-block { padding-top: 68px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; text-align: left; }
  .section-heading.compact { display: flex; align-items: end; }
  .section-heading.compact .text-button { max-width: 110px; text-align: right; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card, .mode-card:last-child { grid-column: auto; min-height: 210px; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .category-item { min-height: 102px; padding: 15px; }
  .source-note { grid-template-columns: auto 1fr; padding: 19px; }
  .source-note a { grid-column: 1 / -1; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.16); text-align: center; }
  #quiz-view { width: 100%; padding: 18px 0 0; }
  .quiz-topline { grid-template-columns: 50px 1fr 50px; padding: 0 16px; }
  .back-button span, .quiz-score { display: none; }
  .quiz-layout { display: block; margin-top: 18px; }
  .quiz-rail { display: none; }
  .question-card { min-height: calc(100vh - 135px); padding: 24px 17px max(24px, env(safe-area-inset-bottom)); border-radius: 23px 23px 0 0; border-bottom: 0; }
  .question-card::before { width: 100%; height: 5px; }
  .sign-stage { width: 185px; height: 155px; }
  .sign-stage::before { width: 125px; height: 125px; }
  .sign-stage::after { width: 164px; height: 164px; }
  .sign-stage img { max-width: 112px; max-height: 118px; }
  .question-copy { margin-bottom: 18px; }
  .answer-list { grid-template-columns: 1fr; gap: 8px; }
  .answer-button { min-height: 56px; }
  .feedback { position: sticky; bottom: max(5px, env(safe-area-inset-bottom)); grid-template-columns: 38px 1fr; }
  .feedback-icon { width: 36px; height: 36px; }
  .feedback .button-next { grid-column: 1 / -1; width: 100%; }
  .keyboard-hint { display: none; }
  #results-view { padding: 25px 0; }
  .results-card { padding: 45px 20px 25px; border-radius: 23px; }
  .results-card h1 { font-size: 49px; }
  .result-insights { grid-template-columns: 1fr; }
  .results-actions { flex-direction: column; }
  .results-actions .button { width: 100%; }
  #library-view { padding-top: 27px; }
  .library-head .back-button { margin-bottom: 33px; }
  .library-head h1 { font-size: 52px; }
  .sign-grid { grid-template-columns: repeat(2, 1fr); }
  .sign-tile { min-height: 188px; }
  .sign-tile img { height: 94px; }
  .memory-dialog { padding: 27px 20px 22px; border-radius: 21px; }
  .memory-dialog h2 { padding-right: 24px; font-size: 33px; }
  .memory-stats { grid-template-columns: 1fr 1fr; }
  .memory-stats div:last-child { grid-column: 1 / -1; }
  .memory-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
