/* Windsock360 — "Dawn patrol": crisp daylight surfaces, deep navy ink, a sunrise of orange to crimson
   reserved for progress and the next action. Readiness is drawn as windsocks. */
:root {
  /* Navy and cyan, from the magnetic compass tool: light surfaces with a navy ink; the cyan carries buttons and focus; amber
     carries eyebrows and highlights. Light and night use the same roles, so a page reads the same in both. */
  --canvas: #eef4f9;
  --surface: #ffffff;
  --surface-2: #f5f9fc;
  --ink: #0b1626;
  --ink-2: #41556d;
  --ink-3: #7b8ea4;
  --line: #d3dee9;
  --line-2: #e4ecf4;
  --info: #6d4aff;          /* information notes: violet, not the accent blue */
  --info-soft: #f3efff;
  --info-line: #c9b8ff;
  --info-ink: #2a1a5e;
  --accent-rgb: 26, 163, 214;
  --orange: #1aa3d6;        /* the accent: buttons, active tabs, focus, top edges */
  --orange-deep: #1f6fd1;   /* the accent's darker end, for gradients */
  --orange-soft: #e7f6fc;
  --orange-text: #0a6e98;   /* the accent that passes text contrast on white */
  --amber: #ffb547;         /* eyebrows and highlights (fills, not text) */
  --amber-text: #8a5200;    /* amber that passes text contrast on white */
  --amber-rgb: 255, 181, 71;
  --crimson: #0a6e98;       /* links and cross references */
  --gloss: #8a5200;         /* glossary terms */
  --link: #0a6e98;
  --sunrise: linear-gradient(120deg, #38d6ff 0%, #1aa3d6 55%, #1f6fd1 100%);
  --sky: linear-gradient(180deg, #eaf7fd 0%, #d9f0fb 42%, #e6f1fb 100%);
  --sock-empty: #e3ebf3;
  --good: #1f7a4a;
  --good-soft: #e6f4ec;
  --bad: #c0182e;
  --bad-soft: #fde8eb;
  --mark: #d6f2fc;
  --hl: #fff0c7;
  --shadow-1: 0 1px 2px rgba(11, 22, 38, .06);
  --shadow-2: 0 1px 2px rgba(11, 22, 38, .05), 0 8px 24px rgba(11, 22, 38, .07);
  --shadow-3: 0 20px 60px rgba(11, 22, 38, .22);
  --glow: 0 0 0 1px rgba(var(--accent-rgb), .25), 0 10px 30px rgba(var(--accent-rgb), .22);
  --glow-soft: 0 1px 2px rgba(11, 22, 38, .05), 0 14px 40px rgba(var(--accent-rgb), .12);
  --heat1: #eaf8fd; --heat2: #bfe9f8; --heat3: #7fd3f0; --heat4: #1aa3d6; --heat5: #0b5f8a;
  --paper: #fbfdff;
  --display: "Barlow", "Segoe UI", system-ui, sans-serif;
  --ui: "Barlow", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --rail: 92px;
  --bar: env(safe-area-inset-top, 0px); /* nothing is pinned to the top of the screen; this keeps sticky things clear of a phone notch */
  color-scheme: light;
}
:root[data-theme="night"] {
  --canvas: #0b1626;
  --surface: #112640;
  --surface-2: #153050;
  --ink: #eef6ff;
  --ink-2: #a9c3d6;
  --ink-3: #6f8aa3;
  --line: #22405e;
  --line-2: #1a3450;
  --info: #a78bfa;
  --info-soft: #231a45;
  --info-line: #4a3a8a;
  --info-ink: #e6dcff;
  --accent-rgb: 56, 214, 255;
  --orange: #38d6ff;
  --orange-deep: #1f8fd6;
  --orange-soft: #0f2d42;
  --orange-text: #38d6ff;
  --amber: #ffb547;
  --amber-text: #ffc66b;
  --amber-rgb: 255, 181, 71;
  --crimson: #38d6ff;
  --gloss: #ffc66b;
  --link: #38d6ff;
  --sunrise: linear-gradient(120deg, #38d6ff 0%, #1f8fd6 60%, #1f5fb0 100%);
  --sky: linear-gradient(180deg, #0f2a44 0%, #112b47 50%, #0b1626 100%);
  --sock-empty: #1d3550;
  --good: #5ee0a0;
  --good-soft: #13301f;
  --bad: #ff7a8a;
  --bad-soft: #3a1a24;
  --mark: #13405a;
  --hl: #4a3a14;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --glow: 0 0 0 1px rgba(var(--accent-rgb), .35), 0 10px 34px rgba(var(--accent-rgb), .25);
  --glow-soft: 0 0 0 1px rgba(var(--accent-rgb), .12), 0 14px 44px rgba(var(--accent-rgb), .14);
  --heat1: #0f2a44; --heat2: #13405a; --heat3: #1a6a92; --heat4: #1fa3d6; --heat5: #7fe3ff;
  --paper: #0f1f33;
  color-scheme: dark;
}

/* information notes (a logbook tip, a regulation footnote): a violet card, so they never read as a main card or as an action */
.info-card { position: relative; background: var(--info-soft); border: 1px solid var(--info-line); border-radius: var(--r-m); color: var(--info-ink); box-shadow: var(--shadow-1); padding: 16px 18px; }
.info-card h3, .info-card h2 { color: var(--info-ink); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 16px); }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.55 var(--ui); }
a { color: var(--crimson); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 1.5em 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 700; margin-top: 0; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.28rem; font-weight: 600; }
h4 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }
svg use { pointer-events: none; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .875rem; }
kbd { font: 600 .72rem var(--ui); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--surface); color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- icons ---------- */
.ico, .rail svg, .bar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- rail ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 50;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 8px;
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none;
}
.rail-brand { display: grid; place-items: center; height: 52px; margin-bottom: 8px; color: var(--ink); }
.rail-brand svg { width: 38px; height: 38px; }
/* Windsock360 wordmark: the mark, "Windsock" in ink, "360" in the orange accent */
.wordmark { display: inline-flex; align-items: center; gap: .38em; font: 800 1.3rem/1 var(--display); letter-spacing: .01em; color: var(--ink); text-transform: none; }
.wordmark b { color: var(--orange); font-weight: 800; }
.wordmark svg { width: 1.55em; height: 1.55em; flex: none; }
.brand-eyebrow { margin-bottom: 12px; }
.auth-brand { font-size: 1.15rem; margin-bottom: 6px; }
.rail a:not(.rail-brand), .more-btn, .rail-search {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px;
  border-radius: 12px; color: var(--ink-2); text-decoration: none; font: 500 .74rem var(--ui); border: 0; background: none; cursor: pointer;
}
.rail a:not(.rail-brand) svg, .more-btn svg, .rail-search svg { width: 22px; height: 22px; }
.rail a:hover, .rail-search:hover { color: var(--ink); background: var(--canvas); }
.rail a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.rail a[aria-current="page"] svg { color: #fff; background: var(--sunrise); border-radius: 9px; padding: 4px; width: 32px; height: 32px; margin: -5px 0; box-shadow: 0 4px 10px rgba(var(--accent-rgb), .35); }
.rail-sep { height: 1px; background: var(--line); margin: 8px 10px; }
.rail a.rail-out { margin-top: auto; }
.rail a.rail-out:hover { color: var(--bad); }
.more-btn { display: none; }

/* ---------- frame ---------- */
.frame { margin-left: var(--rail); min-height: 100vh; padding: var(--bar) 0 0; }
/* small badges on the menu: days to your test on Today, sync state on Account */
.rail-count { position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sunrise); color: #fff; font: 800 .68rem/18px var(--display); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.rail-count[hidden] { display: none; }
.sync-dot { position: absolute; top: 6px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 2px var(--surface); }
.sync-dot.ok { background: var(--good); }
.sync-dot.pending, .sync-dot.busy { background: var(--hue-yellow); }
.sync-dot.err { background: var(--bad); }
.sync-dot.busy { animation: syncPulse 1s ease-in-out infinite; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; font: 600 .9rem var(--ui); color: var(--ink-2); text-decoration: none; }
.back-link:hover { color: var(--orange-text); }
.theme-seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--canvas); border: 1px solid var(--line); }
.theme-seg button { height: 34px; padding: 0 18px; border: 0; border-radius: 99px; background: none; color: var(--ink-2); font: 700 .92rem var(--ui); cursor: pointer; }
.theme-seg button[aria-pressed="true"] { background: var(--sunrise); color: #fff; box-shadow: 0 3px 10px rgba(var(--accent-rgb), .3); }

.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }

main { padding: 14px clamp(16px, 3vw, 36px) 96px; outline: none; }
.page { max-width: 1480px; margin: 0 auto; }
.page.narrow { max-width: 780px; }

.read-progress { position: fixed; top: 0; left: var(--rail); right: 0; height: 3px; z-index: 60; pointer-events: none; display: none; }
body[data-route="read"] .read-progress { display: block; }
.read-progress i { display: block; height: 100%; width: 0; background: var(--sunrise); border-radius: 0 3px 3px 0; }

/* ---------- buttons, chips, surfaces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--control-line, var(--line)); background: var(--surface); color: var(--ink); cursor: pointer;
  font: 600 .9rem var(--ui); text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-1);
}
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn.primary { border: 0; color: #fff; background: var(--sunrise); box-shadow: 0 6px 16px rgba(var(--accent-rgb), .28); }
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(var(--accent-rgb), .36); }
.btn.big { height: 44px; padding: 0 20px; font-size: .98rem; border-radius: 12px; }
.btn.quiet { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); background: var(--surface); border-color: var(--line); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font: 600 .78rem var(--ui); background: var(--canvas); color: var(--ink-2); white-space: nowrap; }
.chip.hot { background: var(--orange-soft); color: var(--orange-text); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
/* the orange top edge is an inset shadow, so it follows the card's rounded corners; empty, vcard, and sunrise cards keep their own look */
.card { background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 6%, var(--surface)) 0%, var(--surface) 46%); border: 1px solid var(--edge-a); border-radius: var(--r-m); box-shadow: inset 0 2px 0 color-mix(in srgb, var(--orange) 55%, transparent), 0 0 22px -4px color-mix(in srgb, var(--orange) 24%, transparent), var(--shadow-1); }
.card.empty-state, .card.vcard, .card.sun { box-shadow: var(--shadow-1); }
.pad { padding: 20px 22px; }
.eyebrow { font: 600 .82rem var(--ui); color: var(--amber-text); margin: 0 0 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
select, input[type="text"], input[type="date"], input[type="search"], input[type="number"] { font: 1rem var(--ui); height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--orange); width: 16px; height: 16px; }
label.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .92rem; }
label.check:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 10px 18px; border-radius: 99px; background: var(--ink); color: var(--canvas); font-weight: 600; box-shadow: var(--shadow-3); }

