/*
 * ODPT アプリギャラリー
 * Layout: 駅の構内。上に発車標（作品と本命）、本命の中身を層の図で、その下に駅名標のカードを並べた壁、
 * 最後に時刻表の注記のような前提と出典。路線の色 = 出どころの資料、駅番号 = 資料の中の順番。
 */
:root {
  /* 色：構内の壁・駅名標の板・墨・発車標の橙 */
  --bg: #e8ecea;
  --panel: #ffffff;
  --panel-2: #f2f5f4;
  --ink: #111a20;
  --ink-2: #43515b;
  --ink-3: #626f79;
  --rule: #cdd5d9;
  --rule-strong: #9eabb3;
  --accent: #a75500;
  --focus: #0b63c5;
  --chip-on: #111a20;
  --chip-on-ink: #ffffff;
  --live: #138a3e;
  --shadow: 0 1px 0 rgb(17 26 32 / 0.06), 0 6px 18px -12px rgb(17 26 32 / 0.25);
  --backdrop: rgb(10 16 20 / 0.5);

  /* 路線の色（色覚の検証済み。記号と名前を必ず添える） */
  --line-W: #e5631f;
  --line-A: #1f9a55;
  --line-B: #2a78d6;
  --line-C: #c23d8e;

  /* 試算の濃さ（青の1色、対数） */
  --h1: #cde2fb; --h2: #9ec5f4; --h3: #6da7ec; --h4: #3987e5; --h5: #256abf; --h6: #184f95; --h7: #0d366b;
  --h-ink-lo: #111a20; --h-ink-hi: #ffffff;

  /* 発車標（どちらのテーマでも同じ板） */
  --board: #0a0e11;
  --board-2: #12181d;
  --board-rule: #232b31;
  --led-amber: #ffb21a;
  --led-green: #49e08e;
  --led-red: #ff6b57;
  --led-white: #f2f0e4;
  --led-dim: #8b8572;

  /* 書体 */
  --font-display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic StdN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --font-body: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --font-num: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --font-led: "DotGothic16", "BIZ UDGothic", ui-monospace, "Osaka-Mono", monospace;

  /* 文字の大きさ */
  --fs-xs: 0.75rem;
  --fs-s: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-m: 1.0625rem;
  --fs-l: 1.3125rem;
  --fs-xl: 1.75rem;
  --fs-title: clamp(2.25rem, 1.4rem + 4vw, 4rem);

  --radius: 6px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1215;
    --panel: #161f25;
    --panel-2: #1b252c;
    --ink: #e6ecef;
    --ink-2: #b4c0c8;
    --ink-3: #8f9ca6;
    --rule: #2b3740;
    --rule-strong: #4a5964;
    --accent: #ffb21a;
    --focus: #79b8ff;
    --chip-on: #e6ecef;
    --chip-on-ink: #0d1215;
    --live: #46d37f;
    --shadow: 0 1px 0 rgb(0 0 0 / 0.4), 0 8px 20px -12px rgb(0 0 0 / 0.7);
    --backdrop: rgb(0 0 0 / 0.62);
    --line-W: #de6a2e;
    --line-A: #22a05c;
    --line-B: #3f88e0;
    --line-C: #d6519e;
    --h1: #0d366b; --h2: #184f95; --h3: #256abf; --h4: #3987e5; --h5: #6da7ec; --h6: #9ec5f4; --h7: #cde2fb;
    --h-ink-lo: #ffffff; --h-ink-hi: #0d1215;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1215;
  --panel: #161f25;
  --panel-2: #1b252c;
  --ink: #e6ecef;
  --ink-2: #b4c0c8;
  --ink-3: #8f9ca6;
  --rule: #2b3740;
  --rule-strong: #4a5964;
  --accent: #ffb21a;
  --focus: #79b8ff;
  --chip-on: #e6ecef;
  --chip-on-ink: #0d1215;
  --live: #46d37f;
  --shadow: 0 1px 0 rgb(0 0 0 / 0.4), 0 8px 20px -12px rgb(0 0 0 / 0.7);
  --backdrop: rgb(0 0 0 / 0.62);
  --line-W: #de6a2e;
  --line-A: #22a05c;
  --line-B: #3f88e0;
  --line-C: #d6519e;
  --h1: #0d366b; --h2: #184f95; --h3: #256abf; --h4: #3987e5; --h5: #6da7ec; --h6: #9ec5f4; --h7: #cde2fb;
  --h-ink-lo: #ffffff; --h-ink-hi: #0d1215;
  color-scheme: dark;
}

