/* YUCTS Transit — generated from packages/ui/src/tokens.json, components.css and site.css */
:root,
[data-theme="light"] {
  --ground: #eef1f3;
  --panel: #ffffff;
  --panel-sunk: #e2e7eb;
  --ink: #10161d;
  --ink-muted: #4c5764;
  --rule: #c7cfd7;
  --border-control: #7d8894;
  --overhead: #10161d;
  --on-overhead: #f2f5f8;
  --on-overhead-muted: #aab4bf;
  --ai: #165e83;
  --on-ai: #ffffff;
  --ai-tint: #dcebf2;
  --exit: #ffd000;
  --exit-strong: #f0c000;
  --on-exit: #10161d;
  --focus-ring: #10161d;
  --ok: #0b7a43;
  --ok-bg: #dff4e8;
  --warn: #8f5600;
  --warn-bg: #fcefd3;
  --stop: #b3261e;
  --stop-bg: #fce5e2;
  --none: #5e6a76;
  --none-bg: #e6eaee;
  --mode-tra: #090980;
  --on-mode-tra: #ffffff;
  --mode-thsr: #db5325;
  --on-mode-thsr: #10161d;
  --mode-metro: #2f6fb0;
  --mode-bus: #1e7d46;
  --mode-bike: #a95700;
  --mode-air: #1d5aa8;
  --mode-ship: #0b7480;
  --mode-afr: #2d6a43;
  --mode-walk: #5e6a76;
  --on-mode: #ffffff;
  --board: #0a1020;
  --board-raise: #111a33;
  --board-rule: #1f2b49;
  --board-text: #f2f5fa;
  --board-dim: #a9b5cb;
  --board-amber: #ffb547;
  --board-green: #4ade80;
  --board-red: #ff8f8f;
  --board-yellow: #ffd000;
  --board-cyan: #67e8f9;
  --board-blue: #8ab4ff;
  --board-tra: #090980;
  --board-thsr: #db5325;
  --board-air: #0b2a5e;
  --board-ship: #063b42;
  --board-bus: #100b05;
  --led-amber: #ffa62b;
  --shadow-panel: 0 1px 2px rgba(16, 22, 29, 0.08);
  --shadow-board: 0 2px 0 rgba(16, 22, 29, 0.18);
  --shadow-pop: 0 8px 24px rgba(16, 22, 29, 0.16);
}

[data-theme="dark"] {
  --ground: #0c1218;
  --panel: #141b23;
  --panel-sunk: #0a0f14;
  --ink: #e9eef3;
  --ink-muted: #a2aebb;
  --rule: #273240;
  --border-control: #6b7886;
  --overhead: #05080c;
  --on-overhead: #e9eef3;
  --on-overhead-muted: #93a0ad;
  --ai: #5ab0d9;
  --on-ai: #04131b;
  --ai-tint: #10283a;
  --exit: #ffd000;
  --exit-strong: #ffdc3a;
  --on-exit: #10161d;
  --focus-ring: #ffd000;
  --ok: #58d68d;
  --ok-bg: #0e2a1c;
  --warn: #f3b44c;
  --warn-bg: #2e220c;
  --stop: #ff8a80;
  --stop-bg: #33130f;
  --none: #9aa6b2;
  --none-bg: #1c242e;
  --mode-tra: #9a9aff;
  --on-mode-tra: #0a0a3a;
  --mode-thsr: #ff8a5b;
  --on-mode-thsr: #10161d;
  --mode-metro: #6fa8e6;
  --mode-bus: #5ccb8a;
  --mode-bike: #f2a246;
  --mode-air: #6ea2ea;
  --mode-ship: #4cc9d3;
  --mode-afr: #6cc08c;
  --mode-walk: #9aa6b2;
  --on-mode: #0b1016;
  --board: #070c18;
  --board-raise: #0d1428;
  --board-rule: #1a2540;
  --board-text: #f2f5fa;
  --board-dim: #a9b5cb;
  --board-amber: #ffb547;
  --board-green: #4ade80;
  --board-red: #ff8f8f;
  --board-yellow: #ffd000;
  --board-cyan: #67e8f9;
  --board-blue: #8ab4ff;
  --board-tra: #090980;
  --board-thsr: #db5325;
  --board-air: #0b2a5e;
  --board-ship: #05323a;
  --board-bus: #0c0803;
  --led-amber: #ffa62b;
  --shadow-panel: 0 1px 0 rgba(0, 0, 0, 0.5);
  --shadow-board: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

[data-theme="contrast"] {
  --ground: #ffffff;
  --panel: #ffffff;
  --panel-sunk: #f0f0f0;
  --ink: #000000;
  --ink-muted: #1a1a1a;
  --rule: #000000;
  --border-control: #000000;
  --overhead: #000000;
  --on-overhead: #ffffff;
  --on-overhead-muted: #ffffff;
  --ai: #003e5c;
  --on-ai: #ffffff;
  --ai-tint: #e6f0f6;
  --exit: #ffd000;
  --exit-strong: #e6bb00;
  --on-exit: #000000;
  --focus-ring: #000000;
  --ok: #005a2e;
  --ok-bg: #e5f5ec;
  --warn: #6b3e00;
  --warn-bg: #fff2d9;
  --stop: #8a0e08;
  --stop-bg: #fde8e6;
  --none: #333333;
  --none-bg: #f0f0f0;
  --mode-tra: #090980;
  --on-mode-tra: #ffffff;
  --mode-thsr: #a83a12;
  --on-mode-thsr: #ffffff;
  --mode-metro: #1f4e80;
  --mode-bus: #145c33;
  --mode-bike: #8a4a00;
  --mode-air: #123f78;
  --mode-ship: #075159;
  --mode-afr: #1f4a2f;
  --mode-walk: #333333;
  --on-mode: #ffffff;
  --board: #000000;
  --board-raise: #000000;
  --board-rule: #ffffff;
  --board-text: #ffffff;
  --board-dim: #ffffff;
  --board-amber: #ffd000;
  --board-green: #7cff9e;
  --board-red: #ff8f8f;
  --board-yellow: #ffd000;
  --board-cyan: #9ff3ff;
  --board-blue: #a8c8ff;
  --board-tra: #090980;
  --board-thsr: #db5325;
  --board-air: #000000;
  --board-ship: #000000;
  --board-bus: #000000;
  --led-amber: #ffd000;
  --shadow-panel: none;
  --shadow-board: none;
  --shadow-pop: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ground: #0c1218;
    --panel: #141b23;
    --panel-sunk: #0a0f14;
    --ink: #e9eef3;
    --ink-muted: #a2aebb;
    --rule: #273240;
    --border-control: #6b7886;
    --overhead: #05080c;
    --on-overhead: #e9eef3;
    --on-overhead-muted: #93a0ad;
    --ai: #5ab0d9;
    --on-ai: #04131b;
    --ai-tint: #10283a;
    --exit: #ffd000;
    --exit-strong: #ffdc3a;
    --on-exit: #10161d;
    --focus-ring: #ffd000;
    --ok: #58d68d;
    --ok-bg: #0e2a1c;
    --warn: #f3b44c;
    --warn-bg: #2e220c;
    --stop: #ff8a80;
    --stop-bg: #33130f;
    --none: #9aa6b2;
    --none-bg: #1c242e;
    --mode-tra: #9a9aff;
    --on-mode-tra: #0a0a3a;
    --mode-thsr: #ff8a5b;
    --on-mode-thsr: #10161d;
    --mode-metro: #6fa8e6;
    --mode-bus: #5ccb8a;
    --mode-bike: #f2a246;
    --mode-air: #6ea2ea;
    --mode-ship: #4cc9d3;
    --mode-afr: #6cc08c;
    --mode-walk: #9aa6b2;
    --on-mode: #0b1016;
    --board: #070c18;
    --board-raise: #0d1428;
    --board-rule: #1a2540;
    --board-text: #f2f5fa;
    --board-dim: #a9b5cb;
    --board-amber: #ffb547;
    --board-green: #4ade80;
    --board-red: #ff8f8f;
    --board-yellow: #ffd000;
    --board-cyan: #67e8f9;
    --board-blue: #8ab4ff;
    --board-tra: #090980;
    --board-thsr: #db5325;
    --board-air: #0b2a5e;
    --board-ship: #05323a;
    --board-bus: #0c0803;
    --led-amber: #ffa62b;
    --shadow-panel: 0 1px 0 rgba(0, 0, 0, 0.5);
    --shadow-board: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

@media (prefers-contrast: more) {
  :root:not([data-theme]) {
    --ground: #ffffff;
    --panel: #ffffff;
    --panel-sunk: #f0f0f0;
    --ink: #000000;
    --ink-muted: #1a1a1a;
    --rule: #000000;
    --border-control: #000000;
    --overhead: #000000;
    --on-overhead: #ffffff;
    --on-overhead-muted: #ffffff;
    --ai: #003e5c;
    --on-ai: #ffffff;
    --ai-tint: #e6f0f6;
    --exit: #ffd000;
    --exit-strong: #e6bb00;
    --on-exit: #000000;
    --focus-ring: #000000;
    --ok: #005a2e;
    --ok-bg: #e5f5ec;
    --warn: #6b3e00;
    --warn-bg: #fff2d9;
    --stop: #8a0e08;
    --stop-bg: #fde8e6;
    --none: #333333;
    --none-bg: #f0f0f0;
    --mode-tra: #090980;
    --on-mode-tra: #ffffff;
    --mode-thsr: #a83a12;
    --on-mode-thsr: #ffffff;
    --mode-metro: #1f4e80;
    --mode-bus: #145c33;
    --mode-bike: #8a4a00;
    --mode-air: #123f78;
    --mode-ship: #075159;
    --mode-afr: #1f4a2f;
    --mode-walk: #333333;
    --on-mode: #ffffff;
    --board: #000000;
    --board-raise: #000000;
    --board-rule: #ffffff;
    --board-text: #ffffff;
    --board-dim: #ffffff;
    --board-amber: #ffd000;
    --board-green: #7cff9e;
    --board-red: #ff8f8f;
    --board-yellow: #ffd000;
    --board-cyan: #9ff3ff;
    --board-blue: #a8c8ff;
    --board-tra: #090980;
    --board-thsr: #db5325;
    --board-air: #000000;
    --board-ship: #000000;
    --board-bus: #000000;
    --led-amber: #ffd000;
    --shadow-panel: none;
    --shadow-board: none;
    --shadow-pop: none;
  }
}

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius-xs: 2px;
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;
  --radius-pill: 999px;
  --container: 1200px;
  --reading: 44rem;
  --header-h: 56px;
  --control-h: 44px;
  --font-sign: "Barlow Semi Condensed", "Barlow", "Hiragino Sans", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Yu Gothic UI", "Noto Sans JP", "Malgun Gothic", system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Noto Sans JP", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-num: "Barlow", "Barlow Semi Condensed", system-ui, sans-serif;
}

/*
 * YUCTS Transit 2026 — component stylesheet: the one source of component styles for the design
 * system (Claude Design "YUCTS Transit 2026", components/bundle.css) and the website (packages/ui).
 * Every colour, length and family comes from tokens.json through its custom properties (--ground,
 * --space-4, --radius-m, --board …). Class names start with yt-; modifiers --, parts __.
 * Concept: a station concourse. A light, cool shell under a dark overhead sign; the departure
 * boards are the luminous, dark displays of each operator; exit yellow marks the one action.
 */

/* ---------- Fonts ----------
 * Barlow and Barlow Semi Condensed (SIL OFL 1.1), self-hosted. The URLs are relative to this
 * stylesheet: /fonts on the site (it is served from /assets/), fonts/ in the design system. */
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/barlow-500-vietnamese.woff2") format("woff2");
  unicode-range:
    U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/barlow-500-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/barlow-500-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-700-vietnamese.woff2") format("woff2");
  unicode-range:
    U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-700-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-700-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-600-vietnamese.woff2") format("woff2");
  unicode-range:
    U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-600-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-600-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-700-vietnamese.woff2") format("woff2");
  unicode-range:
    U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-700-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-700-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* ---------- Language-aware font stacks ----------
 * Latin, figures and signs in Barlow (self-hosted, OFL); CJK in each language's system gothic.
 * --yt-font-ui for running text, --yt-font-sign for names, titles and boards, --yt-font-num for times. */
:root {
  --yt-cjk: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo;
  --yt-font-ui: system-ui, -apple-system, "Segoe UI", var(--yt-cjk), sans-serif;
  --yt-font-sign: "Barlow Semi Condensed", "Barlow", var(--yt-cjk), system-ui, sans-serif;
  --yt-font-num: "Barlow", "Barlow Semi Condensed", system-ui, sans-serif;
}
:lang(zh-TW) {
  --yt-cjk: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC";
}
:lang(zh-CN) {
  --yt-cjk: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Heiti SC";
}
:lang(ko) {
  --yt-cjk: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic";
}
:lang(en),
:lang(vi) {
  --yt-cjk: "Noto Sans", "Segoe UI";
}

/* ---------- Base ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--yt-font-ui);
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
a {
  color: var(--ai);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
img,
svg {
  max-width: 100%;
}
.yt-icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.yt-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
.yt-skip {
  position: absolute;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: -64px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--exit);
  color: var(--on-exit);
  font-weight: 700;
  border-radius: var(--radius-m);
}
.yt-skip:focus {
  top: var(--space-2);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Layout ---------- */
.yt-container {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--space-5));
  margin-inline: auto;
  padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .yt-container {
    padding-left: max(var(--space-5), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-5), env(safe-area-inset-right, 0px));
  }
}
.yt-main {
  padding-block: var(--space-5) var(--space-7);
}
.yt-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.yt-stack > * {
  margin: 0;
  min-width: 0;
}
.yt-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
.yt-between {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}
.yt-gap-1 {
  gap: var(--space-1);
}
.yt-gap-2 {
  gap: var(--space-2);
}
.yt-gap-3 {
  gap: var(--space-3);
}
.yt-gap-4 {
  gap: var(--space-4);
}
.yt-gap-5 {
  gap: var(--space-5);
}
.yt-gap-6 {
  gap: var(--space-6);
}
.yt-grow {
  flex: 1 1 auto;
  min-width: 0;
}
.yt-self-start {
  align-self: flex-start;
}
.yt-flush {
  margin: 0;
}
.yt-mt-2 {
  margin-top: var(--space-2);
}
.yt-mb-2 {
  margin-bottom: var(--space-2);
}
.yt-reading {
  max-width: var(--reading);
}
.yt-columns {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}
.yt-columns > * {
  min-width: 0;
}
@media (min-width: 960px) {
  .yt-columns--split {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
  .yt-columns--halves {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .yt-columns--aside {
    grid-template-columns: minmax(0, 1fr) 20rem;
  }
}
.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Type ---------- */
.yt-display,
.yt-title,
.yt-heading,
.yt-subheading {
  font-family: var(--yt-font-sign);
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
}
.yt-display {
  font-size: clamp(30px, 6vw, 40px);
  line-height: 1.12;
  letter-spacing: 0.01em;
}
.yt-title {
  font-size: clamp(24px, 4.4vw, 28px);
  line-height: 1.25;
}
.yt-heading {
  font-size: 21px;
  line-height: 1.35;
}
.yt-subheading {
  font-size: 17px;
  line-height: 1.4;
}
.yt-roman {
  font-family: var(--yt-font-sign);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}
.yt-lead {
  font-size: 18px;
  line-height: 1.6;
  max-width: var(--reading);
}
.yt-body {
  font-size: 16px;
}
.yt-small {
  font-size: 14px;
  line-height: 1.55;
}
.yt-caption {
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.yt-muted {
  color: var(--ink-muted);
}
.yt-label {
  font-family: var(--yt-font-sign);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
/* The region's local time with its zone (the script keeps it current). */
.yt-clock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.yt-clock .yt-time {
  color: var(--ink);
  font-size: 16px;
}
.yt-time,
.yt-num {
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0;
}
.yt-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.yt-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--ink);
}

/* ---------- Header: the overhead sign ---------- */
.yt-header {
  background: var(--overhead);
  color: var(--on-overhead);
}
.yt-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-h);
}
.yt-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--on-overhead);
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}
.yt-brand:hover {
  color: var(--on-overhead);
}
.yt-brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
}
.yt-brand__name {
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}
.yt-brand__name b {
  font-weight: 600;
  color: var(--on-overhead-muted);
}
.yt-brand__tag {
  display: none;
  font-size: 12.5px;
  color: var(--on-overhead-muted);
}
@media (min-width: 900px) {
  .yt-brand__tag {
    display: inline;
    padding-left: var(--space-3);
    margin-left: var(--space-1);
    border-left: 1px solid var(--on-overhead-muted);
  }
}
.yt-nav {
  display: flex;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Phones: the brand and the language on the first row, the regions on their own row below. */
@media (max-width: 639px) {
  .yt-header__inner {
    flex-wrap: wrap;
    row-gap: 0;
    padding-top: var(--space-2);
  }
  .yt-header__regions {
    order: 3;
    flex: 1 0 100%;
    margin-inline: calc(-1 * var(--space-3));
  }
  .yt-header .yt-nav a {
    min-height: 44px;
    font-size: 15px;
  }
  .yt-brand__name {
    font-size: 17px;
  }
}
.yt-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--header-h);
  padding: 0 var(--space-3);
  color: var(--on-overhead);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  box-shadow: inset 0 -4px 0 transparent;
}
.yt-nav a[aria-current="page"] {
  box-shadow: inset 0 -4px 0 var(--exit);
}
.yt-nav a:hover {
  box-shadow: inset 0 -4px 0 var(--on-overhead-muted);
}
.yt-nav .yt-tag {
  background: transparent;
  color: var(--on-overhead-muted);
  border-color: var(--on-overhead-muted);
}
.yt-langmenu {
  position: relative;
}
.yt-langmenu summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--on-overhead-muted);
  border-radius: var(--radius-pill);
  color: var(--on-overhead);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.yt-langmenu summary::-webkit-details-marker {
  display: none;
}
.yt-langmenu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 40;
  min-width: 11rem;
  padding: var(--space-2);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-pop);
}
.yt-langs {
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-langs a,
.yt-langs span {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-s);
  color: var(--ink);
  text-decoration: none;
}
.yt-langs a:hover {
  background: var(--ai-tint);
}
.yt-langs span[aria-current] {
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--exit);
}
/* The region's own bar under the header: the modes of that region. */
.yt-subnav {
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}
.yt-subnav ul {
  display: flex;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.yt-subnav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 46px;
  padding: 0 var(--space-3);
  color: var(--ink);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 -3px 0 transparent;
}
.yt-subnav a .yt-icon {
  color: var(--mode, var(--ink-muted));
}
.yt-subnav a[aria-current="page"] {
  box-shadow: inset 0 -3px 0 var(--ink);
}
.yt-subnav a:hover {
  background: var(--ground);
}
.yt-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.yt-breadcrumb li + li::before {
  content: "›";
  margin-right: var(--space-2);
  color: var(--ink-muted);
}
.yt-banner {
  background: var(--exit);
  color: var(--on-exit);
  font-weight: 600;
}
.yt-banner p {
  margin: 0;
  padding: var(--space-2) 0;
}

