/* CG50 Academy — site chrome and views (P1-Site) */

/* ---------- Shell ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--header-h); display: flex; align-items: center; gap: var(--sp-6);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-size: var(--fs-md); }
.brand-name span { color: var(--muted); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 550;
}
.nav a:hover { background: var(--bg-sunk); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.header-tools { display: flex; align-items: center; gap: var(--sp-1); }
.theme-btn, .menu-btn { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.theme-btn:hover, .menu-btn:hover { background: var(--bg-sunk); color: var(--ink); }
.theme-btn svg, .menu-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

@media (max-width: 899px) {
  .menu-btn { display: inline-flex; }
  .header-inner { gap: var(--sp-2); }
  .header-tools { margin-left: auto; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h); margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2);
    padding: var(--sp-2) var(--gutter) var(--sp-4); display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { height: 44px; font-size: var(--fs-base); }
}

main { display: block; min-height: calc(100vh - var(--header-h) - 120px); }
main:focus { outline: none; }
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--sp-10) var(--gutter) var(--sp-16); }
.page-narrow { max-width: 820px; }
.page-head { margin-bottom: var(--sp-8); max-width: 68ch; }
.page-head h1 { margin: var(--sp-2) 0 var(--sp-3); font-size: var(--fs-3xl); letter-spacing: -0.025em; }
.page-head .lead { font-size: var(--fs-md); color: var(--ink-2); margin: 0; }
.section { margin-top: var(--sp-12); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.section-head h2 { font-size: var(--fs-xl); }
.section-head a { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-sunk); }
.footer-inner {
  max-width: var(--content-max); margin: 0 auto; padding: var(--sp-8) var(--gutter);
  display: flex; gap: var(--sp-6); justify-content: space-between; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted);
}
.footer-inner p { margin: 0; max-width: 70ch; }
.footer-links { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Simulator frame (site side; the calculator itself is css/calculator.css) ---------- */
.sim { position: relative; width: 100%; margin: 0 auto; }
.sim-stage { position: relative; width: 100%; }
.sim.is-shake .sim-stage { animation: sim-shake 360ms var(--ease); }
@keyframes sim-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); } 40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}
.sim-spot {
  position: absolute; pointer-events: none; z-index: 5; border-radius: 3px;
  box-shadow: 0 0 0 2px var(--cap-shift-bg), 0 0 0 9999px rgba(0, 0, 0, .28);
  animation: spot-in var(--dur-3) var(--ease);
}
@keyframes spot-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
.sim-clip { position: absolute; overflow: hidden; pointer-events: none; z-index: 5; }
.sim-fallback {
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: var(--sp-8) var(--sp-6);
  text-align: center; color: var(--muted); background: var(--surface-2); font-size: var(--fs-sm);
}
.sim-fallback b { display: block; color: var(--ink); font-size: var(--fs-base); margin-bottom: var(--sp-1); }
.sim-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.sim-toolbar .muted { font-size: var(--fs-xs); }
.kbd-hint { font-size: var(--fs-xs); color: var(--muted); }
.kbd-hint kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); }