/* ---- 土台 ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:root:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.75;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.4em; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--panel-2); padding: 0.05em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page {
  padding-inline: var(--gutter);
  padding-block: clamp(24px, 4vw, 48px) 48px;
  display: grid;
  gap: clamp(40px, 6vw, 72px);
}
.page > * { width: 100%; max-width: 1200px; margin-inline: auto; min-width: 0; }

.sec-head { display: grid; gap: 6px; margin-bottom: 20px; }
.sec-head h2 { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-xl); letter-spacing: 0.02em; line-height: 1.3; }
.sec-lede { color: var(--ink-2); max-width: 46em; }
.eyebrow { font-size: var(--fs-s); letter-spacing: 0.12em; color: var(--ink-3); font-weight: 700; }

/* ---- 見出し ---- */
.mast { display: grid; gap: 14px; }
.mast h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-title);
  line-height: 1.12;
  letter-spacing: 0.01em;
}
.mast h1 .odpt { font-family: var(--font-num); font-weight: 700; letter-spacing: 0.02em; }
.lede { font-size: var(--fs-m); color: var(--ink-2); max-width: 44em; line-height: 1.8; }
.mast-lines { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--fs-s); color: var(--ink-2); }
.mast-lines span { display: inline-flex; align-items: center; gap: 6px; }