/* ---------- Footer ---------- */
.yt-footer {
  margin-top: var(--space-6);
  background: var(--panel);
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-muted);
}
.yt-footer__inner {
  display: grid;
  gap: var(--space-3);
  padding-block: var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
}
.yt-footer__inner p {
  margin: 0;
}
.yt-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-footer__links a {
  color: var(--ink);
}
.yt-credits {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Buttons ---------- */
.yt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-5);
  border: 2px solid var(--exit);
  border-radius: var(--radius-m);
  background: var(--exit);
  color: var(--on-exit);
  font: inherit;
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.yt-btn:hover {
  background: var(--exit-strong);
  border-color: var(--exit-strong);
  color: var(--on-exit);
}
.yt-btn--secondary {
  background: var(--panel);
  border-color: var(--border-control);
  color: var(--ink);
}
.yt-btn--secondary:hover {
  background: var(--ground);
  border-color: var(--ink);
  color: var(--ink);
}
.yt-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ai);
  padding-inline: var(--space-3);
}
.yt-btn--ghost:hover {
  background: var(--ai-tint);
  border-color: transparent;
  color: var(--ai);
}
.yt-btn--danger {
  background: var(--panel);
  border-color: var(--stop);
  color: var(--stop);
}
.yt-btn--danger:hover {
  background: var(--stop-bg);
  border-color: var(--stop);
  color: var(--stop);
}
.yt-btn--small {
  min-height: 36px;
  padding: 0 var(--space-3);
  font-size: 14px;
}
.yt-btn--block {
  display: flex;
  width: 100%;
}
/* A button whose label is a long name (路線簡圖（營運單位提供） in Vietnamese): it wraps rather than leave the screen. */
.yt-btn--wrap {
  max-width: 100%;
  padding-block: var(--space-2);
  white-space: normal;
  text-align: left;
}
.yt-btn:disabled,
.yt-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Forms ---------- */
.yt-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.yt-field__label {
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.yt-field__hint {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0;
}
.yt-field__error {
  font-size: 13px;
  color: var(--stop);
  font-weight: 600;
  margin: 0;
}
.yt-input,
.yt-select {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1.5px solid var(--border-control);
  border-radius: var(--radius-m);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
/* Safari draws date and time fields at a width of their own (and centres their text on iOS), which
   can push past a narrow field (owner, 2026-10-28: on a Mac, Safari overlapped or overflowed): they
   keep the field's width here, their text at the start like the other fields. */
.yt-input[type="date"],
.yt-input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
}
.yt-input::-webkit-date-and-time-value {
  text-align: start;
}
.yt-input:hover,
.yt-select:hover {
  border-color: var(--ink);
}
.yt-input[aria-invalid="true"] {
  border-color: var(--stop);
}
.yt-input--compact {
  width: auto;
  min-height: 36px;
  font-size: 14px;
}
textarea.yt-input {
  min-height: 7rem;
  padding: var(--space-2) var(--space-3);
  line-height: 1.5;
}
.yt-select {
  /* Prefixed too: a Safari before 15.4 ignores the plain property and draws its own arrow and height over ours. */
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 55%,
    calc(100% - 12px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.yt-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.yt-fieldset legend {
  padding: 0;
  margin-bottom: var(--space-2);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 14px;
}
.yt-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  cursor: pointer;
}
.yt-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ink);
}
.yt-check--sub {
  font-size: 14px;
  color: var(--ink-muted);
}
.yt-check--off {
  color: var(--ink-muted);
  cursor: not-allowed;
}
/* A segmented choice (radio buttons or links): the chosen one is filled. */
.yt-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  margin: 0;
  background: var(--panel-sunk);
  border-radius: var(--radius-pill);
  list-style: none;
}
.yt-segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.yt-segmented label,
.yt-segmented a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.yt-segmented input:checked + label,
.yt-segmented label:has(input:checked),
.yt-segmented a[aria-current="true"],
.yt-segmented a[aria-current="page"] {
  background: var(--ink);
  color: var(--panel);
}
.yt-segmented input:focus-visible + label,
.yt-segmented label:has(input:focus-visible) {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Key figures: the numbers that matter most on a page, on the departure-board ground ---------- */
.yt-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: var(--space-2);
  margin: 0;
}
.yt-stats__item {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--board);
  color: var(--board-text);
  box-shadow: var(--shadow-board);
}
.yt-stats__item dt {
  font-size: 12px;
  color: var(--board-dim);
}
.yt-stats__item dd {
  margin: 0;
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.yt-stats__item--ok dd {
  color: var(--board-green);
}
.yt-stats__item--info dd {
  color: var(--board-cyan);
}
.yt-stats__item--warn dd {
  color: var(--board-amber);
}
.yt-stats__item--stop dd {
  color: var(--board-red);
}

/* ---------- Meter: what is taken and what is free of one thing, as one bar (an SVG of the thing's size); the figures beside it say the same in words ---------- */
.yt-meter {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--panel-sunk);
  overflow: hidden;
}
.yt-meter__a {
  fill: var(--ok);
}
.yt-meter__b {
  fill: var(--ai);
}

