:root {
  --ink: #17354d;
  --ink-deep: #102a3d;
  --paper: #f8f5ec;
  --sheet: #fffdf7;
  --line: #dcd9cc;
  --muted: #62757e;
  --teal: #1b958c;
  --teal-deep: #14776f;
  --yellow: #f2c84b;
  --coral: #e87858;
  --blue: #7199c1;
  --green: #80a866;
  --success: #2c7f58;
  --danger: #a44037;
  --soft-mint: #e2f0e8;
  --soft-blue: #e5eef3;
  --soft-coral: #f8e6dd;
  --shadow-sm: 0 4px 14px rgba(23, 53, 77, .06);
  --shadow-md: 0 15px 36px rgba(23, 53, 77, .09);
  --radius-sm: 12px;
  --radius: 19px;
  color-scheme: light;
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, a, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #0c7790; outline-offset: 3px; }
.visually-hidden { 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: absolute; z-index: 1000; left: 12px; top: -60px; padding: 12px 18px; background: var(--sheet); border: 2px solid var(--ink); border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* Global frame and navigation */
.topbar { min-height: 74px; padding: 0 clamp(20px, 4.2vw, 66px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #e7e2d5; background: var(--sheet); color: var(--ink); box-shadow: 0 2px 10px rgba(23,53,77,.035); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 190px; }
.brand-mark { width: 42px; height: 42px; color: var(--teal-deep); }
.brand strong { display: block; font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: 18px; letter-spacing: -.45px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 1.25px; }
.main-nav { align-self: stretch; display: flex; align-items: stretch; gap: 5px; }
.nav-link { min-width: 82px; min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; transition: color .18s ease, background .18s ease, transform .18s ease; }
.nav-link:hover { color: var(--ink); background: #eef4ef; }
.nav-link.is-active { background: var(--teal); color: #fff; font-weight: 800; }
.nav-link[aria-current="page"] { color: #fff; }
.top-actions { min-width: 190px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; }
.offline-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.offline-badge i { width: 8px; height: 8px; border-radius: 50%; background: #78d6a0; box-shadow: 0 0 0 3px rgba(120,214,160,.16); }
.offline-badge.is-offline i { background: var(--yellow); }
.install-button { min-height: 40px; padding: 0 14px; border: 1px solid #cbd8d2; border-radius: 999px; background: #f6faf6; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.install-button:hover { background: #eaf4ee; }
.mobile-nav { display: none; }
.page { min-height: calc(100vh - 130px); animation: page-arrive .28s ease both; }
@keyframes page-arrive { from { opacity: .72; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard */
.home-wrap { max-width: 1360px; margin: 0 auto; padding: 30px clamp(18px, 4vw, 62px) 54px; }
.hero { min-height: 392px; display: grid; grid-template-columns: 1.04fr .96fr; align-items: center; gap: clamp(24px, 4vw, 58px); padding: 38px 43px; overflow: hidden; position: relative; border: 1px solid #e1ded2; border-radius: 22px; background: var(--sheet); box-shadow: var(--shadow-md); }
.hero-copy { position: relative; z-index: 1; max-width: 610px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--teal-deep); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow-line { display: inline-block; width: 22px; height: 2px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
.hero h1, .path-heading h1, .result-wrap h1, .about-wrap .page-intro h1, #progress h1, #explore h1 { margin: 17px 0 13px; font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: clamp(38px, 4.3vw, 58px); line-height: 1.05; letter-spacing: -2px; }
.hero h1 span, .about-wrap .page-intro h1 span { color: var(--teal-deep); }
.hero-copy > p { max-width: 570px; margin: 0; color: #546b76; font-size: 16px; line-height: 1.7; }
.hero-actions { margin-top: 23px; display: flex; align-items: center; flex-wrap: wrap; gap: 13px 20px; }
.button { min-height: 48px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 10px; font-size: 14px; font-weight: 850; text-decoration: none; cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(.985); }
.button-coral { background: var(--coral); color: #fff; box-shadow: 0 4px 0 #c75d42; }
.button-coral:hover { background: #ee896d; }
.button-teal { background: var(--teal); color: #fff; box-shadow: 0 4px 0 var(--teal-deep); }
.button-teal:hover { background: #20a79b; }
.button-yellow { background: var(--yellow); color: var(--ink-deep); box-shadow: 0 4px 0 #d3a934; }
.button-yellow:hover { background: #ffda63; }
.button-navy { background: var(--ink); color: #fff; }
.button-navy:hover { background: #244c69; }
.button-outline { color: var(--ink); border: 1px solid #aab6b5; background: transparent; }
.button-outline:hover { background: #f4f3ed; }
.hero-text-action, .section-link, .text-action { min-height: 44px; padding: 0; display: inline-flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 800; cursor: pointer; }
.hero-text-action:hover, .section-link:hover, .text-action:hover { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 4px; }
.hero-stats { margin-top: 27px; display: flex; gap: clamp(18px, 3vw, 36px); }
.hero-stats div { display: grid; gap: 3px; }
.hero-stats strong { color: var(--ink); font-family: "Trebuchet MS", sans-serif; font-size: 20px; font-variant-numeric: tabular-nums; }
.hero-stats span { color: var(--muted); font-size: 11px; }
.hero-study-card { min-height: 298px; padding: 19px 23px 18px; position: relative; overflow: hidden; border: 1px solid #d7e2df; border-radius: 17px; background: #eff4ee; }
.study-card-top { display: flex; align-items: center; justify-content: space-between; color: #52706e; font-size: 9px; font-weight: 850; letter-spacing: .17em; }
.study-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px #f7e7dc; }
.study-sketch { display: block; width: min(100%, 420px); height: 198px; margin: 2px auto 0; overflow: visible; }
.sketch-line, .sketch-circle { fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.sketch-accent { stroke: var(--teal); }
.sketch-muted { stroke: #a4b8b2; stroke-width: 1.45; }
.sketch-circle { stroke: var(--coral); stroke-dasharray: 3 6; stroke-width: 1.8; }
.sketch-label { fill: #687a7b; font: 800 9px "Segoe UI", sans-serif; letter-spacing: 1.7px; }
.study-formula { padding-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid #d5dfd9; }
.study-formula span { color: var(--teal-deep); font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.study-formula strong { color: var(--ink); font-family: "Trebuchet MS", sans-serif; font-size: 13px; text-align: right; }

.dashboard-strip { margin-top: 17px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 16px; }
.dashboard-progress-card, .dashboard-start-card { min-height: 142px; padding: 20px 23px; display: flex; align-items: center; gap: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--sheet); }
.dashboard-progress-card { box-shadow: var(--shadow-sm); }
.progress-ring { width: 82px; height: 82px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal) var(--progress-angle, 0deg), #dce6df 0deg); position: relative; }
.progress-ring::before { content: ""; position: absolute; inset: 8px; border-radius: inherit; background: var(--sheet); }
.progress-ring span { z-index: 1; color: var(--ink); font-family: "Trebuchet MS", sans-serif; font-size: 17px; font-weight: 850; font-variant-numeric: tabular-nums; }
.dashboard-progress-copy { min-width: 0; flex: 1; }
.card-kicker { display: block; color: var(--teal-deep); font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.dashboard-progress-copy h2, .dashboard-start-card h2 { margin: 6px 0 4px; font-family: "Trebuchet MS", sans-serif; font-size: 18px; letter-spacing: -.35px; }
.dashboard-progress-copy p, .dashboard-start-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.dashboard-progress-copy p strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.dashboard-correct { min-width: 88px; padding-left: 18px; display: grid; justify-items: start; gap: 1px; border-left: 1px solid var(--line); }
.dashboard-correct strong { color: var(--teal-deep); font-family: "Trebuchet MS", sans-serif; font-size: 27px; font-variant-numeric: tabular-nums; }
.dashboard-correct span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.dashboard-start-card { background: var(--soft-blue); border-color: #d3dfe4; }
.start-symbol { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #c7d7dc; border-radius: 12px; background: #f5faf8; color: var(--teal-deep); font-family: Georgia, serif; font-size: 22px; }
.dashboard-start-card > div { min-width: 0; flex: 1; }
.dashboard-start-card .button { min-height: 42px; flex: 0 0 auto; padding-inline: 14px; font-size: 12px; }

.routes-section { padding-top: 40px; }
.section-head { margin-bottom: 17px; display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.section-head h2 { margin: 8px 0 0; font-family: "Trebuchet MS", sans-serif; font-size: clamp(24px, 2.8vw, 32px); letter-spacing: -.8px; }
.section-link { flex: 0 0 auto; color: var(--teal-deep); }
.route-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.route-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.route-card { min-height: 205px; padding: 16px 17px 18px; display: flex; flex-direction: column; align-items: stretch; position: relative; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid var(--track, var(--teal)); border-radius: 15px; background: var(--sheet); color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 2px 0 rgba(23,53,77,.025); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.route-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #c7d3ce; }
.route-card:active { transform: translateY(-1px) scale(.995); }
.route-card[data-track="0"] { --track: #80a866; --track-pale: #eff4e9; }
.route-card[data-track="1"] { --track: var(--teal); --track-pale: #e7f3f1; }
.route-card[data-track="2"] { --track: var(--coral); --track-pale: #f9eee9; }
.route-card[data-track="3"] { --track: var(--blue); --track-pale: #eaf0f7; }
.route-top { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.route-grade { color: var(--track); font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.route-symbol { width: 37px; height: 37px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--track) 30%, white); border-radius: 11px; background: var(--track-pale); color: var(--track); font-family: "Trebuchet MS", sans-serif; font-size: 17px; font-weight: 850; }
.route-card h3 { margin: 15px 0 5px; font-family: "Trebuchet MS", sans-serif; font-size: 17px; line-height: 1.25; }
.route-card p { min-height: 37px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.route-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #546973; font-size: 11px; font-weight: 750; }
.route-arrow { color: var(--track); font-size: 18px; transition: transform .18s ease; }
.route-card:hover .route-arrow { transform: translateX(3px); }
.route-progress-track { height: 3px; margin-top: 12px; overflow: hidden; border-radius: 4px; background: #e8e7df; }
.route-progress-track i { height: 100%; display: block; border-radius: inherit; background: var(--track); transition: width .3s ease; }
.method-strip { margin-top: 22px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #d5dfda; border-radius: 14px; background: #e6efea; }
.method-title { display: flex; align-items: center; gap: 11px; }
.method-mark { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid #c7d6cd; border-radius: 10px; background: #f7faf4; color: var(--teal-deep); font-family: Georgia, serif; font-size: 19px; }
.method-title strong { display: block; font-family: "Trebuchet MS", sans-serif; font-size: 13px; }
.method-title small { display: block; margin-top: 2px; color: #667975; font-size: 10px; }
.method-points { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.method-points span { padding: 6px 9px; border-radius: 7px; background: rgba(255,255,255,.62); color: #4d686c; font-size: 10px; font-weight: 750; }
.mode-filter { width: fit-content; margin: 0 0 15px; padding: 4px; display: flex; gap: 4px; border: 1px solid #d6ded6; border-radius: 12px; background: #eef2ec; }
.mode-chip { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #5e7074; font-size: 12px; font-weight: 800; cursor: pointer; transition: color .16s ease, background .16s ease, box-shadow .16s ease; }
.mode-chip:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.mode-chip.is-selected { border-color: #d6e4dd; background: var(--sheet); color: var(--teal-deep); box-shadow: 0 2px 6px rgba(23,53,77,.08); }
#explore .mode-filter { margin: -5px 0 16px; }

/* Explore and subject path */
.content-wrap { max-width: 1220px; margin: 0 auto; padding: 38px clamp(18px, 4vw, 60px) 55px; }
.page-intro { margin: 8px 0 27px; }
.page-intro h1 { margin: 11px 0 8px !important; font-size: clamp(34px, 4vw, 48px) !important; }
.lead { max-width: 760px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.explore-controls { margin: 24px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.explore-note { margin: 18px 0 12px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid #d8e4db; border-radius: 12px; background: #edf4ee; }
.explore-note p { flex: 1; margin: 0; color: #536c69; font-size: 12px; line-height: 1.5; }
.explore-note-label { flex: 0 0 auto; padding: 6px 8px; border-radius: 7px; background: #dcefe7; color: var(--teal-deep); font-size: 9px; font-weight: 850; letter-spacing: .06em; }
.explore-note.is-tka { border-color: #e7d8b6; background: #f8f0df; }
.explore-note.is-tka .explore-note-label { background: #f1e1bd; color: #755c28; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { min-height: 39px; padding: 0 13px; border: 1px solid #d2d4c8; border-radius: 999px; background: var(--sheet); color: #586d75; font-size: 12px; font-weight: 750; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.filter-chip:hover { border-color: var(--teal); color: var(--ink); }
.filter-chip.is-selected { border-color: var(--ink); background: var(--ink); color: #fff; }
.search-field { width: min(340px, 100%); min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 9px; border: 1px solid #d2d4c8; border-radius: 10px; background: var(--sheet); color: var(--muted); }
.search-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(27,149,140,.12); }
.search-field svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-field input::placeholder { color: #859399; }
.explore-count { margin: 17px 0 11px; color: var(--muted); font-size: 12px; }
.explore-grid { align-items: stretch; }
.empty-state { min-height: 190px; display: grid; align-content: center; justify-items: center; gap: 7px; border: 1px dashed #bdc9c4; border-radius: 16px; background: rgba(255,253,247,.7); color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-family: "Trebuchet MS", sans-serif; font-size: 18px; }
.back-link { min-height: 42px; display: inline-flex; align-items: center; padding: 0 3px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 750; cursor: pointer; }
.back-link:hover { color: var(--ink); }
.path-heading { margin: 22px 0 20px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.path-heading h1 { margin: 11px 0 7px; font-size: clamp(34px, 4vw, 46px); }
.path-heading p { max-width: 620px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.path-total { min-width: 126px; padding: 13px 18px; display: grid; justify-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 13px; background: var(--sheet); }
.path-total strong { font-family: "Trebuchet MS", sans-serif; font-size: 28px; font-variant-numeric: tabular-nums; }
.path-total span { color: var(--muted); font-size: 11px; }
.path-note { margin: 20px 0 17px; padding: 13px 16px; display: flex; align-items: center; gap: 12px; border-left: 3px solid var(--yellow); border-radius: 0 9px 9px 0; background: #ecebdd; }
.path-note p { margin: 0; color: #465d66; font-size: 13px; line-height: 1.5; }
.note-icon { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #6a7e83; border-radius: 50%; font-family: Georgia, serif; font-size: 13px; font-weight: 750; }
.chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.chapter-row { min-height: 102px; padding: 14px; display: grid; grid-template-columns: 39px minmax(120px, 1fr) minmax(88px, .7fr); grid-template-rows: 1fr auto; align-items: center; column-gap: 12px; row-gap: 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--sheet); }
.chapter-index { width: 34px; height: 34px; grid-row: 1 / 3; display: grid; place-items: center; border: 1px solid #e2d59b; border-radius: 11px; background: #fcf4d5; color: #786022; font-size: 12px; font-weight: 850; font-variant-numeric: tabular-nums; }
.chapter-info { min-width: 0; }
.chapter-info strong { display: block; font-family: "Trebuchet MS", sans-serif; font-size: 15px; line-height: 1.25; }
.chapter-info small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.chapter-progress { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.mini-track { height: 5px; display: block; flex: 1; overflow: hidden; border-radius: 6px; background: #e7e7de; }
.mini-track i { height: 100%; display: block; border-radius: inherit; background: var(--teal); }
.progress-copy { color: #6e7d81; font-size: 10px; white-space: nowrap; }
.chapter-count { justify-self: end; color: var(--muted); font-size: 10px; }
.chapter-start { grid-column: 3; grid-row: 1 / 3; min-height: 39px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--teal); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.chapter-start:hover { background: var(--teal-deep); }

/* Question flow */
.quiz-wrap { max-width: 1180px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 55px) 52px; }
.quiz-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quiz-path-label { padding: 7px 11px; border: 1px solid #d2dfd8; border-radius: 999px; background: #e6f0e9; color: #507366; font-size: 10px; font-weight: 850; }
.quiz-progress-row { margin: 14px 0 21px; padding: 13px 16px; display: grid; grid-template-columns: minmax(160px, auto) 1fr; align-items: center; gap: 19px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,247,.7); }
.quiz-progress-row > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quiz-topic { color: var(--ink); font-family: "Trebuchet MS", sans-serif; font-size: 13px; font-weight: 850; }
.quiz-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.progress-track { height: 8px; overflow: hidden; border-radius: 8px; background: #dedfd7; }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: var(--teal); transition: width .28s ease; }
.question-layout { display: grid; grid-template-columns: minmax(200px, .31fr) minmax(0, .69fr); align-items: start; gap: 17px; }
.question-rail { display: grid; gap: 12px; }
.rail-card { padding: 18px; border: 1px solid #d5dfda; border-radius: 15px; background: #e7efea; }
.rail-label { display: block; margin-bottom: 10px; color: #5d7c72; font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.rail-card > strong { display: block; font-family: "Trebuchet MS", sans-serif; font-size: 18px; line-height: 1.3; }
.rail-meta { margin-top: 15px; display: grid; gap: 7px; }
.rail-meta span { width: fit-content; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.7); color: #607671; font-size: 10px; font-weight: 750; }
.rail-hint { padding: 13px 14px; display: flex; align-items: start; gap: 9px; border-radius: 11px; background: #f7edd1; color: #6e633e; }
.rail-hint > span { font-size: 17px; }
.rail-hint p { margin: 0; font-size: 11px; line-height: 1.55; }
.question-art { margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--sheet); }
.question-art img { width: 100%; max-height: 245px; display: block; object-fit: contain; border-radius: 8px; }
.question-art figcaption { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.question-art.is-triptych-panel { width: min(100%, 240px); aspect-ratio: 1; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: transparent; }
.question-art.is-triptych-panel img { width: 300%; max-width: none; max-height: none; height: auto; object-fit: fill; border-radius: 0; }
.question-art.is-triptych-panel figcaption { margin-top: 8px; }
.question-art.is-triptych-panel.is-portrait-panel { width: min(100%, 176px); aspect-ratio: .579; }
.question-card { min-width: 0; padding: clamp(20px, 3vw, 34px); border: 1px solid #dedbce; border-radius: 17px; background: var(--sheet); box-shadow: var(--shadow-sm); }
.question-number { margin-bottom: 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.question-number > span:first-child { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #e2d59b; border-radius: 11px; background: #fcf4d5; color: #786022; font-family: "Trebuchet MS", sans-serif; font-size: 14px; font-weight: 850; }
.question-number > span:last-child { color: #6a7c82; font-size: 10px; font-weight: 800; text-align: right; }
.question-card h1 { max-width: 780px; margin: 0 0 22px; font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: clamp(21px, 2.6vw, 29px); line-height: 1.38; letter-spacing: -.45px; }
.question-stimulus { margin-bottom: 18px; padding: 13px; border-radius: 9px; background: #eef3ef; color: #405f5e; font-size: 13px; line-height: 1.6; white-space: pre-line; }
.answer-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.answer-fieldset legend { margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 750; }
.answer-options { display: grid; gap: 9px; }
.answer-option { min-height: 50px; padding: 8px 11px; display: grid; grid-template-columns: 19px 30px minmax(0, 1fr); align-items: center; gap: 10px; border: 1px solid #d8d9d0; border-radius: 10px; background: #fffefa; color: #304956; font-size: 14px; line-height: 1.45; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.answer-option:hover { border-color: #9db8ae; background: #fafcf8; }
.answer-option:focus-within { outline: 3px solid rgba(12,119,144,.38); outline-offset: 2px; }
.answer-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--teal-deep); }
.answer-letter { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #eeeee6; color: #5f7178; font-size: 11px; font-weight: 850; }
.answer-option input:checked + .answer-letter { background: #dcefe7; color: var(--teal-deep); }
.answer-option input:disabled { opacity: .65; }
.answer-option:has(input:checked) { border-color: var(--teal); background: #f0f8f3; box-shadow: 0 0 0 2px rgba(27,149,140,.08); }
.category-row { padding: 12px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 13px; border: 1px solid #d8d9d0; border-radius: 10px; background: #fffefa; }
.category-statement { display: flex; gap: 8px; color: #304956; font-size: 13px; line-height: 1.5; }
.category-statement b { color: var(--teal-deep); }
.category-choice { display: flex; gap: 7px; }
.category-choice label { min-height: 38px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d8d9d0; border-radius: 8px; background: #fff; color: #465e68; font-size: 11px; font-weight: 750; cursor: pointer; }
.category-choice input { accent-color: var(--teal-deep); }
.category-choice label:focus-within { outline: 3px solid rgba(12,119,144,.38); outline-offset: 2px; }
.matching-row { min-height: 52px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0,1fr) minmax(170px,.56fr); align-items: center; gap: 13px; border: 1px solid #d8d9d0; border-radius: 10px; background: #fffefa; }
.matching-prompt { color: #304956; font-size: 13px; line-height: 1.45; }
.matching-row select, .short-answer-wrap input, .open-answer-wrap textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #cbd5d1; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.matching-row select { font-size: 12px; }
.matching-row select:focus-visible, .short-answer-wrap input:focus-visible, .open-answer-wrap textarea:focus-visible { outline: 3px solid rgba(12,119,144,.35); outline-offset: 2px; }
.short-answer-wrap { display: flex; align-items: center; gap: 10px; }
.short-answer-wrap input { max-width: 320px; font-size: 15px; }
.short-answer-unit { color: var(--muted); font-size: 13px; font-weight: 750; }
.open-answer-wrap textarea { min-height: 118px; resize: vertical; font-size: 14px; line-height: 1.55; }
.open-review { margin-top: 14px; padding: 14px; border: 1px solid #d7e0d8; border-radius: 11px; background: #f5f7f0; }
.open-review p { margin: 0 0 11px; color: #52676a; font-size: 12px; line-height: 1.5; }
.open-review > div { display: flex; flex-wrap: wrap; gap: 8px; }
.open-review .button { min-height: 42px; font-size: 12px; }
.answer-rubric { margin: 9px 0 0; padding-left: 21px; font-size: 12px; line-height: 1.55; }
.question-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.answer-error { margin: 12px 0 0; color: var(--danger); font-size: 12px; font-weight: 750; }
.feedback { margin-top: 17px; padding: 15px; border: 1px solid #c2ddcf; border-radius: 12px; background: #e8f3e9; color: #2e5f4b; }
.feedback.is-wrong { border-color: #e9c7bb; background: #fbede7; color: #7c4439; }
.feedback-heading { display: flex; align-items: center; gap: 9px; }
.feedback-heading > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.75); font-weight: 900; }
.feedback-heading strong { font-family: "Trebuchet MS", sans-serif; font-size: 14px; }
.feedback p { margin: 10px 0 0; font-size: 13px; line-height: 1.6; }
.feedback .answer-key { padding-top: 9px; border-top: 1px solid rgba(50,90,70,.15); font-size: 11px; font-weight: 800; }
.after-answer { margin-top: 14px; display: flex; justify-content: flex-end; }

/* Results, progress and source notes */
.result-wrap { max-width: 760px; margin: 0 auto; padding: 72px 22px 90px; text-align: center; }
.result-wrap .eyebrow { justify-content: center; }
.result-medallion { width: 146px; height: 146px; margin: 28px auto 19px; display: grid; align-content: center; justify-items: center; border: 8px solid #dbece2; border-radius: 50%; background: var(--sheet); box-shadow: inset 0 0 0 1px #bddec9; }
.result-medallion strong { color: var(--teal-deep); font-family: "Trebuchet MS", sans-serif; font-size: 32px; font-variant-numeric: tabular-nums; }
.result-medallion span { color: var(--muted); font-size: 10px; }
.result-wrap h1 { margin: 10px 0 12px; font-size: clamp(32px, 4vw, 46px); }
.result-wrap > p { max-width: 600px; margin: 0 auto; color: var(--muted); font-size: 15px; line-height: 1.7; }
.result-actions { margin-top: 24px; display: flex; justify-content: center; flex-wrap: wrap; gap: 11px; }
.progress-wrap > .page-intro { margin-bottom: 22px; }
.progress-overview { margin-bottom: 23px; padding: 19px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; border: 1px solid #d5dfda; border-radius: 15px; background: #e7efea; }
.progress-overview > div { padding-left: 18px; display: grid; gap: 6px; border-left: 1px solid #c9d6cf; }
.progress-overview > div:first-child { padding-left: 0; border-left: 0; }
.progress-overview > div > span { color: #5e7a71; font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.progress-overview strong { color: var(--ink); font-family: "Trebuchet MS", sans-serif; font-size: 26px; font-variant-numeric: tabular-nums; }
.progress-overview strong i { color: #72837f; font-size: 13px; font-style: normal; }
.progress-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 13px; }
.progress-block { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--sheet); }
.progress-block h2 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid #e3e2d8; font-family: "Trebuchet MS", sans-serif; font-size: 14px; line-height: 1.4; }
.progress-line { min-height: 41px; display: grid; grid-template-columns: minmax(100px,1fr) minmax(65px,.8fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid #efeee8; }
.progress-line:last-child { border-bottom: 0; }
.progress-line strong { font-size: 11px; line-height: 1.35; }
.progress-line > span:last-child { color: var(--muted); font-size: 9px; white-space: nowrap; }
.empty-progress { grid-column: 1/-1; margin: 0; padding: 16px; border: 1px dashed #bac9c3; border-radius: 11px; background: #f6f8f1; color: var(--muted); font-size: 13px; line-height: 1.6; }
.clear-action { margin-top: 20px; color: #8c5750; }
.about-wrap .page-intro { max-width: 900px; }
.about-wrap .page-intro h1 { font-size: clamp(35px, 4.3vw, 53px) !important; }
.about-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.about-grid article { min-height: 160px; padding: 19px; position: relative; border: 1px solid var(--line); border-radius: 13px; background: var(--sheet); }
.about-index { width: 30px; height: 30px; margin-bottom: 11px; display: grid; place-items: center; border: 1px solid #e0d59f; border-radius: 9px; background: #fcf4d5; color: #786022; font-size: 10px; font-weight: 850; }
.about-grid article strong { display: block; font-family: "Trebuchet MS", sans-serif; font-size: 16px; }
.about-grid article p { max-width: 470px; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.document-link { min-height: 48px; margin-top: 18px; padding: 0 14px; display: inline-flex; align-items: center; gap: 14px; border: 1px solid #cbd9d4; border-radius: 9px; background: #e8f0eb; color: var(--teal-deep); font-size: 12px; font-weight: 850; text-decoration: none; }
.document-link:hover { background: #dcebe3; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; }
.about-links .document-link { margin-top: 18px; }
.site-footer { min-height: 54px; padding: 13px clamp(18px, 4vw, 62px); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(23,53,77,.09); color: #6c7c7e; font-size: 10px; }
.site-footer span:first-child { color: var(--ink); font-weight: 850; letter-spacing: .09em; }
.site-footer i { color: var(--coral); font-style: normal; }
.footer-about { margin-left: auto; padding: 5px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--teal-deep); font-size: 10px; font-weight: 800; cursor: pointer; }
.footer-about:hover { background: #e8f0eb; }

@media (max-width: 1080px) {
  .topbar { gap: 14px; padding-inline: 25px; }
  .brand { min-width: 160px; }
  .top-actions { min-width: auto; }
  .nav-link { min-width: 73px; padding-inline: 12px; }
  .hero { gap: 25px; padding: 32px; }
  .route-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .route-card { min-height: 180px; }
  .dashboard-strip { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 64px; padding: 0 17px; }
  .brand { min-width: auto; }
  .brand-mark { width: 36px; height: 36px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 8px; }
  .main-nav { display: none; }
  .top-actions { gap: 9px; }
  .offline-badge { font-size: 10px; }
  .install-button { min-height: 37px; padding-inline: 10px; font-size: 10px; }
  .mobile-nav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; min-height: calc(66px + env(safe-area-inset-bottom)); padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid #d7d8cd; background: rgba(255,253,247,.97); box-shadow: 0 -6px 20px rgba(23,53,77,.08); backdrop-filter: blur(12px); }
  .mobile-nav .nav-link { min-width: 0; min-height: 54px; align-self: center; padding: 4px 2px; display: flex; flex-direction: column; gap: 3px; border: 0; border-radius: 10px; color: #718087; font-size: 10px; font-weight: 750; }
  .mobile-nav .nav-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-nav .nav-link.is-active { background: #e7f0eb; color: var(--teal-deep); }
  .mobile-nav .nav-link:hover { color: var(--ink); background: #f1f0e9; }
  .page { min-height: calc(100dvh - 64px - 72px - env(safe-area-inset-bottom)); }
  .home-wrap { padding: 17px 16px 28px; }
  .hero { min-height: 0; grid-template-columns: 1fr; gap: 20px; padding: 24px 20px 19px; border-radius: 17px; }
  .hero h1 { margin: 13px 0 10px; font-size: clamp(34px, 9vw, 46px); letter-spacing: -1.3px; }
  .hero-copy > p { font-size: 14px; line-height: 1.6; }
  .hero-actions { margin-top: 17px; gap: 9px 15px; }
  .button { min-height: 46px; padding-inline: 15px; font-size: 13px; }
  .hero-text-action { font-size: 12px; }
  .hero-stats { margin-top: 19px; gap: 21px; }
  .hero-stats strong { font-size: 18px; }
  .hero-study-card { min-height: 240px; padding: 15px 16px 13px; border-radius: 13px; }
  .study-sketch { height: 152px; }
  .study-formula strong { font-size: 11px; }
  .dashboard-strip { margin-top: 12px; gap: 10px; }
  .dashboard-progress-card, .dashboard-start-card { min-height: 120px; padding: 14px; gap: 12px; border-radius: 13px; }
  .progress-ring { width: 67px; height: 67px; }
  .progress-ring::before { inset: 7px; }
  .progress-ring span { font-size: 14px; }
  .dashboard-progress-copy h2, .dashboard-start-card h2 { font-size: 15px; }
  .dashboard-progress-copy p, .dashboard-start-card p { font-size: 11px; }
  .dashboard-correct { min-width: 65px; padding-left: 10px; }
  .dashboard-correct strong { font-size: 22px; }
  .dashboard-correct span { font-size: 9px; }
  .dashboard-start-card { flex-wrap: wrap; }
  .dashboard-start-card > div { flex: 1 1 calc(100% - 58px); }
  .dashboard-start-card .button { margin-left: 54px; }
  .routes-section { padding-top: 27px; }
  .section-head { margin-bottom: 13px; align-items: center; }
  .section-head h2 { font-size: 24px; }
  .section-link { font-size: 11px; }
  .route-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .route-grid[data-count="3"] { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .route-card { min-height: 178px; padding: 12px; border-radius: 12px; }
  .route-top { min-height: 32px; }
  .route-grade { font-size: 9px; }
  .route-symbol { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
  .route-card h3 { margin-top: 12px; font-size: 14px; }
  .route-card p { min-height: 49px; margin-bottom: 10px; font-size: 10px; }
  .route-bottom { font-size: 9px; }
  .method-strip { margin-top: 15px; padding: 12px; align-items: start; flex-direction: column; gap: 12px; }
  .method-points { justify-content: flex-start; }
  .method-points span { font-size: 9px; }
  .mode-filter { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .mode-chip { padding-inline: 9px; font-size: 11px; }
  .content-wrap { padding: 26px 16px 34px; }
  .page-intro { margin: 4px 0 19px; }
  .page-intro h1, #explore h1, #progress h1 { font-size: clamp(30px, 8vw, 39px) !important; letter-spacing: -1.2px; }
  .lead { font-size: 14px; }
  .explore-controls { margin-top: 19px; align-items: stretch; flex-direction: column-reverse; gap: 13px; }
  .explore-note { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .explore-note p { flex: 1 1 100%; order: 2; }
  .filter-group { gap: 7px; }
  .filter-chip { min-height: 37px; padding-inline: 11px; font-size: 10px; }
  .search-field { width: 100%; min-height: 46px; }
  .explore-count { margin-top: 13px; }
  .chapter-list { grid-template-columns: 1fr; gap: 8px; }
  .chapter-row { min-height: 94px; padding: 12px; grid-template-columns: 35px minmax(100px,1fr) minmax(86px,.75fr); column-gap: 9px; }
  .chapter-index { width: 31px; height: 31px; }
  .chapter-info strong { font-size: 13px; }
  .chapter-start { min-height: 37px; padding-inline: 9px; font-size: 10px; }
  .path-heading { margin-top: 16px; align-items: start; }
  .path-heading h1 { font-size: 32px; letter-spacing: -1px; }
  .path-heading p { font-size: 13px; }
  .path-total { min-width: 80px; padding: 10px; }
  .path-total strong { font-size: 23px; }
  .path-total span { font-size: 9px; }
  .path-note { margin: 15px 0 13px; padding: 11px; }
  .path-note p { font-size: 11px; }
  .quiz-wrap { padding: 16px 15px 28px; }
  .quiz-topline .back-link { font-size: 11px; }
  .quiz-path-label { font-size: 9px; }
  .quiz-progress-row { margin: 10px 0 13px; padding: 10px; grid-template-columns: 1fr; gap: 9px; }
  .quiz-topic { font-size: 12px; }
  .quiz-count { font-size: 10px; }
  .question-layout { grid-template-columns: 1fr; gap: 10px; }
  .question-rail { grid-template-columns: minmax(0,1fr) minmax(130px,.8fr); align-items: stretch; gap: 8px; }
  .rail-card { padding: 12px; border-radius: 11px; }
  .rail-label { margin-bottom: 6px; font-size: 8px; }
  .rail-card > strong { font-size: 14px; }
  .rail-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
  .rail-meta span { padding: 4px 6px; font-size: 8px; }
  .rail-hint { padding: 10px; align-items: center; }
  .rail-hint p { font-size: 10px; }
  .question-art { grid-column: 1/-1; max-height: 240px; }
  .question-art img { max-height: 195px; }
  .question-art.is-triptych-panel { width: min(100%, 180px); max-height: none; }
  .question-art.is-triptych-panel img { max-height: none; }
  .question-art.is-triptych-panel.is-portrait-panel { width: min(100%, 140px); max-height: none; }
  .question-card { padding: 17px; border-radius: 14px; }
  .question-number { margin-bottom: 13px; }
  .question-number > span:first-child { width: 34px; height: 34px; }
  .question-card h1 { margin-bottom: 16px; font-size: 21px; }
  .answer-fieldset legend { margin-bottom: 9px; font-size: 11px; }
  .answer-options { gap: 7px; }
  .answer-option { min-height: 47px; padding: 7px; grid-template-columns: 18px 26px minmax(0,1fr); gap: 7px; font-size: 13px; }
  .answer-letter { width: 25px; height: 25px; }
  .category-row { grid-template-columns: 1fr; gap: 9px; }
  .category-choice label { min-height: 39px; }
  .matching-row { grid-template-columns: 1fr; gap: 8px; }
  .matching-row select { max-width: 100%; }
  .short-answer-wrap { align-items: flex-start; }
  .short-answer-wrap input { min-width: 0; }
  .question-actions .button { width: 100%; }
  .result-wrap { padding: 43px 18px 50px; }
  .progress-overview { padding: 14px; gap: 7px; }
  .progress-overview > div { padding-left: 9px; }
  .progress-overview > div > span { font-size: 7px; letter-spacing: .07em; }
  .progress-overview strong { font-size: 22px; }
  .progress-content { grid-template-columns: 1fr; gap: 9px; }
  .progress-block { padding: 13px; }
  .progress-line { grid-template-columns: minmax(85px,1fr) minmax(45px,.6fr) auto; gap: 7px; }
  .progress-line strong { font-size: 10px; }
  .progress-line > span:last-child { font-size: 8px; }
  .about-grid { grid-template-columns: 1fr; gap: 9px; }
  .about-grid article { min-height: 0; padding: 15px; }
  .about-links { flex-direction: column; gap: 0; }
  .about-links .document-link { width: 100%; justify-content: space-between; }
  .site-footer { padding: 12px 16px; align-items: flex-start; flex-direction: column; gap: 4px; font-size: 9px; }
}
@media (max-width: 390px) {
  .offline-badge { display: none; }
  .hero { padding-inline: 16px; }
  .hero-stats { gap: 14px; }
  .dashboard-progress-card { gap: 8px; padding-inline: 10px; }
  .progress-ring { width: 57px; height: 57px; }
  .progress-ring::before { inset: 6px; }
  .progress-ring span { font-size: 12px; }
  .dashboard-progress-copy h2 { font-size: 13px; }
  .dashboard-progress-copy p { font-size: 10px; }
  .dashboard-correct { min-width: 54px; padding-left: 7px; }
  .route-grid { gap: 7px; }
  .route-card { padding: 10px; }
  .route-grade { max-width: 82px; line-height: 1.35; }
  .route-card h3 { font-size: 13px; }
  .route-card p { font-size: 9px; }
}
@media (orientation: landscape) and (max-height: 560px) and (max-width: 900px) {
  .hero { grid-template-columns: 1.1fr .9fr; min-height: 285px; padding: 19px 22px; }
  .hero h1 { font-size: 34px; }
  .hero-copy > p { font-size: 12px; }
  .hero-actions { margin-top: 13px; }
  .hero-stats { margin-top: 13px; }
  .hero-study-card { min-height: 235px; }
  .study-sketch { height: 145px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