/* ---- 駅ナンバリング（記号）---- */
.badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  align-content: center;
  width: 46px;
  height: 46px;
  border: 4px solid var(--lc);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-num);
  line-height: 1;
}
.badge b { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.badge i { font-style: normal; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }
.badge.sm { width: 22px; height: 22px; border-width: 3px; border-radius: 5px; }
.badge.sm b { font-size: 11px; }
.badge.sm i { display: none; }
.lc-W { --lc: var(--line-W); }
.lc-A { --lc: var(--line-A); }
.lc-B { --lc: var(--line-B); }
.lc-C { --lc: var(--line-C); }

/* ---- 発車標 ---- */
.board {
  background:
    radial-gradient(circle at 1px 1px, rgb(255 255 255 / 0.035) 1px, transparent 1.5px) 0 0 / 5px 5px,
    var(--board);
  color: var(--led-white);
  border-radius: 10px;
  border: 1px solid var(--board-rule);
  box-shadow: inset 0 0 0 6px var(--board-2), var(--shadow);
  padding: clamp(14px, 2.4vw, 24px);
  font-family: var(--font-led);
  overflow: hidden;
}
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 4px 6px 12px; border-bottom: 1px solid var(--board-rule); }
.board-title { font-family: var(--font-led); font-weight: 400; font-size: var(--fs-l); color: var(--led-white); letter-spacing: 0.08em; }
.board-title small { font-size: var(--fs-s); color: var(--led-dim); letter-spacing: 0.04em; margin-left: 0.6em; }
.board-count { color: var(--led-amber); font-size: var(--fs-m); letter-spacing: 0.04em; }
.board-count b { font-weight: 400; font-size: 1.5em; margin-inline: 0.15em; }
.board-cols, .board-row a {
  display: grid;
  grid-template-columns: minmax(8.5rem, 11rem) minmax(0, 1.1fr) minmax(0, 1.4fr) 3.2rem;
  gap: 4px 18px;
  align-items: baseline;
}
.board-cols { padding: 10px 8px 4px; color: var(--led-dim); font-size: var(--fs-xs); letter-spacing: 0.1em; }
.board-cols span:last-child { text-align: right; }
.board-rows { list-style: none; margin: 0; padding: 0; }
.board-row { border-top: 1px solid var(--board-rule); }
.board-row:first-child { border-top: 0; }
.board-row a { padding: 9px 8px; text-decoration: none; border-radius: 4px; }
.board-row a:hover { background: rgb(255 255 255 / 0.05); }
.board-row a:focus-visible { outline-color: var(--led-amber); }
.b-kind { font-size: var(--fs-base); letter-spacing: 0.06em; text-shadow: 0 0 6px currentColor; }
.b-kind.t-green { color: var(--led-green); }
.b-kind.t-red { color: var(--led-red); }
.b-kind.t-amber { color: var(--led-amber); }
.b-kind.t-white { color: var(--led-white); }
.b-name { font-size: var(--fs-l); line-height: 1.35; color: var(--led-white); letter-spacing: 0.04em; text-shadow: 0 0 8px rgb(242 240 228 / 0.35); }
.b-note { color: var(--led-amber); font-size: var(--fs-s); line-height: 1.6; }
.b-score { color: var(--led-amber); text-align: right; font-size: var(--fs-m); font-variant-numeric: tabular-nums; }
.ticker { margin-top: 10px; border-top: 1px solid var(--board-rule); padding-top: 10px; overflow: hidden; }
.ticker-track { display: flex; width: max-content; color: var(--led-amber); font-size: var(--fs-s); letter-spacing: 0.06em; animation: ticker 70s linear infinite; }
.ticker-track span { padding-right: 4em; white-space: nowrap; }
.board:hover .ticker-track, .ticker-track:focus-within { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.board-note { margin-top: 10px; font-size: var(--fs-s); color: var(--ink-3); }

@media (max-width: 760px) {
  .board-title small { display: block; margin-left: 0; margin-top: 2px; }
  .board-cols { display: none; }
  .board-row a { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .b-kind { grid-column: 1; grid-row: 1; font-size: var(--fs-s); }
  .b-score { grid-column: 2; grid-row: 1; }
  .b-name { grid-column: 1 / -1; }
  .b-note { grid-column: 1 / -1; }
}

/* ---- 層の図 ---- */
.stack-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.stack-item {
  display: grid;
  grid-template-columns: minmax(150px, 280px) minmax(0, 1fr);
  gap: 8px 24px;
  align-items: center;
  margin-top: -6px;
}
.stack-item:first-child { margin-top: 0; }
.sheet {
  position: relative;
  height: 58px;
  display: grid;
  place-items: center;
  padding-inline: 18px;
}
.sheet::before {
  content: "";
  position: absolute;
  inset: 6px 0;
  transform: skewX(-38deg) scaleX(0.82);
  border: 1.5px solid var(--rule-strong);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border-radius: 3px;
  box-shadow: 0 6px 10px -8px rgb(0 0 0 / 0.35);
}
.sheet span { position: relative; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-s); letter-spacing: 0.04em; text-align: center; line-height: 1.35; }
.stack-item.core .sheet::before { background: var(--ink); border-color: var(--ink); }
.stack-item.core .sheet span { color: var(--panel); }
.stack-text { display: grid; gap: 4px; padding-block: 8px; border-bottom: 1px solid var(--rule); min-width: 0; }
.stack-text p { color: var(--ink-2); font-size: var(--fs-s); }
.stack-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.stack-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }
.stack-links a:hover span { text-decoration: underline; }
.stack-head { display: grid; gap: 6px; }
@media (max-width: 640px) {
  .stack-item { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
  .sheet { height: 44px; justify-content: start; place-items: center start; padding-left: 28px; }
  .sheet::before { inset: 4px 12px 4px 10px; transform: skewX(-30deg); }
}

/* ---- 絞り込み ---- */
.filters { display: grid; gap: 12px; margin-bottom: 18px; padding: 14px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.search { flex: 1 1 260px; min-width: 0; position: relative; }
.search input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--panel);
  min-height: 42px;
}
.search::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid var(--ink-3);
  border-radius: 50%;
  transform: translateY(-62%);
}
.search::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 50%;
  width: 6px;
  height: 2px;
  background: var(--ink-3);
  transform: translateY(5px) rotate(45deg);
}
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 8px; overflow: hidden; flex: none; }
.seg button { border: 0; background: transparent; padding: 8px 12px; min-height: 40px; cursor: pointer; font-size: var(--fs-s); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--rule-strong); }
.seg button[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); font-weight: 700; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.chip-group > .lab { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.08em; min-width: 4.5em; font-weight: 700; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--rule-strong);
  background: var(--panel);
  border-radius: 999px;
  padding: 4px 11px;
  min-height: 34px;
  font-size: var(--fs-s);
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); color: var(--chip-on-ink); font-weight: 700; }
.chip .n { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: inherit; opacity: 0.7; font-size: var(--fs-xs); }
.chip .badge.sm { border-color: var(--lc); background: var(--panel); color: var(--ink); }
.more-filters summary { cursor: pointer; font-size: var(--fs-s); color: var(--ink-2); font-weight: 700; width: max-content; padding-block: 4px; }
.more-filters[open] summary { margin-bottom: 10px; }
.more-body { display: grid; gap: 10px; }
.select { min-height: 36px; border: 1px solid var(--rule-strong); border-radius: 8px; padding: 4px 10px; background: var(--panel); max-width: 100%; }
.result { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: var(--fs-s); color: var(--ink-2); }
.result b { font-family: var(--font-num); font-size: var(--fs-m); color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; font-size: var(--fs-s); color: var(--ink); }