/* ---------- Panels ---------- */
.yt-card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-panel);
  padding: var(--space-4);
  min-width: 0;
}
@media (min-width: 720px) {
  .yt-card {
    padding: var(--space-5);
  }
}
/* A panel with a colour band on top, like a station sign: --line or a mode. */
.yt-card--band {
  border-top: 6px solid var(--line, var(--ink));
}
.yt-card--sunk {
  background: var(--panel-sunk);
  box-shadow: none;
}
.yt-card--flat {
  box-shadow: none;
}
a.yt-card {
  display: block;
  color: var(--ink);
  text-decoration: none;
}
a.yt-card:hover {
  border-color: var(--ink);
}
.yt-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--yt-font-sign);
  font-weight: 700;
}
a.yt-tile:hover {
  border-color: var(--ink);
}
.yt-tile .yt-mode {
  flex: none;
}
.yt-tile small {
  display: block;
  font-family: var(--yt-font-ui);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Tags, pills, lamps ---------- */
.yt-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-s);
  background: var(--panel);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.yt-tag--quiet {
  border-color: var(--rule);
  color: var(--ink-muted);
  background: transparent;
}
.yt-tag--ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--panel);
}
/* Where a bus only lets passengers on (只上車) or off (只下車): the word says it, the colour helps. */
.yt-tag--on {
  border-color: var(--ok-bg);
  background: var(--ok-bg);
  color: var(--ok);
}
.yt-tag--off {
  border-color: var(--warn-bg);
  background: var(--warn-bg);
  color: var(--warn);
}
/* Status: always a word and an icon or lamp, never colour alone. */
.yt-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-3) 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.yt-status--ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.yt-status--delay {
  background: var(--warn-bg);
  color: var(--warn);
}
.yt-status--stop {
  background: var(--stop-bg);
  color: var(--stop);
}
.yt-status--info {
  background: var(--ai-tint);
  color: var(--ai);
}
.yt-status--none {
  background: var(--none-bg);
  color: var(--none);
}
.yt-lamp {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--none);
}
.yt-lamp--ok {
  background: var(--ok);
}
.yt-lamp--delay {
  background: var(--warn);
}
.yt-lamp--stop {
  background: var(--stop);
}
.yt-lamp--none {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--none);
}
.yt-lamp--live {
  background: var(--ok);
  animation: yt-pulse 2.4s ease-in-out infinite;
}
@keyframes yt-pulse {
  50% {
    opacity: 0.35;
  }
}

/* ---------- Notices ---------- */
.yt-notice {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--ai-tint);
  color: var(--ink);
  border-left: 4px solid var(--ai);
}
.yt-notice__icon {
  flex: none;
  color: var(--ai);
  padding-top: 2px;
}
.yt-notice__body {
  min-width: 0;
}
.yt-notice__body > * {
  margin: 0;
}
.yt-notice__body > * + * {
  margin-top: var(--space-1);
}
.yt-notice__title {
  font-family: var(--yt-font-sign);
  font-weight: 700;
}
.yt-notice--point {
  background: var(--ok-bg);
  border-left-color: var(--ok);
}
.yt-notice--point .yt-notice__icon {
  color: var(--ok);
}
.yt-notice--caution {
  background: var(--warn-bg);
  border-left-color: var(--warn);
}
.yt-notice--caution .yt-notice__icon {
  color: var(--warn);
}
.yt-notice--alert {
  background: var(--stop-bg);
  border-left-color: var(--stop);
}
.yt-notice--alert .yt-notice__icon {
  color: var(--stop);
}
.yt-notice--quiet {
  background: var(--none-bg);
  border-left-color: var(--none);
}

/* ---------- Tabs ---------- */
/* Tabs wrap onto a second row rather than hide a tab off screen. */
.yt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 2px solid var(--rule);
}
.yt-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0 var(--space-4);
  margin-bottom: -2px;
  border-bottom: 3px solid transparent;
  color: var(--ink-muted);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.yt-tabs__tab[aria-current="page"],
.yt-tabs__tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--ai);
}
.yt-tabs__tab:hover {
  color: var(--ink);
}

/* ---------- Tables ---------- */
.yt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--panel);
}
.yt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.yt-table th,
.yt-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
  /* Columns are as wide as their longest word: the page's "anywhere" would let a column shrink to
     a letter (OpenStre|etMap); a word longer than the row still breaks, and the wrap scrolls. */
  overflow-wrap: break-word;
}
.yt-table thead th {
  background: var(--panel-sunk);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.yt-table tbody tr:last-child > * {
  border-bottom: 0;
}
.yt-table tbody tr:hover {
  background: var(--ground);
}
@media (max-width: 719px) {
  .yt-table--stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .yt-table--stack tr {
    display: block;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--rule);
  }
  .yt-table--stack td {
    display: grid;
    grid-template-columns: 7.5em minmax(0, 1fr);
    gap: var(--space-2);
    border: 0;
    padding: var(--space-1) var(--space-3);
  }
  .yt-table--stack td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--ink-muted);
    font-size: 13px;
  }
}
.yt-kv {
  container-type: inline-size;
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.yt-kv > div {
  display: grid;
  grid-template-columns: minmax(7em, 14em) minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--rule);
}
.yt-kv dt {
  font-weight: 700;
  color: var(--ink-muted);
  font-size: 14px;
}
.yt-kv dd {
  margin: 0;
  min-width: 0;
}
/* A narrow list (a phone, a side column): each value under its name. */
@container (max-width: 26rem) {
  .yt-kv > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* ---------- Modes, lines, station codes, train types ---------- */
.yt-mode {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-s);
  background: var(--mode, var(--mode-walk));
  color: var(--on-mode);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.4;
  white-space: nowrap;
}
.yt-mode--tra {
  --mode: var(--mode-tra);
  color: var(--on-mode-tra);
}
.yt-mode--thsr {
  --mode: var(--mode-thsr);
  color: var(--on-mode-thsr);
}
.yt-mode--metro {
  --mode: var(--mode-metro);
}
.yt-mode--bus {
  --mode: var(--mode-bus);
}
.yt-mode--bike {
  --mode: var(--mode-bike);
}
.yt-mode--air {
  --mode: var(--mode-air);
}
.yt-mode--ship {
  --mode: var(--mode-ship);
}
.yt-mode--afr {
  --mode: var(--mode-afr);
}
.yt-mode--walk {
  --mode: var(--mode-walk);
}
/* The same colours as an attribute: an icon, a band or a tile in its mode's colour. */
[data-mode="tra"] {
  --mode: var(--mode-tra);
}
[data-mode="thsr"] {
  --mode: var(--mode-thsr);
}
[data-mode="metro"] {
  --mode: var(--mode-metro);
}
[data-mode="bus"] {
  --mode: var(--mode-bus);
}
[data-mode="bike"] {
  --mode: var(--mode-bike);
}
[data-mode="air"] {
  --mode: var(--mode-air);
}
[data-mode="ship"] {
  --mode: var(--mode-ship);
}
[data-mode="afr"] {
  --mode: var(--mode-afr);
}
[data-mode="walk"] {
  --mode: var(--mode-walk);
}
/* A line: its official colour as --line, its code filled, its name beside. */
.yt-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  white-space: nowrap;
}
.yt-line__code {
  display: inline-grid;
  place-items: center;
  min-width: 2em;
  padding: 1px var(--space-1);
  border-radius: var(--radius-s);
  background: var(--line, var(--mode-metro));
  color: var(--line-ink, var(--board-text));
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}
/* A station number (BL12, 1000): a white plate ringed in the line colour. */
.yt-code {
  display: inline-grid;
  place-items: center;
  min-width: 2.6em;
  padding: 0 var(--space-1);
  border: 2.5px solid var(--line, var(--ink));
  border-radius: var(--radius-s);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--yt-font-num);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: nowrap;
}
.yt-codes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Train types, as on Taiwan Railway's boards: express red, limited orange, local blue. */
.yt-train {
  display: inline-block;
  padding: 0 var(--space-1);
  border: 1.5px solid currentColor;
  border-radius: var(--radius-xs);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 0.82em;
  line-height: 1.45;
  white-space: nowrap;
  color: var(--ink);
}
.yt-train--express {
  color: var(--stop);
}
.yt-train--limited {
  color: var(--warn);
}
.yt-train--local {
  color: var(--ai);
}

/* ---------- Station sign (駅名標): the station page's header ---------- */
.yt-sign {
  --line: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  text-align: center;
}
.yt-sign__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-4) var(--space-4);
}
.yt-sign__kicker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: 0;
}
.yt-sign__name {
  margin: 0;
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: clamp(34px, 7vw, 48px);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-wrap: balance;
}
.yt-sign__roman {
  margin: 0;
  font-family: var(--yt-font-sign);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.yt-sign__band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  background: var(--line);
  color: var(--line-ink, var(--on-mode));
  font-family: var(--yt-font-sign);
  font-weight: 700;
}
/* Neighbour names wrap rather than lose their ends. */
.yt-sign__band a {
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.yt-sign__band a:hover {
  text-decoration: underline;
}
.yt-sign__prev {
  justify-self: start;
}
.yt-sign__next {
  justify-self: end;
  text-align: right;
}
.yt-sign__prev::before {
  content: "◀ ";
  font-size: 0.75em;
}
.yt-sign__next::after {
  content: " ▶";
  font-size: 0.75em;
}
.yt-sign__band .yt-sign__line {
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}
/* Phones: the line on its own row, the neighbours below it at either end. */
@media (max-width: 639px) {
  .yt-sign__band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    row-gap: var(--space-1);
    padding-block: var(--space-2);
  }
  .yt-sign__band > :first-child {
    grid-area: 2 / 1;
  }
  .yt-sign__band > :last-child {
    grid-area: 2 / 2;
  }
  .yt-sign__band > .yt-sign__line {
    grid-area: 1 / 1 / 2 / -1;
    justify-self: center;
    white-space: normal;
    text-align: center;
  }
}
.yt-sign__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--ink-muted);
}

/* The station's pages along the sign's foot: centred when they fit, scrolling when they do not. */
.yt-sign__tabs {
  padding-inline: var(--space-3);
  border-top: 1px solid var(--rule);
  border-bottom: 0;
}
.yt-sign__tabs > :first-child {
  margin-left: auto;
}
.yt-sign__tabs > :last-child {
  margin-right: auto;
}
.yt-sign__tabs .yt-tabs__tab {
  margin-bottom: 0;
  border-bottom-width: 4px;
}

/* ---------- Search form ---------- */
.yt-search {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-panel);
}
@media (min-width: 720px) {
  .yt-search {
    padding: var(--space-5);
  }
}
.yt-search__places {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: end;
}
.yt-search__group {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}
.yt-search__swap {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.yt-search__swap:hover {
  border-color: var(--ink);
}
.yt-search__when {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
}
.yt-search__tz {
  font-size: 12.5px;
  color: var(--ink-muted);
}
.yt-search__modes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.yt-search__modes .yt-check {
  padding: 0 var(--space-3) 0 var(--space-2);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  min-height: 38px;
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 14px;
}
.yt-search__modes .yt-check:has(input:checked) {
  border-color: var(--ink);
  background: var(--ground);
}

/* ---------- Data stamp and delayed times ---------- */
.yt-stamp {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.yt-updated {
  font-size: 12.5px;
  color: var(--ink-muted);
}
.yt-delayed {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-1);
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
}
.yt-delayed__was {
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  font-weight: 500;
}
.yt-delayed__now {
  color: var(--stop);
  font-weight: 700;
}
.yt-delayed__plus {
  color: var(--stop);
  font-size: 0.85em;
  font-weight: 700;
}
.yt-delayed__kind {
  font-family: var(--yt-font-ui);
  font-size: 12px;
  color: var(--ink-muted);
}

/* ---------- Boards ----------
 * A departure board is a dark display in every theme, as at the station. One table per board; its
 * cells name their role (__c-meta train type and number, __c-time, __c-dest, __c-plat, __c-extra,
 * __c-state) so that on a phone each row folds into two lines:
 *   time | destination | platform
 *   time | type, number, extra | state
 * Variants keep each operator's board grammar: --tra (blue head band), --thsr (orange strip,
 * non-reserved cars and seats), --metro (minutes to the next trains), --air (flight board),
 * --bus (amber dot-matrix LED), --ship (ferry board). */
.yt-board {
  --board-accent: var(--board-yellow);
  background: var(--board);
  color: var(--board-text);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-board);
  overflow: hidden;
  font-family: var(--yt-font-sign);
  min-width: 0;
}
.yt-board a {
  color: inherit;
  text-decoration: none;
}
.yt-board a:hover {
  text-decoration: underline;
  text-decoration-color: var(--board-dim);
}
.yt-board :focus-visible {
  outline-color: var(--board-yellow);
}
.yt-board__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--board-raise);
  border-bottom: 2px solid var(--board-rule);
}
.yt-board__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.yt-board__title small {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--board-dim);
  text-transform: uppercase;
}
.yt-board__clock {
  margin: 0;
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  color: var(--board-accent);
}
.yt-board__clock small {
  margin-left: var(--space-1);
  font-family: var(--yt-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--board-dim);
}
.yt-board__table {
  width: 100%;
  border-collapse: collapse;
}
.yt-board__table th {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--board-rule);
  color: var(--board-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  white-space: nowrap;
}
.yt-board__table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--board-rule);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  vertical-align: middle;
}
.yt-board__table tbody tr:nth-child(even) {
  background: var(--board-raise);
}
.yt-board__table tbody tr:last-child td {
  border-bottom: 0;
}
.yt-board__c-time {
  width: 1%;
  white-space: nowrap;
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 26px !important;
  font-weight: 700 !important;
}
.yt-board__c-time s,
.yt-board__was {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--board-dim);
  text-decoration-thickness: 2px;
}
.yt-board__c-time .yt-board__late {
  color: var(--board-amber);
}
/* A word where a time goes (尚未發車, 末班已過): smaller than a time, and it may wrap in a narrow column. */
.yt-board__c-time > [class*="yt-board__state--"] {
  display: inline-block;
  font-family: var(--yt-font-ui);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}