/* ---------- windsock ---------- */
.sock { display: block; overflow: visible; }
.sock .pole { stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.sock .band { stroke: var(--orange); stroke-width: 1; }
.sock .band.o { fill: url(#sunrise); }
.sock .band.w { fill: #fff; }
.sock .band.e { fill: var(--sock-empty); stroke: var(--sock-empty); }

/* ---------- home: dawn sky + route ---------- */
.sky { position: relative; overflow: hidden; border-radius: var(--r-l); background: var(--sky); padding: 34px 36px 22px; border: 1px solid var(--line-2); }
.sky::before { content: ""; position: absolute; right: -80px; bottom: -150px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 110, .55), rgba(255, 140, 90, .12) 55%, transparent 70%); pointer-events: none; }
.sky-top { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.greet { font: 600 1rem var(--ui); color: var(--ink-2); margin: 0 0 6px; }
.sky h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: .98; margin: 0 0 12px; max-width: 16ch; }
.sky.welcome h1 { max-width: 26ch; }
.sky.welcome .sub { max-width: 68ch; }
.welcome .sky-top { align-items: center; gap: 24px 40px; }
.sky .sub { color: var(--ink-2); font-size: 1.08rem; max-width: 52ch; margin: 0 0 20px; }
.gauge { text-align: center; min-width: 170px; }
.gauge .num { font: 800 3.6rem/1 var(--display); background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gauge .lbl { font-size: .86rem; color: var(--ink-2); margin-top: 4px; }
.gauge .sock { margin: 12px auto 0; }
.goal-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.goal-form select, .goal-form input { height: 36px; background: rgba(255, 255, 255, .75); }
:root[data-theme="night"] .goal-form select, :root[data-theme="night"] .goal-form input { background: var(--surface); }

.route { position: relative; margin-top: 18px; }
.route svg { width: 100%; height: auto; display: block; overflow: visible; }
.route .course-flown { stroke: url(#sunrise); stroke-width: 3.5; fill: none; stroke-linecap: round; }
.route .course-ahead { stroke: var(--ink-3); stroke-width: 2; fill: none; stroke-dasharray: 2 8; stroke-linecap: round; opacity: .7; }
.route .wp { cursor: pointer; }
.route .wp .ring-bg { fill: var(--surface); stroke: var(--line); stroke-width: 4; }
.route .wp .ring { fill: none; stroke: url(#sunrise); stroke-width: 4; stroke-linecap: round; }
.route .wp text { font: 700 15px var(--display); fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.route .wp .lab { font: 600 12.5px var(--ui); fill: var(--ink-2); dominant-baseline: hanging; }
.route .wp:hover .ring-bg, .route .wp:focus .ring-bg { stroke: var(--orange); }
.route .wp:focus { outline: none; }
/* waypoint states: in progress (ring), completed (sunrise fill), mastered (green fill and a star) */
.route .wp.completed .ring-bg { fill: url(#sunrise); stroke: none; }
.route .wp.mastered .ring-bg { fill: var(--good); stroke: none; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--good) 55%, transparent)); }
.route .wp.completed text:not(.lab), .route .wp.mastered text:not(.lab) { fill: #fff; }
.route .wp .star circle { fill: var(--surface); stroke: var(--good); stroke-width: 1.6; }
.route .wp .star path { fill: #f5b301; }
.route .wp.just .ring-bg { animation: wp-pulse 1.1s ease-out 3; transform-box: fill-box; transform-origin: center; }
@keyframes wp-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .route .wp.just .ring-bg { animation: none; } }
.route-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; color: var(--ink-2); }
.rl-key { display: inline-flex; align-items: center; gap: 6px; }
.rl { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.rl.new { border: 2px solid var(--line); background: var(--surface); }
.rl.started { border: 2px solid var(--orange); background: var(--surface); }
.rl.completed { background: linear-gradient(135deg, #ffa36b, var(--orange)); }
.rl.mastered { background: var(--good); box-shadow: 0 0 0 2px color-mix(in srgb, #f5b301 70%, transparent); }
.chip.warn { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
:root[data-theme="night"] .chip.warn { color: var(--amber); }
.pace { margin-top: 12px; max-width: 640px; line-height: 1.45; }
.pace-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pace .chip { flex: none; }
.pace-note { margin: 8px 0 0; color: var(--ink-2); }
.pace-more { margin-top: 6px; }
.pace-more summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--orange-text); width: max-content; }
.pace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.pace-grid div { padding: 6px 10px; border-radius: var(--r-s); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.pace-grid span { display: block; font-size: .7rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.pace-grid b { font-size: .92rem; }
.forecast { margin: 8px 0 0; max-width: 640px; }
.info-i { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; border-radius: 50%; border: 1px solid currentColor; font: 700 .62rem var(--ui); font-style: normal; vertical-align: 1px; cursor: help; opacity: .7; }
.route .airport circle { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.route .airport text { font: 800 13px var(--display); fill: var(--ink); text-anchor: middle; }
.route .plane { fill: var(--ink); filter: drop-shadow(0 3px 4px rgba(28, 35, 51, .25)); }
.route-tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); background: var(--ink); color: var(--canvas); padding: 8px 12px; border-radius: 10px; font-size: .86rem; line-height: 1.35; white-space: nowrap; box-shadow: var(--shadow-3); }
.route-tip b { display: block; font-size: .95rem; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.home-col { display: grid; gap: 18px; }
.plan { padding: 8px; }
.plan-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; }
.plan-head h2 { margin: 0; font-size: 1.35rem; }
.plan-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.plan-item:hover { background: var(--canvas); }
.plan-item .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; }
.plan-item .tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.plan-item.done .tick { background: var(--sunrise); border-color: transparent; color: #fff; }
.plan-item.done .t { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-2); }
.plan-item .k { font: 600 .78rem var(--ui); color: var(--orange-text); }
.plan-item .t { display: block; font-weight: 600; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-item .m { display: block; font-size: .86rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-item .go { width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plan-foot { padding: 10px 14px 14px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); }
.stat { background: var(--surface); padding: 14px 16px; }
.stat b { display: block; font: 800 1.9rem/1.05 var(--display); }
.stat span { font-size: .84rem; color: var(--ink-2); }
.continue { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.continue .t { font: 700 1.2rem var(--display); }
.mini-bar { height: 6px; border-radius: 3px; background: var(--sock-empty); overflow: hidden; margin-top: 8px; }
.mini-bar i { display: block; height: 100%; background: var(--sunrise); border-radius: 3px; }
.ch-list a { display: grid; grid-template-columns: 30px minmax(0, 1fr) 100px 44px; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.ch-list a:hover { background: var(--canvas); }
.ch-list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ch-list .p { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.num-badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--canvas); color: var(--ink); font: 700 .95rem var(--display); flex: none; }

/* ---------- reader ---------- */
.read-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 250px; gap: 40px; max-width: 1400px; margin: 0 auto; align-items: start; }
.toc { position: sticky; top: calc(var(--bar) + 8px); max-height: calc(100vh - var(--bar) - 24px); overflow-y: auto; padding: 4px 4px 30px 0; scrollbar-width: thin; }
.toc-ch > button { display: grid; grid-template-columns: 28px minmax(0, 1fr) 14px; gap: 10px; align-items: center; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 10px; text-align: left; cursor: pointer; font: 600 .95rem/1.25 var(--ui); color: var(--ink); }
.toc-ch > button:hover { background: var(--surface); }
.toc-ch > button .chev { width: 14px; height: 14px; fill: none; stroke: var(--ink-3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.toc-ch > button[aria-expanded="true"] .chev { transform: rotate(90deg); }
.toc-ch .num-badge { width: 26px; height: 26px; font-size: .88rem; background: var(--surface); border: 1px solid var(--line); }
.toc-ch.has-cur .num-badge { background: var(--sunrise); color: #fff; border: 0; }
.toc-ch ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 22px; }
.toc-ch li a { display: flex; gap: 8px; align-items: baseline; padding: 5px 10px 5px 14px; color: var(--ink-2); text-decoration: none; font-size: .9rem; line-height: 1.3; border-left: 2px solid var(--line); }
.toc-ch li a:hover { color: var(--ink); border-left-color: var(--ink-3); }
.toc-ch li a[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--orange); background: linear-gradient(90deg, var(--orange-soft), transparent); }
.toc-ch li a .done { margin-left: auto; color: var(--good); font-size: .8rem; }
.toc-src { font-size: .82rem; color: var(--ink-3); padding: 14px 10px; }

.article { min-width: 0; max-width: 720px; }
.crumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); margin: 8px 0 14px; }
.crumb a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--ink); }
.article h1 { font-size: clamp(2rem, 3.4vw, 2.8rem); margin-bottom: 12px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.toc-btn { display: none; }
.reader { font: 18.5px/1.72 var(--serif); color: var(--ink); }
.reader p, .reader li { margin: 0 0 1.05em; }
.reader ul { padding-left: 1.25em; margin: 0 0 1.05em; }
.reader li { margin-bottom: .4em; }
.reader li::marker { color: var(--orange); }
.reader h3, .reader h4, .reader h5 { font-family: var(--display); }
.reader h3 { font-size: 1.5rem; margin: 1.6em 0 .5em; }
.reader h4 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
.reader h5 { font-size: 1.05rem; margin: 1.3em 0 .3em; color: var(--ink-2); }
.reader b { font-weight: 600; }
.pg { display: inline-block; font: 600 .68rem/1 var(--ui); color: var(--ink-3); border: 1px solid var(--line); border-radius: 99px; padding: 3px 6px; margin-left: 6px; vertical-align: 3px; text-decoration: none; white-space: nowrap; }
.pg:hover { color: var(--crimson); border-color: var(--crimson); }
.gl { color: inherit; text-decoration: underline dotted var(--gloss); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: help; }
.gl:hover { color: var(--gloss); }
.acr { text-decoration: underline dotted var(--ink-3); text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: help; }
.acr:hover { text-decoration-color: currentColor; }
.figref { font-family: var(--ui); font-weight: 600; font-size: .9em; white-space: nowrap; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
mark.hl-user { background: var(--hl); cursor: pointer; padding: 1px 0; box-shadow: 0 2px 0 rgba(var(--accent-rgb), .35); }
.flash { animation: flash 1.8s ease-out 1; }
@keyframes flash { 0%, 30% { background: var(--mark); } 100% { background: transparent; } }

.hl-btn { position: absolute; z-index: 70; transform: translate(-50%, calc(-100% - 8px)); display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--ink); color: var(--canvas); font: 600 .88rem var(--ui); cursor: pointer; box-shadow: var(--shadow-3); }
.hl-btn::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--hl); }

.margin { position: sticky; top: calc(var(--bar) + 8px); display: grid; gap: 14px; max-height: calc(100vh - var(--bar) - 24px); overflow-y: auto; scrollbar-width: none; padding-bottom: 30px; }
.margin h4 { font: 600 .8rem var(--ui); color: var(--ink-3); margin: 0 0 8px; }
.margin .card { padding: 14px 16px; }
.outline { list-style: none; margin: 0; padding: 0; }
.outline a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: .88rem; line-height: 1.3; }
.outline a.on { color: var(--ink); border-left-color: var(--orange); font-weight: 600; }
.outline a:hover { color: var(--ink); }
.terms { display: flex; flex-wrap: wrap; gap: 6px; }
.terms a { font-size: .82rem; padding: 3px 9px; border-radius: 99px; background: var(--canvas); color: var(--ink); text-decoration: none; }
.terms a:hover { background: var(--orange-soft); color: var(--orange-text); }
.margin ul.concepts { margin: 0; padding-left: 1.1em; font-size: .9rem; }
.margin ul.concepts li { margin-bottom: 4px; }

.checkself { margin: 44px 0 0; padding: 22px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.checkself-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.checkself-head h2 { margin: 0; font-size: 1.4rem; }
.cq { padding: 18px 0 4px; border-top: 1px solid var(--line-2); margin-top: 14px; }
.cq:first-of-type { border-top: 0; margin-top: 0; }
.cq .stem { font-size: 1.12rem; margin-bottom: 14px; }
.upnext { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-top: 22px; padding: 20px 22px; border-radius: var(--r-l); text-decoration: none; color: var(--ink); background: var(--sky); border: 1px solid var(--line-2); }
.upnext:hover { box-shadow: var(--shadow-2); }
.upnext .t { font: 700 1.45rem var(--display); }
.upnext p { margin: 4px 0 0; color: var(--ink-2); font-size: .95rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.upnext .go { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--sunrise); box-shadow: 0 6px 16px rgba(var(--accent-rgb), .3); }
.upnext .go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.prevlink { display: inline-flex; margin-top: 14px; color: var(--ink-2); font-size: .9rem; text-decoration: none; }
.prevlink:hover { color: var(--ink); }

/* ---------- popovers / overlays ---------- */
.pop { position: absolute; z-index: 70; max-width: 360px; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-3); font-size: .94rem; line-height: 1.5; }
.pop strong { display: block; font: 700 1.1rem var(--display); margin-bottom: 4px; }
.pop .pop-note { margin-top: 6px; color: var(--ink-2); font-size: .88rem; }
.pop .pop-actions { display: flex; gap: 14px; margin-top: 10px; font-weight: 600; font-size: .88rem; }
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 30px; background: rgba(16, 20, 28, .82); backdrop-filter: blur(4px); cursor: zoom-out; }

.palette-wrap { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(16, 20, 28, .38); backdrop-filter: blur(3px); }
.palette { width: min(640px, 100%); border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); overflow: hidden; }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.palette-in svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 2; }
.palette-in input { flex: 1; height: 58px; border: 0; background: none; color: var(--ink); font: 1.12rem var(--ui); outline: none; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 52vh; overflow-y: auto; }
.palette li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.palette li .k { font: 600 .74rem var(--ui); color: var(--ink-3); }
.palette li .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li .t small { color: var(--ink-3); margin-left: 6px; }
.palette li[aria-selected="true"] { background: var(--orange-soft); }
.palette li[aria-selected="true"] .k { color: var(--orange-text); }
.palette-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--ink-3); }

/* ---------- concepts ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; }
.tabs a { display: inline-grid; place-items: center; min-width: 34px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font: 700 .88rem var(--display); }
.tabs a:hover { border-color: var(--ink-3); }
/* Proper Case on every button and button-style tab (the text itself stays as written, for screen readers) */
.btn, .tabs a, .home-tabs a { text-transform: capitalize; }
.tabs a[aria-current="page"] { background: var(--sunrise); color: #fff; border-color: transparent; }
.ch-card { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; text-decoration: none; color: var(--ink); }
.ch-card:hover { box-shadow: var(--shadow-2); }
.ch-card h3 { margin: 0; font-size: 1.3rem; }
.ch-card p { margin: 0; color: var(--ink-2); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ch-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; font-size: .84rem; color: var(--ink-2); }
.learn-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.learn-nav { position: sticky; top: calc(var(--bar) + 8px); max-height: calc(100vh - var(--bar) - 24px); overflow-y: auto; padding: 12px 10px; }
.learn-nav-h { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); font: 700 1.05rem var(--display); }
.learn-nav-h span { font: 600 .84rem var(--display); color: var(--ink-3); }
.learn-nav a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font: 500 1.02rem/1.3 var(--display); }
.learn-nav a:hover { color: var(--ink); background: var(--line-2); }
.concept, .brief { padding: 24px 26px; margin-bottom: 14px; scroll-margin-top: calc(var(--bar) + 12px); }
.concept h3, .brief h3 { margin: 0 0 10px; font-size: 1.4rem; }
.concept .body, .brief .body { font: 17px/1.65 var(--serif); }
.concept .body p, .brief .body p { margin: 0 0 .7em; }
.concept .body ul, .brief .body ul { padding-left: 1.2em; margin: 0 0 .7em; }
.concept .body li::marker, .brief .body li::marker { color: var(--orange); }
/* briefs: one short topic, then drill it */
.brief-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.brief .body > p:first-child { font: 600 1.08rem/1.45 var(--ui); color: var(--ink); }
.brief .body li { margin-bottom: .25em; }
.brief.learned { opacity: .82; }
.brief.learned:hover { opacity: 1; }
.drill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.drill .pg { margin-left: 0; vertical-align: 0; }
.fig-chips { display: flex; flex-wrap: wrap; gap: 0 8px; }
.fig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fig-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; text-decoration: none; color: var(--ink-2); font-size: .92rem; line-height: 1.35; }
.fig-tile:hover { color: var(--ink); box-shadow: var(--shadow-2); }
.fig-tile .fnum { align-self: flex-start; }
.tip { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); border: 1px solid var(--info-line); color: var(--info-ink); font-size: .95rem; clear: both; }
.tip b { color: var(--info); white-space: nowrap; }
.src { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; font-size: .9rem; text-decoration: none; }
.src svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mnemo { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.mnemo .m { font: 800 1.7rem/1.15 var(--display); background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .03em; }

/* ---------- flashcards ---------- */
.run-back { display: inline-block; margin: 0 0 10px; font: 600 .9rem var(--ui); color: var(--ink-2); text-decoration: none; }
.run-back:hover { color: var(--orange-text); }
.deck-top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ring-prog { --p: 0; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--sock-empty) 0); display: grid; place-items: center; flex: none; }
.ring-prog span { width: 36px; height: 36px; border-radius: 50%; background: var(--canvas); display: grid; place-items: center; font: 700 .8rem var(--ui); }
.grade-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.grade-row .btn small { font-weight: 500; opacity: .6; margin-left: 2px; }
.grade-row .g0:hover { border-color: var(--bad); color: var(--bad); }
.grade-row .g1:hover { border-color: var(--orange); color: var(--orange-text); }