/* ---------- Home ---------- */
.hero {
  max-width: var(--content-max); margin: 0 auto; padding: var(--sp-12) var(--gutter) var(--sp-10);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, 400px); gap: var(--sp-12); align-items: center;
}
.hero-copy h1 { font-size: var(--fs-3xl); letter-spacing: -0.03em; line-height: 1.07; margin: var(--sp-3) 0 var(--sp-4); max-width: 16ch; }
.hero-copy .lead { font-size: var(--fs-md); color: var(--ink-2); max-width: 50ch; margin-bottom: var(--sp-6); }
.hero-ctas { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.hero-continue { margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--muted); }
.hero-continue b { color: var(--ink); font-weight: 600; }
.hero-facts { display: flex; gap: var(--sp-6); margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-facts div { font-size: var(--fs-sm); color: var(--muted); }
.hero-facts b { display: block; font-size: var(--fs-xl); color: var(--ink); font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.hero-desk {
  position: relative; padding: var(--sp-6) var(--sp-6) var(--sp-4); border-radius: var(--r-xl);
  background: radial-gradient(120% 80% at 50% 0%, var(--surface) 0%, var(--bg-sunk) 100%);
  border: 1px solid var(--line);
}
.hero-desk .sim { max-width: 330px; }
.desk-caption { text-align: center; font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-3); }
.desk-prompt {
  max-width: 330px; margin: 0 auto var(--sp-4); min-height: 58px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  padding: 10px 14px; font-size: var(--fs-sm); line-height: 1.45;
}
.desk-prompt .eyebrow { display: block; margin-bottom: 2px; color: var(--accent); }
.desk-prompt.is-done { border-color: var(--accent-line); }

.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.steps3 > div { padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.steps3 .num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.steps3 h3 { margin-bottom: var(--sp-1); }
.steps3 p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.module-card {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1);
  transition: border-color var(--dur-1) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
a.module-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); color: var(--ink); }
.module-card .mc-top { display: flex; align-items: center; gap: var(--sp-3); }
.module-icon { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.module-icon svg { width: 22px; height: 22px; }
.module-card .mc-num { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.module-card h3 { font-size: var(--fs-md); }
.module-card p { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; margin: 0; flex: 1; }
.module-card .mc-foot { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--muted); }
.module-card .mc-foot .progress { flex: 1; }
.module-card.is-soon { background: var(--surface-2); box-shadow: none; }
.module-card.is-soon .module-icon { background: var(--bg-sunk); color: var(--faint); }
.module-card.is-done .module-icon { background: var(--accent); color: var(--accent-ink); }

.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.tool-card { display: block; padding: var(--sp-5); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.tool-card:hover { border-color: var(--line-strong); color: var(--ink); }
.tool-card svg { width: 22px; height: 22px; color: var(--accent); margin-bottom: var(--sp-3); }
.tool-card h3 { margin-bottom: 4px; }
.tool-card p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

/* ---------- Course ---------- */
.course-summary { display: flex; align-items: center; gap: var(--sp-6); padding: var(--sp-5) var(--sp-6); margin-bottom: var(--sp-8); flex-wrap: wrap; }
.course-summary .cs-num { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.02em; line-height: 1; }
.course-summary .cs-label { font-size: var(--fs-sm); color: var(--muted); }
.course-summary .cs-bar { flex: 1; min-width: 180px; }
.course-summary .progress { height: 8px; }
.course-module { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--sp-8); padding: var(--sp-8) 0; border-top: 1px solid var(--line); }
.course-module:first-of-type { border-top: 0; padding-top: 0; }
.cm-side { position: relative; }
.cm-side .module-icon { margin-bottom: var(--sp-3); }
.cm-side h2 { font-size: var(--fs-lg); margin: 2px 0 var(--sp-2); }
.cm-side p { color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.cm-side .cm-prog { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: var(--sp-2); }
.cm-side .cm-prog .progress { width: 90px; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.lesson-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--ink);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.lesson-row:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-2); }
.lr-state { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: 650; color: var(--muted); }
.lr-state svg { width: 15px; height: 15px; }
.lesson-row.is-done .lr-state { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lesson-row.is-started .lr-state { border-color: var(--accent); color: var(--accent); border-width: 2px; }
.lr-main { min-width: 0; }
.lr-title { display: block; font-weight: 600; line-height: 1.35; }
.lr-sum { display: block; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; margin-top: 2px; }
.lr-meta { display: flex; gap: var(--sp-2); align-items: center; }
.soon {
  display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5); border-radius: var(--r-md);
  border: 1px dashed var(--line-strong); color: var(--muted); font-size: var(--fs-sm); background: transparent;
}
.soon svg { width: 22px; height: 22px; flex: none; color: var(--faint); }
.soon b { color: var(--ink-2); display: block; font-weight: 600; }
.lvl { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.lvl i { display: inline-block; width: 4px; height: 10px; border-radius: 1px; background: var(--line-strong); }
.lvl i.on { background: var(--accent); }

/* ---------- Two-column "tool" layout (playground, keys, how-to, challenges) ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-10); align-items: start; }
.split-sim { position: sticky; top: calc(var(--header-h) + var(--sp-6)); }
.panel { padding: var(--sp-5); }
.panel + .panel { margin-top: var(--sp-4); }
.panel h2 { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.panel-title h2 { margin: 0; }

/* playground inspector */
.switch { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-size: var(--fs-sm); font-weight: 600; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background var(--dur-2) var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--dur-2) var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.inspect-out { min-height: 120px; }
.kd-panel { margin-bottom: var(--sp-4); }
.split-sim { display: flex; flex-direction: column; }
.page-head-tool { margin-bottom: var(--sp-6); }
.page-head-tool h1 { font-size: var(--fs-2xl); }
.page-head-tool .lead { font-size: var(--fs-base); }
.inspect-empty { color: var(--muted); font-size: var(--fs-sm); }
.key-detail { display: grid; gap: var(--sp-3); }
.key-detail .kd-head { display: flex; align-items: center; gap: var(--sp-3); }
.key-detail .kd-head .cap { font-size: 15px; min-width: 44px; height: 32px; }
.kd-name { font-weight: 650; font-size: var(--fs-md); }
.kd-layers { display: grid; gap: var(--sp-2); }
.kd-layer { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--sp-3); align-items: baseline; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.kd-layer .kd-tag { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kd-layer.is-shift .kd-tag { color: var(--cap-shift-text); }
.kd-layer.is-alpha .kd-tag { color: var(--cap-alpha-text); }
.kd-layer .kd-leg { font-weight: 650; margin-right: 6px; }
.kd-layer.is-active { border-color: var(--accent-line); background: var(--accent-soft); }
.kd-layer.is-none { opacity: .55; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.log li { display: inline-flex; }

/* key reference table */
.keyref-tools { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.keyref-tools .input { max-width: 360px; }
.keygroup + .keygroup { margin-top: var(--sp-8); }
.keygroup h2 { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.keytable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.keytable { table-layout: fixed; }
.keytable th:nth-child(1) { width: 92px; } .keytable th:nth-child(2) { width: 34%; } .keytable th:nth-child(3) { width: 76px; }
.keytable th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.keytable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.keytable tr:last-child td { border-bottom: 0; }
.keytable tr.is-picked td { background: var(--accent-soft); }
.keytable tr { cursor: pointer; }
.keytable tr:hover td { background: var(--surface-2); }
.keytable .t-shift { color: var(--cap-shift-text); font-weight: 650; }
.keytable .t-alpha { color: var(--cap-alpha-text); font-weight: 650; }
.keytable .t-desc { color: var(--ink-2); }
.keytable .t-sub { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.keyref-legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-3); }
.keyref-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.keyref-legend .l-shift::before { background: var(--cap-shift-bg); }
.keyref-legend .l-alpha::before { background: var(--cap-alpha-bg); }

/* how-to */
.search { position: relative; margin-bottom: var(--sp-4); }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 42px; min-height: 48px; font-size: var(--fs-base); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--sp-6); }
.chip { height: 30px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-n { font-weight: 500; opacity: .7; margin-left: 2px; }
.howto-group { border-top: 1px solid var(--line); }
.howto-group:last-child { border-bottom: 1px solid var(--line); }
.howto-group > summary { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-1); min-height: 44px; cursor: pointer; font-weight: 650; list-style: none; }
.howto-group > summary::-webkit-details-marker { display: none; }
.howto-group > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: var(--sp-2); flex: none; }
.howto-group[open] > summary::before { transform: rotate(45deg); }
.howto-group > summary > span:first-child { flex: 1; }
.howto-group > .howto-list { padding-bottom: var(--sp-4); }
@media (prefers-reduced-motion: reduce) { .howto-group > summary::before { transition: none; } }
.howto-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.howto { padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.howto.is-playing { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.howto-q { font-weight: 650; font-size: var(--fs-base); margin: 0 0 var(--sp-2); }
.howto-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.howto-note { color: var(--muted); font-size: var(--fs-sm); margin: var(--sp-2) 0 0; }
.howto-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-3); }
.empty {
  text-align: center; padding: var(--sp-12) var(--sp-6); border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  color: var(--muted); background: var(--surface-2);
}
.empty svg { width: 32px; height: 32px; margin: 0 auto var(--sp-3); color: var(--faint); }
.empty b { display: block; color: var(--ink); font-size: var(--fs-md); margin-bottom: 4px; }
.empty p { max-width: 46ch; margin: 0 auto; font-size: var(--fs-sm); }

/* challenges */
.ch-group + .ch-group { margin-top: var(--sp-8); }
.ch-group > h2 { font-size: var(--fs-md); margin: 0 0 var(--sp-3); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
.ch-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-align: left; }
.ch-card h3 { font-size: var(--fs-base); }
.ch-card p { margin: 0; color: var(--muted); font-size: var(--fs-sm); flex: 1; }
.ch-card .ch-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-3); gap: var(--sp-2); }
.ch-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stars { display: inline-flex; gap: 2px; color: var(--line-strong); }
.stars svg { width: 16px; height: 16px; }
.stars .on { color: #e0a417; }
.ch-run { padding: var(--sp-6); }
.ch-run h2 { font-size: var(--fs-xl); margin: var(--sp-1) 0 var(--sp-2); }
.ch-brief { font-size: var(--fs-md); color: var(--ink-2); }
.ch-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin: var(--sp-5) 0; }
.ch-stat { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.ch-stat span { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ch-stat b { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ch-stat small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.ch-result { margin-top: var(--sp-4); padding: var(--sp-5); border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ch-result h3 { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-lg); }
.ch-result .stars svg { width: 22px; height: 22px; }
.ch-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }

/* about */
.prose { max-width: 68ch; }
.prose h2 { font-size: var(--fs-lg); margin: var(--sp-10) 0 var(--sp-3); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose li { margin-bottom: 6px; }
.disclaimer { padding: var(--sp-5); border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); }
.notfound { text-align: center; padding: var(--sp-20) var(--gutter); }
.notfound h1 { margin-bottom: var(--sp-3); }

/* ---------- Responsive ---------- */
@media (max-width: 999px) {
  .hero { grid-template-columns: 1fr; gap: var(--sp-8); padding-top: var(--sp-8); }
  .hero-desk { max-width: 420px; width: 100%; margin: 0 auto; }
  .split { grid-template-columns: 1fr; gap: var(--sp-6); }
  .split-sim { position: static; order: -1; max-width: 400px; width: 100%; margin: 0 auto; }
  .split-sim.sim-after { order: 0; }
  .kd-panel { order: 2; margin: var(--sp-4) 0 0; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .course-module { grid-template-columns: 1fr; gap: var(--sp-4); }
  .cm-side { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--sp-3); align-items: start; }
  .cm-side > * { grid-column: 2; }
  .cm-side .module-icon { grid-column: 1; grid-row: 1 / span 2; margin: 2px 0 0; }
  .cm-side .eyebrow { margin: 0; }
}
@media (max-width: 640px) {
  .page { padding-top: var(--sp-6); }
  .steps3 { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .tool-card { padding: var(--sp-4); }
  .hero-facts { gap: var(--sp-5); }
  .hero-desk { padding: var(--sp-4); }
  .lesson-row { grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-3); }
  .lesson-row .lr-meta { grid-column: 2; }
  .ch-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
  .ch-stat { padding: var(--sp-2) var(--sp-3); }
  .ch-stat b { font-size: var(--fs-lg); }
  .keytable th:nth-child(4), .keytable td:nth-child(4) { display: none; }
  .keytable th:nth-child(2) { width: auto; }
  .brand-name span { display: none; }
}
@media (max-width: 640px) {
  .kbd-hint { display: none; }
  .steps3 > div { display: grid; grid-template-columns: 26px 1fr; column-gap: var(--sp-3); padding: var(--sp-4); }
  .steps3 .num { grid-row: span 2; margin: 0; }
  .module-grid { gap: var(--sp-3); }
  .module-card { padding: var(--sp-4); }
  .module-card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .module-card .mc-foot { margin-top: 0; }
}
@media (max-width: 400px) {
  .tool-grid { grid-template-columns: 1fr; }
}

/* P3-QA: spacing for sub-headings in prose pages (About) */
.prose h3 { font-size: var(--fs-md); margin: var(--sp-6) 0 var(--sp-2); }