/* A time worked out from a delay is an estimate, and says so. */
.yt-board__est {
  display: block;
  font-family: var(--yt-font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--board-dim);
}
.yt-board__c-meta {
  width: 1%;
  white-space: nowrap;
}
.yt-board__no {
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin-left: var(--space-2);
}
/* A number that leads its cell (Taiwan Railway's boards: the number, then the type). */
.yt-board__c-meta > .yt-board__no:first-child {
  margin-left: 0;
}
.yt-board__no + .yt-train {
  margin-left: var(--space-2);
}
/* What TDX adds to a train type (EMU3000, 推拉式): quiet tags under the number and type. */
.yt-board__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: 2px;
  white-space: normal;
}
.yt-board__c-dest {
  font-size: 21px !important;
  font-weight: 700 !important;
}
.yt-board__via {
  margin-left: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--board-dim);
}
/* On a board (dark in every theme), a quiet tag reads in the board's own dim colour. */
.yt-board .yt-tag--quiet {
  color: var(--board-dim);
  border-color: var(--board-rule);
}
/* The same aircraft's other flight numbers (codeshares), under the number. */
.yt-board__also {
  display: block;
  margin-left: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--board-dim);
  white-space: normal;
}
/* A flight that has left or arrived (a train that has gone): kept on the board, dimmed, its words still read. */
.yt-board__table tbody tr.yt-board__row--past td,
.yt-board__table tbody tr.yt-board__row--past td * {
  color: var(--board-dim);
}
.yt-board__c-plat {
  width: 1%;
  text-align: center;
  white-space: nowrap;
  font-family: var(--yt-font-num);
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--board-cyan);
}
/* A flight board's terminal, in its own column before the gate (owner, 2026-10-30: 航廈與登機門不要擠在一起). */
.yt-board__c-term {
  width: 1%;
  text-align: center;
  white-space: nowrap;
  font-family: var(--yt-font-num);
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--board-text);
}
.yt-board__c-extra {
  white-space: nowrap;
  font-size: 15px !important;
}
.yt-board__c-state {
  width: 1%;
  min-width: 5.5em;
  max-width: 14em;
  text-align: right;
  font-size: 16px !important;
  font-weight: 700 !important;
  overflow-wrap: anywhere;
}
.yt-board__state--ok {
  color: var(--board-green);
}
.yt-board__state--late {
  color: var(--board-amber);
}
.yt-board__state--stop {
  color: var(--board-red);
}
.yt-board__state--none {
  color: var(--board-dim);
  font-weight: 600;
}
.yt-board__empty {
  margin: 0;
  padding: var(--space-5) var(--space-4);
  color: var(--board-dim);
  font-family: var(--yt-font-ui);
  font-size: 15px;
}
.yt-board__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border-top: 2px solid var(--board-rule);
  color: var(--board-dim);
  font-family: var(--yt-font-ui);
  font-size: 12.5px;
}
.yt-board__foot p {
  margin: 0;
}
/* Train types on boards. */
.yt-board .yt-train {
  color: var(--board-text);
}
.yt-board .yt-train--express {
  color: var(--board-red);
}
.yt-board .yt-train--limited {
  color: var(--board-amber);
}
.yt-board .yt-train--local {
  color: var(--board-blue);
}
.yt-board .yt-lamp--ok {
  background: var(--board-green);
}
.yt-board .yt-lamp--delay {
  background: var(--board-amber);
}
.yt-board .yt-lamp--stop {
  background: var(--board-red);
}
.yt-board .yt-lamp--none {
  box-shadow: inset 0 0 0 2px var(--board-dim);
}

/* Taiwan Railway: the blue head band. */
.yt-board--tra .yt-board__head {
  background: var(--board-tra);
  border-bottom-color: var(--board-tra);
}

/* High Speed Rail: an orange strip, non-reserved cars and seat lamps. */
.yt-board--thsr {
  --board-accent: var(--board-thsr);
}
.yt-board--thsr .yt-board__head {
  box-shadow: inset 0 5px 0 var(--board-thsr);
  padding-top: calc(var(--space-3) + 5px);
}
.yt-board--thsr .yt-board__clock {
  color: var(--board-text);
}
/* The cars and the seats wrap where they must, each seat mark in one piece, so a narrow board keeps
   room for the destination (real-data layout test, 2026-10-30: English at 768px was 20px too wide). */
.yt-board--thsr .yt-board__c-extra {
  white-space: normal;
}
.yt-cars {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.yt-cars small {
  font-family: var(--yt-font-sign);
  font-size: 12px;
  color: var(--board-dim);
}
.yt-seats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin-left: var(--space-3);
  font-size: 13px;
  color: var(--board-dim);
}
.yt-seats span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}
.yt-seat {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: var(--radius-xs);
  font-family: var(--yt-font-num);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.yt-seat--o {
  color: var(--board-green);
  box-shadow: inset 0 0 0 1.5px var(--board-green);
}
.yt-seat--l {
  color: var(--board-amber);
  box-shadow: inset 0 0 0 1.5px var(--board-amber);
}
.yt-seat--x {
  color: var(--board-red);
  box-shadow: inset 0 0 0 1.5px var(--board-red);
}

/* Metro: minutes to the next trains, the line's colour as a band. */
.yt-board--metro .yt-board__c-meta {
  box-shadow: inset 5px 0 0 var(--line, var(--mode-metro));
  padding-left: calc(var(--space-3) + 5px);
}
.yt-mins {
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 700;
}
.yt-mins small {
  margin-left: 2px;
  font-family: var(--yt-font-sign);
  font-size: 14px;
  color: var(--board-dim);
}
/* "Arriving" is a word, not a count: the sign face, small enough for the time column. */
.yt-mins--now {
  color: var(--board-yellow);
  font-family: var(--yt-font-sign);
  font-size: 18px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}
.yt-stopping {
  display: inline-block;
  padding: 0 var(--space-1);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  background: var(--board-rule);
  color: var(--board-text);
}
.yt-stopping--express {
  background: var(--board-amber);
  color: var(--board);
}

/* Airport: the flight board, yellow heads on airport blue. */
.yt-board--air {
  background: var(--board-air);
}
.yt-board--air .yt-board__head {
  background: var(--board-air);
  border-bottom-color: var(--board-rule);
}
.yt-board--air .yt-board__table th {
  color: var(--board-yellow);
}
.yt-board--air .yt-board__table tbody tr:nth-child(even),
.yt-board--ship .yt-board__table tbody tr:nth-child(even) {
  background: rgb(255 255 255 / 0.06);
}

/* Ferry: sea teal. */
.yt-board--ship {
  background: var(--board-ship);
  --board-accent: var(--board-cyan);
}
.yt-board--ship .yt-board__head {
  background: var(--board-ship);
}

/* Phones: each row folds into two lines. */
@media (max-width: 639px) {
  .yt-board__head {
    padding: var(--space-2) var(--space-3);
  }
  .yt-board__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .yt-board__table,
  .yt-board__table tbody {
    display: block;
  }
  .yt-board__table tbody tr {
    display: grid;
    grid-template-columns: 4.6em minmax(0, 1fr) auto;
    column-gap: var(--space-3);
    row-gap: 2px;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--board-rule);
  }
  .yt-board__table tbody tr:last-child {
    border-bottom: 0;
  }
  .yt-board__table td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .yt-board__c-time {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-size: 22px !important;
  }
  .yt-board__c-dest {
    grid-column: 2;
    grid-row: 1;
    font-size: 18px !important;
    min-width: 0;
  }
  .yt-board__c-plat {
    grid-column: 3;
    grid-row: 1;
    font-size: 20px !important;
    text-align: right;
  }
  /* The train class, number and operator wrap within the column. */
  .yt-board__c-meta {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-2);
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 15px !important;
    color: var(--board-dim);
  }
  .yt-board__c-meta .yt-board__no,
  .yt-board__c-meta .yt-board__via {
    margin-left: 0;
  }
  .yt-board__c-meta .yt-train {
    max-width: 100%;
    margin-left: 0;
    white-space: normal;
  }
  .yt-board__tags {
    margin-top: 0;
  }
  .yt-board__c-extra {
    grid-column: 2 / span 2;
    grid-row: 3;
    white-space: normal;
  }
  .yt-board__c-state {
    grid-column: 3;
    grid-row: 2;
    min-width: 0;
    max-width: 8.5em;
    justify-self: end;
    text-align: right;
    font-size: 14px !important;
  }
  /* A flight board keeps the terminal apart from the gate on a phone too: terminal, then gate, on the first line. */
  .yt-board--air .yt-board__table tbody tr {
    grid-template-columns: 4.6em minmax(0, 1fr) auto auto;
  }
  .yt-board--air .yt-board__c-term {
    grid-column: 3;
    grid-row: 1;
    font-size: 14px !important;
    color: var(--board-dim);
  }
  .yt-board--air .yt-board__c-plat {
    grid-column: 4;
  }
  .yt-board--air .yt-board__c-state {
    grid-column: 3 / span 2;
  }
  .yt-board--metro .yt-board__c-meta {
    box-shadow: none;
    padding-left: 0;
  }
  .yt-board--metro .yt-board__table tbody tr {
    box-shadow: inset 4px 0 0 var(--line, var(--mode-metro));
  }
  .yt-seats {
    margin-left: 0;
    margin-top: 2px;
  }
}

