:root {
  --bg: #fdfffc;
  --fg: #2d2d2d;
  --muted: #6b6b6b;
  --line: rgba(0, 0, 0, 0.12);
  --tint: rgba(0, 0, 0, 0.03);
  --accent: #e85f5c;
  --accent-dark: #c93b38;
  --accent-bg: #fff6f5;
  --good: #1c7c54;
  --good-bg: #e8f5ef;
  --bad: #c93b38;
  --bad-bg: #fdeceb;
  --radius: 8px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* class-based `display` rules below would otherwise beat the UA [hidden] rule */
[hidden] { display: none !important; }

body {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- chrome ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background-color: rgba(253, 255, 252, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.topbar-nav { display: flex; gap: 1.5rem; align-items: center; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.linkish:hover { color: var(--accent); }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}
.wrap.wide { max-width: 980px; }

h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 3rem 0 0.35rem; }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.35; }

code, kbd { font-family: var(--mono); }
code { font-size: 0.85em; background: rgba(0, 0, 0, 0.05); padding: 0.1rem 0.35rem; border-radius: 3px; }
kbd {
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn:disabled:hover { border-color: var(--line); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn.dark { background: var(--fg); border-color: var(--fg); color: #fff; }
.btn.dark:hover { background: #000; border-color: #000; }
.btn.sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn.lg { padding: 0.8rem 1.4rem; }

.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.row.tight { margin-top: 0.85rem; }

/* ---------- toggle ---------- */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.toggle input { width: 1rem; height: 1rem; accent-color: var(--accent); cursor: pointer; flex: none; }

/* ---------- home ---------- */

.home .toggle { margin-top: 0.85rem; }

.lede { color: var(--muted); margin-top: 0.75rem; max-width: 46rem; }
.howto { margin-top: 0.85rem; font-size: 0.9rem; color: var(--muted); max-width: 46rem; }
.section-blurb { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.1rem; }

.mix {
  margin-top: 2rem;
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-bg);
}
.mix h2 { margin: 0; }
.mix .hint { font-size: 0.9rem; color: var(--muted); margin-top: 0.2rem; }

.chip-group { margin-top: 1.2rem; }
.chip-group h3 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.88rem;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--fg); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--fg); border-color: var(--fg); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.mix-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(232, 95, 92, 0.45);
}
.mix-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }

/* segmented 10 / 20 / 30 */
.seg {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 0.7rem 1rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.seg label + label span { border-left: 1.5px solid var(--line); }
.seg label:hover span { background: var(--tint); }
.seg input:checked + span { background: var(--fg); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -3px; }
.seg-label { font-size: 0.9rem; color: var(--muted); }

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 1rem;
}

.rule {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}
.rule:hover { border-color: rgba(0, 0, 0, 0.3); }
.rule-num { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); margin-bottom: 0.2rem; }
.rule-text { font-size: 0.9rem; margin-top: 0.45rem; }
.example {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  background: var(--tint);
  border-left: 3px solid var(--line);
  border-radius: 0 6px 6px 0;
}
.rule-foot {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.record { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.record.good { color: var(--good); }

.stats-foot { margin-top: 3rem; font-size: 0.82rem; color: var(--muted); }
.stats-foot .linkish { font-size: inherit; text-decoration: underline; }

/* ---------- quiz ---------- */

.progress { margin-bottom: 1.5rem; }
.progress-bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.25s ease; }
.progress-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--muted);
}

.card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

/* "previous one was right" after an auto-pass; overlaid so nothing shifts */
.flash {
  position: absolute;
  top: 1.45rem;
  right: 1.75rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--good);
  background: var(--good-bg);
  pointer-events: none;
  animation: flash-out 1.6s ease forwards;
}
@keyframes flash-out {
  0%, 55% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .flash { animation: none; opacity: 0.85; }
}

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.prompt { overflow-wrap: anywhere; }
.prompt.calc {
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.prompt.case { font-size: 1.2rem; font-weight: 500; line-height: 1.5; }
.ask { margin-top: 0.5rem; color: var(--muted); }

.answer { display: flex; gap: 0.6rem; margin-top: 1.5rem; }
.answer input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 1.25rem;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--fg);
  transition: border-color 0.15s ease;
}
.answer input:focus { outline: none; border-color: var(--fg); }
.answer input:disabled { background: var(--tint); color: var(--fg); -webkit-text-fill-color: var(--fg); }
.answer input.ok { border-color: var(--good); background: var(--good-bg); }
.answer input.bad { border-color: var(--bad); background: var(--bad-bg); }