/* ---- 駅名標のカード ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 16px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgb(17 26 32 / 0.06), 0 12px 24px -14px rgb(17 26 32 / 0.4); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card.is-drop { opacity: 0.78; }
.card-sign { display: flex; gap: 12px; align-items: center; padding: 14px 14px 12px; }
.card-names { min-width: 0; flex: 1; }
.card-name { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-l); line-height: 1.3; letter-spacing: 0.02em; }
.card-name a { text-decoration: none; }
.card-name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-name a:focus-visible { outline: none; }
.card-sub { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; margin-top: 2px; }
.card-also { display: flex; gap: 4px; align-self: flex-start; }
.card-band { height: 7px; background: var(--lc); margin-inline: -1px; }
.card-shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--panel-2); border-bottom: 1px solid var(--rule); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; flex: 1; }
.card-whatif { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-base); line-height: 1.6; }
.card-whatif::before { content: "もしも、"; color: var(--ink-3); }
.card-pitch { color: var(--ink-2); font-size: var(--fs-s); line-height: 1.75; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: auto; padding-top: 2px; }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 9px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.7; border: 1px solid transparent; white-space: nowrap; }
.pill small { font-weight: 400; font-size: 1em; }
.st-live { border-color: var(--rule-strong); }
.st-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.st-design { border-color: var(--rule-strong); }
.st-design::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--ink-2); background: linear-gradient(90deg, var(--ink-2) 50%, transparent 50%); }
.st-honmei { background: var(--ink); color: var(--panel); }
.st-kouho { border-color: var(--ink); }
.st-osusume { border-color: var(--accent); color: var(--accent); }
.st-layer { border-color: var(--rule-strong); }
.st-layer::before {
  content: "";
  width: 10px;
  height: 10px;
  background:
    linear-gradient(var(--ink-2) 0 0) top / 100% 2px no-repeat,
    linear-gradient(var(--ink-2) 0 0) center / 100% 2px no-repeat,
    linear-gradient(var(--ink-2) 0 0) bottom / 100% 2px no-repeat;
}
.st-merge { border: 1px dashed var(--rule-strong); color: var(--ink-2); }
.st-drop { background: var(--panel-2); color: var(--ink-3); }

.score { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-num); font-weight: 700; font-size: var(--fs-m); line-height: 1; }
.score small { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-xs); color: var(--ink-3); }
.score .meter { width: 34px; height: 5px; border-radius: 3px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--rule); overflow: hidden; }
.score .meter i { display: block; height: 100%; background: var(--ink-2); }
.score.is-merged { color: var(--ink-2); }
.tag { font-size: var(--fs-xs); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; line-height: 1.8; white-space: nowrap; }
.verdict { font-size: var(--fs-m); line-height: 1; color: var(--ink); }
.check-weak { color: var(--ink); border-color: var(--rule-strong); background: var(--panel-2); }

.empty { padding: 40px 16px; text-align: center; color: var(--ink-2); background: var(--panel); border: 1px dashed var(--rule-strong); border-radius: 10px; }

/* ---- 表 ---- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
.list { border-collapse: collapse; width: 100%; min-width: 880px; font-size: var(--fs-s); }
.list th, .list td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.list thead th { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.06em; font-weight: 700; position: sticky; top: 0; background: var(--panel); }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: var(--panel-2); }
.list .muted { color: var(--ink-3); }
.list .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.list .name a { font-weight: 700; text-decoration: none; }
.list .name a:hover { text-decoration: underline; }
.list .name small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.list .bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.list .bar i { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--ink-2); }
.list .bar span { font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.2em; }

/* ---- 前提（審査と日程）---- */
.prem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.prem h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-m); margin-bottom: 10px; }
.criteria { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.criteria li { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; font-weight: 700; line-height: 1.5; }
.criteria li small { display: block; font-weight: 400; color: var(--ink-2); font-size: var(--fs-xs); margin-top: 4px; }
.findings { display: grid; gap: 8px; color: var(--ink-2); }
.findings li::marker { color: var(--ink-3); }
.tl { list-style: none; padding: 0; position: relative; display: grid; gap: 0; }
.tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--rule-strong); }
.tl li { position: relative; display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 4px 12px; padding: 6px 0 10px 28px; }
.tl li::before { content: ""; position: absolute; left: 1px; top: 12px; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 3px solid var(--ink-2); }
.tl li.key::before { background: var(--ink); border-color: var(--ink); }
.tl li.past { color: var(--ink-3); }
.tl li.past::before { border-color: var(--rule-strong); }
.tl time { font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl li.key span { font-weight: 700; }
.tl li.today { padding-block: 2px 8px; }
.tl li.today::before { background: var(--accent); border-color: var(--accent); width: 10px; height: 10px; left: 3px; top: 9px; }
.tl li.today time, .tl li.today span { color: var(--accent); font-weight: 700; font-size: var(--fs-s); }
@media (max-width: 820px) {
  .prem { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .criteria { grid-template-columns: minmax(0, 1fr); }
  .tl li { grid-template-columns: minmax(0, 1fr); }
}

/* ---- 出典・注記 ---- */
.foot { display: grid; gap: 18px; padding-top: 24px; border-top: 1px solid var(--rule-strong); color: var(--ink-2); font-size: var(--fs-s); }
.foot h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-m); color: var(--ink); }
.notes { display: grid; gap: 6px; }
.sources { display: grid; gap: 8px; }
.sources summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px 28px; margin-top: 12px; }
.src-grid h3 { font-size: var(--fs-s); color: var(--ink); margin-bottom: 4px; }
.src-grid ul { display: grid; gap: 2px; }