/* ---------- Service status (運行情報): a grid of lines, each a band, a lamp and a word ---------- */
.yt-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-matrix__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "band name"
    "band state";
  column-gap: var(--space-3);
  align-items: center;
  min-height: 58px;
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}
a.yt-matrix__item:hover {
  border-color: var(--ink);
}
.yt-matrix__band {
  grid-area: band;
  align-self: stretch;
  width: 8px;
  margin: calc(-1 * var(--space-2)) 0;
  background: var(--line, var(--mode-walk));
}
.yt-matrix__item[data-mode] > .yt-matrix__band {
  background: var(--mode);
}
.yt-matrix__name {
  grid-area: name;
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}
.yt-matrix__state {
  grid-area: state;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13.5px;
  font-weight: 700;
}
.yt-matrix__item--ok .yt-matrix__state {
  color: var(--ok);
}
.yt-matrix__item--delay .yt-matrix__state {
  color: var(--warn);
}
.yt-matrix__item--stop .yt-matrix__state {
  color: var(--stop);
}
.yt-matrix__item--none .yt-matrix__state {
  color: var(--none);
}
.yt-matrix__item--delay {
  border-color: var(--warn);
}
.yt-matrix__item--stop {
  border-color: var(--stop);
}
.yt-alerts {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Rail diagram: the stops of a train or a journey on a line in its colour ---------- */
.yt-rail {
  --line: var(--ink);
  --rail-time: 4.2em;
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-rail__stop {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-time) 28px minmax(0, 1fr) auto;
  column-gap: var(--space-2);
  align-items: center;
  min-height: 44px;
}
.yt-rail__stop::before {
  content: "";
  position: absolute;
  left: calc(var(--rail-time) + var(--space-2) + 11px);
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--line);
}
.yt-rail__stop:first-child::before {
  top: 50%;
}
.yt-rail__stop:last-child::before {
  bottom: 50%;
}
.yt-rail__time {
  grid-column: 1;
  text-align: right;
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 17px;
}
.yt-rail__dot {
  grid-column: 2;
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 14px;
  height: 14px;
  border: 4px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
}
.yt-rail__name {
  grid-column: 3;
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 17px;
  min-width: 0;
}
.yt-rail__name small {
  margin-left: var(--space-2);
  font-family: var(--yt-font-ui);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-muted);
}
.yt-rail__meta {
  grid-column: 4;
  font-size: 13.5px;
  color: var(--ink-muted);
  text-align: right;
}
.yt-rail__stop--pass .yt-rail__dot {
  width: 8px;
  height: 8px;
  border-width: 0;
  background: var(--panel);
}
.yt-rail__stop--pass .yt-rail__name,
.yt-rail__stop--pass .yt-rail__time {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-muted);
}
.yt-rail__stop--done .yt-rail__time,
.yt-rail__stop--done .yt-rail__name {
  color: var(--ink-muted);
}
.yt-rail__stop--done::before {
  opacity: 0.45;
}
/* Where the train is now: an exit-yellow marker on the line. */
.yt-rail__here {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-time) 28px minmax(0, 1fr);
  column-gap: var(--space-2);
  align-items: center;
  min-height: 34px;
}
.yt-rail__here::before {
  content: "";
  position: absolute;
  left: calc(var(--rail-time) + var(--space-2) + 11px);
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--line);
}
.yt-rail__marker {
  grid-column: 2;
  position: relative;
  z-index: 1;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--exit);
  color: var(--on-exit);
  box-shadow: 0 0 0 3px var(--panel);
}
.yt-rail__here p {
  grid-column: 3;
  margin: 0;
  font-weight: 700;
  font-size: 14px;
}
/* A journey: legs of different modes, with walks dotted. */
.yt-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}
.yt-timeline__leg {
  --line: var(--mode-walk);
  display: grid;
  grid-template-columns: 4.2em 28px minmax(0, 1fr);
  column-gap: var(--space-2);
}
.yt-timeline__time {
  text-align: right;
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
/* The word under a time (出發, 抵達). */
.yt-timeline__time small {
  display: block;
  font-family: var(--yt-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.yt-timeline__bar {
  justify-self: center;
  width: 6px;
  min-height: 100%;
  background: var(--line);
  border-radius: var(--radius-xs);
}
.yt-timeline__leg--walk .yt-timeline__bar {
  width: 0;
  background: none;
  border-left: 4px dotted var(--line);
}
.yt-timeline__stop {
  display: grid;
  grid-template-columns: 4.2em 28px minmax(0, 1fr);
  column-gap: var(--space-2);
  align-items: center;
  min-height: 40px;
}
.yt-timeline__dot {
  justify-self: center;
  width: 14px;
  height: 14px;
  border: 4px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--panel);
}
.yt-timeline__station,
.yt-timeline__name {
  font-family: var(--yt-font-sign);
  font-weight: 700;
}
.yt-timeline__ride {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  font-size: 14.5px;
}
.yt-timeline__passes summary {
  cursor: pointer;
  color: var(--ai);
  font-size: 14px;
}

/* ---------- Station timetable (時刻表): an hour per row, its minutes beside ---------- */
.yt-hours {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.yt-hours th,
.yt-hours td {
  border-bottom: 1px solid var(--rule);
  padding: var(--space-1) var(--space-2);
  vertical-align: top;
}
.yt-hours thead th {
  background: var(--panel-sunk);
  font-family: var(--yt-font-sign);
  font-size: 13px;
  text-align: left;
}
.yt-hours tbody th {
  width: 3em;
  background: var(--panel-sunk);
  font-family: var(--yt-font-num);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}
.yt-hours__mins {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-hours__mins a,
.yt-hours__mins span.yt-hours__item {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 2px var(--space-1);
  border-radius: var(--radius-xs);
  color: var(--ink);
  text-decoration: none;
}
.yt-hours__mins a:hover {
  background: var(--ai-tint);
}
.yt-hours__min {
  font-family: var(--yt-font-num);
  font-weight: 700;
  font-size: 18px;
}
.yt-hours__mark {
  font-size: 11px;
  font-weight: 700;
}
.yt-hours__mark--express {
  color: var(--stop);
}
.yt-hours__mark--limited {
  color: var(--warn);
}
.yt-hours__mark--local {
  color: var(--ai);
}
.yt-hours__mins .yt-hours__item--off {
  color: var(--ink-muted);
  text-decoration: line-through;
}
.yt-hours__nextday {
  display: block;
  font-family: var(--yt-font-ui);
  font-size: 11px;
  font-weight: 500;
}
.yt-hours__to {
  font-size: 11px;
  color: var(--ink-muted);
}
.yt-hours tr.yt-hours--now th {
  background: var(--exit);
  color: var(--on-exit);
}

/* ---------- Journeys (route results) ---------- */
.yt-journeys {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-journey {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
}
.yt-journey[aria-current="true"],
.yt-journey--chosen {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.yt-journey__times {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 24px;
}
.yt-journey__arrow {
  color: var(--ink-muted);
  font-size: 18px;
}
.yt-journey__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}
.yt-journey__facts b {
  color: var(--ink);
}
.yt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Weather ---------- */
.yt-weather {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
}
.yt-weather__now {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}
.yt-weather__icon {
  width: 48px;
  height: 48px;
  color: var(--ai);
}
.yt-weather__icon .yt-icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.3;
}
.yt-weather__temp {
  font-family: var(--yt-font-num);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.yt-weather__temp small {
  font-size: 20px;
  color: var(--ink-muted);
}
.yt-weather__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: 14px;
}
.yt-weather__facts dt {
  color: var(--ink-muted);
  font-size: 12.5px;
}
.yt-weather__facts dd {
  margin: 0;
  font-weight: 700;
}
.yt-weather__periods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-weather__periods li {
  display: grid;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  background: var(--panel-sunk);
  border-radius: var(--radius-s);
  font-size: 13.5px;
}
.yt-weather__periods b {
  font-family: var(--yt-font-num);
  font-size: 17px;
}

/* ---------- Station facilities ---------- */
.yt-facilities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-facilities li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
}
.yt-facilities__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-s);
  background: var(--ai);
  color: var(--on-ai);
}
.yt-facilities__icon .yt-icon {
  width: 22px;
  height: 22px;
}
.yt-facilities strong {
  font-family: var(--yt-font-sign);
}
.yt-facilities p {
  margin: var(--space-1) 0 0;
  font-size: 14px;
}

/* ---------- News ---------- */
.yt-news {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.yt-news li {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
}
.yt-news time {
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink-muted);
}
.yt-news a {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 559px) {
  .yt-news li {
    grid-template-columns: 1fr;
  }
}

/* ---------- Ads ---------- */
.yt-ad {
  display: grid;
  gap: var(--space-1);
  margin-block: var(--space-5);
}
.yt-ad__label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.yt-ad__unit {
  display: block;
  min-height: 100px;
  background: var(--panel-sunk);
  border-radius: var(--radius-s);
  overflow: hidden;
}
.yt-ad--wide .yt-ad__unit {
  min-height: 90px;
}
/* AdSense measures its unit's width from the <ins>, which must be a block (its own docs put it in a
   style attribute, which this site's CSP refuses): inline, Safari measured 0 and showed no ad. */
.yt-ad__unit > .adsbygoogle {
  display: block;
  width: 100%;
}

/* ---------- Image viewer: an official image (route map, facility map) shown on the page ---------- */
.yt-viewer {
  width: min(96vw, 1200px);
  height: min(92vh, 920px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.yt-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.yt-viewer::backdrop {
  background: rgba(16, 22, 29, 0.72);
}
.yt-viewer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
}
.yt-viewer__title {
  flex: 1 1 12em;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.yt-viewer__stage {
  position: relative;
  min-height: 0;
  overflow: auto;
  background: var(--panel-sunk);
}
/* Fitted (the default): the whole image in the stage and centred, its proportions kept. A
   percentage max-height does not hold in the stage's grid row (a tall map overflowed from the top
   left corner), so the image box fills the stage and object-fit places the picture in it. */
.yt-viewer__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
/* Full size: the image as large as it is, scrolled inside the stage (centred while it is narrower). */
.yt-viewer--full .yt-viewer__stage img {
  position: static;
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  margin: 0 auto;
  cursor: zoom-out;
}
.yt-viewer__state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--space-4);
  text-align: center;
  color: var(--ink-muted);
}
.yt-viewer__credit {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-muted);
}
@media (max-width: 599px) {
  .yt-viewer {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

/* ---------- Toggletip: an explanation behind a small "!" (hover, focus or tap), the text in the page without a script ---------- */
.yt-tipped {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}
.yt-tipped > :not(.yt-tip):not(.yt-tip__text) {
  min-width: 0;
}
.yt-tip {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid var(--border-control);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink-muted);
  font: 700 13px/1 var(--yt-font-num);
  cursor: help;
}
.yt-tip:hover,
.yt-tip[aria-expanded="true"] {
  border-color: var(--ai);
  color: var(--ai);
}
.yt-tip__text {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}
/* With the script: the text opens under its row as a bubble over what follows. */
.yt-tipped--live .yt-tip__text {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline: 0;
  z-index: 5;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}

/* ---------- Pages, documents, states ---------- */
.yt-pages {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-pages a,
.yt-pages span {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--yt-font-num);
  font-weight: 700;
}
.yt-pages span[aria-current] {
  background: var(--ink);
  color: var(--panel);
  border-color: var(--ink);
}
.yt-doc {
  max-width: var(--reading);
}
.yt-doc h2 {
  font-family: var(--yt-font-sign);
  font-size: 21px;
  margin: var(--space-6) 0 var(--space-2);
}
.yt-doc h3 {
  font-family: var(--yt-font-sign);
  font-size: 17px;
  margin: var(--space-5) 0 var(--space-1);
}
.yt-doc p,
.yt-doc li {
  line-height: 1.75;
}
.yt-state {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  padding: var(--space-6) 0;
}
.yt-state__code {
  font-family: var(--yt-font-num);
  font-weight: 700;
  font-size: 64px;
  line-height: 1;
  color: var(--ink-muted);
}
.yt-static {
  font-size: 14px;
  color: var(--ink-muted);
}

/* ---------- Regions (the global home) ---------- */
.yt-regions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-region {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  min-height: 12rem;
  padding: var(--space-5);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-top: 8px solid var(--line, var(--ink));
  border-radius: var(--radius-l);
  color: var(--ink);
  text-decoration: none;
}
a.yt-region:hover {
  border-color: var(--ink);
  border-top-color: var(--line, var(--ink));
}
.yt-region__name {
  margin: 0;
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
}
.yt-region__roman {
  margin: 0;
  font-family: var(--yt-font-sign);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.yt-region--planned {
  background: var(--panel-sunk);
  border-top-style: dashed;
}
/* A region or feature not open yet: what it will hold and where it stands. */
.yt-preparing {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--panel);
  border: 2px dashed var(--border-control);
  border-radius: var(--radius-l);
}
.yt-preparing__stamp {
  justify-self: start;
  padding: var(--space-1) var(--space-4);
  border: 3px solid var(--ink);
  border-radius: var(--radius-s);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.2em;
}
.yt-checklist {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.yt-checklist li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
}
.yt-checklist .yt-icon {
  margin-top: 0.2em;
}

/* ---------- Admin ---------- */
/* A dark rail like the overhead sign (the brand and the menu), the page beside it from 960px. On
 * narrower screens the rail is a band on top and the menu wraps as chips. */
.yt-admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  background: var(--ground);
}
.yt-admin__side {
  padding: var(--space-3) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-3) max(var(--space-4), env(safe-area-inset-left, 0px));
  background: var(--overhead);
  color: var(--on-overhead);
}
.yt-admin__side nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}
.yt-admin__group {
  display: none;
}
.yt-admin__nav {
  display: contents;
}
.yt-admin__nav li {
  list-style: none;
}
.yt-admin__nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--on-overhead-muted);
  border-radius: var(--radius-pill);
  color: var(--on-overhead);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.yt-admin__nav a:hover {
  border-color: var(--on-overhead);
}
.yt-admin__nav a[aria-current="page"] {
  background: var(--exit);
  border-color: var(--exit);
  color: var(--on-exit);
}
@media (min-width: 960px) {
  .yt-admin {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
  .yt-admin__side {
    padding: var(--space-5) var(--space-3);
  }
  .yt-admin__side nav {
    display: block;
    margin-top: var(--space-3);
  }
  .yt-admin__group {
    display: block;
    margin: var(--space-4) 0 var(--space-1);
    padding: 0 var(--space-2);
    font-family: var(--yt-font-sign);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--on-overhead-muted);
    text-transform: uppercase;
  }
  .yt-admin__nav {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
  }
  .yt-admin__nav a {
    min-height: 40px;
    padding: 0 var(--space-2);
    border: 0;
    border-radius: var(--radius-s);
  }
  .yt-admin__nav a:hover {
    box-shadow: inset 3px 0 0 var(--on-overhead-muted);
  }
  .yt-admin__nav a[aria-current="page"]:hover {
    box-shadow: none;
  }
}
.yt-admin__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--space-5);
  min-width: 0;
  padding: var(--space-4) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-7) max(var(--space-4), env(safe-area-inset-left, 0px));
}
@media (min-width: 720px) {
  .yt-admin__main {
    padding: var(--space-5) var(--space-6) var(--space-7);
  }
}
/* The page's title row: the title keeps room for itself; the account cluster (language, who is
 * signed in, sign out) moves below it when both do not fit. */