/* on-screen keypad for touch screens (app.js decides when) */
.card.kp-mode .answer input { border-color: var(--fg); caret-color: transparent; }
.card.kp-mode .answer input:disabled { border-color: var(--line); }
.card.kp-mode .answer input.ok { border-color: var(--good); }
.card.kp-mode .answer input.bad { border-color: var(--bad); }

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin-top: 0.85rem;
  user-select: none;
  -webkit-user-select: none;
}
.kp {
  display: grid;
  place-items: center;
  min-height: 3.1rem;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--fg);
  cursor: pointer;
  touch-action: manipulation; /* no double-tap zoom on fast entry */
  -webkit-tap-highlight-color: transparent;
}
.kp.side { background: var(--tint); font-size: 1.1rem; }
.kp.go {
  grid-column: span 3;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
}
.kp:active { background: rgba(0, 0, 0, 0.1); transform: translateY(1px); }
.kp.go:active { background: var(--accent-dark); }
.kp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.parse-error { margin-top: 0.75rem; font-size: 0.88rem; color: var(--bad); }

.feedback:empty { display: none; }
.feedback { margin-top: 1.4rem; }

.verdict {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.98rem;
}
.verdict strong { font-family: var(--mono); font-weight: 500; }
.verdict .you { font-family: var(--mono); }
.verdict.ok { background: var(--good-bg); color: var(--good); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.verdict.shown { background: var(--tint); }
.verdict .sub { display: block; font-size: 0.85rem; color: var(--fg); opacity: 0.8; margin-top: 0.15rem; }

.working { margin-top: 1.1rem; }
.working h4, .rv details summary {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.working h4 { margin-bottom: 0.5rem; }
.steps { list-style: none; counter-reset: step; display: grid; gap: 0.35rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 1.6rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.12rem;
  width: 1.1rem;
  height: 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--line);
  font-size: 0.65rem;
  color: var(--muted);
}

.override { margin-top: 1rem; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1.25rem; justify-content: flex-end; }
.controls .toggle { margin-right: auto; font-size: 0.85rem; color: var(--muted); }

.keys { margin-top: 1.1rem; font-size: 0.78rem; color: var(--muted); text-align: right; }

/* ---------- results ---------- */

.bigscore { margin: 1.25rem 0 0.5rem; font-family: var(--mono); }
.bigscore strong { font-size: 3rem; font-weight: 500; letter-spacing: -0.03em; }
.bigscore span { color: var(--muted); margin-left: 0.75rem; }
.target { font-size: 0.92rem; }
.target.ok { color: var(--good); }
.target.miss { color: var(--muted); }

.breakdown { display: grid; margin: 1.75rem 0 0; }
.brow {
  display: grid;
  grid-template-columns: 1fr 7rem 3.5rem;
  gap: 1rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.brow .num { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); text-align: right; }
.brow .meter { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.brow .meter span { display: block; height: 100%; background: var(--good); }

.results-actions { margin-top: 2rem; }

.review { list-style: none; display: grid; gap: 0.6rem; margin-top: 0.85rem; }
.rv {
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
}
.rv.ok { border-left-color: var(--good); }
.rv.bad { border-left-color: var(--bad); }
.rv-q { font-weight: 500; overflow-wrap: anywhere; }
.rv-q .n { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-right: 0.5rem; }
.rv-a { margin-top: 0.25rem; font-size: 0.88rem; color: var(--muted); }
.rv-a strong { font-family: var(--mono); font-weight: 500; color: var(--fg); }
.rv-a .you { font-family: var(--mono); }
.rv.bad .rv-a .you { color: var(--bad); }
.rv details { margin-top: 0.55rem; }
.rv details summary { cursor: pointer; }
.rv details .steps { margin-top: 0.5rem; }

@media (max-width: 640px) {
  .topbar { padding: 0.75rem 1rem; }
  .topbar-nav { gap: 1rem; }
  .brand { font-size: 0.95rem; }
  .linkish { font-size: 0.82rem; }
  .wrap { padding: 1.75rem 1rem 4rem; }
  h1 { font-size: 1.6rem; }
  .mix { padding: 1.15rem 1rem 1.25rem; }
  .card { padding: 1.25rem; }
  .flash { top: 1rem; right: 1.25rem; }
  .prompt.calc { font-size: 1.6rem; }
  .prompt.case { font-size: 1.08rem; }
  .answer input { font-size: 1.1rem; }
  .bigscore strong { font-size: 2.4rem; }
  .bigscore span { display: block; margin: 0.25rem 0 0; }
  .brow { grid-template-columns: 1fr 4.5rem 3rem; }
  .keys { display: none; }
  .meta-title { display: none; } /* the card's tag names the rule */
}

/* short phones: keep the question, input and the whole keypad on one screen */
@media (max-width: 640px) and (max-height: 760px) {
  .wrap { padding-top: 1rem; }
  .progress { margin-bottom: 0.85rem; }
  .card.kp-mode { padding: 1rem 1.1rem; }
  .card.kp-mode .tag { margin-bottom: 0.45rem; }
  .card.kp-mode .prompt.calc { font-size: 1.45rem; }
  .card.kp-mode .prompt.case { font-size: 1rem; line-height: 1.45; }
  .card.kp-mode .ask { font-size: 0.9rem; margin-top: 0.3rem; }
  .card.kp-mode .answer { margin-top: 0.8rem; }
  .card.kp-mode .answer input { padding: 0.45rem 0.75rem; }
  .card.kp-mode .flash { top: 0.8rem; right: 1.1rem; }
  .keypad { gap: 0.35rem; margin-top: 0.6rem; }
  .kp { min-height: 2.6rem; }
}

/* ---------- links from the trainer to the guide pages ---------- */

.rule-link { color: inherit; text-decoration: none; }
.rule-link:hover { color: var(--accent); }
.guide-link {
  align-self: flex-start;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-dark);
  text-decoration: none;
}
.guide-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.guide-inline {
  margin-left: 0.5rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--accent-dark);
  text-decoration: none;
}
.guide-inline:hover { text-decoration: underline; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* the static rule list on the trainer page and in guide footers */
.guides { padding-top: 0; }
.guides h2 { margin-top: 0; }
.guide-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem 2rem;
}
.guide-groups h3 {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.guide-list { list-style: none; display: grid; gap: 0.45rem; }
.guide-list a { color: var(--fg); font-weight: 500; text-decoration: none; }
.guide-list a:hover { color: var(--accent); }
.guide-list span { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.guide-list [aria-current] { font-weight: 600; color: var(--accent-dark); }

/* ---------- guide pages ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.guide h1 { font-size: 2.4rem; }
.guide .lede { font-size: 1.08rem; color: var(--fg); margin-top: 0.9rem; max-width: none; }
.guide section { margin-top: 2.75rem; }
.guide h2 { font-size: 1.3rem; margin: 0 0 0.85rem; }
.guide h3 { margin: 1.4rem 0 0.4rem; }
.guide p + p, .guide p + .tablewrap, .guide .tablewrap + p { margin-top: 0.85rem; }
.guide section > p:first-of-type:not(:first-child) { margin-top: 0.85rem; }
.guide a:not(.btn):not(.related-card) { color: var(--accent-dark); text-underline-offset: 2px; }
.guide strong { font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.cta-note { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }

.guide .rule-box {
  padding: 1.15rem 1.35rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-bg);
}
.rule-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.rule-statement { margin-top: 0.3rem; font-size: 1.12rem; font-weight: 500; line-height: 1.5; }

.howto-steps { padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.howto-steps li::marker { font-family: var(--mono); color: var(--accent); }
.bullets { padding-left: 1.2rem; display: grid; gap: 0.5rem; margin-top: 0.5rem; }

.tablewrap { overflow-x: auto; margin-top: 0.85rem; }
table.data { border-collapse: collapse; min-width: 100%; font-size: 0.9rem; }
table.data th, table.data td { text-align: left; padding: 0.45rem 1rem 0.45rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
table.data td:not(:first-child) { font-family: var(--mono); font-size: 0.84rem; }

.examples { display: grid; gap: 0.85rem; }
.example-card { padding: 1.1rem 1.25rem; border: 1.5px solid var(--line); border-radius: var(--radius); }
.ex-q { font-family: var(--mono); font-size: 1.2rem; font-weight: 500; margin-bottom: 0.7rem; overflow-wrap: anywhere; }
.ex-q.case { font-family: inherit; font-size: 1rem; }
.ex-a { margin-top: 0.7rem; font-size: 0.95rem; }
.ex-a strong { font-family: var(--mono); font-weight: 500; color: var(--good); }

.try { list-style: none; display: grid; gap: 0.6rem; margin-top: 0.85rem; counter-reset: try; }
.try > li { padding: 0.85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius); }
.try-q { font-weight: 500; overflow-wrap: anywhere; }
.try-ask { font-weight: 400; color: var(--muted); }
.try details { margin-top: 0.4rem; }
.try summary { cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--accent-dark); -webkit-tap-highlight-color: transparent; }
.try details .steps { margin-top: 0.5rem; }

.guide .cta-block {
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-bg);
}
.cta-block .cta-row { margin-top: 1.1rem; }

.faq h3 { font-size: 1rem; }
.faq h3 + p { margin-top: 0; }

.related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 0.75rem;
}
.related-card {
  display: block;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.related-card:hover { border-color: var(--fg); }
.related-card .t { display: block; font-weight: 600; }
.related-card .d { display: block; margin-top: 0.2rem; font-size: 0.84rem; color: var(--muted); line-height: 1.45; }

.guide-footer { margin-top: 2rem; border-top: 1px solid var(--line); background: var(--tint); }
.guide-footer .wrap { padding-top: 2.25rem; padding-bottom: 2.5rem; }
.guide-footer a { color: inherit; }
.guide-footer-title { font-weight: 600; margin-bottom: 1.1rem; }
.guide-footer-title a { text-decoration: none; }
.guide-footer-site { margin-top: 1.75rem; font-size: 0.82rem; color: var(--muted); }

@media (max-width: 640px) {
  .guide h1 { font-size: 1.85rem; }
  .guide .lede { font-size: 1rem; }
  .guide section { margin-top: 2.25rem; }
  .ex-q { font-size: 1.05rem; }
  .cta-row .btn.lg { flex: 1 1 auto; }
}
