:root {
  --bg: #fbfaf7;
  --panel: #ffffff;
  --ink: #1f2328;
  --muted: #6b6f76;
  --line: #e3e0d8;
  --line-strong: #cfcac0;
  --accent: #2f5d8a;
  --accent-soft: #e6eef6;
  --match: #1f7a4d;
  --match-bg: #e8f4ec;
  --near: #946200;
  --near-bg: #fbf1d9;
  --miss: #b0342c;
  --miss-bg: #fbe7e5;
  --sel: #fff4c2;
  --mono: 'Noto Sans Mono', ui-monospace, Menlo, monospace;
  --sans: 'Noto Sans', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --panel: #1d2024;
    --ink: #e7e5e0;
    --muted: #9a9ea5;
    --line: #2d3136;
    --line-strong: #3d4248;
    --accent: #8db7e0;
    --accent-soft: #22303e;
    --match: #7fd3a3;
    --match-bg: #19352a;
    --near: #e7c170;
    --near-bg: #3a3020;
    --miss: #f09a92;
    --miss-bg: #432523;
    --sel: #3d3a22;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); }
#app { display: flex; flex-direction: column; height: 100vh; }
button, select, input, textarea { font: inherit; color: inherit; }
button, select, .button {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 5px;
  padding: 3px 9px; cursor: pointer;
}
button:hover, .button:hover { border-color: var(--accent); }
button:disabled { opacity: .4; cursor: default; }
input, textarea { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 6px; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
small { color: var(--muted); font-size: 11.5px; }
.hint { color: var(--muted); font-size: 12.5px; }
.pad { padding: 8px 16px; }
.loading { padding: 20px; }

/* top bar */
.top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand {
  display: inline-flex; align-items: center; gap: 7px; border: none; background: none; padding: 2px 4px;
  font-weight: 600; font-size: 15px; letter-spacing: .01em; color: var(--ink); border-radius: 6px;
}
.brand .mark { color: var(--accent); }
.brand:hover { background: var(--accent-soft); }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tabs button { border: none; background: none; padding: 5px 10px; border-radius: 5px; color: var(--muted); }
.tabs button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.spacer { flex: 1; }
.toggle { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.score { font-variant-numeric: tabular-nums; color: var(--muted); }
.score b { color: var(--ink); }
/* margin-left: auto keeps the menu at the right end of whichever row it wraps
   onto, so its right-anchored dropdown always opens inside the viewport */
.menu { position: relative; margin-left: auto; }
.menu summary { list-style: none; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 9px; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; width: 280px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.menu-body button, .menu-body .button { text-align: left; }
.menu-body hr { border: none; border-top: 1px solid var(--line); width: 100%; margin: 2px 0; }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { width: 200px; }
.legend { display: flex; gap: 6px; }
.legend .cell { padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.split { flex: 1; min-height: 0; display: flex; }
.table-wrap { flex: 1; min-width: 0; overflow: auto; }

/* cognate table */
table { border-collapse: collapse; }
table.cognates { font-size: 13.5px; }
.cognates th, .cognates td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.cognates thead th { position: sticky; top: 0; background: var(--panel); z-index: 2; border-bottom: 1px solid var(--line-strong); font-weight: 600; white-space: nowrap; }
.cognates td.gloss { white-space: nowrap; position: sticky; left: 0; background: var(--bg); z-index: 1; }
.cognates td.gloss small { display: block; }
.note-dot { color: var(--accent); }
.cognates td.proto, .cognates .ref { color: var(--muted); font-style: italic; white-space: nowrap; }
.cognates td.recon input { width: 130px; font-family: var(--sans); }
.cognates .cell { cursor: pointer; white-space: nowrap; min-width: 70px; }
.cognates .cell.empty { cursor: default; }
.cognates .att { font-style: italic; }
.cognates .der { font-size: 12px; color: var(--muted); }
.cognates .mark { display: inline-block; width: 1.1em; }
.cell.match .der, .legend .match { color: var(--match); }
.cell.near .der, .legend .near { color: var(--near); }
.cell.miss .der, .legend .miss { color: var(--miss); }
.legend .match { background: var(--match-bg); }
.legend .near { background: var(--near-bg); }
.legend .miss { background: var(--miss-bg); }
.cognates .cell.miss { background: var(--miss-bg); }
.cognates .cell.near { background: var(--near-bg); }
.cognates .cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cognates .mid .der { color: var(--ink); font-size: 13px; }
.cognates .mid.match .der { color: var(--match); }
.irr { font-size: 10.5px; color: var(--near); font-style: normal; }

/* derivation trace */
.trace {
  width: 440px; flex-shrink: 0; border-left: 1px solid var(--line); background: var(--panel);
  overflow: auto; padding: 10px 14px;
}
.trace-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.trace-head .close { margin-left: auto; border: none; font-size: 18px; line-height: 1; padding: 0 6px; }
.trace .src { margin: 4px 0 8px; }
.stages { list-style: none; padding: 0; margin: 0; }
.stages li { border-left: 2px solid var(--line-strong); padding: 2px 0 8px 10px; }
.stage-name { font-weight: 600; }
.stage-name .form { font-weight: 400; font-style: italic; margin-left: 6px; }
table.steps { font-size: 12.5px; margin-top: 2px; }
.steps td { padding: 1px 4px; vertical-align: top; }
.steps .before, .steps .after { font-family: var(--sans); white-space: nowrap; }
.steps .after { font-weight: 600; }
.steps .rule a { color: var(--accent); text-decoration: none; }
.steps .rule a:hover { text-decoration: underline; }
.verdict { padding: 6px 8px; border-radius: 5px; }
.verdict.match { background: var(--match-bg); color: var(--match); }
.verdict.near { background: var(--near-bg); color: var(--near); }
.verdict.miss { background: var(--miss-bg); color: var(--miss); }
.note { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; }
.err { color: var(--miss); }

/* rules */
.rules-layout { flex: 1; min-height: 0; display: flex; }
.side { width: 300px; flex-shrink: 0; border-right: 1px solid var(--line); overflow: auto; padding: 10px 12px; background: var(--panel); }
.side h3 { margin: 4px 0; font-size: 14px; }
ul.tree { list-style: none; padding: 0; margin: 6px 0 12px; }
ul.tree li button {
  width: 100%; text-align: left; border: none; background: none; border-radius: 4px;
  padding: 3px 6px 3px calc(6px + var(--depth) * 14px); display: flex; gap: 6px; align-items: baseline;
}
ul.tree li.selected button { background: var(--accent-soft); color: var(--accent); }
ul.tree .nname { flex: 1; }
ul.tree .nmeta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
ul.tree .nmeta b.ok { color: var(--match); }
.panel { border-top: 1px solid var(--line); padding: 8px 0; }
.panel summary { cursor: pointer; font-weight: 600; }
textarea.cats { width: 100%; font-family: var(--mono); font-size: 12px; margin-top: 6px; }
.help table td { padding: 1px 6px 1px 0; vertical-align: top; font-size: 12.5px; }
.help pre { background: var(--bg); padding: 6px; border-radius: 4px; overflow: auto; }
.rules-main { flex: 1; min-width: 0; overflow: auto; padding: 12px 18px 40px; }
.node-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.node-name { font-size: 17px; font-weight: 600; width: 280px; }
.node-short { width: 80px; }
.rule { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 6px 8px; margin: 8px 0; }
.rule.off { opacity: .55; }
.rule.has-error { border-color: var(--miss); }
.rule.focus { box-shadow: 0 0 0 2px var(--accent); }
.rule-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rule-head .idx { color: var(--muted); font-size: 12px; width: 1.6em; text-align: right; }
.rule-name { flex: 1; min-width: 220px; border-color: transparent; font-weight: 600; background: transparent; }
.rule-name:hover { border-color: var(--line); }
.rule-ref { width: 110px; border-color: transparent; color: var(--muted); background: transparent; font-size: 12.5px; }
.rule-ref:hover { border-color: var(--line); }
.fires { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rule-tools { display: flex; gap: 3px; }
.rule-tools button, .rule-tools select { padding: 1px 6px; font-size: 12px; }
.rule-tools select { width: 92px; }
textarea.rule-text { width: 100%; font-family: var(--mono); font-size: 13.5px; margin-top: 5px; resize: vertical; line-height: 1.5; }
.rule-error { color: var(--miss); font-size: 12.5px; margin-top: 3px; }
.rule-note { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.tag { font-size: 11px; border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; color: var(--muted); }
.add-rule { display: flex; gap: 8px; margin-top: 10px; }

/* derive */
.derive { padding: 14px 18px; overflow: auto; }
.derive-input { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.derive-input input.big { font-size: 20px; width: 340px; padding: 4px 10px; }
.segs .seg { display: inline-block; border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; margin: 0 2px; font-size: 15px; }
.segs .seg.unknown { border-color: var(--miss); color: var(--miss); }
ul.dtree { list-style: none; padding: 0; margin: 10px 0; }
ul.dtree li { padding-left: calc(var(--depth) * 22px); }
.dnode { display: flex; gap: 12px; align-items: baseline; border: none; background: none; padding: 4px 6px; width: 100%; text-align: left; border-radius: 4px; }
.dnode:hover { background: var(--accent-soft); }
.dnode .nname { width: 190px; color: var(--muted); }
.dnode .form { font-size: 17px; font-style: italic; min-width: 140px; }
.dnode .nmeta { font-size: 12px; color: var(--muted); }
ul.dtree table.steps { margin: 0 0 6px 200px; }

/* correspondences */
table.corr { font-size: 14px; }
.corr th, .corr td { border-bottom: 1px solid var(--line); padding: 4px 10px; text-align: left; }
.corr thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.corr tbody th button { font-size: 15px; min-width: 2.4em; border-color: var(--line); }
.corr tr.selected { background: var(--sel); }
.refl { white-space: nowrap; margin-right: 6px; }
.refl sub { color: var(--muted); font-size: 10px; margin-left: 1px; }
.refl.main { font-weight: 600; }
.refl.rare { opacity: .55; }
table.corr-sets { font-size: 13px; }
.corr-sets th, .corr-sets td { border-bottom: 1px solid var(--line); padding: 2px 6px; text-align: left; }
.corr-sets td.ex { color: var(--muted); font-size: 12px; }

/* subgrouping */
.tree-view { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 18px 0; overflow: hidden; }
.tree-view > .hint { max-width: 900px; }
.scorecard { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.scorecard > div { font-variant-numeric: tabular-nums; }
.scorecard b { font-size: 20px; }
.scorecard .snap { display: flex; gap: 6px; margin-left: auto; }
table.snapshots { margin: 10px 0; font-size: 13px; }
.snapshots th, .snapshots td { padding: 2px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tree-view .toolbar { padding: 8px 0; border: none; }
table.evidence { font-size: 13px; }
.evidence thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; padding: 4px 8px; border-bottom: 1px solid var(--line-strong); }
.evidence td { padding: 2px 8px; border-bottom: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.evidence td.rname { text-align: left; }
.evidence td.rfires { color: var(--muted); }
.evidence .branch-head th { text-align: left; padding: 10px 8px 4px calc(8px + var(--depth) * 14px); border-bottom: 1px solid var(--line-strong); }
.evidence .branch-head button { font-weight: 600; }
.evidence td.na { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--line) 4px 5px); }
.evidence td.inh { color: var(--muted); }
.evidence td.zero { color: var(--muted); opacity: .6; }
.evidence td.pos { color: var(--match); background: var(--match-bg); font-weight: 600; }
.evidence td.neg .minus { color: var(--miss); margin-left: 3px; }
.evidence td.neg:not(.pos) { background: var(--miss-bg); }

/* Narrow screens: the page scrolls as a whole instead of squeezing several
   fixed-height scrolling panels into the screen. */
@media (max-width: 900px) {
  #app { height: auto; min-height: 100vh; }
  .view, .split, .rules-layout, .tree-view { flex: none; min-height: auto; overflow: visible; }
  .split, .rules-layout { flex-direction: column; }
  .table-wrap { flex: none; overflow-x: auto; overflow-y: hidden; }
  .rules-main, .side, .trace, .derive { overflow: visible; max-height: none; }
  .trace { width: 100%; border-left: none; border-top: 1px solid var(--line); }
  .side { width: 100%; border-right: none; border-bottom: 1px solid var(--line); }
}

/* import */
.import { padding: 8px 16px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.import p { margin: 0 0 6px; }
.import textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; margin-bottom: 6px; }
.cognates td.gloss .del { border: none; background: none; color: var(--muted); padding: 0 4px 0 0; }
.cognates td.gloss .del:hover { color: var(--miss); }

/* ---- tutorial ---- */
.pill { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }
.menu-like { border: 1px solid var(--line-strong); }
.top .menu-like { margin-left: auto; }
.with-coach { flex: 1; min-height: 0; display: flex; }
.with-coach > .view { flex: 1; min-width: 0; }
.coach {
  width: 340px; flex-shrink: 0; overflow: auto; background: var(--panel);
  border-left: 1px solid var(--line); padding: 12px 16px 20px; font-size: 14px; line-height: 1.55;
}
.coach.collapsed { width: auto; padding: 8px; }
.coach.collapsed button { writing-mode: vertical-rl; padding: 10px 4px; }
.coach-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.coach-head .icon { margin-left: auto; border: none; background: none; font-size: 15px; padding: 0 4px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.dots i.past { background: var(--accent); opacity: .45; }
.dots i.now { background: var(--accent); }
.coach h2 { font-size: 18px; margin: 6px 0 8px; }
.coach-text p { margin: 0 0 10px; }
.coach-text ol { margin: 0 0 10px; padding-left: 20px; }
.coach-text pre, .coach pre { background: var(--bg); border-radius: 5px; padding: 6px 10px; font-size: 15px; }
.coach code { background: var(--bg); border-radius: 3px; padding: 0 4px; }
ul.tasks { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.task { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: var(--bg); }
.task p { margin: 0; }
.task.done { border-color: var(--match); background: var(--match-bg); }
.task .tick { display: inline-block; width: 1.2em; font-weight: 700; color: var(--accent); }
.task.done .tick { color: var(--match); }
.task .options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.task .options button { font-size: 13.5px; }
.task .options button.right { border-color: var(--match); background: var(--match-bg); color: var(--match); }
.task .options button.wrong { border-color: var(--near); background: var(--near-bg); }
.task .reply { margin-top: 8px; font-size: 13.5px; }
.task .reply.right { color: var(--match); }
.task .reply.wrong { color: var(--near); }
.task .hint-text { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.task-help { display: flex; gap: 12px; margin-top: 4px; }
button.link { border: none; background: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 13px; }
.coach-nav { display: flex; justify-content: space-between; margin-top: 14px; }
.coach-nav .primary, .finale button { background: var(--accent); color: var(--panel); border-color: var(--accent); font-weight: 600; }
.coach-nav .primary { padding: 5px 18px; }
.finale { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.finale button { text-align: left; padding: 8px 12px; }
.lesson-list { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.lesson-list summary { cursor: pointer; color: var(--muted); }
.lesson-list ol { padding-left: 22px; margin: 6px 0; }
.lesson-list li.now button { font-weight: 700; }
.node-title { font-size: 17px; margin: 0; }
.cognates td.recon { white-space: nowrap; }
.cognates td.recon .star { color: var(--muted); margin-right: 2px; }
.cognates .cell:not(.clickable) { cursor: default; }
/* tutorial highlights are drawn as rings in a layer above the page (rings.js),
   so scrolling panels and sticky headers can't clip or cover them */
.tour-hl { scroll-margin: 24px; }
.cognates .tour-hl { scroll-margin-top: 72px; } /* clear the sticky header row */
.tour-rings { position: fixed; inset: 0; pointer-events: none; z-index: 1000; }
.tour-ring {
  position: fixed; border: 3px solid var(--near); border-radius: 7px; box-sizing: border-box;
  animation: tour-pulse 1.6s ease-in-out 3;
}
@keyframes tour-pulse { 50% { border-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .tour-ring { animation: none; } }
/* Narrow screens: the tutorial panel is a sheet fixed to the bottom of the
   screen, and the page leaves room for it. */
@media (max-width: 900px) {
  .with-coach { display: block; padding-bottom: 46vh; }
  .with-coach.coach-collapsed { padding-bottom: 56px; }
  .coach {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 44vh; z-index: 50;
    border-left: none; border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  }
  .coach.collapsed { max-height: none; padding: 6px 10px; }
  .coach.collapsed button { writing-mode: horizontal-tb; width: 100%; }
  /* scroll highlighted things into view above the sheet, not under it */
  .tour-hl, .cognates .tour-hl { scroll-margin-bottom: calc(46vh + 16px); }
}
.with-coach .table-wrap { padding: 10px 14px; }
.with-coach table.cognates { font-size: 15px; }
.with-coach .cognates .der { font-size: 13px; }
.rule-head .rule-tools { margin-left: auto; }
/* a known exception (flagged irregular in the source) is not an error of the rules */
.cognates .cell.irregular.miss, .cognates .cell.irregular.near { background: transparent; }
.cognates .cell.irregular .der { color: var(--muted); }
.coach code { white-space: nowrap; }
.cognates th.compare, .cognates td.compare { background: var(--bg); color: var(--muted); }
.cognates td.compare .att { color: var(--muted); }
.palette { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 8px; }
.palette button { min-width: 2em; padding: 1px 6px; font-size: 14px; }
.menu.tutorials .menu-body { width: 300px; }
.menu.tutorials .menu-body button { line-height: 1.35; }
.other-tutorials { padding-left: 18px; margin: 4px 0; }

/* destructive actions */
button.danger { color: var(--miss); border-color: var(--miss); }
button.danger:hover { background: var(--miss-bg); border-color: var(--miss); }
button.danger.solid { background: var(--miss); color: var(--panel); font-weight: 600; }
button.danger.solid:hover { filter: brightness(1.1); background: var(--miss); }
.danger-zone { border: 1px solid var(--miss); background: var(--miss-bg); border-radius: 6px; padding: 8px 10px; }
.danger-zone p { margin: 0 0 6px; font-size: 13px; }
.danger-buttons { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }

/* ---- welcome page ---- */
.view-home { overflow: auto; }
.home-top { border-bottom: none; background: transparent; }
.home { max-width: 880px; margin: 0 auto; padding: 8px 20px 48px; }
.hero { text-align: center; padding: 28px 0 12px; }
.hero-mark { color: var(--accent); display: inline-block; }
.hero h1 { font-size: 44px; margin: 6px 0 4px; letter-spacing: .01em; }
.hero .tagline { font-size: 21px; margin: 0; }
.intro { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: center; margin: 28px 0; }
.intro-text p { font-size: 15.5px; line-height: 1.6; margin: 0 0 12px; }
.home-diagram { width: 100%; height: auto; }
.home-diagram .proto { font-size: 22px; font-style: italic; font-weight: 600; fill: var(--accent); }
.home-diagram .form { font-size: 19px; font-style: italic; fill: var(--ink); }
.home-diagram .changed { fill: var(--near); font-weight: 600; }
.home-diagram .gloss { font-size: 12.5px; fill: var(--muted); }
.home-diagram .branch { stroke: var(--line-strong); stroke-width: 1.5; }
.start { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 28px; }
.more-tutorials { display: grid; gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); line-height: 1.4;
}
.card:hover { border-color: var(--accent); }
.card .kicker { color: var(--muted); font-size: 13px; }
.card .card-title { font-weight: 600; font-size: 16px; }
.card .card-text { color: var(--muted); font-size: 13.5px; }
.card .card-facts { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.card .card-go { color: var(--accent); font-weight: 600; margin-top: auto; padding-top: 6px; }
.card.primary { background: var(--accent-soft); border-color: var(--accent); justify-content: flex-start; }
.card.primary .card-title { font-size: 22px; }
.card.primary .card-text { font-size: 15px; color: var(--ink); }
.explore h2 { font-size: 16px; margin: 0 0 10px; }
.explore-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.home-foot p { margin: 0 0 6px; }
.home-foot a { color: var(--accent); }
.loading { font-weight: 600; color: var(--muted); }
/* on narrow screens the tutorial card is below the fold, so offer it up top too */
.hero-cta { display: none; }
@media (max-width: 720px) {
  .hero-cta {
    display: inline-block; margin-top: 16px; background: var(--accent); color: var(--panel);
    border: none; border-radius: 8px; padding: 9px 20px; font-weight: 600; font-size: 15px;
  }
  .intro, .start, .explore-cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .hero .tagline { font-size: 18px; }
}
.card.primary .card-go {
  align-self: flex-start; background: var(--accent); color: var(--panel); padding: 7px 16px; border-radius: 7px;
}
.card.primary:hover .card-go { filter: brightness(1.08); }