.yt-admin__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--ink);
}
.yt-admin__top > .yt-title {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
}
.yt-admin__account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  font-size: 14px;
  color: var(--ink-muted);
}
/* The language menu is made for the overhead bar; on the light title row it takes the page's ink. */
.yt-admin__top .yt-langmenu summary {
  border-color: var(--border-control);
  color: var(--ink);
}
.yt-admin-form {
  display: grid;
  gap: var(--space-3);
  max-width: 34rem;
}
.yt-inline-form {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.yt-secret {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  word-break: break-all;
  padding: var(--space-3);
  background: var(--panel-sunk);
  border-radius: var(--radius-s);
}

/*
 * YUCTS Transit 2026 — page layouts of the website (not design-system components): how each page
 * arranges the components of components.css. The same tokens; pages carry no style attributes.
 */

/* ---------- Shell: the footer stays at the bottom of short pages ---------- */
.yt-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.yt-page > .yt-main {
  flex: 1 0 auto;
}
.yt-page-head {
  display: grid;
  gap: var(--space-2);
}
.yt-page-head .yt-lead {
  margin: 0;
}
.yt-display br {
  display: none;
}
@media (min-width: 600px) {
  .yt-display br {
    display: inline;
  }
}

/* Helpers (pages carry no style attributes). */
.yt-self-start {
  justify-self: start;
  align-self: start;
}
.yt-align-start {
  align-self: start;
}
.yt-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.yt-grow {
  flex: 1 1 auto;
}
.yt-mt-2 {
  margin-top: var(--space-2);
}
.yt-body-small {
  font-size: 14px;
}
.yt-inline-form {
  display: inline;
}
.yt-code-block {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--panel-sunk);
  border-radius: var(--radius-s);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

/* ---------- Searches above lists (stations, buses, ferries, islands) ---------- */
.rail-find,
.bus-find {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-panel);
}
.rail-find .yt-field {
  flex: 1 1 260px;
  min-width: 0;
}
.bus-find__area {
  flex: 1 1 160px;
  min-width: 0;
}
.bus-find__q {
  flex: 2 1 220px;
  min-width: 0;
}
.rail-source,
.bus-source {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}

/* Station suggestions under a search box (the script adds the list). */
.rail-suggest {
  position: relative;
}
.rail-suggest__list,
.rail-suggest__empty {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  inset-inline: 0;
  box-sizing: border-box;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-pop);
}
.rail-suggest__list {
  max-height: min(60vh, 22rem);
  overflow-y: auto;
  padding: var(--space-1);
  list-style: none;
}
.rail-suggest__empty {
  padding: var(--space-2) var(--space-3);
  color: var(--ink-muted);
  font-size: 14px;
}
.rail-suggest__option {
  display: grid;
  gap: 2px;
  min-height: 44px;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-s);
  cursor: pointer;
}
.rail-suggest__option:hover,
.rail-suggest__option[aria-selected="true"] {
  background: var(--ai-tint);
}
.rail-suggest__option[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--exit);
}
.rail-suggest__name {
  font-family: var(--yt-font-sign);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.rail-suggest__detail {
  color: var(--ink-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---------- Station page: the sign, the board and a side column ---------- */
.st-page {
  gap: var(--space-5);
}
.st-transfers {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.st-transfers > li {
  display: grid;
  gap: 2px;
  padding-block: var(--space-2);
  border-top: 1px solid var(--rule);
}
.st-transfers > li:first-child {
  padding-top: 0;
  border-top: 0;
}
.st-transfers__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: 32px;
  color: var(--ink);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.st-transfers__name:hover > span:last-child {
  text-decoration: underline;
}
.st-transfers__time {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Station index: each system a card under its mode band ---------- */
.rail-page {
  max-width: calc(var(--reading) + 64px);
}
.rail-page--index {
  max-width: none;
}
.rail-page--index > .rail-find {
  max-width: calc(var(--reading) + 64px);
}
.rail-places,
.rail-members,
.rail-lines,
.rail-chips,
.rail-singles {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rail-index {
  columns: 3 19rem;
  column-gap: var(--space-4);
}
.rail-index > .rail-operator {
  break-inside: avoid;
  margin-block-end: var(--space-4);
}
.rail-operator,
.rail-single,
.rail-place {
  border-top: 6px solid var(--mode, var(--ink));
}
.rail-operator {
  display: grid;
  align-content: start;
  gap: var(--space-2);
}
.rail-operator > .yt-heading,
.rail-place > .yt-heading {
  font-family: var(--yt-font-sign);
}
.rail-lines a,
.rail-members a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: 44px;
  padding-block: var(--space-1);
  border-radius: var(--radius-s);
  color: var(--ink);
  text-decoration: none;
}
/* The fill reaches past the text column without making the row wider than its list. */
.rail-lines a:hover,
.rail-members a:hover {
  background: var(--ground);
  box-shadow: 0 0 0 var(--space-2) var(--ground);
}
.rail-lines__name,
.rail-member__name {
  min-width: 0;
  font-family: var(--yt-font-sign);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.rail-code {
  color: var(--ink-muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.rail-lines .rail-code {
  margin-inline-start: auto;
}
.rail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.rail-chips a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  text-decoration: none;
}
.rail-chips a:hover {
  border-color: var(--ink);
}
.rail-singles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: var(--space-3);
}
.yt-card.rail-single {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
}
.rail-single .yt-heading {
  font-family: var(--yt-font-sign);
  font-size: 17px;
}
.rail-single .yt-heading a {
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
/* The whole card is the system's link. */
.rail-single .yt-heading a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.rail-single:hover {
  border-color: var(--ink);
  border-top-color: var(--mode, var(--ink));
}
.rail-single:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.rail-single .yt-heading a:focus-visible {
  outline: none;
}
.rail-single__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  font-size: 14px;
}
.rail-places {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-3);
  align-items: start;
}
.rail-place {
  display: grid;
  gap: var(--space-2);
}
.rail-place__shared {
  margin-inline-start: var(--space-2);
  font-weight: 400;
}
.rail-members {
  display: grid;
  gap: 0;
}

/* ---------- Line page: the line's own band, its stops on the rail diagram ---------- */
.ln-head {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-top: 10px solid var(--line, var(--ink));
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-panel);
}
.ln-head__kicker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
}
.ln-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0;
  font-family: var(--yt-font-sign);
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1.2;
}
.ln-head__title .yt-line__code {
  font-size: 0.6em;
}
.ln-head__ends {
  margin: 0;
  color: var(--ink-muted);
}
.ln-stops .yt-rail__name a {
  color: inherit;
  text-decoration: none;
}
.ln-stops .yt-rail__name a:hover {
  text-decoration: underline;
}
.ln-stops .yt-rail__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1);
}
@media (max-width: 479px) {
  .ln-stops .yt-rail__stop {
    grid-template-columns: 4.2em 28px minmax(0, 1fr);
  }
  .ln-stops .yt-rail__meta {
    grid-column: 3;
    justify-content: flex-start;
  }
  .ln-stops .yt-rail__meta:not(:empty) {
    padding-block-end: var(--space-2);
  }
}

/* ---------- Station timetable: the head under its mode band, a table per direction ---------- */
.tt-head {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-top: 10px solid var(--mode, var(--ink));
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-panel);
}
.tt-head__kicker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
}
.tt-head__title {
  margin: 0;
  font-family: var(--yt-font-sign);
  font-size: clamp(24px, 4.5vw, 34px);
  line-height: 1.2;
  text-wrap: balance;
}
.tt-head__meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}
.rail-dates ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.rail-dates a,
.rail-dates [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.rail-dates a:hover {
  border-color: var(--ink);
}
.rail-dates [aria-current] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--panel);
}
.tt-dirs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
@media (min-width: 1024px) {
  .tt-dirs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.tt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 13.5px;
}
.tt-legend b {
  color: var(--ink);
  font-family: var(--yt-font-sign);
}