/* ---------- questions ---------- */
.q-shell { max-width: 780px; margin: 0 auto; }
.q-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.dots i { height: 6px; flex: 1; min-width: 6px; max-width: 26px; border-radius: 3px; background: var(--sock-empty); }
.dots i.cur { background: var(--ink); }
.dots i.ok { background: var(--good); }
.dots i.no { background: var(--bad); }
.dots i.ans { background: var(--orange); }
.dots i.flag { box-shadow: 0 3px 0 var(--crimson); }
.q-card { padding: 28px 30px; }
.stem { font: 1.3rem/1.5 var(--serif); margin: 0 0 22px; }
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; font-size: 1.04rem; line-height: 1.4; transition: border-color .12s, background .12s; }
.choice:hover:not([disabled]) { border-color: var(--orange); background: var(--orange-soft); }
.choice .letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--canvas); font: 700 .95rem var(--display); color: var(--ink-2); }
.choice.sel { border-color: var(--orange); background: var(--orange-soft); }
.choice.sel .letter { background: var(--sunrise); color: #fff; }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.right .letter { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.wrong .letter { background: var(--bad); color: #fff; }
.choice[disabled] { cursor: default; }
.explain { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--good-soft); }
.explain.no { background: var(--bad-soft); }
.explain h4 { margin: 0 0 6px; }
.explain.no h4 { color: var(--bad); }
.explain:not(.no) h4 { color: var(--good); }
.explain p:last-child { margin-bottom: 0; }
.timer { font: 800 1.25rem var(--display); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); }
.score-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px 30px; }
.score-ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c, var(--orange)) calc(var(--p) * 1%), var(--sock-empty) 0); }
.score-ring span { width: 122px; height: 122px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 800 2.6rem var(--display); }
.bar-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 140px 52px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.bar-row a { color: var(--ink); text-decoration: none; font-weight: 500; }
.hbar { height: 8px; border-radius: 4px; background: var(--sock-empty); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.hbar.low i { background: var(--bad); }
.review-item { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.review-item details summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }

/* ---------- glossary / index / search / notes ---------- */
.az { position: sticky; top: var(--bar); z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 0; background: var(--canvas); }
.az a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font: 700 .9rem var(--display); }
.az a:hover { border-color: var(--orange); color: var(--orange-text); }
.gl-entry { padding: 16px 20px; margin-bottom: 8px; scroll-margin-top: calc(var(--bar) + 70px); }
.gl-entry h3 { margin: 0 0 4px; font-size: 1.2rem; }
.gl-entry .def { font: 16.5px/1.6 var(--serif); }
.gl-entry .uses { margin-top: 8px; font-size: .9rem; }
.acs-els { margin: 8px 0 0; padding-left: 0; list-style: none; }
.acs-els li { padding: 6px 0; border-top: 1px solid var(--line); font: 16px/1.55 var(--serif); }
.acs-els li.acs-sub { margin-left: 1.6em; }
.acs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.acs-pager a { display: grid; gap: 4px; padding: 14px 18px; }
.acs-pager a:last-child { text-align: right; }
.acs-area-link h3 { margin-bottom: 6px; }
.acs-area-link { display: block; color: inherit; text-decoration: none; }
.gl-entry.target { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.letter-h { font: 800 1.8rem var(--display); margin: 26px 0 10px; }
.idx-cols { columns: 2 340px; column-gap: 36px; }
.idx-item { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.idx-item .refs a { font-size: .86rem; font-weight: 600; margin-left: 6px; }
.result { display: block; padding: 14px 18px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.result:hover { border-color: var(--ink-3); }
.result .t { font-weight: 600; }
.result p { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }
.note-item { padding: 14px 18px; margin-bottom: 10px; }
.note-new { margin-bottom: 18px; }
.note-new textarea { width: 100%; min-height: 96px; resize: vertical; }
.note-text { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-item blockquote { margin: 0 0 8px; padding-left: 14px; border-left: 3px solid var(--orange); font: 17px/1.6 var(--serif); }

/* ---------- rebuilt figures: a small kit shared by every figure ---------- */
.vfig { margin: 2.2em 0; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--glow-soft); overflow: hidden; font: 15px/1.5 var(--ui); color: var(--ink); }
.vfig-body { position: relative; padding: 24px; overflow-x: auto; }
.vfig-body::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sunrise); }
.vfig figcaption { display: flex; gap: 12px; align-items: baseline; padding: 12px 22px 14px; border-top: 1px solid var(--line-2); background: var(--surface-2); font: .9rem/1.45 var(--ui); color: var(--ink-2); }
.fnum { flex: none; font: 700 .76rem var(--ui); color: #fff; background: var(--orange-deep); border-radius: 99px; padding: 3px 10px; box-shadow: 0 3px 10px rgba(var(--accent-rgb), .35); white-space: nowrap; }
.vfig figcaption a.expand { margin-left: auto; flex: none; font-weight: 600; font-size: .84rem; text-decoration: none; cursor: zoom-in; }
.vfig .vt-title { font: 700 1.1rem var(--display); margin: 0 0 12px; }
.vfig p { margin: 0 0 .6em; }
.vfig .vsub { color: var(--ink-2); font-size: .9rem; }

/* tables */
.vt { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: .94rem; }
.vt th, .vt td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.vt thead tr { background: var(--sunrise); }
.vt thead th { background: transparent; color: #fff; font: 700 .95rem var(--display); letter-spacing: .01em; border-bottom: 0; }
.vt tbody tr:nth-child(even) td { background: var(--surface-2); }
.vt tbody tr:last-child td, .vt tbody tr:last-child th { border-bottom: 0; }
.vt td + td, .vt th + td, .vt th + th { border-left: 1px solid var(--line-2); }
.vt thead th + th { border-left-color: rgba(255, 255, 255, .25); }
.vt.vt-key tbody td:first-child, .vt tbody th { font-weight: 700; font-family: var(--display); font-size: 1rem; color: var(--ink); background: var(--orange-soft); }
.vt td.hot, .vt th.hot { background: var(--orange-soft) !important; box-shadow: inset 3px 0 0 var(--orange); font-weight: 600; }
.vt .center, .vt.center td, .vt.center th { text-align: center; }
.vt.compact th, .vt.compact td { padding: 7px 10px; font-size: .88rem; }
.vt caption { caption-side: bottom; padding-top: 8px; font-size: .84rem; color: var(--ink-2); text-align: left; }
.heat1 { background: var(--heat1) !important; } .heat2 { background: var(--heat2) !important; } .heat3 { background: var(--heat3) !important; }
.heat4 { background: var(--heat4) !important; color: #fff; font-weight: 700; } .heat5 { background: var(--heat5) !important; color: #fff; font-weight: 700; }

/* card grids */
.vgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.vgrid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vgrid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vgrid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vgrid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vcard { position: relative; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--edge-a); background: var(--surface); }
.vcard h5 { margin: 0 0 4px; font: 700 1.05rem/1.2 var(--display); color: var(--ink); }
.vcard p, .vcard li { font-size: .9rem; color: var(--ink-2); margin: 0 0 .35em; }
.vcard ul { margin: 6px 0 0; padding-left: 1.1em; }
.vcard li::marker { color: var(--orange); }
.vcard .k { display: block; font: 600 .78rem var(--ui); color: var(--orange-text); margin-bottom: 4px; }
.vcard .big { display: block; font: 800 2rem/1 var(--display); background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px; }
.vcard.hot { border-color: rgba(var(--accent-rgb), .45); background: var(--orange-soft); box-shadow: var(--glow); }
.vcard.sun { border: 0; background: var(--sunrise); box-shadow: var(--glow); }
.vcard.sun h5, .vcard.sun p, .vcard.sun li, .vcard.sun .k { color: #fff; }
details.vcard summary { cursor: pointer; list-style: none; }
details.vcard summary::-webkit-details-marker { display: none; }
details.vcard summary h5::after { content: " +"; color: var(--orange); }
details.vcard[open] summary h5::after { content: " \2212"; }

/* numbered steps */
.vsteps { list-style: none; margin: 0; padding: 0; counter-reset: vs; display: grid; gap: 4px; }
.vsteps > li { counter-increment: vs; position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; padding: 8px 0 14px; }
.vsteps > li::before { content: counter(vs); grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sunrise); color: #fff; font: 800 1rem var(--display); box-shadow: 0 4px 12px rgba(var(--accent-rgb), .35); z-index: 1; }
.vsteps > li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 46px; bottom: -4px; width: 2px; background: linear-gradient(var(--orange), transparent); opacity: .5; }
.vsteps > li > b { display: block; font: 700 1.06rem/1.25 var(--display); margin-top: 7px; }
.vsteps > li > span, .vsteps > li > p { display: block; color: var(--ink-2); font-size: .92rem; grid-column: 2; margin: 2px 0 0; }
.vsteps.row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
.vsteps.row > li { grid-template-columns: minmax(0, 1fr); padding: 0; }
.vsteps.row > li::before { grid-row: auto; }
.vsteps.row > li:not(:last-child)::after { left: 46px; right: -6px; top: 17px; bottom: auto; width: auto; height: 2px; background: linear-gradient(90deg, var(--orange), transparent); }
.vsteps.row > li > span, .vsteps.row > li > p { grid-column: 1; }

/* stacked levels and pyramids */
.vstack { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vstack.up { flex-direction: column-reverse; }
.lvl { width: 100%; padding: 10px 16px; border-radius: 12px; text-align: center; background: var(--orange-soft); border: 1px solid rgba(var(--accent-rgb), .25); color: var(--ink); }
.lvl b { display: block; font: 700 1.02rem/1.2 var(--display); }
.lvl span { display: block; font-size: .86rem; color: var(--ink-2); }
.lvl.hot { background: var(--sunrise); border: 0; color: #fff; box-shadow: var(--glow); }
.lvl.hot span { color: rgba(255, 255, 255, .9); }
.lvl.t1 { background: var(--heat1); } .lvl.t2 { background: var(--heat2); } .lvl.t3 { background: var(--heat3); }
.lvl.t4 { background: var(--heat4); color: #fff; border: 0; } .lvl.t5 { background: var(--heat5); color: #fff; border: 0; }
.lvl.t4 span, .lvl.t5 span { color: rgba(255, 255, 255, .9); }

/* flows */
.vflow { display: flex; align-items: stretch; flex-wrap: wrap; }
.vflow > .node { flex: 1 1 140px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.vflow > .node b { display: block; font: 700 1.02rem var(--display); }
.vflow > .node span { display: block; font-size: .86rem; color: var(--ink-2); }
.vflow > .node.hot { background: var(--orange-soft); border-color: rgba(var(--accent-rgb), .45); box-shadow: var(--glow); }
.vflow > .arrow { flex: 0 0 34px; display: grid; place-items: center; color: var(--orange); font: 700 1.3rem var(--ui); }
.vflow > .arrow::before { content: "\2192"; }
.vflow.down { flex-direction: column; align-items: center; }
.vflow.down > .node { width: min(100%, 460px); flex: none; }
.vflow.down > .arrow { flex: 0 0 26px; }
.vflow.down > .arrow::before { content: "\2193"; }

/* notes, documents, pills, 2x2 */
.vnote { padding: 12px 16px; border-radius: 12px; background: var(--orange-soft); border-left: 4px solid var(--orange); font-size: .94rem; }
.vdoc { padding: 20px 22px; border-radius: 10px; background: var(--paper); border: 1px dashed rgba(var(--accent-rgb), .45); font: 16px/1.6 var(--serif); color: var(--ink); box-shadow: var(--glow-soft); }
.vdoc .sig { display: block; margin-top: 14px; padding-top: 6px; border-top: 1px solid var(--ink-3); width: min(340px, 100%); font: .82rem var(--ui); color: var(--ink-2); }
.vdoc .fill { display: inline-block; min-width: 90px; border-bottom: 1px solid var(--ink-3); color: var(--orange-text); font-family: var(--ui); font-size: .9em; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--canvas); border: 1px solid var(--line); font: 600 .8rem var(--ui); color: var(--ink-2); white-space: nowrap; }
.pill.hot { background: var(--sunrise); color: #fff; border: 0; box-shadow: 0 3px 10px rgba(var(--accent-rgb), .3); }
.vquad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vlabel { font: 600 .82rem var(--ui); color: var(--ink-3); margin: 0 0 8px; }
.vsplit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: start; }

/* svg diagrams */
.vsvg { display: block; width: 100%; height: auto; max-width: 760px; margin: 0 auto; overflow: visible; font-family: var(--ui); }
.vsvg .f-sun { fill: url(#sunrise); } .vsvg .f-soft { fill: var(--orange-soft); } .vsvg .f-surface { fill: var(--surface); }
.vsvg .f-line { fill: var(--line); } .vsvg .f-ink { fill: var(--ink); } .vsvg .f-none { fill: none; }
.vsvg .f-h1 { fill: var(--heat1); } .vsvg .f-h2 { fill: var(--heat2); } .vsvg .f-h3 { fill: var(--heat3); } .vsvg .f-h4 { fill: var(--heat4); } .vsvg .f-h5 { fill: var(--heat5); }
.vsvg .s-orange { stroke: var(--orange); } .vsvg .s-line { stroke: var(--line); } .vsvg .s-ink { stroke: var(--ink-3); } .vsvg .s-surface { stroke: var(--surface); }
.vsvg .t-ink { fill: var(--ink); } .vsvg .t-muted { fill: var(--ink-2); } .vsvg .t-white { fill: #fff; } .vsvg .t-orange { fill: var(--orange-text); }
.vsvg .t-h { font: 700 16px var(--display); } .vsvg .t-s { font: 500 13px var(--ui); } .vsvg .t-xs { font: 500 11.5px var(--ui); }
.vsvg .glow { filter: drop-shadow(0 4px 12px rgba(var(--accent-rgb), .45)); }
.vsvg text { dominant-baseline: middle; }

.lightbox .vfig { margin: 0; width: min(1000px, 94vw); max-height: 88vh; overflow: auto; cursor: auto; }
.fig-chip { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 12px; padding: 3px 12px 3px 3px; border-radius: 99px; background: var(--orange-soft); color: var(--orange-text); font: 600 .84rem var(--ui); cursor: zoom-in; border: 0; }
.fig-list a { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; color: var(--ink-2); text-decoration: none; font-size: .86rem; line-height: 1.3; }
.fig-list a:hover { color: var(--ink); }
.fig-list .fnum { font-size: .7rem; padding: 2px 7px; }
@media (max-width: 760px) {
  .vfig-body { padding: 16px; }
  .vfig figcaption { flex-wrap: wrap; padding: 12px 16px 14px; }
  .vfig figcaption > span:nth-child(2) { flex-basis: 100%; order: 3; }
  .vgrid.cols-3, .vgrid.cols-4, .vgrid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vsteps.row { grid-auto-flow: row; }
  .vsteps.row > li:not(:last-child)::after { display: none; }
  .vflow:not(.down) { flex-direction: column; }
  .vflow:not(.down) > .node { flex: 0 0 auto; }
  .vflow:not(.down) > .arrow { flex-basis: 26px; }
  .vflow:not(.down) > .arrow::before { content: "\2193"; }
  .vt { font-size: .86rem; }
}

/* ---------- small shared pieces ---------- */
.big-num { font: 800 2.6rem/1.05 var(--display); }
.run-title { font: 700 1.3rem var(--display); }
.learn-hero, .progress-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; background: var(--sky); border-color: var(--line-2); }
.progress-hero { grid-template-columns: auto minmax(0, 1fr); }
.review-q { margin: 8px 0; font: 1.05rem/1.5 var(--serif); }
a.ch-card { color: inherit; text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .read-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .margin { display: none; }
}
@media (max-width: 1000px) {
  .read-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: fixed; top: 0; left: 0; bottom: 0; width: min(340px, 88vw); max-height: none; z-index: 80; padding: 20px 14px; background: var(--surface); box-shadow: var(--shadow-3); transform: translateX(-105%); transition: transform .2s; }
  body.toc-open .toc { transform: none; }
  .toc-btn { display: inline-flex; }
  .home-grid, .learn-layout { grid-template-columns: minmax(0, 1fr); }
  .learn-nav { display: none; }
  .sky-top { grid-template-columns: minmax(0, 1fr); }
  .gauge { text-align: left; display: flex; align-items: center; gap: 16px; }
  .gauge .sock { margin: 0; }
}
@media (max-width: 760px) {
  :root { --rail: 0px; }
  .rail { inset: auto 0 0 0; width: auto; height: calc(64px + env(safe-area-inset-bottom)); flex-direction: row; padding: 4px 6px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .rail-brand, .rail-sep { display: none; }
  .rail a:not(.rail-brand), .more-btn, .rail-search { flex: 1; padding: 6px 0; font-size: .68rem; }
  .rail-search { order: 15; }
  .more-btn { order: 20; }
  .rail a.secondary:not(.rail-brand) { display: none; }
  .rail a:not(.rail-brand), .more-btn, .rail-search { min-width: 0; }
  .more-btn { display: flex; }
  body.more-open .rail { flex-wrap: wrap; height: auto; padding-top: 10px; box-shadow: 0 -12px 30px rgba(28, 35, 51, .12); }
  body.more-open .rail a:not(.rail-brand), body.more-open .more-btn, body.more-open .rail-search { flex: 1 0 12%; }
  body.more-open .rail a.secondary:not(.rail-brand) { display: flex; flex: 0 0 calc(20% - 2px); order: -1; margin-bottom: 6px; }
  .frame { margin-left: 0; padding-bottom: 72px; }
  .read-progress { left: 0; }
  .sky { padding: 22px 18px 14px; border-radius: var(--r-m); }
  .stat b { font-size: 1.5rem; }
  .bar-row { grid-template-columns: 26px minmax(0, 1fr) 70px 44px; }
  .ch-list a { grid-template-columns: 28px minmax(0, 1fr) 70px 38px; }
  .score-hero { grid-template-columns: minmax(0, 1fr); }
  .concept, .brief { padding: 18px; }
  .q-card { padding: 20px 18px; }
  .learn-hero, .progress-hero { grid-template-columns: minmax(0, 1fr); }
  .route .lab { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .rail, .bar, .toc, .margin, .checkself, .upnext, .read-progress { display: none !important; }
  .frame { margin: 0; }
  .read-layout { display: block; }
}

/* numbered steps in any rendered text (cards, briefs, explanations): soft number badges */
ol.steps { list-style: none; counter-reset: step; margin: .4em 0 .8em; padding: 0; display: grid; gap: 10px; }
ol.steps > li { counter-increment: step; position: relative; padding: 2px 0 0 42px; min-height: 28px; line-height: 1.45; }
/* soft, low-glare badges: tinted fill, colored number, thin ring, faint glow. Change --step to try another color. */
:root { --step: 46, 132, 204; --step-ink: #1f6aa8; }
[data-theme="night"] { --step: 125, 190, 240; --step-ink: #a9d4f5; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 700 .85rem/1 var(--ui); color: var(--step-ink);
  background: rgba(var(--step), .14); border: 1px solid rgba(var(--step), .45);
  box-shadow: 0 0 10px rgba(var(--step), .18);
}
.fc-ans ol.steps { text-align: left; }

/* progress you can see: per-brief %, drill buttons with mastery, and the chapter's "what's left" panel */
.brief-pct { font: 700 .85rem var(--ui); color: var(--ink-3); white-space: nowrap; }
.brief-pct.all { color: var(--good); }
.learn-nav a { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; }
.learn-nav a .nav-pct { flex: none; font: 600 .84rem var(--display); color: var(--ink-3); }
.drill-btn { position: relative; overflow: hidden; height: 34px; padding: 0 12px; font-size: .85rem; }
.drill-btn::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--m, 0%); background: var(--sunrise); }
.drill-btn.all::after { background: var(--good); }
.drill-btn .m-count { margin-left: 6px; font: 700 .74rem var(--ui); color: var(--ink-3); padding: 1px 6px; border-radius: 99px; background: var(--line-2); }
.drill-btn.all .m-count { color: var(--good); background: var(--good-soft); }
.drill-btn.fresh { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 14%, transparent); }
.drill-btn.fresh .m-count { color: #fff; background: var(--orange); }
.drill-btn.some .m-count { color: var(--orange-text); background: var(--orange-soft); }
.left-panel { margin-top: 16px; }
.left-total { font: 800 1.2rem var(--display); }
.left-row { display: grid; grid-template-columns: 110px minmax(120px, 1fr) 330px 104px; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.left-row:first-of-type { border-top: 0; }
.left-label { display: flex; flex-direction: column; line-height: 1.2; }
.left-row .hbar i { background: var(--sunrise); }
.left-row.all .hbar i { background: var(--good); }
@media (max-width: 760px) { .left-row { grid-template-columns: 1fr auto; } .left-row .hbar, .left-row .left-detail { grid-column: 1 / -1; } }

/* chapter page: glowing toggle under the windsock that opens the progress breakdown */
.progress-toggle {
  display: block; margin: 12px auto 0; padding: 7px 14px; border-radius: 99px; cursor: pointer;
  font: 700 .8rem var(--ui); color: var(--good); background: var(--good-soft); border: 1px solid rgba(35, 130, 79, .35);
  box-shadow: 0 0 12px rgba(46, 204, 113, .35); transition: box-shadow .2s, transform .2s;
}
.progress-toggle:hover, .progress-toggle:focus-visible { box-shadow: 0 0 20px rgba(46, 204, 113, .6); transform: translateY(-1px); outline: none; }
.progress-toggle[aria-expanded="true"] { box-shadow: 0 0 8px rgba(46, 204, 113, .25); }
[data-theme="night"] .progress-toggle { color: #5fe39a; background: rgba(46, 204, 113, .12); border-color: rgba(95, 227, 154, .4); box-shadow: 0 0 16px rgba(95, 227, 154, .45); }
[data-theme="night"] .progress-toggle:hover { box-shadow: 0 0 24px rgba(95, 227, 154, .7); }

/* last-result bars: knew it / right (green), shaky (amber), missed / wrong (red), not yet seen (track) */
.gradebar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--sock-empty); }
.gradebar i { display: block; height: 100%; }
.gradebar .g2, .gl-dot.g2 { background: var(--good); }
.gradebar .g1, .gl-dot.g1 { background: #e0a32b; }
.gradebar .g0, .gl-dot.g0 { background: var(--bad); }
.gl-dot.gn { background: var(--sock-empty); }
.gl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.gradebar.hero { height: 12px; margin: 4px 0 16px; max-width: 420px; }
.drill-btn .gradebar.mini { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0; background: transparent; }
.drill-btn::after { content: none; }
.pips { display: inline-flex; gap: 3px; vertical-align: -1px; margin-right: 4px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--good) calc(var(--f) * 100%), var(--sock-empty) 0); }
.left-detail { line-height: 1.6; }

/* home: overall progress summary (compact version of a chapter's breakdown) */
.sum-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0 2px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-2); }
.sum-card .sum-row:first-of-type { border-top: 0; }
.sum-row:hover .sum-label { color: var(--orange-text); }
.sum-label { font: 700 .92rem var(--ui); }
.sum-n { font: 700 .8rem var(--ui); color: var(--ink-2); min-width: 54px; text-align: right; }
.sum-row .hbar, .sum-row .gradebar { height: 8px; }
.sum-sub { padding: 2px 0 8px 94px; line-height: 1.6; }
.sum-sub .pips i { width: 10px; height: 5px; }
@media (max-width: 760px) { .sum-sub { padding-left: 0; } }
.sum-sub .nw { white-space: nowrap; margin-right: 8px; }
.left-row > :last-child { justify-self: end; }
.left-row > .hbar, .left-row > .gradebar { width: 100%; }
@media (max-width: 1100px) { .left-row { grid-template-columns: 100px minmax(100px, 1fr) 270px 96px; } }
@media (max-width: 760px) { .left-row { grid-template-columns: 1fr auto; } .left-row .hbar, .left-row .gradebar, .left-row .left-detail { grid-column: 1 / -1; } }
.deck-done { margin-top: 18px; }

/* risk colors named in text (FRAT / risk matrix): a dot and tinted label, tuned for day and night */
:root { --hue-red: #c0392b; --hue-yellow: #946200; --hue-green: #1f7a47; }
[data-theme="night"] { --hue-red: #ff8080; --hue-yellow: #f2c94c; --hue-green: #62dd98; }
.hue { color: var(--h); font-weight: 600; white-space: nowrap; padding: 0 .28em; border-radius: 5px; background: color-mix(in srgb, var(--h) 12%, transparent); }
.hue::before { content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%; margin-right: .3em; vertical-align: .08em; background: var(--h); }
.hue-red { --h: var(--hue-red); }
.hue-yellow { --h: var(--hue-yellow); }
.hue-green { --h: var(--hue-green); }

/* brief self-rating: Got it / Review / Struggling */
.rate { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rate button { font: 600 .82rem var(--ui); padding: 6px 10px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.rate button + button { border-left: 1px solid var(--line); }
.rate button:hover { color: var(--ink); background: var(--line-2); }
.rate button[aria-pressed="true"] { color: var(--h); background: color-mix(in srgb, var(--h) 14%, transparent); }
.rate .rate-got { --h: var(--hue-green); }
.rate .rate-review { --h: var(--hue-yellow); }
.rate .rate-struggle { --h: var(--hue-red); }
.learn-nav a .nav-pct::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--sock-empty); vertical-align: 1px; }
.learn-nav a.r-got .nav-pct::before { background: var(--hue-green); }
.learn-nav a.r-review .nav-pct::before { background: var(--hue-yellow); }
.learn-nav a.r-struggle .nav-pct::before { background: var(--hue-red); }
.learn-nav a.r-got { color: var(--ink-3); }
.rated-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.rated-col h4 { margin: 0 0 6px; font: 700 .95rem var(--display); }
.rated-col ul { margin: 0; padding-left: 1.1em; font-size: .9rem; }
.rated-col li { margin-bottom: 3px; }
.sum-revisit { padding: 8px 0 4px; border-top: 1px solid var(--line-2); }

/* ---------- touch screens, tablets, phones ---------- */
/* keyboard hints (Ctrl K, Space, 1/2/3) give way to tap wording on touch screens */
.touch-hint { display: none; }
@media (hover: none) and (pointer: coarse) {
  .kbd-hint { display: none !important; }
  .touch-hint { display: inline; }
}
button, .btn, .rail a, .fc-stage, .choice, .tabs a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* tablet portrait and phones: the chapter header stacks so the title gets the full width */
@media (max-width: 1000px) {
  .learn-hero { grid-template-columns: minmax(0, 1fr); }
  .learn-hero .gauge { flex-wrap: wrap; row-gap: 10px; }
  .progress-toggle { margin: 0; white-space: nowrap; }
}
/* phones: chapter tabs become one swipeable row */
@media (max-width: 760px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -4px; margin-right: -4px; padding: 0 4px 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; }
}

/* notches, rounded corners, and home indicators (installed app / iOS) */
.rail { padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(8px, env(safe-area-inset-left)); }
@media (max-width: 760px) { .rail { padding-top: 4px; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); } }
.hl-btn.below { transform: translate(-50%, 10px); height: 40px; padding: 0 16px; }

/* ---------- account + sync ---------- */
@keyframes syncPulse { 50% { opacity: .3; } }
.account-card .tabs a { min-width: 0; padding: 0 16px; }
.stack { display: grid; gap: 12px; }
.stack label:not(.check) { display: grid; gap: 6px; font: 600 .9rem var(--ui); color: var(--ink-2); }
.stack input:not([type="checkbox"]):not([type="radio"]), #apiUrl { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 1rem var(--ui); }
.stack input:not([type="checkbox"]):not([type="radio"]):focus, #apiUrl:focus { outline: 2px solid color-mix(in srgb, var(--orange) 45%, transparent); border-color: var(--orange); }
.sync-line { font: 600 .92rem var(--ui); color: var(--good); }
.sync-line.err { color: var(--bad); }
details.card > summary { cursor: pointer; }
.danger-zone summary b { color: var(--bad); }

/* ---------- modules ---------- */
body[data-handbook="0"] [data-hb] { display: none !important; }
.rail-mod span { font: 800 .82rem var(--display); letter-spacing: .04em; }
.mod-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 10px 2px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: 800 .8rem var(--display); letter-spacing: .05em; text-decoration: none; vertical-align: middle; }
.mod-chip span { font: 500 .8rem var(--ui); letter-spacing: 0; color: var(--ink-2); }
.mod-chip:hover { box-shadow: var(--glow-soft); }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 22px; }
.mod-card { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; transition: box-shadow .2s, transform .2s; }
/* status at a glance: a padlock in the corner (closed = locked, open = owned); hover and the current module are orange */
.mod-card.current { border-color: var(--orange); box-shadow: var(--glow); }
.mod-card:hover:not([disabled]) { border-color: var(--orange); box-shadow: var(--glow); transform: translateY(-2px); }
.mod-card[disabled] { opacity: .55; cursor: default; }
.mod-card .chip .ico { vertical-align: -2px; }
.mod-card h3 { margin: 0; font-size: 1.3rem; }
.mod-card p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.mod-top { display: flex; align-items: center; justify-content: space-between; }
.mod-tags { display: inline-flex; align-items: center; gap: 8px; }
.mod-lock { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--canvas); border: 1px solid var(--line); color: var(--ink-2); }
.mod-lock svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mod-lock.open { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); background: var(--good-soft); }
.mod-code { display: inline-grid; place-items: center; min-width: 56px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--sunrise); color: #fff; font: 800 1.25rem var(--display); letter-spacing: .06em; box-shadow: 0 4px 12px rgba(var(--accent-rgb), .3); }
.mod-code .ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@keyframes mod-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); text-shadow: none; } 50% { box-shadow: 0 0 20px 4px rgba(var(--accent-rgb), .55); text-shadow: 0 0 12px rgba(255, 196, 150, .9); } }
.mod-card:hover .mod-code, .mod-card:focus-visible .mod-code { animation: mod-glow 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mod-card:hover .mod-code, .mod-card:focus-visible .mod-code { animation: none; } }
/* ---------- engine teardown ---------- */
.eng-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .eng-layout { grid-template-columns: 1fr; } }
.eng-stage { position: relative; height: 420px; overflow: hidden; background: var(--sky); }
.eng-cv { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.eng-cv:active { cursor: grabbing; }
.eng-read { position: absolute; left: 14px; top: 12px; display: grid; gap: 2px; font: 600 .9rem var(--ui); color: var(--ink-2); pointer-events: none; }
.eng-read b { font: 800 1rem var(--display); color: var(--ink); }
.eng-load { position: absolute; inset: auto 0 16px; margin: 0; text-align: center; }
.eng-panel { display: grid; gap: 14px; align-content: start; }
.eng-panel [hidden] { display: none !important; }
.eng-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.eng-slide { display: grid; gap: 4px; flex: 1 1 200px; font: 600 .86rem var(--ui); color: var(--ink-2); }
.eng-slide input { width: 100%; accent-color: var(--orange); }
.eng-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.eng-part { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: .82rem; background: var(--surface); color: var(--ink); }
.eng-part[aria-pressed="true"] { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-text); }
.eng-info b { font: 800 1.1rem var(--display); }
.eng-info p { margin: 4px 0 0; color: var(--ink-2); }
.eng-prompt { margin: 0; font-size: 1.5rem; }
.eng-fb { margin: 0; min-height: 3em; color: var(--ink-2); }
.eng-fb .good { color: var(--good); }
.eng-fb .bad { color: var(--bad); }
.eng-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eng-choice { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 600 .95rem var(--ui); cursor: pointer; }
.eng-choice.right { border-color: var(--good); background: var(--good-soft); }
.eng-choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.eng-choice:disabled { cursor: default; }

