/* The Joggernaut: white ground, deep indigo ink, signal coral for ground covered. */
:root {
  color-scheme: light;
  --bg: #ffffff; --ink: #141d36; --soft: #5b6580; --faint: #8a93a8;
  --track: #d4d9e4; --band: #f2f4f9; --line: #e3e7ef; --card: #ffffff;
  --run: #ff5a4e; --run-ink: #d93a2f; --on-run: #ffffff;
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600;
  --shadow: 0 1px 2px rgba(20,29,54,.06), 0 8px 24px rgba(20,29,54,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1424; --ink: #eef1f8; --soft: #a3acc4; --faint: #737d96;
    --track: #2c3753; --band: #151d33; --line: #25304a; --card: #131b30;
    --run: #ff6a5e; --run-ink: #ff8a80;
    --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1424; --ink: #eef1f8; --soft: #a3acc4; --faint: #737d96;
  --track: #2c3753; --band: #151d33; --line: #25304a; --card: #131b30;
  --run: #ff6a5e; --run-ink: #ff8a80;
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05;
  --shadow: none;
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif; overflow-x: clip; }
:lang(ja) body { font-family: "Zen Kaku Gothic New", Inter, system-ui, sans-serif; line-break: strict; }
h1, h2, h3, .big, .brand { font-family: "Zen Kaku Gothic New", Inter, system-ui, sans-serif; }
a { color: var(--run-ink); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1240px; margin: 0 auto; padding: 10px max(4vw, 16px); display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 900; font-size: 20px; letter-spacing: .02em; text-decoration: none; color: var(--ink); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--run); display: inline-grid; place-items: center; color: #fff; font-style: normal; font-size: 15px; }
.brand span { color: var(--run); }
#lang { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 0 14px; min-height: 40px; font: 700 14px "Zen Kaku Gothic New", Inter, sans-serif; cursor: pointer; white-space: nowrap; }
nav.tabs { max-width: 1240px; margin: 0 auto; padding: 0 max(4vw, 16px) 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; border: 1px solid var(--line); white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
nav.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- layout ---------- */
.band { padding: clamp(28px, 5vw, 64px) max(4vw, 16px); }
.band.alt { background: var(--band); }
.wrap { max-width: 1240px; margin: 0 auto; }
.kicker { font: 700 13px Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--run-ink); margin: 0 0 10px; }
h1 { font-size: clamp(38px, 7.5vw, 76px); line-height: 1; margin: 0; font-weight: 900; letter-spacing: -.01em; text-wrap: balance; }
h1 em { font-style: normal; color: var(--run); }
h2 { font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 18px; line-height: 1.15; font-weight: 900; }
h3 { font-size: 19px; margin: 0; line-height: 1.3; }
.sub { color: var(--soft); margin: 14px 0 0; max-width: 62ch; font-size: 18px; }
.empty { color: var(--soft); }
.muted { color: var(--soft); }

/* ---------- counts ---------- */
.count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.count > div { display: flex; flex-direction: column; border-top: 3px solid var(--line); padding-top: 10px; }
.count > div.hot { border-color: var(--run); }
.big { font-size: clamp(34px, 6vw, 58px); font-weight: 900; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.big.run { color: var(--run); }
.big small { font-size: .45em; font-weight: 700; color: var(--soft); margin-left: 4px; }
.lbl { font-size: 14px; color: var(--soft); margin-top: 6px; }
.meter { height: 12px; background: var(--track); border-radius: 6px; margin-top: 26px; overflow: hidden; position: relative; }
.meter i { display: block; height: 100%; background: var(--run); border-radius: 6px; transition: width .8s; }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; }
.pace { margin: 14px 0 0; max-width: 74ch; }
.pace p { margin: 6px 0; color: var(--soft); font-size: 16px; }
.pace strong { color: var(--ink); }

/* ---------- rail map ---------- */
.mapbox { position: relative; margin-top: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); overflow: hidden; box-shadow: var(--shadow); }
.mapbox svg { display: block; width: 100%; height: clamp(460px, 68vw, 680px); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.mapbox svg:active { cursor: grabbing; }
.mapctl { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.mapctl button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 700 20px Inter, sans-serif; cursor: pointer; box-shadow: var(--shadow); }
.mapinfo { position: absolute; left: 12px; bottom: 12px; right: 70px; font-size: 14px; pointer-events: none; }
.mapinfo span { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: inline-block; box-shadow: var(--shadow); }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--soft); margin-top: 12px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; display: inline-block; width: 22px; height: 6px; border-radius: 3px; background: var(--c); }
.linechips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--band); color: var(--ink); white-space: nowrap; }
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--faint)); }
.chip.plain::before { display: none; }
.chip b { color: var(--run-ink); }