/* ---------- Train page: the head as the train's own destination sign, its stops on the line ---------- */
.tr-head {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--board);
  color: var(--board-text);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-board);
  border-top: 8px solid var(--mode, var(--board-tra));
}
.tr-head__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}
.tr-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin: 0;
  font-family: var(--yt-font-sign);
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.15;
}
.tr-head .yt-train {
  font-size: 0.6em;
  align-self: center;
}
.tr-head .yt-train--express {
  color: var(--board-red);
}
.tr-head .yt-train--limited {
  color: var(--board-amber);
}
.tr-head .yt-train--local {
  color: var(--board-blue);
}
.tr-head .yt-train--other {
  color: var(--board-text);
}
/* A quiet tag on the dark head (加班車) reads in the board's dim colour, in either theme. */
.tr-head .yt-tag--quiet {
  color: var(--board-dim);
  border-color: var(--board-rule);
}
.tr-head__no {
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  color: var(--board-yellow);
}
.tr-head__to {
  color: var(--board-text);
}
.tr-head__meta {
  margin: 0;
  font-size: 13.5px;
  color: var(--board-dim);
}
/* What TDX adds to the type's name (EMU3000, 推拉式, 無自行車車廂), under the title. */
.tr-head__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0;
}
.tr-stops {
  --line: var(--mode, var(--ink));
  --rail-time: 5.4em;
}
.tr-stops .yt-rail__time {
  display: grid;
  justify-items: end;
  font-size: 16px;
}
.tr-stops .yt-rail__time small {
  font-family: var(--yt-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.tr-stops .yt-delayed {
  justify-content: flex-end;
  text-align: right;
}
.tr-stops .yt-rail__name a {
  color: inherit;
  text-decoration: none;
}
.tr-stops .yt-rail__name a:hover {
  text-decoration: underline;
}
.tr-stop--off .yt-rail__time {
  color: var(--ink-muted);
  text-decoration: line-through;
}
/* The stations a train passes, with estimated times: listed when the visitor ticks the box (owner, 2026-10-30). */
.tr-stops .yt-rail__stop--pass {
  display: none;
  min-height: 30px;
}
.tr-stops-card:has(.tr-passes-toggle input:checked) .tr-stops .yt-rail__stop--pass {
  display: grid;
}
/* Where the train waits for another, overtakes one or meets one: time, then what happens. */
.tr-encounters {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tr-encounters li {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);
  gap: var(--space-2);
  align-items: baseline;
}
.tr-encounters .yt-time {
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.tr-encounters .yt-time small {
  margin-left: var(--space-1);
  font-family: var(--yt-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.tr-encounters a {
  overflow-wrap: anywhere;
}
@media (max-width: 479px) {
  .tr-stops .yt-rail__stop {
    grid-template-columns: var(--rail-time) 28px minmax(0, 1fr);
  }
  .tr-stops .yt-rail__meta {
    grid-column: 3;
    text-align: left;
  }
  .tr-stops .yt-rail__meta:not(:empty) {
    padding-block-end: var(--space-2);
  }
}

/* ---------- Buses near a place: each stop and the routes that call there ---------- */
.near-stops {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.near-stops > li {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--mode-bus);
  border-radius: var(--radius-m);
}
.near-stops--compact > li {
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
  border-width: 0 0 0 4px;
  border-radius: 0;
}
.near-stop__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 var(--space-3);
}
.near-stop__head a {
  color: var(--ink);
  font-family: var(--yt-font-sign);
}
.near-stop__head small {
  color: var(--ink-muted);
  font-size: 13px;
}
.near-stop__routes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.near-stop__routes a {
  text-decoration: none;
}
.bus-line {
  --line: var(--mode-bus);
  --line-ink: var(--on-mode);
  max-width: 100%;
  white-space: normal;
}
.bus-line .yt-line__code {
  max-width: 100%;
  min-height: 24px;
  text-align: center;
  overflow-wrap: anywhere;
}
.st-more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-4);
  align-items: start;
}

/* ---------- Metro: first and last trains, the current headway ---------- */
.metro-firstlast {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.metro-firstlast li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-width: 0;
  padding-block: var(--space-2);
  border-top: 1px solid var(--rule);
}
.metro-firstlast li:first-child {
  border-top: 0;
}
.metro-firstlast li > span {
  overflow-wrap: anywhere;
}
.metro-firstlast .yt-time {
  margin-inline-start: auto;
}
.metro-headways tr[aria-current] td {
  font-weight: 700;
  background: var(--ai-tint);
}

/* A station tab's own head under the sign (the timetable's title, service day and dates). */
.tt-bar {
  display: grid;
  gap: var(--space-2);
}
.tt-bar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

/* ---------- Service status: system cards, their official messages, the quiet systems ---------- */
.st-systems {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}
@media (min-width: 960px) {
  .st-systems {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
.st-system {
  border-top: 6px solid var(--mode, var(--ink));
}
.st-system .yt-status,
.st-summary .yt-status {
  white-space: normal;
}
.st-alert {
  padding: var(--space-3) var(--space-4);
  background: var(--panel-sunk);
  border-left: 5px solid var(--rule);
  border-radius: var(--radius-s);
}
.st-alert--disrupted {
  border-left-color: var(--warn);
}
.st-alert--stopped {
  border-left-color: var(--stop);
}
.st-alert__text,
.st-alert__facts dd {
  overflow-wrap: anywhere;
}
.st-alert__facts dd {
  font-size: 14px;
}
.st-city + .st-city {
  padding-top: var(--space-2);
  border-top: 1px solid var(--rule);
}
.st-more summary {
  min-height: 32px;
  color: var(--ai);
  font-weight: 600;
  cursor: pointer;
}
.st-quiet th[scope="row"] {
  font-family: var(--yt-font-sign);
  font-weight: 700;
  text-align: left;
}
.st-quiet__times {
  display: grid;
  gap: 2px;
  font-size: 13px;
  color: var(--ink-muted);
}
.st-quiet tr:target {
  background: var(--ai-tint);
}
.st-board-foot {
  display: grid;
  justify-content: stretch;
}
.st-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.st-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}
.wx-caution ul {
  display: grid;
  gap: 2px;
  margin: var(--space-1) 0;
  padding-left: 1.2em;
}
/* When each warning applies (CWA's period), after the counties; it wraps on a narrow phone. */
.wx-caution__period {
  font-size: 13px;
  color: var(--ink-muted);
}
/* NCDR's disaster alerts: a category per row with its count, its alerts folded under it. */
.ncdr-group summary {
  cursor: pointer;
}
.ncdr-list {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}
.ncdr-list p {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- Home: choose a region ---------- */
.home-hero {
  display: grid;
  gap: var(--space-3);
  max-width: 48rem;
  padding-top: var(--space-4);
}
.home-hero .yt-lead {
  margin: 0;
}
.home-region {
  --line: var(--ai);
}
.home-region.yt-region--planned {
  --line: var(--border-control);
}
.home-modes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-region__cta {
  justify-self: start;
  margin-top: var(--space-2);
}
.home-steps {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.home-steps li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}
.home-steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-m);
  background: var(--overhead);
  color: var(--exit);
  font-family: var(--yt-font-num);
  font-weight: 700;
  font-size: 22px;
}
.home-steps h3,
.home-feature h3 {
  margin: 0;
  font-family: var(--yt-font-sign);
  font-size: 17px;
}
.home-steps p,
.home-feature p {
  margin: var(--space-1) 0 0;
  font-size: 14px;
  color: var(--ink-muted);
}
.home-features {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.home-feature {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
}
.home-feature > .yt-icon {
  width: 28px;
  height: 28px;
  color: var(--ai);
}

/* ---------- Taiwan: the hub ---------- */
.tw-modes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tw-mode {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 100%;
  box-sizing: border-box;
  padding: var(--space-3) var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 6px solid var(--mode, var(--ink));
  border-radius: var(--radius-m);
  color: var(--ink);
  text-decoration: none;
}
.tw-mode:hover {
  border-color: var(--ink);
  border-left-color: var(--mode, var(--ink));
}
.tw-mode__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-m);
  background: var(--mode, var(--ink));
  color: var(--on-mode);
}
.tw-mode[data-mode="tra"] .tw-mode__icon {
  color: var(--on-mode-tra);
}
.tw-mode__icon .yt-icon {
  width: 22px;
  height: 22px;
}
.tw-mode__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.tw-mode__text strong {
  font-family: var(--yt-font-sign);
  font-size: 17px;
}
.tw-mode__text span {
  font-size: 13px;
  color: var(--ink-muted);
}
.tw-train__fields {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 480px) {
  .tw-train__fields {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr);
  }
}
/* The side column of the hub is narrow: its train search stacks its fields. */
aside .tw-train__fields {
  grid-template-columns: minmax(0, 1fr);
}

/* ---------- Journey results: each journey a card that opens into its legs ---------- */
.jr-page {
  max-width: calc(var(--reading) + 160px);
}
.jr-edit > summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--panel);
  cursor: pointer;
}
.jr-edit[open] > summary {
  margin-bottom: var(--space-3);
}
.jr-item > details > summary {
  list-style: none;
  cursor: pointer;
}
.jr-item > details > summary::-webkit-details-marker {
  display: none;
}
.jr-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  min-height: 44px;
}
.jr-times small {
  margin-inline-start: 2px;
  font-family: var(--yt-font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.jr-modes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-inline-start: auto;
}
.jr-item > details[open] > .jr-summary {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
}
.jr-legs {
  margin-top: var(--space-3);
}
.jr-legs .yt-timeline__ride a,
.jr-legs .yt-timeline__name a {
  overflow-wrap: anywhere;
}
.jr-legs .yt-timeline__leg {
  --line: var(--mode-metro);
}
.jr-legs .yt-timeline__leg[data-line="TRA"] {
  --line: var(--mode-tra);
}
.jr-legs .yt-timeline__leg[data-line="THSR"] {
  --line: var(--mode-thsr);
}
.jr-legs .yt-timeline__leg[data-line="AFR"] {
  --line: var(--mode-afr);
}
.jr-legs .yt-timeline__leg--walk {
  --line: var(--mode-walk);
}
.jr-passes summary {
  color: var(--ai);
  font-size: 14px;
  cursor: pointer;
}
.yt-timeline__passes {
  display: grid;
  gap: 2px;
  margin: var(--space-2) 0 0;
  padding-left: 1.2em;
  font-size: 14px;
}
.jr-sort__off {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 var(--space-3);
  border: 1.5px dashed var(--rule);
  border-radius: var(--radius-pill);
  color: var(--ink-muted);
}
.jr-choices a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  color: var(--ink);
  text-decoration: none;
}
.jr-choices a:hover {
  border-color: var(--ink);
}
.jr-choices {
  gap: var(--space-2);
}

/* ---------- Buses: the search by county or city, a route's stops on its line, the LED estimates ---------- */
.bus-page {
  max-width: calc(var(--reading) + 160px);
}
.bus-list,
.bus-areas,
.bus-stops {
  margin: 0;
  padding: 0;
  list-style: none;
}
.bus-list {
  display: grid;
  gap: var(--space-2);
}
.bus-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-1) var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--mode-bus);
  border-radius: var(--radius-m);
  color: var(--ink);
  text-decoration: none;
}
.bus-list a:hover {
  border-color: var(--ink);
  border-left-color: var(--mode-bus);
}
.bus-list strong {
  font-family: var(--yt-font-sign);
}
.bus-list small {
  grid-column: 2;
  color: var(--ink-muted);
  font-size: 13px;
}
.bus-areas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: var(--space-2);
}
.bus-areas a,
.bus-areas__off {
  display: grid;
  gap: 2px;
  height: 100%;
  box-sizing: border-box;
  padding: var(--space-3);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--mode-bus);
  border-radius: var(--radius-m);
  color: var(--ink);
  text-decoration: none;
}
.bus-areas a:hover {
  border-color: var(--ink);
  border-top-color: var(--mode-bus);
}
.bus-areas strong {
  font-family: var(--yt-font-sign);
}
.bus-areas small {
  color: var(--ink-muted);
  font-size: 13px;
}
.bus-areas__off {
  background: var(--panel-sunk);
  border-top-style: dashed;
  border-top-color: var(--border-control);
  color: var(--ink-muted);
}
.bus-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  font-family: var(--yt-font-sign);
}
.bus-title .yt-line__code {
  padding: 2px var(--space-2);
  font-size: 0.75em;
}
.bus-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
}
.bus-facts div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.bus-facts dt {
  color: var(--ink-muted);
  font-size: 12px;
}
.bus-facts dd {
  margin: 0;
}
/* Every direction stays in view: the tabs wrap instead of scrolling sideways. */
.bus-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
}
.bus-tabs .yt-tabs__tab {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 100%;
  white-space: normal;
}
.bus-tab__sub {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 500;
}
/* A route's stops on its line, in the bus colour; each estimate an amber LED plate. */
.bus-stops {
  --line: var(--mode-bus);
}
.bus-stops li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  min-height: 46px;
}
.bus-stops li::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--line);
}
.bus-stops li:first-child::after {
  top: 50%;
}
.bus-stops li:last-child::after {
  bottom: 50%;
}
.bus-stops li::before {
  content: "";
  position: relative;
  z-index: 1;
  grid-column: 1;
  justify-self: center;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 4px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
}
.bus-stop {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.bus-stop a {
  color: var(--ink);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.bus-stop a:hover {
  text-decoration: underline;
}
.bus-stop small {
  font-size: 12px;
}
.bus-stop .yt-tag {
  justify-self: start;
}
.bus-eta {
  min-width: 4.8em;
  padding: 3px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--board-bus);
  color: var(--led-amber);
  font-family: var(--yt-font-sign);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.bus-eta:empty {
  visibility: hidden;
}
/* Under three minutes: the plate lights up. */
.bus-eta--soon {
  background: var(--led-amber);
  color: var(--board-bus);
}
/* Live data the page stopped asking for (10 minutes without the visitor touching it): faded until it asks again. */
[data-live-idle] .bus-eta,
[data-live-idle] [data-flight],
[data-live-idle] [data-sailing],
[data-live-idle] [data-plat],
[data-live-idle] [data-state],
[data-live-idle] [data-board-rows],
[data-live-idle] [data-rent],
[data-live-idle] [data-return] {
  opacity: 0.45;
}
.bus-bands,
.bus-times {
  margin: 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}
.bus-bands {
  display: grid;
  gap: var(--space-1);
}
.bus-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5em, 1fr));
  gap: var(--space-1) var(--space-2);
  font-family: var(--yt-font-num);
  font-weight: 700;
}
.locate {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
}