/* ---- 詳細（駅名標をひらく）---- */
.detail {
  border: 0;
  padding: 0;
  margin: 0 0 0 auto;
  width: min(760px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--panel);
  color: var(--ink);
  box-shadow: -12px 0 40px -20px rgb(0 0 0 / 0.5);
  overflow: hidden;
}
.detail[open] { display: flex; flex-direction: column; }
.detail::backdrop { background: var(--backdrop); }
.d-sign { flex: none; background: var(--panel); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); }
.d-top { display: flex; align-items: center; gap: 14px; padding: 18px 18px 14px 20px; }
.d-names { flex: 1; min-width: 0; }
.d-names h2 { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem); line-height: 1.25; letter-spacing: 0.02em; }
.d-sub { color: var(--ink-3); font-size: var(--fs-s); margin-top: 2px; }
.d-also { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.d-also .card-also { align-self: center; }
.d-top .badge { width: 58px; height: 58px; border-width: 5px; border-radius: 10px; }
.d-top .badge b { font-size: 14px; }
.d-top .badge i { font-size: 24px; }
.d-close { flex: none; align-self: flex-start; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--panel); cursor: pointer; font-size: 22px; line-height: 1; display: grid; place-items: center; }
.d-close:hover { background: var(--panel-2); }
.d-band { height: 10px; background: var(--lc); }
.d-adj { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; padding: 6px 12px 8px; font-size: var(--fs-s); align-items: center; }
.d-adj a { text-decoration: none; display: inline-flex; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 6px; min-width: 0; color: var(--ink-2); }
.d-adj a:hover { background: var(--panel-2); color: var(--ink); }
.d-adj a span { overflow-wrap: anywhere; }
.d-adj .next { justify-self: end; text-align: right; }
.d-adj .pos { font-family: var(--font-num); color: var(--ink-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px calc(48px + env(safe-area-inset-bottom, 0px)); display: grid; grid-auto-rows: max-content; gap: 26px; align-content: start; }
.d-scroll > * { min-width: 0; }
.d-status { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: var(--fs-s); color: var(--ink-2); }
.d-whatif { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-l); line-height: 1.5; }
.d-whatif::before { content: "もしも、"; color: var(--ink-3); font-weight: 700; }
.d-pitch { font-size: var(--fs-m); line-height: 1.85; max-width: 40em; }
.d-shot { margin: 0; }
.d-shot a { display: block; border-radius: 8px; }
.d-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel-2); }
.d-shot figcaption { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-s); line-height: 1.75; max-width: 44em; }
.d-links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--ink); text-decoration: none; font-weight: 700; font-size: var(--fs-s); min-height: 42px; }
.btn.primary { background: var(--ink); color: var(--panel); }
.btn::after { content: "↗"; font-weight: 400; }
.facts { margin: 0; min-height: max-content; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.facts > div { background: var(--panel); padding: 10px 14px; display: grid; gap: 2px; align-content: start; }
.facts dt { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.06em; font-weight: 700; }
.facts dd { margin: 0; font-weight: 700; }
.facts dd.big { font-family: var(--font-num); font-size: var(--fs-xl); line-height: 1.1; }
.facts dd.big small { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.d-sec { display: grid; gap: 10px; min-width: 0; }
.d-sec > h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-m); display: flex; align-items: center; gap: 10px; }
.d-sec > h3::before { content: ""; width: 14px; height: 4px; background: var(--lc, var(--ink)); border-radius: 2px; flex: none; }
.d-sec p, .d-sec li { max-width: 44em; }
.d-sec ul, .d-sec ol { display: grid; gap: 6px; }
.d-sec li > ul { margin-top: 6px; }
.d-sec .muted { color: var(--ink-2); font-size: var(--fs-s); }
.tbl { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: var(--fs-s); min-width: 520px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; line-height: 1.6; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-size: var(--fs-xs); color: var(--ink-3); background: var(--panel-2); font-weight: 700; }
.tbl tbody th { background: transparent; color: var(--ink); font-size: var(--fs-s); font-weight: 700; }
.tbl th.r { white-space: nowrap; }
.tbl td.r, .tbl th.r { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 8px; }
.bars .row { display: grid; grid-template-columns: 11em minmax(0, 1fr) 2.6em; gap: 10px; align-items: center; font-size: var(--fs-s); }
.bars .track { height: 10px; background: var(--panel-2); border-radius: 0 5px 5px 0; position: relative; box-shadow: inset 0 0 0 1px var(--rule); }
.bars .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--lc, var(--ink-2)); border-radius: 0 5px 5px 0; }
.bars .track .avg { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.bars .val { font-family: var(--font-num); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bars .axis { display: grid; grid-template-columns: 11em minmax(0, 1fr) 2.6em; gap: 10px; font-family: var(--font-num); font-size: var(--fs-xs); color: var(--ink-3); }
.bars .axis span:nth-child(2) { display: flex; justify-content: space-between; }
@media (max-width: 520px) {
  .bars .row, .bars .axis { grid-template-columns: 7.5em minmax(0, 1fr) 2.4em; }
}
.rel { display: flex; flex-wrap: wrap; gap: 8px; }
.rel a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; background: var(--panel); min-width: 0; }
.rel a:hover { border-color: var(--rule-strong); background: var(--panel-2); }
.rel a small { color: var(--ink-3); font-size: var(--fs-xs); display: block; line-height: 1.3; }
.rel a b { display: block; font-size: var(--fs-s); line-height: 1.35; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.check-box { display: grid; gap: 10px; padding: 14px 16px; background: var(--panel-2); border-radius: 8px; }
.check-box .res { font-weight: 700; }
.src-list { display: grid; gap: 4px; font-size: var(--fs-s); color: var(--ink-2); }

/* 試算の表（濃さは件数の対数） */
.heat td.v { text-align: right; font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4.2em; }
.heat td.v[data-h="0"] { background: var(--panel); color: var(--ink-3); }
.heat td.v[data-h="1"] { background: var(--h1); color: var(--h-ink-lo); }
.heat td.v[data-h="2"] { background: var(--h2); color: var(--h-ink-lo); }
.heat td.v[data-h="3"] { background: var(--h3); color: var(--h-ink-lo); }
.heat td.v[data-h="4"] { background: var(--h4); color: var(--h-ink-hi); }
.heat td.v[data-h="5"] { background: var(--h5); color: var(--h-ink-hi); }
.heat td.v[data-h="6"] { background: var(--h6); color: var(--h-ink-hi); }
.heat td.v[data-h="7"] { background: var(--h7); color: var(--h-ink-hi); }
.heat td.v { box-shadow: inset 0 0 0 1px var(--panel); }
.heat .place small { display: block; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.4; }
.heat-key { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--ink-3); flex-wrap: wrap; }
.heat-key i { display: inline-block; width: 18px; height: 12px; border-radius: 2px; }

@media (max-width: 640px) {
  .detail { width: 100vw; }
  .d-top { padding: 14px 14px 12px 16px; gap: 12px; }
  .d-top .badge { width: 50px; height: 50px; border-width: 4px; }
  .d-scroll { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; flex-wrap: wrap; width: auto; }
  .ticker-track span[aria-hidden="true"] { display: none; }
  .ticker-track span { white-space: normal; }
  .card, .card:hover { transition: none; transform: none; }
}