/* ---------- run log ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card .pic { position: relative; aspect-ratio: 4/3; background: var(--band); }
.card .pic > img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.card .pic .inset { position: absolute; right: 10px; bottom: 10px; width: 64px; height: 96px; border-radius: 10px; overflow: hidden; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: zoom-in; padding: 0; background: #fff; }
.card .pic .inset img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.card .num { position: absolute; left: 10px; top: 10px; background: var(--run); color: #fff; font: 900 15px "Zen Kaku Gothic New", sans-serif; border-radius: 999px; padding: 2px 10px; }
.card .b { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.card .r { font-weight: 800; font-size: 18px; line-height: 1.3; }
.card .m { font-size: 14px; color: var(--soft); }
.card p { margin: 0; white-space: pre-wrap; }
.card audio { width: 100%; height: 40px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px 12px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font: 800 18px Inter, sans-serif; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--soft); }
.ep-link { font-weight: 700; text-decoration: none; }
.ep-link::before { content: "▶ "; }
.morebtn { margin-top: 20px; }

/* ---------- 54 for 54 ---------- */
.grid54 { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin-top: 28px; }
.k { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; padding: 0; font: inherit; color: inherit; display: flex; flex-direction: column; }
.k.on { cursor: pointer; }
.k.on:hover { border-color: var(--run); }
.k svg { width: 100%; aspect-ratio: 1; display: block; background: var(--band); }
.k .n { font: 900 24px "Zen Kaku Gothic New", sans-serif; padding: 8px 12px 0; color: var(--faint); }
.k.on .n { color: var(--run); }
.k .t { padding: 0 12px 12px; min-height: 1.6em; font-size: 13px; color: var(--soft); }
.k .t b { display: block; color: var(--ink); font-size: 14px; }
#fkmap { height: min(60vh, 420px); border-radius: 12px; margin: 14px 0; background: var(--band); }

/* ---------- health ---------- */
.hero2 { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 28px; align-items: flex-end; }
.hero2 > div { display: flex; flex-direction: column; }
.arrow { font: 900 clamp(28px, 5vw, 48px) Inter, sans-serif; color: var(--faint); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 18px; margin-top: 28px; }
.chart { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); position: relative; }
.chart.wide { grid-column: 1 / -1; }
.chart h3 { font-size: 16px; }
.chart .unit { font-size: 13px; color: var(--soft); }
.chart svg { width: 100%; height: 240px; display: block; margin-top: 8px; overflow: visible; }
.chart.wide svg { height: 300px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.4; white-space: nowrap; z-index: 5; transform: translate(-50%, -100%); }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 13px; color: var(--soft); font-weight: 600; }
.scroll { overflow-x: auto; margin-top: 24px; }

/* ---------- about ---------- */
.about { max-width: 66ch; font-size: 19px; line-height: 1.75; margin-top: 28px; }
.about p { margin: 0 0 1.1em; }
.about p:first-child::first-letter { font: 900 3.2em/0.9 "Zen Kaku Gothic New", sans-serif; float: left; margin: 6px 10px 0 0; color: var(--run); }
:lang(ja) .about p:first-child::first-letter { font: inherit; float: none; margin: 0; color: inherit; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 36px; max-width: 960px; }
.facts div { background: var(--band); border-radius: 16px; padding: 18px; }
.facts b { display: block; font: 900 34px "Zen Kaku Gothic New", sans-serif; color: var(--run); }

/* ---------- episodes ---------- */
.ep { display: grid; grid-template-columns: minmax(0, 1fr); }
.ep .pic { aspect-ratio: 16/9; }
.listen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.listen a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 700; font-size: 15px; min-height: 44px; }
.video { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 16px; overflow: hidden; margin-top: 24px; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose { max-width: 68ch; font-size: 18px; line-height: 1.75; }
.prose p { margin: 0 0 1em; }
.guest { display: flex; gap: 16px; align-items: flex-start; background: var(--band); border-radius: 16px; padding: 18px; margin: 24px 0; max-width: 68ch; }
.back { display: inline-block; margin-bottom: 18px; font-weight: 700; text-decoration: none; }

/* ---------- dialogs / lightbox ---------- */
dialog { border: 0; border-radius: 18px; padding: 22px; width: min(640px, 94vw); background: var(--bg); color: var(--ink); max-height: 92vh; }
dialog::backdrop { background: rgba(8, 12, 24, .7); }
dialog.lb { padding: 0; background: transparent; width: auto; max-width: 96vw; }
dialog.lb img { max-width: 96vw; max-height: 90vh; display: block; border-radius: 12px; }
.x { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 20px; cursor: pointer; }

/* ---------- forms (admin) ---------- */
form.f { display: grid; gap: 14px; max-width: 620px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
label.chk { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; }
label.chk input { width: 22px; height: 22px; min-height: 0; }
input, textarea, select { font: 16px Inter, system-ui, sans-serif; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-height: 46px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--run); outline-offset: 2px; }
.go { background: var(--run); color: #fff; border: 0; border-radius: 12px; font: 700 17px Inter, sans-serif; min-height: 52px; padding: 0 22px; cursor: pointer; }
.go:disabled { opacity: .6; }
.ghost { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 12px; font: 600 15px Inter, sans-serif; min-height: 44px; padding: 0 16px; cursor: pointer; }
.danger { color: #c62828; }
.note { font-size: 14px; color: var(--soft); margin: 0; }
.msg { font-weight: 700; margin: 0; min-height: 1.4em; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 12px; }

@media (max-width: 640px) {
  .count { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .brand { font-size: 17px; }
  .about { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .meter i { transition: none; } }
.alltime { margin-top: 36px; padding: 20px; border-radius: 16px; background: var(--band); }
.alltime .count { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.alltime .big { font-size: clamp(28px, 5vw, 44px); }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 800; font-size: 18px; padding: 14px 28px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 24px; color: var(--run); }
.faq details[open] summary::after { content: "−"; }
.faq .prose { font-size: 17px; padding-bottom: 10px; }
#kinds input:checked + * { color: var(--run); }
#kinds label:has(input:checked) { background: var(--ink); color: var(--bg); }
#kinds label { flex-direction: row; align-items: center; gap: 0; font-weight: 700; }
#kinds label::before { display: none; }