/* ---------- Public bikes: each station's bikes to rent and docks to return, as a dock display ---------- */
.bike-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.bike-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--mode-bike);
  border-radius: var(--radius-m);
}
.bike-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.bike-name strong {
  font-family: var(--yt-font-sign);
}
.bike-name small {
  color: var(--ink-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.bike-note:empty {
  display: none;
}
.bike-num {
  display: grid;
  justify-items: center;
  min-width: 4.4em;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-s);
  background: var(--board);
  color: var(--board-text);
}
.bike-num strong {
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  line-height: 1.15;
  color: var(--board-green);
}
.bike-num + .bike-num strong {
  color: var(--board-cyan);
}
.bike-num span {
  font-size: 11px;
  color: var(--board-dim);
}
@media (max-width: 419px) {
  .bike-list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .bike-name {
    grid-column: 1 / -1;
  }
  .bike-num {
    grid-row: 2;
  }
}
/* A city's stations (design p15b): the tools, then one line per station — name, meter, the two
   figures — or two lines on narrow screens; rows out of view are not laid out. */
.bike-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-4);
}
.bike-tools__filter {
  flex: 1 1 16rem;
}
.bike-tools__sort {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.bike-tools__has {
  min-height: var(--control-h);
  align-items: center;
}
.bike-list--city {
  gap: var(--space-1);
}
.bike-list--city li {
  grid-template-columns: minmax(0, 1fr) minmax(4rem, 8rem) auto auto;
  padding: var(--space-2) var(--space-3);
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
}
.bike-list--city .bike-num {
  min-width: 3.8em;
  padding: 2px var(--space-2);
}
.bike-list--city .bike-num strong {
  font-size: 18px;
}
@media (max-width: 599px) {
  .bike-list--city li {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .bike-list--city .bike-name {
    grid-column: 1 / -1;
  }
  .bike-list--city .yt-meter {
    grid-row: 2;
    grid-column: 1;
  }
  .bike-list--city .bike-num {
    grid-row: 2;
  }
}

/* ---------- Flights: each airport's destinations, the airports' boards, an airport's rail stations ---------- */
.air-routes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--space-3);
  align-items: start;
}
.air-routes > .yt-card {
  border-top: 5px solid var(--mode-air);
}
.air-dests,
.air-access,
.air-boards {
  margin: 0;
  padding: 0;
  list-style: none;
}
.air-dests,
.air-access {
  display: grid;
  gap: var(--space-1);
}
.air-dests li,
.air-access li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 var(--space-2);
  min-width: 0;
}
.air-dests small,
.air-access small {
  color: var(--ink-muted);
  font-size: 13px;
}
.air-flight {
  white-space: nowrap;
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.air-boards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
  gap: var(--space-2);
}
.air-boards a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-2) var(--space-3);
  background: var(--board-air);
  color: var(--board-text);
  border-radius: var(--radius-s);
  font-family: var(--yt-font-sign);
  font-weight: 700;
  text-decoration: none;
}
.air-boards a:hover {
  outline: 2px solid var(--board-yellow);
  outline-offset: -2px;
}
.air-boards__code {
  font-family: var(--yt-font-num);
  color: var(--board-yellow);
  letter-spacing: 0.05em;
}
/* The airport's or the port's own words on a board: the remark as given, cancellations in red. */
.air-live,
.ship-live {
  font-weight: 700;
}
.yt-board .live-cancel {
  color: var(--board-red);
}
.live-cancel {
  color: var(--stop);
}
.ship-live-note {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}
.yt-board .ship-live-note {
  color: var(--board-dim);
}
.ship-live-note:empty {
  display: none;
}

/* ---------- Ferries: routes, a route's facts, headways and its boards ---------- */
.ship-mark {
  display: inline-flex;
  color: var(--mode-ship);
}
.ship-facts {
  color: var(--ink-muted);
  font-size: 14px;
}
.ship-headways {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}
.ship-others summary {
  cursor: pointer;
  color: var(--ai);
}
.ship-routes {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.ship-routes a {
  border-left-color: var(--mode-ship);
}
.ship-routes a:hover {
  border-left-color: var(--mode-ship);
}

/* ---------- To the islands: flights and boats in their colours on the trip line ---------- */
.yt-timeline__leg.isl-leg--air {
  --line: var(--mode-air);
}
.yt-timeline__leg.isl-leg--ship {
  --line: var(--mode-ship);
}
.isl-risk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}
.isl-find .bus-find {
  margin-top: var(--space-3);
}
.isl-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Transit map: the panel beside the map on wide screens, above it on narrow ones ---------- */
.map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.map-panel {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  min-width: 0;
  padding: var(--space-4);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 960px) {
  .map-wrap {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .map-panel {
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }
}
.map-find {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2);
}
.map-find .yt-field {
  flex: 1 1 12em;
  min-width: 0;
}
.map-layers {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.map-layers legend {
  margin-bottom: var(--space-1);
  padding: 0;
  font-family: var(--yt-font-sign);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.map-layers .yt-check input {
  flex: none;
}
.map-results {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.map-results .yt-btn {
  justify-content: flex-start;
  width: 100%;
  text-align: start;
  white-space: normal;
}
.map-view {
  position: relative;
  min-width: 0;
}
/* The map's clock at another time than now (owner, 2026-10-30: 倍速與回看): said on the map itself. */
.map-replay {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 2;
  max-width: calc(100% - 2 * var(--space-2) - 48px);
  margin: 0;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-s);
  background: var(--exit);
  color: var(--on-exit);
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 14px;
  pointer-events: none;
}
.map-time__clock {
  margin: 0;
  font-family: var(--yt-font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.map-time__row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2);
}
.map-time__row .yt-field {
  min-width: 0;
}
.map-time__speeds,
.map-time__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}
.map-canvas {
  height: min(72vh, 680px);
  min-height: 360px;
  background: var(--panel-sunk);
}
.map-fallback {
  margin: 0;
  padding: var(--space-3) var(--space-4);
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--rule);
  font-size: 13px;
  list-style: none;
}
.map-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.map-legend__dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.map-legend__dot--tra {
  background: var(--mode-tra);
}
.map-legend__dot--hsr {
  background: var(--mode-thsr);
}
.map-legend__dot--afr {
  background: var(--mode-afr);
}
.map-legend__dot--metro {
  background: conic-gradient(var(--mode-metro) 0 25%, var(--stop) 0 50%, var(--exit) 0 75%, var(--mode-bus) 0);
}
.map-legend__dot--exit {
  width: 10px;
  height: 10px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--panel);
}
.map-legend__dot--alert {
  width: 14px;
  height: 14px;
  border: 3px solid var(--warn);
  box-sizing: border-box;
}
.map-legend__dot--train {
  width: 12px;
  height: 12px;
  background: var(--mode-tra);
  box-shadow:
    0 0 0 2px var(--panel),
    0 0 0 3px var(--mode-tra);
}
/* A level crossing: an exit-yellow disc ringed in ink, as on the map. */
.map-legend__dot--crossing {
  width: 10px;
  height: 10px;
  background: var(--exit);
  border: 1.5px solid var(--on-exit);
  box-sizing: border-box;
}
/* A train estimated from the timetable: a hollow ring, never the filled dot of a reported train. */
.map-legend__dot--estimated {
  background: var(--panel);
  border: 2.5px solid var(--mode-tra);
  box-sizing: border-box;
}
.map-legend__dot--est-metro {
  background:
    radial-gradient(circle, var(--panel) 0 42%, transparent 44%),
    conic-gradient(var(--mode-metro) 0 25%, var(--stop) 0 50%, var(--exit) 0 75%, var(--mode-bus) 0);
}
.map-legend__dot--bus {
  background: var(--mode-bus);
}
.map-legend__dot--air,
.map-legend__dot--ship {
  width: 16px;
  height: 0;
  border-radius: 0;
  border-top: 3px dashed var(--mode-air);
}
.map-legend__dot--ship {
  border-top-color: var(--mode-ship);
}
.map-view .maplibregl-popup-content {
  padding: var(--space-3);
  border-radius: var(--radius-s);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.map-view .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.map-view .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.map-view .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: var(--panel);
}
.map-view .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.map-view .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.map-view .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: var(--panel);
}
.map-view .maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--panel);
}
.map-view .maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--panel);
}
.map-popup {
  display: grid;
  gap: var(--space-1);
  padding-inline-end: var(--space-3);
  font-size: 14px;
}
.map-popup a,
.map-popup strong {
  font-family: var(--yt-font-sign);
  font-weight: 700;
}
.map-popup p {
  margin: 0;
  font-size: 13px;
}
.map-popup p.map-popup__where {
  color: var(--ink-muted);
}
.map-popup__has {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}
.map-popup__has li {
  padding: 0 var(--space-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
}
/* A train's start → end, under its name. */
.map-popup p.map-popup__route {
  font-size: 14px;
  font-weight: 600;
}
/* An estimated train: its 推估 tag and "!", the explanation opening under them inside the popup. */
.map-popup__est .yt-tip__text {
  font-size: 12.5px;
}
/* Follow the train: the map keeps it in the middle. */
.map-popup__follow {
  justify-self: start;
}

/* ---------- News: the operators' own words, newest first ---------- */
.news-page {
  max-width: calc(var(--reading) + 160px);
}
.news-item {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}
.news-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
}
.news-item__title {
  margin: 0;
  font-family: var(--yt-font-sign);
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.news-item__title a {
  color: var(--ink);
}
.news-item__body summary {
  color: var(--ai);
  font-size: 14px;
  cursor: pointer;
}
.news-item__body p {
  margin: var(--space-2) 0 0;
  font-size: 14.5px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ---------- Alishan Forest Railway: its lines on the diagram, its timetable ---------- */
/* Its badge where its stations and trains are listed with the others (journeys, the station search). */
[data-line="AFR"] {
  --line: var(--mode-afr);
  --line-ink: var(--on-mode);
}
.afr-head {
  --line: var(--mode-afr);
}
/* The long main line on the left, the short branches stacked beside it (one column on phones). */
.afr-lines {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}
@media (min-width: 760px) {
  .afr-lines {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}
.afr-stops {
  --line: var(--mode-afr);
  --rail-time: 4.6em;
}
.afr-stops .yt-rail__time {
  font-size: 14px;
  color: var(--ink-muted);
}
.afr-table .yt-time {
  font-size: 17px;
}
.afr-stops-detail summary {
  color: var(--ai);
  font-size: 13.5px;
  cursor: pointer;
}
.afr-stops-detail ol {
  display: grid;
  gap: 2px;
  margin: var(--space-2) 0 0;
  padding-left: 1.2em;
  font-size: 14px;
}

/* ---------- Admin: sign-in and setup pages (the admin shell is the design system's yt-admin) ---------- */
.yt-admin-login {
  display: grid;
  place-items: start center;
  padding-block: var(--space-7);
}
.yt-admin-login > .yt-card,
.yt-admin-login > form,
.yt-admin-login > section {
  box-sizing: border-box;
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: var(--space-4);
}
/* Members: a member button and its note; the member page's lists (a link and its remove button per row). */
.member-action {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.member-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.member-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--rule);
}
.member-list a {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

/* The 駅すぱあと route map preview (admin): the block rosen.js draws in. */
.rosen-map {
  inline-size: 100%;
  block-size: min(70vh, 520px);
  border: 1px solid var(--rule);
}

.yt-admin-form {
  display: grid;
  gap: var(--space-4);
  max-width: 640px;
}
.yt-admin-form .yt-btn {
  justify-self: start;
}
.yt-secret {
  display: block;
  padding: var(--space-3);
  background: var(--panel-sunk);
  border-radius: var(--radius-s);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  /* One click selects all of it, for copying by hand. */
  user-select: all;
}
/* API keys: an internal key has no limits or expiry to set (owner, 2026-10-30), so its form hides
   them; without :has() they stay visible and the server ignores them. */
.api-key-form:has(input[name="kind"][value="internal"]:checked) .api-key-limits {
  display: none;
}