/* tool cards: a quiet icon well and a plain text tag, so they read apart from the module cards */
.tool-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--canvas); border: 1px solid var(--line); color: var(--ink-2); transition: color .2s, border-color .2s; }
.tool-ico .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mod-vs:hover:not([disabled]) .tool-ico { color: var(--orange-text); border-color: color-mix(in srgb, var(--orange) 45%, var(--line)); }
.tool-tag { font: 600 .82rem var(--ui); color: var(--ink-3); }
.mod-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.mod-ready { display: inline-flex; align-items: center; gap: 6px; }
.mod-test { border-top: 1px solid var(--line-2); padding-top: 8px; }
.pg.src-pg { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- V-speed trainer: the airspeed indicator ---------- */
.vs-head { align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.vs-planes { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; padding: 8px 10px 8px 16px; border-radius: 16px; min-width: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--orange) 12%, var(--surface)) 0%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--orange) 30%, var(--line)); box-shadow: var(--shadow-1); }
.vs-plane-sel { display: flex; flex-direction: column; gap: 2px; }
.vs-plane-sel select { height: 38px; min-width: 200px; }
.vs-layout { display: grid; grid-template-columns: minmax(280px, 460px) minmax(0, 1fr); gap: 22px; align-items: start; }
.vs-dial { position: sticky; top: calc(var(--bar) + 12px); padding: 18px; background: radial-gradient(circle at 50% 40%, var(--surface) 0%, var(--surface-2) 100%); }
.vs-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.vs-readout { min-height: 92px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-s); background: var(--canvas); font-size: .93rem; }
.vs-readout p { margin: 6px 0 0; color: var(--ink-2); }
.vs-quiz { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 16px; border-radius: 16px; min-width: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--orange) 12%, var(--surface)) 0%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--orange) 30%, var(--line)); box-shadow: var(--shadow-1); }
.vs-quiz-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vs-quiz-text .eyebrow { margin: 0; }
.vs-quiz-text .small { white-space: nowrap; }
.vs-quiz-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.vs-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.vs-row:hover { background: var(--canvas); }
.vs-row.on { background: var(--orange-soft); box-shadow: inset 3px 0 0 var(--orange); }
.vs-code { font: 800 1.05rem var(--display); }
.vs-title { color: var(--ink-2); font-size: .92rem; }
.vs-val { font: 700 1.05rem var(--display); white-space: nowrap; }
.vs-val small { font: 500 .75rem var(--ui); color: var(--ink-3); }
.vs-swatch { display: inline-block; width: 26px; height: 8px; border-radius: 4px; vertical-align: middle; }
.sw-white { background: #e9edf3; border: 1px solid #b9c0cc; }
.sw-green { background: #22c55e; }
.sw-yellow { background: #facc15; }
.vs-review { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.vs-review:last-child { border: 0; }
.vs-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.vs-field { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--ink-2); }
.vs-field b { color: var(--ink); font: 800 1rem var(--display); }
.vs-field input { height: 38px; font: 700 1.05rem var(--display); }
#vsForm .only-multi, #vsForm .only-gear { display: none; }
#vsForm.show-multi .only-multi, #vsForm.show-gear .only-gear { display: flex; }
.vs-answer { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.vs-answer input { width: 130px; height: 48px; font: 800 1.5rem var(--display); text-align: center; }

.asi { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 22px rgba(10, 14, 22, .35)); }
.asi-tick { stroke: #dfe5ee; stroke-width: 1.4; }
.asi-tick.major { stroke: #fff; stroke-width: 3; }
.asi-num { fill: #f4f6fa; font: 700 19px var(--display); text-anchor: middle; dominant-baseline: central; }
.asi-cap { fill: #9aa3b5; font: 700 14px var(--display); letter-spacing: .22em; text-anchor: middle; }
.asi-units { fill: #f4f6fa; font: 800 15px var(--display); letter-spacing: .16em; text-anchor: middle; }
.asi-plane { fill: #7d879b; font: 500 11px var(--ui); text-anchor: middle; }
.asi-mark { fill: none; transition: opacity .35s; }
.asi-arc { stroke-linecap: butt; }
.arc-white { stroke: #f2f4f8; }
.arc-green { stroke: #22c55e; }
.arc-yellow { stroke: #facc15; }
.asi-line { stroke-width: 4.5; stroke-linecap: round; }
.line-red, .line-redr { stroke: #ef4444; }
.line-blue { stroke: #3b82f6; }
.asi-bug { fill: var(--amber); stroke: #1b1f29; stroke-width: 1; }
.asi-ticks { transition: opacity .35s; }
.asi.focusing .asi-mark:not(.lit) { opacity: .25; }
.asi.focusing .asi-tick { opacity: .45; }
.asi-needle { transform-box: view-box; transform-origin: 200px 200px; transition: transform 1.1s cubic-bezier(.25, 1.35, .45, 1); }
.asi-needle path { fill: #f8fafc; stroke: #0b0e14; stroke-width: .8; }
.asi-needle .tail { fill: #cbd2dd; }
.asi-hub { fill: #2b313d; stroke: #5b6475; stroke-width: 2; }
.asi-hub-dot { fill: #0b0e14; }
/* the glow: a bright copy of the marking with a colored halo and a slow pulse */
.asi-hl .glow { fill: none; stroke-linecap: round; animation: asiPulse 1.6s ease-in-out infinite; }
.asi-hl .glow.faint { animation: none; opacity: .55; }
.asi-hl .glow-dot { animation: asiPulse 1.6s ease-in-out infinite; }
.asi-hl .glow-white { stroke: #fff; filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 12px rgba(255, 255, 255, .85)); }
.asi-hl .glow-green { stroke: #4ade80; filter: drop-shadow(0 0 4px #4ade80) drop-shadow(0 0 14px #22c55e); }
.asi-hl .glow-yellow { stroke: #fde047; filter: drop-shadow(0 0 4px #fde047) drop-shadow(0 0 14px #facc15); }
.asi-hl .glow-red, .asi-hl .glow-redr { stroke: #ff6b6b; filter: drop-shadow(0 0 4px #ff6b6b) drop-shadow(0 0 14px #ef4444); }
.asi-hl .glow-blue { stroke: #60a5fa; filter: drop-shadow(0 0 4px #60a5fa) drop-shadow(0 0 14px #3b82f6); }
.asi-hl .glow-bug { stroke: var(--amber); filter: drop-shadow(0 0 4px var(--amber)) drop-shadow(0 0 14px var(--orange)); }
.asi-hl .glow-dot.glow-white { fill: #fff; }
.asi-hl .glow-dot.glow-green { fill: #4ade80; }
.asi-hl .glow-dot.glow-yellow { fill: #fde047; }
.asi-hl .glow-dot.glow-bug { fill: var(--amber); }
.asi-hl .glow-ray { stroke-dasharray: 3 7; }
@keyframes asiPulse { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .asi-hl .glow, .asi-hl .glow-dot { animation: none; }
  .asi-needle { transition: none; }
}
@media (max-width: 900px) {
  .vs-layout { grid-template-columns: 1fr; }
  .vs-dial { position: static; max-width: 420px; width: 100%; margin: 0 auto; }
  .vs-layout.quiz .vs-dial { max-width: 290px; padding: 8px; }
}

/* ---------- holding entry trainer: plan view ---------- */
.hp { display: block; width: 100%; height: auto; }
.hp-face { fill: #0f1520; stroke: #3a4354; stroke-width: 2; }
.hp-tick { stroke: #6b7588; stroke-width: 1.2; }
.hp-tick.major { stroke: #c9d1de; stroke-width: 2; }
.hp-num { fill: #dfe5ee; font: 700 14px var(--display); text-anchor: middle; dominant-baseline: central; }
.hp-sector { stroke: none; transition: opacity .4s; }
.sec-direct { fill: rgba(34, 197, 94, .2); }
.sec-teardrop { fill: rgba(251, 146, 60, .24); }
.sec-parallel { fill: rgba(96, 165, 250, .24); }
.hp-sector.dim { opacity: .3; }
.hp-sector.lit { animation: hpPulse 1.6s ease-in-out infinite; }
.hp-sector.lit.sec-direct { fill: rgba(74, 222, 128, .5); filter: drop-shadow(0 0 10px #22c55e); }
.hp-sector.lit.sec-teardrop { fill: rgba(var(--amber-rgb), .55); filter: drop-shadow(0 0 10px var(--amber)); }
.hp-sector.lit.sec-parallel { fill: rgba(96, 165, 250, .55); filter: drop-shadow(0 0 10px #60a5fa); }
.hp-line { stroke: #94a3b8; stroke-width: 1.2; stroke-dasharray: 4 5; }
.hp-line.course { stroke: #e2e8f0; stroke-dasharray: none; opacity: .55; }
.hp-lab { font: 700 12px var(--display); letter-spacing: .06em; text-anchor: middle; dominant-baseline: central; fill: #cbd5e1; opacity: .85; text-transform: uppercase; }
.hp-lab.lit { fill: #fff; opacity: 1; }
.hp-track { fill: none; stroke: #f8fafc; stroke-width: 3; }
.hp-inbound { stroke: #f8fafc; stroke-width: 3; }
.hp-arrow { fill: #f8fafc; }
.hp-arrive { stroke: var(--amber); stroke-width: 2; stroke-dasharray: 6 6; }
.hp-arrive.faint { opacity: .6; }
.hp-entry { fill: none; stroke: var(--amber); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: hpDraw 2.4s .3s ease-in-out forwards; filter: drop-shadow(0 0 5px var(--orange)); }
.hp-fix path { fill: none; stroke: #7dd3fc; stroke-width: 2; }
.hp-fix circle { fill: #7dd3fc; }
.hp-fixname { fill: #7dd3fc; font: 700 12px var(--display); letter-spacing: .1em; text-anchor: middle; }
.hp-plane svg { fill: var(--amber); overflow: visible; }
.hp-plane use { fill: var(--amber); stroke: #0f1520; stroke-width: .6; }
@keyframes hpDraw { to { stroke-dashoffset: 0; } }
@keyframes hpPulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hp-entry { animation: none; stroke-dashoffset: 0; } .hp-sector.lit { animation: none; } }
.hp-card { background: radial-gradient(circle at 50% 40%, var(--surface) 0%, var(--surface-2) 100%); }
.hp-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.hp-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hp-legend .sw.sec-direct { background: #22c55e; } .hp-legend .sw.sec-teardrop { background: var(--amber); } .hp-legend .sw.sec-parallel { background: #60a5fa; }
.hp-clr { background: var(--sky); }
.hp-clearance { font: 600 1.25rem/1.4 var(--serif); margin: 0; }
.hp-fb { padding: 6px 10px; margin-bottom: 8px; border-radius: var(--r-s); font-weight: 600; font-size: .92rem; }
.hp-fb.ok { background: var(--good-soft); color: var(--good); }
.hp-fb.no { background: var(--bad-soft); color: var(--bad); }
.hp-steps li { margin-bottom: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- landing intro (modules page) ---------- */
.intro { margin-bottom: 30px; }
.intro-hero { position: relative; padding: 22px 28px 20px; border-radius: var(--r-l); background: var(--sky); border: 1px solid var(--line); overflow: hidden; }
.intro-hero::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb), .35), transparent 65%); pointer-events: none; }
.intro-hero h1, .intro-hero .intro-h { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.08; margin: 0 0 10px; }
.intro-hero .grad { background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-hero .lede { max-width: 760px; }
/* the big logo on the right of the landing hero */
.intro-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; }
.intro-main { min-width: 0; position: relative; z-index: 1; }
.intro-logo { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-right: 12px; color: var(--ink); }
.intro-logo svg { width: clamp(110px, 12vw, 160px); height: clamp(110px, 12vw, 160px); filter: drop-shadow(0 12px 30px rgba(var(--accent-rgb), .22)); }
.intro-logo-name { font: 800 clamp(1.7rem, 2.6vw, 2.4rem)/1 var(--display); letter-spacing: .01em; }
.intro-logo-name b { color: var(--orange); font-weight: 800; }
.intro-logo-tag { font: 600 .82rem var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 980px) {
  .intro-hero { grid-template-columns: minmax(0, 1fr); }
  .intro-logo { order: -1; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0; }
  .intro-logo svg { width: 64px; height: 64px; }
  .intro-logo-tag { display: none; }
}
.intro-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.why-card { position: relative; padding: 18px 18px 16px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--edge-a); box-shadow: var(--shadow-1); }
.why-card .ico { width: 26px; height: 26px; color: var(--orange); fill: none; stroke: currentColor; stroke-width: 1.8; }
.why-card h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.why-card p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.why-n { position: absolute; top: 12px; right: 14px; font: 800 1.6rem var(--display); color: var(--line); }
.intro-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.intro-src .chip { text-decoration: none; }
.intro-src .chip:hover { background: var(--orange-soft); color: var(--orange-text); }
.pick-h { margin: 30px 0 8px; }
.mod-topics { display: flex; flex-wrap: wrap; gap: 4px; }
.mod-topics span { padding: 2px 8px; border-radius: 99px; background: var(--canvas); color: var(--ink-2); font-size: .76rem; }
.mod-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .84rem; color: var(--ink-2); }
.mod-counts b { font: 800 1rem var(--display); color: var(--ink); }
/* module cards line up across a row: header, title, summary, counts, ownership, and footer share the grid's rows */
@supports (grid-template-rows: subgrid) {
  .mod-grid.mods .mod-card { display: grid; grid-template-rows: subgrid; grid-row: span 6; row-gap: 10px; align-content: start; }
  .mod-grid.mods .mod-foot { margin-top: 0; align-self: end; }
}
/* module cards: the code is a soft orange badge rather than a solid glowing tile */
.mod-grid.mods .mod-code { background: var(--orange-soft); color: var(--orange-text); box-shadow: none; border: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); font-size: 1.1rem; }
.mod-grid.mods .mod-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-clamp: 3; overflow: hidden; }
.mod-grid.mods .mod-own:empty { display: block; }
.mod-grid.mods .mod-foot { display: flex; align-items: center; gap: 12px; padding-top: 6px; }
.mod-prog { flex: 1; height: 8px; border-radius: 4px; background: var(--sock-empty); overflow: hidden; }
.mod-prog i { display: block; height: 100%; border-radius: 4px; background: var(--sunrise); }
.mod-pct { font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
.mod-pct b { font: 800 1rem var(--display); color: var(--ink); }
@media (max-width: 640px) { .intro-hero { padding: 24px 20px 20px; } }
/* Learn it. Practice it. Master it. */
/* knowledge test results and missed ACS code review */
.kt-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-bottom: 12px; }
/* score medal: color by tier (70s, 80s, 90s, 100, below the pass mark) */
.kt-medal { --m: var(--good); display: grid; place-items: center; width: 92px; height: 92px; flex: none; border-radius: 50%; border: 4px solid var(--m); background: color-mix(in srgb, var(--m) 12%, transparent); }
.kt-medal b { font: 800 1.6rem var(--display); color: var(--m); }
.kt-medal.sm { width: 64px; height: 64px; border-width: 3px; } .kt-medal.sm b { font-size: 1.15rem; }
.t70 { --m: var(--good); } .t80 { --m: #22a06b; } .t90 { --m: var(--orange); } .t100 { --m: #e0a100; } .fail { --m: var(--bad); }
.kt-medal.t100 { box-shadow: 0 0 0 4px color-mix(in srgb, #f5b301 30%, transparent), 0 8px 30px rgba(245, 179, 1, .35); }
.kt-result { display: flex; gap: 20px; align-items: center; padding: 20px 22px; border-radius: var(--r-l); border: 1px solid color-mix(in srgb, var(--m, var(--good)) 45%, var(--line)); background: color-mix(in srgb, var(--m, var(--good)) 9%, var(--surface)); margin-bottom: 10px; }
.kt-result h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.kt-result p { margin: 0; color: var(--ink-2); }
.kt-result-text { flex: 1; min-width: 0; }
.kt-replay { align-self: flex-start; }
.kt-sum { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: .9rem; color: var(--ink-2); margin: 4px 2px 8px; }
.kt-sum a { font-weight: 600; }
.kt-actions { margin: 12px 0 18px; }
.kt-area { padding: 6px 20px 10px; margin-bottom: 14px; }
.kt-area h2 { font-size: 1.1rem; margin: 14px 0 4px; }
.kt-area-n { color: var(--orange-text); margin-right: 4px; }
.kt-task-h { font: 600 .9rem var(--ui); color: var(--ink-2); margin: 14px 0 2px; }
.kt-code { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.kt-task-h + .kt-code { border-top: 0; }
.kt-tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: none; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; }
.kt-tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; }
.kt-tick:hover { border-color: var(--good); color: color-mix(in srgb, var(--good) 50%, transparent); }
.kt-tick[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.kt-code-id { font: 700 .82rem ui-monospace, monospace; color: var(--orange-text); margin-right: 4px; }
.kt-code-text { color: var(--ink); }
.kt-code.done .kt-code-text, .kt-code.done .kt-code-id { color: var(--ink-3); }
.kt-study { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; margin-top: 5px; font-size: .88rem; }
.kt-study-k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.kt-study a { font-weight: 600; }
.kt-note { margin: 10px 0 0; font-size: .88rem; }
.kt-disclaim { margin: 10px 0 0; }
/* Today's action row: next brief (sky), hours (amber), study plan (violet); Clear is a soft red */
.btn-sky { border-color: color-mix(in srgb, #38bdf8 55%, transparent); color: #0369a1; background: color-mix(in srgb, #38bdf8 12%, var(--surface)); }
.btn-amber { border-color: color-mix(in srgb, #f5b301 70%, transparent); color: #92400e; background: color-mix(in srgb, var(--amber) 16%, var(--surface)); }
.btn-violet { border-color: color-mix(in srgb, #a78bfa 60%, transparent); color: #6d28d9; background: color-mix(in srgb, #a78bfa 12%, var(--surface)); }
:root[data-theme="night"] .btn-sky { color: #7dd3fc; }
:root[data-theme="night"] .btn-amber { color: #fcd34d; }
:root[data-theme="night"] .btn-violet { color: #c4b5fd; }
.btn-sky .ico, .btn-amber .ico, .btn-violet .ico { fill: none; stroke: currentColor; stroke-width: 2; }
/* Sign in on the welcome and sign-in pages: sky blue with a glow so it reads as a real choice next to Create account */
.btn-signin { border-width: 2px; border-color: #38bdf8; background: color-mix(in srgb, #38bdf8 18%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, #38bdf8 18%, transparent), 0 6px 22px color-mix(in srgb, #38bdf8 38%, transparent); }
.btn-signin:hover { background: color-mix(in srgb, #38bdf8 28%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, #38bdf8 28%, transparent), 0 8px 28px color-mix(in srgb, #38bdf8 50%, transparent); }
.btn-amber b { margin-left: 4px; }
.btn-clear { color: var(--bad) !important; }
.btn-clear:hover { background: var(--bad-soft) !important; }
.pace-link { display: inline-block; margin-top: 6px; font-size: .85rem; font-weight: 600; color: var(--orange-text); }
.plan-page .pace { margin-top: 0; max-width: none; }
/* Hours tracker */
.hr-sum .row { align-items: baseline; gap: 8px; }
.hr-bar { height: 6px; border-radius: 3px; background: var(--sock-empty); overflow: hidden; margin-top: 6px; max-width: 360px; }
.hr-bar.big { height: 10px; max-width: none; margin-top: 10px; }
.hr-bar i { display: block; height: 100%; background: var(--sunrise); }
.hr-row.ok .hr-bar i { background: var(--good); }
.hr-list { padding-top: 6px; padding-bottom: 6px; }
.hr-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0 10px calc(var(--lvl) * 22px); border-top: 1px solid var(--line-2); }
.hr-row:first-child { border-top: 0; }
.hr-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.hr-row.ok .hr-tick { background: var(--good); border-color: var(--good); color: #fff; }
.hr-tick svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; }
.hr-t { font-weight: 600; }
.hr-row[style*="--lvl:1"] .hr-t, .hr-row[style*="--lvl:2"] .hr-t { font-weight: 500; }
.hr-reg { font-size: .78rem; font-weight: 600; color: var(--orange-text); }
.hr-num { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .85rem; color: var(--ink-3); }
.hr-num input { width: 84px; height: 36px; text-align: right; }
.hr-met { height: 36px; padding: 0 12px; color: var(--good) !important; border: 1px solid color-mix(in srgb, var(--good) 45%, transparent) !important; }
.hr-met:hover:not(:disabled) { background: var(--good-soft) !important; }
.hr-met:disabled { opacity: .45; }
.hr-check { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 560px) { .hr-row { grid-template-columns: 26px minmax(0, 1fr); padding-left: calc(var(--lvl) * 12px); } .hr-row > .hr-num, .hr-row > .hr-check { grid-column: 2; } }
/* Formulas */
.fx-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.fx-list { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.fx-list input[type=search] { width: 100%; margin-bottom: 8px; }
.fx-pick { display: none; width: 100%; }
.fx-group h3 { font: 600 .74rem var(--ui); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 12px 0 4px; }
.fx-item { display: block; padding: 6px 10px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.fx-item:hover { background: var(--canvas); color: var(--ink); }
.fx-item.on { background: var(--orange-soft); color: var(--orange-text); font-weight: 600; }
.fx-formula { font: 600 .92rem ui-monospace, monospace; padding: 12px 14px; border-radius: var(--r-s); background: var(--canvas); border-left: 3px solid var(--orange); line-height: 1.7; margin-bottom: 14px; }
.fx-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.fx-inputs label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.fx-num { display: flex; align-items: center; gap: 6px; }
.fx-num input { flex: 1; min-width: 0; }
.fx-u { font-size: .82rem; color: var(--ink-3); min-width: 34px; }
.fx-out { margin-top: 16px; display: grid; gap: 6px; }
.fx-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 10px 14px; border-radius: var(--r-s); background: var(--orange-soft); }
.fx-row span { color: var(--ink-2); font-size: .9rem; }
.fx-row b { font: 800 1.2rem var(--display); color: var(--ink); text-align: right; }
.fx-note { margin: 12px 0 0; }
@media (max-width: 820px) { .fx-layout { grid-template-columns: minmax(0, 1fr); } .fx-list { position: static; max-height: none; } .fx-group, .fx-list input[type=search] { display: none; } .fx-pick { display: block; } }
/* V-speeds: Va and weight */
.va-w { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.va-formula { font: 600 .88rem ui-monospace, monospace; padding: 8px 10px; border-radius: var(--r-s); background: var(--canvas); color: var(--ink); line-height: 1.5; }
.va-slider { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 10px 0 4px; font-size: .88rem; color: var(--ink-2); }
.va-slider input { accent-color: var(--orange); width: 100%; }
.va-slider b { font: 700 .95rem var(--display); color: var(--ink); min-width: 70px; text-align: right; }
.va-calc { margin: 4px 0 0; font-size: .92rem; }
.run-note { margin: 0 0 14px; font-size: .9rem; }
.kt-link { background: none; border: 0; padding: 0; font: 600 .88rem var(--ui); color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.kt-goal { height: 36px; }
.kt-goal.pass b { color: var(--good); } .kt-goal.fail b { color: var(--bad); }
@media (max-width: 640px) { .kt-result { flex-wrap: wrap; } .kt-medal { width: 76px; height: 76px; } }
/* celebrations: confetti and the card */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; }
.celebrate { position: fixed; inset: 0; z-index: 1900; display: grid; place-items: center; background: rgba(8, 10, 16, .35); animation: celIn .25s ease-out; padding: 20px; }
.celebrate.out { opacity: 0; transition: opacity .25s; }
.celebrate-card { width: min(440px, 100%); text-align: center; padding: 26px 26px 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--edge-a); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: celPop .45s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate-card h2 { margin: 10px 0 6px; font-size: 1.7rem; }
.celebrate-card p { margin: 0 0 16px; color: var(--ink-2); }
.celebrate-card .row { justify-content: center; }
.celebrate-badge { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font: 800 1.6rem var(--display); color: #fff; background: var(--sunrise); box-shadow: 0 10px 30px rgba(var(--accent-rgb), .35); }
.tier-t100 .celebrate-badge, .tier-module .celebrate-badge, .tier-mastered .celebrate-badge { background: linear-gradient(135deg, #ffd34d, #e0a100); box-shadow: 0 10px 30px rgba(245, 179, 1, .45); }
.tier-t70 .celebrate-badge, .tier-t80 .celebrate-badge { background: linear-gradient(135deg, #4cc38a, #23824f); box-shadow: 0 10px 30px rgba(35, 130, 79, .35); }
@keyframes celIn { from { opacity: 0; } }
@keyframes celPop { from { transform: scale(.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .celebrate, .celebrate-card { animation: none; } }
.kt-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kt-bar { height: 6px; border-radius: 3px; background: var(--sock-empty); overflow: hidden; margin-top: 4px; max-width: 320px; }
.kt-bar i { display: block; height: 100%; background: var(--good); }
.kt-form .row label { flex: 1; min-width: 160px; }
.kt-form textarea { font-family: ui-monospace, monospace; }
@media (max-width: 640px) { .kt-item { grid-template-columns: auto minmax(0, 1fr); } .kt-item > .row { grid-column: 1 / -1; } }
.tour-info { margin: 2px 0 10px; padding: 10px 12px; border-left: 3px solid var(--orange); background: var(--orange-soft); border-radius: 0 10px 10px 0; font-size: .92rem; }
.tour-info p { margin: 0; }
.tour-ident { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.tour-morse { font-family: ui-monospace, monospace; letter-spacing: .08em; }
.pillars-head { margin: 30px 0 4px; }
.pillars-head h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.pillars-head p { margin: 0; max-width: 820px; }
.pillars-head .grad { background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.pillar { display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 18px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.pillar-top { display: flex; align-items: center; gap: 10px; }
.pillar-top .ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--sunrise); color: #fff; fill: none; stroke: currentColor; stroke-width: 2; box-sizing: border-box; }
.pillar-k { font: 800 1.35rem var(--display); letter-spacing: .06em; }
.pillar p { margin: 0; color: var(--ink-2); }
.pillar-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; }
.pillar-links a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--orange-text); text-decoration: none; }
.pillar-links a:hover { text-decoration: underline; }
.pillar-links .ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.hp-fly { display: flex; align-items: center; gap: 12px; margin-top: 10px; min-height: 40px; flex-wrap: wrap; justify-content: center; }
.hp-fly-cap { font-weight: 600; color: var(--ink-2); }
.hp-fly-trail { fill: none; stroke: #fde68a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px var(--amber)); }
.hp.flying .hp-entry, .hp.flying .hp-arrive { opacity: .25; animation: none; stroke-dashoffset: 0; }
.hp.flying .hp-plane use { fill: #fff; }

/* ---------- approach trainer: plates (paper stays white in night mode, like a printed chart) ---------- */
.ap-disclaimer { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-s); border: 1px solid #f5c26b; background: #fff7e6; color: #6b4500; font-size: .9rem; }
[data-theme="night"] .ap-disclaimer { background: #2b2210; border-color: #7a5a1c; color: #f5d08b; }
.ap-layout { display: grid; grid-template-columns: minmax(300px, 520px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ap-plate { padding: 8px; position: sticky; top: calc(var(--bar) + 12px); }
.ap-types { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-types .chip { border: 0; cursor: pointer; font: 600 .82rem var(--ui); }
.plate { display: block; width: 100%; height: auto; font-family: Arial, Helvetica, sans-serif; }
.pl-paper { fill: #fff; }
.plate .pl-water { fill: rgba(200, 30, 30, .07); font: 800 64px Arial, sans-serif; letter-spacing: .1em; }
.pl-box { fill: none; stroke: #111; stroke-width: 1.2; }
.pl-ln, .pl-tick { stroke: #111; stroke-width: .7; }
.pl-tick { stroke-dasharray: 2 3; }
.plate text { fill: #111; }
.pl-xs { font-size: 8.5px; }
.pl-xsb { font-size: 8.5px; font-weight: 700; }
.pl-s { font-size: 10px; }
.pl-b { font-weight: 700; font-size: 11px; }
.pl-title { font-size: 13px; font-weight: 800; }
.plate .pl-red { fill: #c0182e; font-weight: 700; }
.pl-ul { text-decoration: underline; }
.pl-crs { stroke: #111; stroke-width: 2.2; fill: none; }
.pl-feed { stroke: #111; stroke-width: 1.3; fill: none; }
.pl-pt { stroke: #111; stroke-width: 1.5; fill: none; }
.pl-rwy, .pl-rwy2 { stroke: #111; stroke-width: 5; }
.pl-rwy2 { stroke-width: 8; }
.pl-loc { stroke: #111; stroke-width: 6; }
.pl-fix { fill: #fff; stroke: #111; stroke-width: 1.2; }
.pl-wp { fill: #fff; stroke: #111; stroke-width: 1.2; }
.pl-vor { fill: #fff; stroke: #111; stroke-width: 1.2; }
.pl-dot { fill: #111; }
.pl-hold { fill: none; stroke: #111; stroke-width: 1.2; stroke-dasharray: 5 3; }
.pl-miss { fill: none; stroke: #111; stroke-width: 1; stroke-dasharray: 4 4; }
.pl-msa { fill: none; stroke: #111; stroke-width: 1; }
.pl-path { fill: none; stroke: #111; stroke-width: 2; }
.pl-bolt, .pl-mx { fill: none; stroke: #111; stroke-width: 2.4; }
.pl-mbox { fill: #f3f3f3; stroke: #111; stroke-width: .6; }
.pl-glow { fill: rgba(255, 170, 60, .18); stroke: var(--orange); stroke-width: 2.5; filter: drop-shadow(0 0 6px var(--orange)); animation: hpPulse 1.6s ease-in-out infinite; }
.ap-real { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ap-pdf { margin-top: 16px; }
.ap-pdf iframe { width: 100%; height: 82vh; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; }
.ap-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10, 14, 22, .6); padding: 16px; }
.ap-modal-in { width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- approach trainer: fly it ---------- */
.fl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fl-sight { padding: 4px 10px; border-radius: 99px; background: var(--canvas); font: 700 .8rem var(--ui); color: var(--ink-2); }
.fl-sight.on { background: var(--good-soft); color: var(--good); box-shadow: 0 0 12px rgba(35, 130, 79, .4); }
/* the map column is as wide as the map at its capped height (38vh, drawn 380x300), never more than half; the cockpit takes the rest */
.fl-grid { display: grid; grid-template-columns: min(calc(38vh * 1.267 + 22px), 50%) minmax(0, 1fr); gap: 16px; align-items: start; }
.fl-views { padding: 10px; background: #0f1520; }
.fl-cap { color: #9aa3b5 !important; margin: 2px 4px; }
.fl-plan, .fl-prof { display: block; width: 100%; height: auto; }
.fl-wedge { fill: rgba(96, 165, 250, .12); }
.fl-crs { stroke: #cbd5e1; stroke-width: 1.5; }
.fl-leg { fill: none; stroke: #e879f9; stroke-width: 2.5; }
/* approach practice setup */
.fl-setup .fl-opt { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 0; }
.fl-opt-k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.fl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fl-chips .chip { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: .82rem; }
.fl-chips .chip.off { opacity: .5; border-style: dashed; }
.fl-feed { fill: none; stroke: #94a3b8; stroke-width: 1.2; stroke-dasharray: 5 3; }
.fl-limit { fill: none; stroke: #64748b; stroke-width: 1; stroke-dasharray: 4 4; }
.fl-barb { stroke: #cbd5e1; stroke-width: 1.5; }
.fl-rwy { stroke: #f8fafc; stroke-width: 5; }
.fl-fix { fill: none; stroke: #7dd3fc; stroke-width: 1.4; }
.fl-lab { fill: #cbd5e1; font: 600 10px var(--ui); }
.fl-red { fill: #ff6b6b; }
.fl-trail { fill: none; stroke: #fde68a; stroke-width: 2; stroke-linejoin: round; filter: drop-shadow(0 0 3px var(--amber)); }
#flPlane use { fill: var(--amber); }
.fl-cloud { fill: rgba(148, 163, 184, .16); }
.fl-ground { stroke: #8b6b3d; stroke-width: 3; }
.fl-tick { stroke: #475569; stroke-dasharray: 2 4; }
.fl-path { fill: none; stroke: #94a3b8; stroke-width: 2; stroke-dasharray: 6 4; }
.fl-mins { stroke: #ff6b6b; stroke-width: 1.2; stroke-dasharray: 3 3; }
.fl-dot { fill: var(--amber); filter: drop-shadow(0 0 4px var(--orange)); }
/* the panel: flying controls up and left of the HSI with the readouts under them; the steps on the right under the
   HSI. Each side is a column (fl-colL, fl-colR); on narrower screens the columns dissolve into one stack. */
.fl-panel { padding: 14px; display: grid; gap: 12px; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fl-colL, .fl-colR { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 1280px) {
  /* one stack: HSI, readouts, the step, the controls, events */
  .fl-panel { grid-template-columns: minmax(0, 1fr); }
  .fl-colL, .fl-colR { display: contents; }
  .fl-hsi { order: 1; } .fl-read { order: 2; } .fl-coach { order: 3; } .fl-ctl { order: 4; } .fl-events { order: 5; }
}
.fl-hsi { max-width: 270px; margin: 0 auto; width: 100%; }
.hsi { display: block; width: 100%; height: auto; }
.hs-bezel { fill: #2b313d; } .hs-face { fill: #0b0e14; }
.hs-tick { stroke: #cbd5e1; stroke-width: 1.2; } .hs-tick.major { stroke: #fff; stroke-width: 2; }
.hs-num { fill: #fff; font: 700 12px var(--display); text-anchor: middle; dominant-baseline: central; }
.hs-crs { fill: #d946ef; }
.hs-cdi { fill: #d946ef; filter: drop-shadow(0 0 3px #d946ef); }
.hsi.vloc .hs-crs { fill: #22c55e; }
.hsi.vloc .hs-cdi { fill: #22c55e; filter: drop-shadow(0 0 3px #22c55e); }
.hs-dot { fill: none; stroke: #e2e8f0; stroke-width: 1.2; }
.hs-lubber { fill: var(--amber); } .hs-plane { fill: var(--amber); }
.hs-gsbar { fill: rgba(11, 14, 20, .92); stroke: #64748b; }
.hs-gsptr { fill: #22c55e; stroke: #0b0e14; stroke-width: 1; filter: drop-shadow(0 0 4px #22c55e); }
#hsGs.gp .hs-gsptr { fill: #e879f9; filter: drop-shadow(0 0 4px #e879f9); }
.hs-gsmid { stroke: #f8fafc; stroke-width: 2; }
.hs-gslab { font: 800 10px var(--display); fill: #e2e8f0; text-anchor: middle; }
.hs-gstag { fill: #0b0e14; stroke: #64748b; }
#hsGs.off .hs-gsptr { display: none; }
#hsGs.off { opacity: .45; }
.hs-flag { fill: var(--amber); font: 700 11px var(--display); }
.fl-read { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fl-read div { padding: 6px 8px; border-radius: var(--r-s); background: var(--canvas); }
.fl-read span { display: block; font: 600 .7rem var(--ui); color: var(--ink-3); letter-spacing: .05em; }
.fl-read b { font: 800 1.25rem var(--display); }
.fl-read small { display: block; color: var(--ink-3); font-size: .72rem; }
.fl-read .fl-wind { grid-column: 1 / -1; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.fl-read .fl-wind > div { padding: 0; background: none; }
.fl-warrow { width: 34px; height: 34px; }
.fl-warrow path { fill: none; stroke: #22d3ee; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hs-trk { fill: #fff; stroke: #0b0e14; stroke-width: 1.6; paint-order: stroke; }
.fl-ctl .fl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fl-ctl .btn { height: 36px; }
.fl-ctl .fl-ap .btn { flex: 0 0 64px; }
.fl-ctl .fl-ap .fl-fma { flex: 1 1 0 !important; }
.fl-keys { margin: 4px 0 0; font-size: .74rem; }
.fl-ctl .fl-row > span { flex: 0 0 100%; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.fl-ctl .btn { padding: 0 8px; min-width: 0; flex: 1 1 0; }
.fl-ctl .fl-row #flMiss { flex: 1 1 100%; }
.fl-ctl .kbd-hint { display: block; }
.fl-colL .fl-read div { padding: 5px 8px; }
.fl-colL .fl-read b { font-size: 1.1rem; }
.fl-read span small { display: inline; font-weight: 500; letter-spacing: 0; }
.fl-events { display: flex; flex-direction: column; gap: 4px; min-height: 60px; }
.fl-ev { padding: 5px 9px; border-radius: var(--r-s); background: var(--canvas); font-size: .85rem; }
.fl-ev.good { background: var(--good-soft); color: var(--good); }
.fl-ev.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.fl-ev.warn { background: var(--orange-soft); color: var(--orange-text); }
.fl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.fl-stats div { padding: 8px 10px; border-radius: var(--r-s); background: var(--canvas); }
.fl-stats span { display: block; font-size: .8rem; color: var(--ink-2); }
.fl-stats b { font: 800 1.15rem var(--display); }
@media (max-width: 980px) {
  .ap-layout, .fl-grid { grid-template-columns: 1fr; }
  .ap-plate { position: static; }
}
.ap-real .vs-row { text-decoration: none; }
.fl-plan { max-height: 38vh; }
.fl-prof { max-height: 22vh; }

/* ---------- real FAA plates: search, chart tabs, PDF viewer ---------- */
.rp-search { display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-1); }
.rp-search:focus-within { border-color: var(--orange); box-shadow: var(--glow-soft); }
.rp-search .ico { width: 18px; height: 18px; color: var(--ink-3); fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
form.rp-search input { flex: 1; min-width: 0; height: 38px; padding: 0; border: 0; outline: 0; background: none; box-shadow: none; color: var(--ink); font: 700 1.05rem var(--display); letter-spacing: .08em; text-transform: uppercase; }
form.rp-search input::placeholder { font: 500 .95rem var(--ui); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.rp-search .btn { border-radius: 99px; height: 38px; }
.rp-recent { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0 4px; }
.rp-recent .chip { text-decoration: none; letter-spacing: .05em; }
.rp-recent .chip:hover { background: var(--orange-soft); color: var(--orange-text); }
#rpOut { margin-top: 16px; }
.rp-loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.rp-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--orange); animation: rpSpin .8s linear infinite; }
@keyframes rpSpin { to { transform: rotate(360deg); } }
.rp-apt { margin-bottom: 12px; }
.rp-apt b { font: 800 1.25rem var(--display); }
.rp-id { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px; background: var(--sunrise); color: #fff; font: 800 .85rem var(--display); letter-spacing: .06em; vertical-align: 2px; }
.rp-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.rp-list { padding: 10px; position: sticky; top: calc(var(--bar) + 12px); max-height: calc(100vh - var(--bar) - 24px); display: flex; flex-direction: column; }
.rp-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.rp-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink-2); font: 600 .84rem var(--ui); cursor: pointer; }
.rp-tabs button i { font-style: normal; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--canvas); font-size: .74rem; display: grid; place-items: center; }
.rp-tabs button:hover { color: var(--ink); border-color: var(--ink-3); }
.rp-tabs button[aria-selected="true"] { background: var(--sunrise); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(var(--accent-rgb), .3); }
.rp-tabs button[aria-selected="true"] i { background: rgba(255, 255, 255, .25); }
.rp-charts { overflow: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.rp-chart { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--r-s); background: none; color: var(--ink); font: 600 .9rem var(--ui); text-align: left; cursor: pointer; }
.rp-chart small { font: 500 .74rem var(--ui); color: var(--ink-3); }
.rp-chart:hover { background: var(--canvas); }
.rp-chart.on { background: var(--orange-soft); color: var(--orange-text); box-shadow: inset 3px 0 0 var(--orange); }
.rp-view { padding: 10px; min-height: 70vh; }
.rp-view-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; }
.rp-view iframe { width: 100%; height: calc(100vh - var(--bar) - 120px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; }
@media (max-width: 980px) {
  .rp-layout { grid-template-columns: 1fr; }
  .rp-list { position: static; max-height: none; }
  .rp-view iframe { height: 75vh; }
}

/* ---------- practice plates, FAA chart styling ---------- */
.plate { font-family: Futura, "Futura PT", "Century Gothic", "Avenir Next", "Trebuchet MS", Arial, sans-serif; }
.plate text { fill: #111; }
.plate .pl-light { font-weight: 300; letter-spacing: .01em; }
.plate .pl-serif { font-family: "Times New Roman", Times, serif; }
.plate .pl-red { fill: #b3122a; }
.pl-fill { fill: #111; }
.pl-box { fill: none; stroke: #111; stroke-width: 1.5; }
.pl-boxh { fill: none; stroke: #111; stroke-width: 2.4; }
.pl-ln { fill: none; stroke: #111; stroke-width: .8; }
.pl-thin { stroke: #111; stroke-width: .7; }
.pl-crs { fill: none; stroke: #111; stroke-width: 2.4; stroke-linecap: butt; }
.pl-path { fill: none; stroke: #111; stroke-width: 2.4; stroke-linejoin: round; }
.pl-miss { fill: none; stroke: #111; stroke-width: 2.6; stroke-dasharray: .1 3.4; stroke-linecap: round; }
.pl-gs { fill: #c9c9c9; }
.pl-lake { fill: #d4d4d4; }
.pl-obst { fill: none; stroke: #111; stroke-width: 1.2; }
.pl-call { fill: #fff; stroke: #111; stroke-width: 1; }
.pl-callh { fill: #fff; stroke: #111; stroke-width: 2; }
.pl-tag { fill: #fff; stroke: #111; stroke-width: 1; }
.pl-fix, .pl-wp, .pl-vor { fill: #fff; stroke: #111; stroke-width: 1.3; }
.pl-msa { fill: #fff; stroke: #111; stroke-width: 1; }
.pl-rwy { stroke: #111; stroke-width: 4; }
.pl-rwy2 { stroke: #111; stroke-width: 5; }
.pl-bolt { fill: none; stroke: #111; stroke-width: 1.4; stroke-linejoin: miter; }
.fl-fma { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px 6px; border-radius: 6px; background: #0b0e14; min-height: 30px; font: 700 .8rem var(--display); letter-spacing: .06em; }
.fl-fma span { padding: 2px 7px; border-radius: 4px; }
.fl-fma .on { color: #0b0e14; background: #4ade80; }
.fl-fma .off { color: #94a3b8; }
.fl-fma .act { color: #4ade80; border: 1px solid #4ade80; }
.fl-fma .arm { color: #f8fafc; border: 1px solid #94a3b8; }
.fl-fma .sel { color: #22d3ee; }
.fl-fma .sep { width: 1px; height: 18px; background: #475569; padding: 0; margin: 0 2px; }
.fl-ev.ap { background: rgba(34, 211, 238, .12); color: #0e7490; }
[data-theme="night"] .fl-ev.ap { color: #67e8f9; }
.fl-coach { padding: 10px 12px; border-radius: var(--r-s); background: var(--sky); border: 1px solid var(--line); min-height: 64px; }
.fl-coach b { display: block; font: 800 1rem var(--display); margin-bottom: 2px; }
.fl-coach span { font-size: .9rem; color: var(--ink-2); }
.fl-clock { font: 800 1rem var(--display); padding: 3px 10px; border-radius: 99px; background: var(--canvas); }
.fl-how li { margin-bottom: 6px; }
.mod-card.soon { opacity: .6; pointer-events: none; }

/* ---------- learn: one brief at a time ---------- */
.brief-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 16px 0 6px; }
.brief-pager > :last-child { justify-self: end; }
.pager-btn { height: auto; min-height: 46px; padding: 6px 14px; flex-direction: column; align-items: flex-start; gap: 1px; text-decoration: none; max-width: 100%; }
.pager-btn.next { align-items: flex-end; text-align: right; background: var(--sunrise); color: #fff; border-color: transparent; box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .35), 0 6px 22px rgba(var(--accent-rgb), .45); animation: pagerGlow 2.4s ease-in-out infinite; }
.pager-btn.next:hover { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .5), 0 8px 30px rgba(var(--accent-rgb), .65); }
.pager-btn:not(.next), .btn.prev:not(.disabled) { background: linear-gradient(135deg, #5d6676, #3b4250); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(40, 46, 60, .35); }
.pager-btn:not(.next):hover, .btn.prev:not(.disabled):hover { filter: brightness(1.12); box-shadow: 0 6px 18px rgba(40, 46, 60, .5); }
.pg-dir { font: 800 .88rem var(--display); letter-spacing: .02em; }
.pg-t { font: 500 .76rem var(--ui); opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.pg-count { font: 700 .85rem var(--display); color: var(--ink-3); }
.learn-nav a[aria-current="true"] { background: var(--orange-soft); color: var(--orange-text); box-shadow: inset 3px 0 0 var(--orange); }
@keyframes pagerGlow { 0%, 100% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .35), 0 6px 22px rgba(var(--accent-rgb), .35); } 50% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .5), 0 8px 30px rgba(var(--accent-rgb), .6); } }
@media (prefers-reduced-motion: reduce) { .pager-btn.next { animation: none; } }
@media (max-width: 640px) { .brief-pager { grid-template-columns: 1fr 1fr; } .pg-count { display: none; } .pg-t { max-width: 130px; } }
.brief-pager > :first-child { justify-self: start; }
.learn-layout { scroll-margin-top: calc(var(--bar) + 12px); }
.study-only { margin-top: 14px; padding: 12px 16px; border-radius: var(--r-m); border: 1px solid var(--line); border-left: 4px solid var(--ink-2); background: var(--surface); color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
.study-only b { color: var(--ink); }

/* ---------- landing page tabs ---------- */
.home-tabs { display: flex; gap: 6px; margin: 2px 0 20px; padding: 5px; width: fit-content; max-width: 100%; overflow-x: auto; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.home-tabs a { padding: 9px 20px; border-radius: 99px; color: var(--ink-2); font: 700 1rem var(--display); letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.home-tabs a:hover { color: var(--ink); background: var(--canvas); }
.home-tabs a[aria-current="page"] { color: #fff; background: var(--sunrise); box-shadow: 0 4px 14px rgba(var(--accent-rgb), .35); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--orange); width: 16px; height: 16px; margin: 0; }
.vs-seg { display: inline-flex; padding: 3px; border-radius: 99px; border: 1px solid var(--line); background: var(--canvas); }
.vs-seg label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; cursor: pointer; font: 600 .92rem var(--ui); color: var(--ink-2); }
.vs-seg input { position: absolute; opacity: 0; pointer-events: none; }
.vs-seg label:has(input:checked) { background: var(--sunrise); color: #fff; box-shadow: 0 3px 10px rgba(var(--accent-rgb), .3); }
.vs-seg label:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.vs-me { display: none; flex-direction: column; gap: 10px; }
#vsForm.show-multi .vs-me { display: flex; }
.vs-lock { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-s); background: var(--orange-soft); border: 1px solid color-mix(in srgb, var(--orange) 40%, transparent); font-size: .9rem; }
.vs-lock span { flex: 1; min-width: 240px; }
.vs-field.locked { opacity: .55; }
.vs-field.locked input { cursor: not-allowed; }
/* Today for visitors: the module's chapters and the way in */
.welcome-chs > div { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; }
.fl-read span span { display: inline; font: inherit; color: inherit; letter-spacing: 0; }

/* ---------- Study and Reference switchers (js/hubs.js) ---------- */
.subnav { display: flex; gap: 2px; margin: -6px 0 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav a { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; color: var(--ink-2); text-decoration: none; font: 700 .95rem var(--display); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--orange-text); border-bottom-color: var(--orange); }
.subnav .ico { width: 18px; height: 18px; }
.study-grid { margin-top: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .study-grid { grid-template-columns: minmax(0, 1fr); } }
.study-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--orange-soft); color: var(--orange-text); }
.study-ico .ico { width: 22px; height: 22px; }
.study-go { color: var(--orange-text); }
.study-card h3 { font-size: 1.35rem; }
@media (max-width: 760px) { .subnav a { padding: 0 10px; font-size: .9rem; } .subnav a span { display: inline; } }
.gl-set { display: inline-flex; padding: 3px; margin: 0 8px 14px 0; border-radius: 99px; background: var(--canvas); border: 1px solid var(--line); }
.gl-set .seg-a { display: inline-grid; place-items: center; height: 30px; padding: 0 14px; border-radius: 99px; color: var(--ink-2); font: 700 .85rem var(--ui); text-decoration: none; }
.gl-set .seg-a[aria-current="page"] { background: var(--sunrise); color: #fff; }
.gl-src { margin-top: 6px; }
@media (max-width: 760px) { .subnav .ico { display: none; } }

/* Progress page (js/study.js) */
.pg-page h2 { margin: 0; }
.pg-sec { display: grid; gap: 12px; min-width: 0; align-content: start; margin-top: 34px; }
.pg-sec > * { margin: 0; }
.pg-sub { margin: -6px 0 0; font-size: .9rem; color: var(--ink-2); }
.pg-focus { margin: 22px 0 0; }
.pg-mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.pg-mod { display: grid; gap: 6px; padding: 10px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pg-mod:hover { border-color: var(--ink-3); }
.pg-mod[aria-current="page"] { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.pg-mod-top { display: flex; justify-content: space-between; align-items: baseline; font: 800 1rem var(--display); }
.pg-mod-pct { font-size: .9rem; color: var(--ink-2); }
.pg-mod-bar { display: block; height: 6px; border-radius: 99px; background: var(--canvas); overflow: hidden; }
.pg-mod-bar i { display: block; height: 100%; border-radius: inherit; background: var(--sunrise); }
.pg-mod-sub { color: var(--ink-2); }
.pg-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-top: 8px; }
.pg-hero { grid-template-columns: auto minmax(0, 1fr); margin: 0; }
.pg-how { margin-top: 8px; }
.pg-how summary { cursor: pointer; font-size: .85rem; color: var(--ink-2); }
.pg-how p { margin: 6px 0 0; }
.pg-stats { grid-template-columns: repeat(3, 1fr); margin: 0; }
.pg-stats a.stat { color: inherit; text-decoration: none; }
.pg-stats a.stat:hover { background: var(--canvas); }
.pg-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
.pg-col { display: grid; gap: 12px; min-width: 0; align-content: start; }
.pg-col > h2 { margin-bottom: 0; }
.pg-col > h2:first-child { margin-top: 22px; }
.pg-trend { display: block; width: 100%; max-width: 480px; height: auto; }
.pg-trend rect.ok { fill: var(--good); }
.pg-trend rect.low { fill: var(--orange); }
.pg-trend .pass { stroke: var(--ink-3, #8a90a2); stroke-dasharray: 4 4; stroke-width: 1; }
.pg-trend .v { font: 700 11px var(--ui); fill: var(--ink); }
.pg-trend .d { font: 600 10px var(--ui); fill: var(--ink-2); }
.pg-got { margin-top: 12px; }
.pg-got summary { cursor: pointer; font-weight: 700; font-size: .95rem; }
.pg-chapters { padding-top: 6px; padding-bottom: 6px; }
.pg-ch { display: grid; grid-template-columns: 28px minmax(0, 1fr) 62px 96px 58px 118px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.pg-ch:last-child { border-bottom: 0; }
a.pg-ch:hover .t { text-decoration: underline; }
.pg-ch .t { font-weight: 500; min-width: 0; }
.pg-ch small { display: block; color: var(--ink-2); font-size: .78rem; }
.pg-ch .m { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pg-ch-head { padding: 8px 0; font: 700 .78rem var(--ui); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.pg-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 26px 0 8px; }
@media (max-width: 980px) {
  .pg-top, .pg-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .pg-ch-head { display: none; }
  .pg-ch { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 4px; }
  .pg-ch > span[data-l] { grid-column: 2; font-size: .85rem; color: var(--ink-2); }
  .pg-ch > span[data-l]::before { content: attr(data-l) ": "; }
  .pg-ch > span[data-l] small { display: inline; margin-left: 6px; }
  .pg-ch .m { grid-column: 3; grid-row: 1; }
  .pg-hero { grid-template-columns: minmax(0, 1fr); }
}
/* Pages under the Study and Reference menus keep the tab bar in the same place: the bar spans the page, the content below stays readable */
/* a page in the Study or Reference hub: the header spans the page, the content below stays readable */
.page.narrow:has(> .page-head .subnav) { max-width: none; }
.page.narrow:has(> .page-head .subnav) > :not(.page-head) { max-width: 880px; }

/* ---------- the page header: title and options in one glowing panel ---------- */
.page-head { container-type: inline-size; position: relative; margin: 0 0 18px; border-radius: 20px; isolation: isolate;
  background: linear-gradient(118deg, color-mix(in srgb, var(--orange) 24%, var(--surface)) 0%, color-mix(in srgb, var(--orange-deep) 11%, var(--surface)) 46%, var(--surface) 88%);
  border: 1px solid color-mix(in srgb, var(--orange) 62%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--orange) 16%, transparent), 0 0 26px color-mix(in srgb, var(--orange) 26%, transparent), inset 0 0 34px color-mix(in srgb, var(--orange) 9%, transparent);
  animation: headGlow 5s ease-in-out infinite; }
/* a thin bright edge that follows the panel's top-left corner */
.page-head::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, var(--orange) 0%, color-mix(in srgb, var(--orange) 15%, transparent) 38%, transparent 62%, color-mix(in srgb, var(--orange) 40%, transparent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes headGlow { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--orange) 24%, transparent), 0 0 36px color-mix(in srgb, var(--orange) 38%, transparent), inset 0 0 40px color-mix(in srgb, var(--orange) 12%, transparent); } }
@media (prefers-reduced-motion: reduce) { .page-head { animation: none; } }
.ph-grid { display: grid; grid-template-columns: auto minmax(0, auto) minmax(0, 1fr) auto; column-gap: 18px; row-gap: 8px; align-items: center; padding: 14px 20px;
  grid-template-areas: "back back back back" "ico title lede opts" "filt filt filt filt"; }
.ph-grid.no-ico { grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; grid-template-areas: "back back back" "title lede opts" "filt filt filt"; }
.ph-back { grid-area: back; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .ph-back:empty { display: none; }
.ph-ico { grid-area: ico; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--sunrise); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--orange) 45%, transparent); }
.ph-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ph-title { grid-area: title; min-width: 0; } .ph-title:empty { display: none; }
.ph-lede { grid-area: lede; min-width: 0; align-self: center; } .ph-lede:empty { display: none; }
.ph-opts { grid-area: opts; justify-self: end; min-width: 0; max-width: 52cqw; display: grid; gap: 10px; justify-items: end; } .ph-opts:empty { display: none; }
.ph-filters { grid-area: filt; min-width: 0; } .ph-filters:empty { display: none; }
.page-head h1 { margin: 0; font-size: clamp(1.7rem, 2.3vw, 2.25rem); line-height: 1.08; }
.page-head .eyebrow { margin: 0 0 3px; }
.page-head .vs-head { margin: 0; }
.page-head .ph-lede > * { margin: 0; max-width: 64ch; font-size: .96rem; line-height: 1.42; color: var(--ink-2); }
.page-head .back-link, .page-head .run-back { margin: 0; }
.page-head .tabs { margin: 0 !important; }
.page-head .subnav { margin: 0; gap: 4px; padding: 4px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--canvas) 72%, transparent); overflow-x: auto; }
.page-head .subnav a { height: 36px; margin: 0; padding: 0 14px; border: 0; border-radius: 10px; }
.page-head .subnav a[aria-current="page"] { background: var(--sunrise); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--orange) 40%, transparent); }
.page-head .subnav a[aria-current="page"] .ico { color: #fff; }
.page-head .subnav a:not([aria-current="page"]):hover { background: var(--surface); }
/* The icon and options span the title and the intro, so a header is two short lines at most. A single row needs a very wide screen. */
@container (max-width: 1699px) {
  .ph-grid { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "back back back" "ico title opts" "ico lede opts" "filt filt filt"; row-gap: 2px; }
  .ph-grid.no-ico { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "back back" "title opts" "lede opts" "filt filt"; }
  .ph-grid > .ph-filters, .ph-grid > .ph-back { margin-top: 6px; }
  .page-head .ph-lede > * { max-width: 100ch; }
}
@container (max-width: 699px) {
  .ph-grid, .ph-grid.no-ico { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "back back" "ico title" "opts opts" "lede lede" "filt filt"; row-gap: 8px; }
  .ph-grid.no-ico { grid-template-columns: minmax(0, 1fr); grid-template-areas: "back" "title" "opts" "lede" "filt"; }
  .ph-opts { justify-self: stretch; }
}

/* ---------- flashcards: the question on the left; the answer waits on the right, ghosted, until you click ---------- */
.fc-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin: 4px 0 18px; cursor: pointer; outline: none; }
.fc-q, .fc-ghost, .fc-ans { position: relative; min-height: 380px; padding: 34px 38px; border-radius: var(--r-l); display: flex; flex-direction: column; }
.fc-q { justify-content: center; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .6s; }
.fc-q::after { content: ""; position: absolute; left: 38px; right: 38px; bottom: 0; height: 4px; border-radius: 4px 4px 0 0; background: var(--sunrise); }
.fc-q .q { font: 700 clamp(1.5rem, 2.1vw, 2rem)/1.22 var(--display); }
.fc-q .meta, .fc-ghost .meta, .fc-ans .meta { position: absolute; top: 16px; left: 38px; right: 38px; display: flex; justify-content: space-between; font: 600 .8rem var(--ui); color: var(--ink-3); }
.fc-a { perspective: 1600px; }
.fc-flip { position: relative; height: 100%; min-height: 380px; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.revealed .fc-flip { transform: rotateY(180deg); }
.fc-ghost, .fc-ans { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fc-ghost { align-items: center; justify-content: center; gap: 24px; color: var(--ink-3); border: 2px dashed color-mix(in srgb, var(--orange) 55%, transparent); background: color-mix(in srgb, var(--surface) 55%, transparent);
  box-shadow: inset 0 0 44px color-mix(in srgb, var(--orange) 8%, transparent); transition: border-color .2s, background .2s; }
.fc-stage:hover .fc-ghost { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 7%, var(--surface)); }
.fc-stage:focus-visible .fc-ghost { box-shadow: 0 0 0 3px var(--orange-soft), 0 0 0 5px var(--orange); }
.fc-lines { display: grid; gap: 13px; width: min(78%, 380px); }
.fc-lines i { display: block; height: 14px; border-radius: 8px; opacity: .85; filter: blur(.7px);
  background: linear-gradient(90deg, var(--line) 0%, color-mix(in srgb, var(--orange) 24%, var(--line)) 50%, var(--line) 100%); background-size: 200% 100%; animation: fcShimmer 2.6s linear infinite; }
.fc-lines i:nth-child(2) { width: 90%; } .fc-lines i:nth-child(3) { width: 64%; } .fc-lines i:nth-child(4) { width: 78%; }
.fc-hint { font: 600 .95rem var(--ui); text-align: center; }
.fc-ans { transform: rotateY(180deg); justify-content: flex-start; padding-top: 50px; overflow-y: auto; font: 18px/1.6 var(--serif); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--orange) 45%, var(--line)); box-shadow: var(--shadow-2); }
.fc-src { margin-top: auto; padding-top: 12px; }
/* the reveal: the card turns over, glows once, and the answer's lines come up one after another; the question settles back */
.revealed .fc-ans { animation: ansGlow 1.2s ease-out .4s both; }
.revealed .fc-q { opacity: .74; transform: scale(.985); }
.revealed .fc-body > * { animation: ansIn .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .5s; }
.revealed .fc-body > :nth-child(2) { animation-delay: .58s; } .revealed .fc-body > :nth-child(3) { animation-delay: .66s; } .revealed .fc-body > :nth-child(4) { animation-delay: .74s; }
.revealed .fc-body > :nth-child(5) { animation-delay: .82s; } .revealed .fc-body > :nth-child(n+6) { animation-delay: .9s; }
.grade-row:not(.hidden) { animation: ansIn .5s cubic-bezier(.2, .8, .2, 1) .55s both; }
.fc-stage.instant, .fc-stage.instant * { transition: none !important; animation: none !important; }
@keyframes ansGlow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 60%, transparent); } 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 38%, transparent), 0 0 50px color-mix(in srgb, var(--orange) 55%, transparent); } 100% { box-shadow: var(--shadow-2); } }
@keyframes ansIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes fcShimmer { to { background-position: -200% 0; } }
@media (max-width: 899px) { .fc-stage { grid-template-columns: minmax(0, 1fr); } .fc-q, .fc-ghost, .fc-ans, .fc-flip { min-height: 280px; } .fc-q, .fc-ghost, .fc-ans { padding: 30px 22px; } }
@media (prefers-reduced-motion: reduce) { .fc-flip { transition-duration: .01s; } .fc-lines i, .revealed .fc-ans, .revealed .fc-body > *, .grade-row:not(.hidden) { animation: none; } }

/* ---------- runs (a deck, practice, an exam, today's session): the shared header on top, the work below it ---------- */
.run-page { container-type: inline-size; }
.run-meta { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rm-text { display: grid; gap: 7px; flex: 1; min-width: 220px; }
.rm-text b { font: 700 1rem var(--display); }
.rm-text b .small { font-weight: 500; }
.run-meta .dots { min-width: 220px; max-width: 480px; }
.run-meta .ring-prog span { background: var(--surface); }
/* a question on a wide screen: the question on the left, the choices on the right */
@container (min-width: 900px) {
  .run-page .q-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; align-items: start; padding: 30px 34px; }
  .run-page .q-card > .eyebrow { grid-column: 1 / -1; }
  .run-page .q-card .stem { grid-column: 1; grid-row: 2; margin: 0; font-size: 1.45rem; }
  .run-page .q-card .choices { grid-column: 2; grid-row: 2; }
  .run-page .q-card .explain { grid-column: 1 / -1; }
}

/* a chapter's mastery gauge (beside the title) and actions (on the bottom row with the chapter tabs) */
.ph-gauge { display: flex; align-items: center; gap: 12px; }
.ph-gauge .num { font: 800 2.1rem/1 var(--display); background: var(--sunrise); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-gauge .lbl { margin-top: 3px; font: 600 .78rem var(--ui); color: var(--ink-2); }
.ph-filters { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ph-actions .progress-toggle { width: auto; background: none; border: 0; padding: 0 6px; font: 600 .86rem var(--ui); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ph-actions .progress-toggle:hover { color: var(--orange-text); }

/* run pages the server draws: the exam's jump dots are links, and a form can sit inline in a row of buttons */
.dots a { display: flex; flex: 1; min-width: 6px; max-width: 26px; text-decoration: none; }
.dots a i { flex: 1; max-width: none; }
.inline-form { display: inline; margin: 0; }
.btn.disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* the chapter header's action row: one height, one voice (no green glow on the breakdown toggle) */
.ph-filters:has(.ph-actions) { justify-content: space-between; }
.ph-actions { gap: 10px; }
.ph-actions .btn, .ph-actions .progress-toggle { height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.ph-actions .progress-toggle, [data-theme="night"] .ph-actions .progress-toggle { padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: none; transform: none; color: var(--ink-2); text-decoration: none; font: 600 .9rem var(--ui); }
.ph-actions .progress-toggle::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.ph-actions .progress-toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
.ph-actions .progress-toggle:hover, [data-theme="night"] .ph-actions .progress-toggle:hover { box-shadow: none; border-color: var(--orange); color: var(--orange-text); }

/* the store: three tiers in glowing panels like the page header, then a Renew strip */
.tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; margin: 6px 0 26px; }
.tier { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 20px; border-radius: 20px;
  background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--orange) 13%, var(--surface)) 0%, var(--surface) 58%);
  border: 1px solid color-mix(in srgb, var(--orange) 62%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--orange) 16%, transparent), 0 0 26px color-mix(in srgb, var(--orange) 26%, transparent), inset 0 0 34px color-mix(in srgb, var(--orange) 9%, transparent); }
.tier.featured { box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 55%, transparent), 0 0 40px color-mix(in srgb, var(--orange) 42%, transparent), inset 0 0 40px color-mix(in srgb, var(--orange) 14%, transparent); }
.tier .store-flag { position: absolute; top: -11px; right: 18px; }
.tier-k { margin: 0; font: 800 .8rem var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--orange-text); }
.tier h2 { margin: 0; font-size: 1.5rem; }
.tier-price { font: 800 2.4rem/1 var(--display); } .tier-price span { font: 600 .9rem var(--ui); color: var(--ink-2); }
.tier-sub { margin: 0; color: var(--ink-2); font-size: .95rem; }
.tier-pick { display: grid; gap: 6px; }
.tier-opt { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); cursor: pointer; }
.tier-opt:has(input:checked) { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, var(--surface)); }
.tier-opt.off { opacity: .45; cursor: not-allowed; }
.tier-opt.owned .t::after { content: " (you have it)"; color: var(--good); font-size: .8rem; }
.tier-opt .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-inc { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .9rem; color: var(--ink-2); }
.tier-inc li::before { content: "\2713"; color: var(--good); margin-right: 8px; font-weight: 800; }
.tier .btn { margin-top: auto; justify-content: center; }
.tier .btn:disabled { opacity: .55; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--orange-text); text-decoration: underline; cursor: pointer; }
.renew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.renew-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 14px 16px; }
.renew-card .t { display: grid; } .renew-card .btn { grid-column: 1 / -1; }
@media (max-width: 1000px) { .tier-grid { grid-template-columns: minmax(0, 1fr); } }
.renew-btns { grid-column: 1 / -1; display: grid; gap: 8px; }
.tier-price .big-total { font: 800 2.4rem/1 var(--display); color: var(--ink); }

/* Sign in: the sky to the sunrise's orange. Same solid shape, shadow, and weight as the primary button, in a clear-sky blue. */
.btn-signin, :root[data-theme="night"] .btn-signin { border: 0; color: #fff; background: linear-gradient(135deg, #38c0f0 0%, #2f6fe0 100%); box-shadow: 0 6px 16px rgba(47, 111, 224, .32); }
.btn-signin:hover, :root[data-theme="night"] .btn-signin:hover { filter: brightness(1.07); background: linear-gradient(135deg, #38c0f0 0%, #2f6fe0 100%); box-shadow: 0 8px 22px rgba(47, 111, 224, .42); }

/* Sections (.card.pad, the account cards) get a thin dark gray to black edge so they stand out; the page head keeps its orange edge. */
:root { --edge-a: #333948; --edge-b: #1c2029; }
:root[data-theme="night"] { --edge-a: #444b5c; --edge-b: #262b36; }
.account-card, .card.pad:not(.danger-zone) { position: relative; isolation: isolate; border-color: transparent;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .16); }
.account-card::before, .card.pad:not(.danger-zone)::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, var(--edge-a) 0%, var(--edge-b) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* Today: session first, compact training overview, optional schedule editing, and the existing airplane trail. */
.today-sky .sky-top { align-items:center; gap:24px 44px; }
.today-sky h1 { max-width:26ch; font-size:clamp(2rem,3.2vw,3.1rem); line-height:1.08; }
.today-sky .sub { max-width:66ch; margin-bottom:20px; }
.today-session { display:flex; align-items:center; gap:22px; flex-wrap:wrap; }
.today-next { color:var(--ink-2); font-size:.94rem; font-weight:600; text-decoration:none; }
.today-next span { margin-left:8px; color:var(--orange); }
.today-sky .gauge { padding:8px 0 8px 24px; border-left:1px solid var(--line); }
.today-sky .gauge .num { font-size:3rem; }
.today-status { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:0; border:1px solid var(--line); border-radius:14px; margin-top:28px; background:var(--surface); position:relative; overflow:hidden; }
.today-status-item { display:grid; grid-template-columns:20px minmax(0,1fr); gap:4px 10px; padding:16px 18px; color:var(--ink); text-decoration:none; border-right:1px solid var(--line); }
.today-status-item:last-child { border-right:0; }
.today-status-item .ico { width:18px; height:18px; color:var(--ink-3); }
.today-status-item > span { color:var(--ink-2); font-size:.8rem; }
.today-status-item b { grid-column:2; font:700 1.16rem var(--display); }
.today-status-item small { grid-column:2; color:var(--ink-3); font-size:.74rem; }
.today-status-item:hover { background:var(--canvas); }
.today-schedule { position:relative; margin-top:12px; padding:0 4px; }
.today-schedule summary { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; cursor:pointer; padding:12px 0; font-size:.86rem; }
.today-schedule summary::-webkit-details-marker { display:none; }
.today-schedule summary:before { content:'+'; color:var(--orange); font-size:1.1rem; }
.today-schedule[open] summary:before { content:'\2212'; }
.today-edit { margin-left:auto; font-size:.8rem; color:var(--ink-2); text-decoration:underline; }
.today-schedule .goal-form { margin:0 0 14px; padding:16px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.today-trail-head { display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid var(--line); margin-top:12px; padding-top:18px; position:relative; }
.today-trail-head .eyebrow { margin:0; }
.today-trail-head a { color:var(--ink-2); font-size:.8rem; }
.today-sky .route { margin-top:6px; }
@media(max-width:760px) { .today-sky .sky-top { grid-template-columns:minmax(0,1fr) auto; gap:14px; } .today-sky .gauge { min-width:100px; padding-left:12px; } .today-sky .gauge .num { font-size:2.25rem; } .today-sky .gauge .sock { max-width:95px; } .today-status { grid-template-columns:repeat(2,minmax(0,1fr)); } .today-status-item { padding:14px 10px; border-bottom:1px solid var(--line); } .today-status-item:nth-child(2n) { border-right:0; } .today-status-item small { font-size:.7rem; } .today-sky .sub { font-size:.94rem; } }
@media(max-width:480px) { .today-sky .sky-top { grid-template-columns:1fr; } .today-sky .gauge { border-left:0; border-top:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; text-align:left; padding:14px 0 0; } .today-sky .gauge .sock { margin:0; } .today-session { gap:14px; } .today-schedule summary .muted { flex-basis:75%; font-size:.72rem; } }

/* Account study preferences: explicit format choices, without changing progress scoring. */
.study-preferences h2 { margin:0; }
.study-format-options { border:0; margin:0; padding:0; display:grid; gap:10px; }
.study-format-options legend { font-weight:600; margin-bottom:12px; }
.study-format-option, .study-visual-option { display:flex; gap:12px; align-items:flex-start; padding:16px; border:1px solid var(--line); border-radius:12px; cursor:pointer; }
.study-format-option:has(input:checked) { border-color:var(--orange); background:var(--orange-soft); }
.study-format-option input, .study-visual-option input { flex:none; margin-top:3px; }
.study-format-option b, .study-visual-option b { display:block; }
.study-format-option small, .study-visual-option small { display:block; margin-top:5px; color:var(--ink-2); line-height:1.5; font-weight:400; }
.today-study-preference { margin:0 0 12px; }
.today-study-preference a { margin-left:8px; color:var(--ink-2); }

/* Expanded chapter breakdown: self-contained activity cards with space before the lesson. */
.chapter-progress-region:not(.hidden) { margin:0 0 28px; }
.chapter-breakdown { padding:22px; }
.breakdown-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.breakdown-head h3 { margin:0; font-size:1.25rem; }
.breakdown-head p { margin:5px 0 0; color:var(--ink-3); font-size:.84rem; }
.breakdown-total { flex:none; font:700 1.4rem var(--display); color:var(--ink); }
.breakdown-total small { display:block; text-align:right; font:400 .75rem var(--ui); color:var(--ink-3); margin-top:3px; }
.breakdown-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:14px; }
.breakdown-part { min-width:0; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--canvas); display:flex; flex-direction:column; gap:14px; }
.breakdown-part-head { display:flex; justify-content:space-between; align-items:start; gap:12px; }
.breakdown-part-head h4 { font:700 1.1rem var(--display); margin:0 0 5px; }
.breakdown-weight { color:var(--ink-3); font-size:.73rem; }
.breakdown-score { font:700 1.7rem/1 var(--display); white-space:nowrap; }
.breakdown-score small { font-size:.9rem; color:var(--ink-3); }
.breakdown-part .gradebar { width:100%; height:7px; flex:none; }
.breakdown-detail { display:grid; gap:12px; color:var(--ink-2); font-size:.79rem; line-height:1.5; }
.breakdown-counts { display:flex; flex-wrap:wrap; gap:5px 14px; }
.breakdown-counts > span { white-space:nowrap; }
.breakdown-review { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; color:var(--ink-3); font-size:.76rem; }
.breakdown-due { color:var(--orange-text); }
.breakdown-action { margin-top:auto; padding-top:2px; }
.breakdown-action a { display:inline-flex; align-items:center; gap:10px; min-height:30px; font-size:.84rem; font-weight:600; color:var(--ink-2); text-decoration:none; }
.breakdown-action a:hover { color:var(--orange-text); text-decoration:underline; }
.breakdown-help { margin-top:18px; font-size:.8rem; }
.breakdown-help summary { cursor:pointer; width:fit-content; padding:4px 0; }
.breakdown-help > div { line-height:1.65; }
.breakdown-help p { margin:10px 0 0; }
@media(max-width:600px) { .chapter-breakdown { padding:16px; } .breakdown-head { align-items:start; } .breakdown-head h3 { font-size:1.1rem; } .breakdown-part { padding:16px; } .chapter-progress-region:not(.hidden) { margin-bottom:22px; } }

/* Chapter actions: disclosure as a text control, practice links as a compact matched group. */
.chapter-actions { align-items:center; gap:20px; }
.chapter-actions .progress-toggle, [data-theme="night"] .chapter-actions .progress-toggle { margin:0; padding:0 2px; height:40px; width:auto; border:0; border-radius:4px; background:none; box-shadow:none; color:var(--ink-2); font-size:.84rem; white-space:nowrap; }
.chapter-actions .progress-toggle:hover, [data-theme="night"] .chapter-actions .progress-toggle:hover { background:none; box-shadow:none; transform:none; color:var(--orange-text); }
.chapter-actions .progress-toggle:focus-visible { outline:2px solid var(--orange); outline-offset:4px; box-shadow:none; transform:none; }
.chapter-practice-actions { display:flex; align-items:center; gap:8px; padding-left:18px; border-left:1px solid var(--line); }
.chapter-actions .chapter-practice-actions .btn { box-sizing:border-box; margin:0; height:40px; padding:0 14px; border-radius:10px; font-size:.86rem; white-space:nowrap; box-shadow:none; }
.chapter-actions .chapter-practice-actions .btn.primary { background:var(--orange-soft); border:1px solid color-mix(in srgb,var(--orange) 40%,var(--line)); color:var(--orange-text); }
.chapter-actions .chapter-practice-actions .btn.primary:hover { background:var(--orange-soft); border-color:var(--orange); filter:none; box-shadow:none; }
.chapter-practice-actions .ico { width:17px; height:17px; }
@media(max-width:760px) { .chapter-actions { flex-basis:100%; margin-left:0; justify-content:space-between; gap:12px; padding-top:12px; border-top:1px solid var(--line); } .chapter-practice-actions { padding-left:0; border-left:0; } }
@media(max-width:440px) { .chapter-actions { align-items:stretch; flex-direction:column; gap:8px; } .chapter-actions .progress-toggle { align-self:flex-start; height:32px; } .chapter-practice-actions .btn { flex:1; justify-content:center; } }

/* Module-specific reset: explicit scope on the page, deliberate confirmation in a native modal. */
.reset-progress-page h2 { margin:4px 0 12px; }
.reset-module-label { display:block; margin:22px 0 8px; font-weight:600; }
.reset-module-select { width:100%; }
.reset-scope-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:22px; }
.reset-scope { border:1px solid var(--line); border-radius:12px; padding:18px; background:var(--canvas); }
.reset-scope h3 { margin:0 0 10px; font-size:1.05rem; }
.reset-scope ul { margin:0; padding-left:18px; color:var(--ink-2); font-size:.88rem; line-height:1.6; }
.reset-scope li + li { margin-top:7px; }
.reset-scope-remove { border-top:3px solid var(--bad); }
.reset-page-action { display:flex; align-items:center; justify-content:space-between; gap:16px; border-top:1px solid var(--line); margin-top:22px; padding-top:18px; }
.reset-page-action > span { color:var(--bad); font-size:.85rem; font-weight:600; }
.btn.reset-danger-button { background:var(--bad); color:white; border:1px solid var(--bad); box-shadow:none; }
.btn.reset-danger-button:hover { filter:brightness(1.08); }
.reset-confirm-dialog { box-sizing:border-box; width:min(700px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); padding:0; border:1px solid var(--bad); border-radius:20px; background:var(--surface); color:var(--ink); box-shadow:0 24px 80px #0007; overflow:auto; }
.reset-confirm-dialog::backdrop { background:rgba(5,9,16,.78); backdrop-filter:blur(5px); }
.reset-dialog-heading { padding:28px 30px 24px; background:color-mix(in srgb,var(--bad) 9%,var(--surface)); border-bottom:1px solid var(--line); }
.reset-alert-icon { display:grid; place-items:center; width:48px; height:48px; margin-bottom:18px; border-radius:14px; color:white; background:var(--bad); font:800 1.8rem var(--display); }
.reset-dialog-heading h2 { margin:7px 0 12px; font-size:1.8rem; line-height:1.2; }
.reset-dialog-heading > p:last-child { margin:0; color:var(--ink-2); line-height:1.6; }
.reset-dialog-body { padding:22px 30px; color:var(--ink-2); line-height:1.6; }
.reset-module-warning { margin-top:0; color:var(--ink); }
.reset-kept-note { margin-top:14px; font-size:.87rem; }
.reset-kept-note b { display:block; margin-bottom:4px; }
.reset-acknowledgement { display:flex; gap:12px; align-items:start; margin:22px 0 18px; font-size:.9rem; }
.reset-acknowledgement input { flex:none; margin-top:5px; }
.reset-type-label { display:block; color:var(--ink); font-size:.85rem; margin-bottom:7px; }
#resetConfirmText { box-sizing:border-box; width:100%; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--canvas); color:var(--ink); font:600 1rem var(--ui); }
.reset-dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; padding:18px 30px 24px; border-top:1px solid var(--line); }
@media(max-width:600px) { .reset-scope-grid { grid-template-columns:1fr; } .reset-dialog-heading,.reset-dialog-body { padding:20px; } .reset-dialog-heading h2 { font-size:1.45rem; } .reset-dialog-actions { padding:16px 20px 20px; } .reset-dialog-actions .btn { flex:1; justify-content:center; } .reset-page-action { align-items:start; flex-direction:column; } }

/* ACS index: the module-card visual language, with separate document and PDF links. */
.acs-catalog { align-items:stretch; margin-top:0; grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr)); }
.acs-catalog-card { padding:0; gap:0; min-width:0; cursor:default; overflow:hidden; }
.acs-card-link { flex:1; display:flex; flex-direction:column; gap:14px; padding:22px; color:inherit; text-decoration:none; }
.acs-catalog-card .mod-code, .acs-area-card .mod-code { background:var(--orange-soft); color:var(--orange-text); box-shadow:none; border:1px solid color-mix(in srgb,var(--orange) 35%,transparent); font-size:1.1rem; }
.acs-catalog-card h3 { font-size:1.4rem; line-height:1.2; }
.acs-catalog-card .acs-card-description { font-size:.86rem; line-height:1.55; color:var(--ink-3); }
.acs-card-meta { display:flex; align-items:center; flex-wrap:wrap; gap:10px; font-size:.74rem; color:var(--ink-3); margin-top:auto; padding-top:6px; }
.acs-card-meta .chip { font-size:.7rem; }
.acs-card-open { display:flex; justify-content:space-between; align-items:center; gap:12px; color:var(--orange-text); font-size:.88rem; font-weight:600; padding-top:6px; }
.acs-card-footer { padding:12px 22px; border-top:1px solid var(--line); background:var(--canvas); }
.acs-card-footer a { display:flex; justify-content:space-between; align-items:center; gap:12px; color:var(--ink-2); text-decoration:none; font-size:.78rem; }
.acs-card-footer a:hover { color:var(--orange-text); text-decoration:underline; }
.acs-catalog-card:focus-within { border-color:var(--orange); }
.acs-card-link:focus-visible, .acs-card-footer a:focus-visible { outline:2px solid var(--orange); outline-offset:-4px; border-radius:8px; }
.acs-catalog-note { display:flex; align-items:start; gap:12px; padding:18px 20px; margin-top:24px; font-size:.86rem; line-height:1.6; }
.acs-catalog-note .ico { flex:none; width:20px; height:20px; margin-top:3px; }
.acs-catalog-note p { margin:0; }
@media(prefers-reduced-motion:reduce) { .acs-catalog-card:hover:not([disabled]) { transform:none; } }

/* ACS area selection follows the same responsive card grid as modules and standards. */
.acs-areas-intro { margin:0 0 20px; max-width:90ch; line-height:1.6; }
.acs-area-grid { margin-top:0; align-items:stretch; grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr)); }
.acs-area-card { gap:14px; min-width:0; }
.acs-area-card h3 { font-size:1.25rem; line-height:1.3; }
.acs-area-preview { margin:0; padding-left:17px; color:var(--ink-2); font-size:.83rem; line-height:1.6; }
.acs-area-preview li + li { margin-top:5px; }
.acs-area-more { font-size:.76rem; color:var(--ink-3); }
.acs-area-card .acs-card-open { margin-top:auto; padding-top:14px; border-top:1px solid var(--line); }
.acs-area-card:focus-visible { outline:2px solid var(--orange); outline-offset:3px; }
@media(prefers-reduced-motion:reduce) { .acs-area-card:hover:not([disabled]) { transform:none; } }

/* Content report forms float above the page without affecting its layout. */
.report-issue { margin-top:16px; }
.report-open { cursor:pointer; display:inline-flex; align-items:center; gap:7px; padding:8px 0; background:none; border:0; font:inherit; }
.report-open:focus-visible { outline:2px solid var(--orange); outline-offset:4px; border-radius:4px; }
.report-dialog { box-sizing:border-box; width:min(560px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:28px; border:1px solid var(--line); border-radius:18px; background:var(--surface); color:var(--ink); box-shadow:0 24px 80px #0007; }
.report-dialog::backdrop { background:rgba(5,9,16,.75); backdrop-filter:blur(4px); }
.report-dialog h2 { margin:0 0 8px; }
.report-dialog form { margin-top:20px; }
.report-dialog textarea, .report-dialog select { width:100%; }
.report-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; }
.page-report { display:flex; justify-content:flex-end; max-width:1480px; margin:24px auto 0; padding:16px 0; border-top:1px solid var(--line); }
.page-report .report-issue { margin:0; }
.page-report .report-open { padding:10px 14px; min-height:44px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--ink-2); box-shadow:var(--shadow-1); font-size:.82rem; }
.page-report .report-open:hover { color:var(--orange-text); border-color:var(--orange); }
@media print { .page-report { display:none; } }

/* Glossary: keep the search and alphabet available above a responsive term grid. */
.glossary-toolbar { position:sticky; top:var(--bar); z-index:6; display:flex; flex-wrap:wrap; align-items:center; gap:12px 20px; padding:16px; margin-bottom:24px; border:1px solid var(--line); border-radius:14px; background:var(--canvas); box-shadow:var(--shadow-1); }
.glossary-toolbar .gl-set { margin:0; }
.glossary-search { flex:1 1 240px; width:100%; min-width:0; max-width:420px; }
.glossary-toolbar .az { position:static; flex:1 1 100%; padding:0; gap:4px; }
.glossary-toolbar .az[hidden] { display:none; }
.glossary-top { font-size:.85rem; white-space:nowrap; margin-left:auto; }
.glossary-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr)); gap:18px; align-items:stretch; }
.glossary-grid .letter-h { grid-column:1 / -1; margin:12px 0 0; padding-bottom:8px; border-bottom:1px solid var(--line); }
.glossary-grid .gl-entry { min-width:0; margin:0; padding:22px; display:flex; flex-direction:column; gap:10px; overflow-wrap:anywhere; }
.glossary-grid .gl-entry[hidden] { display:none; }
.glossary-grid .gl-entry h3 { margin:0; font-size:1.25rem; }
.glossary-grid .gl-entry .gl-src, .glossary-grid .gl-entry .uses { margin-top:auto; padding-top:14px; border-top:1px solid var(--line); }
.glossary-page .letter-h, .glossary-page .gl-entry { scroll-margin-top:calc(var(--bar) + var(--glossary-toolbar-height,200px) + 20px); }
@media(max-width:600px) { .glossary-toolbar { padding:12px; gap:10px; } .glossary-search { max-width:none; } .glossary-toolbar .az { flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; } .glossary-toolbar .az a { flex:0 0 32px; } .glossary-grid { gap:14px; } }
