:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c2321;
  --muted: #55605d;
  --line: #e4e1d9;
  --accent: #0f5c57;
  --accent-soft: #e3f0ee;
  --accent-ink: #ffffff;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121615;
    --surface: #1a201f;
    --ink: #e8ecea;
    --muted: #a3aeab;
    --line: #2c3533;
    --accent: #5fb8ae;
    --accent-soft: #1d2e2c;
    --accent-ink: #0d1312;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.7 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; line-height: 1.2; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.top .brand { font-family: "Source Serif 4", Georgia, serif; font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; }
.top .back { font-size: 14px; font-weight: 500; text-decoration: none; }

article { padding: 48px 0 16px; }
.crumb { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.crumb a { color: var(--muted); }
article h1 { font-size: 38px; letter-spacing: -0.01em; margin: 0 0 12px; }
.byline { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
article h2 { font-size: 25px; margin: 40px 0 10px; }
article h3 { font-size: 19px; margin: 28px 0 8px; }
article p { margin: 0 0 16px; }
article ul, article ol { padding-left: 22px; margin: 0 0 16px; }
article li { margin-bottom: 8px; }

.tldr {
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 28px;
}
.tldr b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

/* Jump links as a sentence, not a button row */
.paths {
  margin: -8px 0 28px;
  color: var(--muted);
  font-size: 15px;
}
.paths a { font-weight: 500; }

/* Four-beat map under the short answer — a list, not cards */
.map {
  margin: 0 0 32px; padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.map li {
  display: grid; grid-template-columns: 2ch 1fr; gap: 12px;
  padding: 14px 0; margin: 0;
  border-top: 1px solid var(--line);
}
.map li:first-child { border-top: 0; }
.map .n { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; padding-top: 2px; }
.map p { margin: 0; }
.map strong { font-weight: 600; }

.aside {
  margin: 20px 0 24px;
  padding: 0 0 0 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
}
.aside .k {
  display: block; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 6px;
}
.aside p:last-child { margin-bottom: 0; }

.jobs { margin: 16px 0 28px; padding: 0; list-style: none; }
.jobs li {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 16px;
  align-items: baseline;
  padding: 14px 0; margin: 0;
  border-bottom: 1px solid var(--line);
}
.jobs li:first-child { border-top: 1px solid var(--line); }
.jobs .what { margin: 0; font-weight: 600; }
.jobs .why { margin: 4px 0 0; color: var(--muted); font-size: 15px; font-weight: 400; grid-column: 1 / -1; }
.jobs .eq { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

details.deeper {
  margin: 20px 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
details.deeper > summary {
  cursor: pointer; list-style: none;
  padding: 14px 0; font-weight: 600; font-size: 15px;
}
details.deeper > summary::-webkit-details-marker { display: none; }
details.deeper > summary::after {
  content: "+"; float: right; color: var(--muted); font-weight: 500;
}
details.deeper[open] > summary::after { content: "–"; }
details.deeper .body { padding: 0 0 16px; }
details.deeper .body > :last-child { margin-bottom: 0; }

.fig { margin: 24px 0 28px; }
.fig .fig-body {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 16px;
}
.fig figcaption { margin-top: 10px; font-size: 15px; color: var(--muted); }
.fig figcaption b { color: var(--ink); font-weight: 600; }

.widget {
  margin: 22px 0 28px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.widget .wh {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 14px; color: var(--muted); margin-bottom: 12px;
}
.widget .wh b { color: var(--ink); font-weight: 600; }
.widget label { display: block; font-size: 14px; margin: 0 0 6px; }
.widget input[type="range"] { width: 100%; accent-color: var(--accent); }
.widget .out {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px;
  margin-top: 14px; font-size: 15px;
}
.widget .out span { color: var(--muted); }
.widget .out strong { font-variant-numeric: tabular-nums; }

.status-ok { color: var(--accent); font-weight: 600; }
.status-wait { color: var(--muted); }

mark.hl {
  background: color-mix(in srgb, var(--accent-soft) 85%, var(--accent));
  color: inherit; padding: 0 2px; border-radius: 2px;
}

.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; }
.box h3 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 20px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.num { font-variant-numeric: tabular-nums; }

.watch {
  display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; text-decoration: none; color: var(--ink); margin: 20px 0;
}
.watch:hover { border-color: var(--accent); }
.watch img { width: 120px; height: 68px; object-fit: cover; border-radius: 6px; display: block; background: var(--line); }
.watch b { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.watch .t { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; }
.watch .m { display: block; font-size: 13px; color: var(--muted); }

.peace-list { list-style: none; padding: 0; margin: 8px 0 0; }
.peace-list li { margin: 0; border-top: 1px solid var(--line); }
.peace-list li:last-child { border-bottom: 1px solid var(--line); }
.peace-list a {
  display: block; padding: 18px 0; text-decoration: none; color: inherit;
}
.peace-list a:hover strong { color: var(--accent); }
.peace-list strong { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.peace-list span { display: block; color: var(--muted); font-size: 15px; line-height: 1.5; }

.related { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 24px; }
.related h2 { font-size: 21px; margin: 0 0 12px; }
.related ul { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.related li { margin: 0; }
.related a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.4; height: 100%; }
.related a:hover { border-color: var(--accent); }

.cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 32px 0 0; }
.cta p { margin: 0 0 12px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; background: var(--accent); color: var(--accent-ink); }

footer { margin-top: 48px; padding: 24px 0 48px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  article { padding-top: 32px; }
  article h1 { font-size: 30px; }
  article h2 { font-size: 22px; }
  .related ul { grid-template-columns: 1fr; }
  table.wide { min-width: 600px; font-size: 14px; }
  .table-scroll { margin: 0 -20px; padding: 0 20px; }
  .widget .out { grid-template-columns: 1fr 1fr; }
  .jobs li { grid-template-columns: 1fr; }
  .jobs .eq { justify-self: start; }
}
