/* 終電前線 */
:root {
  --bg: #05070d;
  --panel: rgba(12, 16, 27, 0.74);
  --panel-solid: #0c111d;
  --panel-2: rgba(255, 255, 255, 0.045);
  --panel-3: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --text-2: #b8c0d0;
  --muted: #8a94aa;
  --faint: #5b6680;
  --accent: #ffb23f;
  --accent-ink: #1a1204;
  --hot: #ff6a55;
  --ok: #5fdca0;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
  --blur: saturate(140%) blur(18px);
  --r: 18px;
  --r-sm: 11px;
  --f-jp: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  --f-num: "Barlow Semi Condensed", "BIZ UDPGothic", "Helvetica Neue", Arial, sans-serif;
  --f-board: "DotGothic16", "Barlow Semi Condensed", ui-monospace, monospace;
  --gap: 14px;
  --timebar-h: 96px;
  color-scheme: dark;
}
body.day {
  --bg: #e9edf1;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --panel-2: rgba(16, 24, 40, 0.04);
  --panel-3: rgba(16, 24, 40, 0.07);
  --border: rgba(16, 24, 40, 0.08);
  --border-2: rgba(16, 24, 40, 0.14);
  --text: #121620;
  --text-2: #3b4353;
  --muted: #5f6879;
  --faint: #8b93a3;
  --accent: #d9771a;
  --accent-ink: #ffffff;
  --hot: #d9432f;
  --ok: #178a55;
  --shadow: 0 16px 40px rgba(20, 30, 50, 0.14), 0 2px 6px rgba(20, 30, 50, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-jp);
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, .track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .stat b { font-family: var(--f-num); font-feature-settings: "tnum" 1, "lnum" 1; }
.r-t, .rc-dep, .lg-t, .l-time, .st-table td.t, .fact .f-v b, .stops .s-t, .nexts span.n { font-variant-numeric: tabular-nums; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* ---------------------------------------------------------------- 駅名 */
.lbl {
  position: absolute; left: 0; top: 0;
  padding: 2px 7px 3px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
  color: var(--text);
  background: rgba(8, 11, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  transition: opacity 0.25s, color 0.4s;
  will-change: transform, opacity;
}
body.day .lbl { background: rgba(255, 255, 255, 0.86); border-color: rgba(16, 24, 40, 0.08); }
.lbl.dead { color: var(--muted); }
.lbl.sel { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-size: 13px; z-index: 2; }

.tip {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  max-width: 280px; padding: 9px 12px;
  background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow);
  font-size: 12.5px; line-height: 1.5;
}
.tip b { font-weight: 700; }
.tip .t-sub { color: var(--muted); font-size: 11.5px; }
.tip .t-last { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------------- 共通の部品 */
.panel {
  background: var(--panel);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.seg button {
  border: 0; background: transparent; padding: 7px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); transition: background 0.2s, color 0.2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg button .today { font-size: 9.5px; margin-left: 4px; color: var(--accent); vertical-align: 1px; }
.seg button[aria-pressed="true"] .today { color: var(--accent); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: 50%; box-shadow: var(--shadow); color: var(--text-2);
}
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.badge {
  --c: #888;
  display: inline-grid; place-items: center; flex: none;
  min-width: 28px; height: 28px; padding: 0 4px;
  border-radius: 50%; border: 3.5px solid var(--c); background: #fff; color: #111;
  font-family: var(--f-num); font-weight: 800; font-size: 11px; letter-spacing: -0.02em; line-height: 1;
}
.badge.sm { min-width: 22px; height: 22px; border-width: 3px; font-size: 9.5px; }
.badge.xs { min-width: 18px; height: 18px; border-width: 2.5px; font-size: 8px; }
.badge.wide { border-radius: 8px; padding: 0 5px; }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- 左上：題字と数字 */
.brand {
  position: fixed; left: 18px; top: 16px; z-index: 20;
  display: flex; align-items: center; gap: 11px; pointer-events: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
body.day .brand { text-shadow: none; }
.brand .mark { width: 42px; height: 42px; color: var(--text); flex: none; }
.brand h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: 0.16em; line-height: 1.1; }
.brand-en { margin: 3px 0 0; font-family: var(--f-num); font-size: 9.5px; font-weight: 700; letter-spacing: 0.28em; color: var(--muted); }
.stats {
  position: fixed; left: 18px; top: 76px; z-index: 20;
  display: flex; gap: 18px; pointer-events: none;
}
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 24px; font-weight: 700; line-height: 1.05; letter-spacing: 0; }
.stat span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; margin-top: 3px; }

/* ---------------------------------------------------------------- 右上：切り替え */
.controls { position: fixed; right: 16px; top: 16px; z-index: 20; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- 左のパネル */
.side {
  position: fixed; left: 16px; top: calc(128px + var(--gh, 4px)); bottom: calc(var(--timebar-h) + 28px); width: 336px; z-index: 15;
  display: flex; flex-direction: column; overflow: hidden;
}
.search { position: relative; display: flex; align-items: center; gap: 8px; margin: 12px 12px 8px; padding: 0 6px 0 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; }
.search > svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14.5px; padding: 11px 0; outline: none; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: 0.5; }
.geo { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0; }
.geo:hover { color: var(--text); background: var(--panel-3); }
.geo svg { width: 18px; height: 18px; }
.sugg {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 5;
  background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow);
  padding: 5px; max-height: 360px; overflow: auto;
}
.sugg button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 8px 9px; border-radius: 8px; }
.sugg button[aria-selected="true"], .sugg button:hover { background: var(--panel-3); }
.sugg .s-name { font-weight: 700; font-size: 14px; }
.sugg .s-lines { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 55%; }
.sugg .s-kind { font-size: 10.5px; color: var(--muted); margin-left: auto; }

.tabs { display: flex; gap: 4px; padding: 0 12px 8px; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; background: transparent; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--panel-3); }
.tabbody { flex: 1; overflow: auto; padding: 10px 12px 16px; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.sheet-grip { display: none; }

/* はじめに */
.home-lead { margin: 4px 2px 14px; font-size: 13.5px; color: var(--text-2); }
.home-lead b { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip { border: 1px solid var(--border-2); background: var(--panel-2); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.chip:hover { background: var(--panel-3); }
.home-h { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); margin: 18px 2px 8px; }
.legend { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.legend li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.lg { width: 34px; height: 10px; border-radius: 3px; position: relative; }
.lg.live { background: linear-gradient(90deg, #00b2e5 50%, #00b2e5 50%); box-shadow: 0 0 10px rgba(0, 178, 229, 0.5); }
.lg.dead { background: #2a3144; }
.lg.front::after { content: ""; position: absolute; right: -2px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 0 14px #fff; }
.lg.front { background: linear-gradient(90deg, #2a3144 0%, #2a3144 30%, #00b2e5 100%); }
.lg.lanes { background: linear-gradient(180deg, #80c241 0 50%, #2a3144 50% 100%); }
.lg.soon::after { content: ""; position: absolute; left: 11px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 178, 63, 0.25); }
.lg.soon { background: transparent; }
body.day .lg.dead, body.day .lg.front { background-color: #d5d9df; }

/* 路線一覧 */
.sort { display: flex; gap: 4px; margin: 2px 0 10px; }
.sort button { flex: 1; border: 1px solid var(--border); background: transparent; border-radius: 9px; padding: 6px 2px; font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.sort button[aria-pressed="true"] { background: var(--panel-3); color: var(--text); border-color: var(--border-2); }
.op-h { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); margin: 14px 4px 5px; }
.op-h:first-child { margin-top: 2px; }
.lrow {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 3px 10px; align-items: center;
  width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 8px; border-radius: 11px;
}
.lrow:hover { background: var(--panel-2); }
.lrow.on { background: var(--panel-3); }
.lrow .badge { grid-row: span 2; }
.lrow .l-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .l-time { font-family: var(--f-num); font-weight: 700; font-size: 16px; text-align: right; }
.lrow .l-spark { grid-column: 2; height: 16px; width: 100%; display: block; }
.lrow .l-left { font-size: 11px; text-align: right; color: var(--muted); white-space: nowrap; }
.lrow .l-left.soon { color: var(--accent); font-weight: 700; }
.lrow .l-left.done { color: var(--faint); }
.lrow.done .l-name, .lrow.done .l-time { color: var(--muted); }
.lrow .nodata { font-size: 10.5px; color: var(--faint); }

/* 今夜の記録 */
.fact { padding: 12px 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-2); margin-bottom: 9px; }
.fact .f-k { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.fact .f-v { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.fact .f-v b { font-family: var(--f-num); font-size: 22px; font-weight: 800; }
.fact .f-v span { font-weight: 700; }
.fact .f-s { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.fact button.linklike { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; font-size: 12px; margin-top: 6px; }

/* ---------------------------------------------------------------- 右の詳細 */
.detail {
  position: fixed; right: 16px; top: 72px; bottom: calc(var(--timebar-h) + 28px); width: 392px; z-index: 16;
  display: flex; flex-direction: column; overflow: hidden;
}
.detail .close, .about .close {
  position: absolute; right: 12px; top: 12px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--panel-3); display: grid; place-items: center; color: var(--text-2);
}
.detail .close svg, .about .close svg { width: 16px; height: 16px; }
#detailBody { flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.d-head { padding: 18px 56px 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel-solid); z-index: 2; }
body:not(.day) .d-head { background: linear-gradient(var(--panel-solid), rgba(12, 17, 29, 0.97)); }
.d-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); }
.d-title { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; font-size: 25px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
.d-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.d-sum { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.d-sum b { font-family: var(--f-num); font-size: 15px; color: var(--text); }
.d-sum .left { color: var(--accent); font-weight: 700; }
.d-sec { padding: 14px 18px 4px; }
.d-h { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 8px; }

.ln-block { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; overflow: hidden; background: var(--panel-2); }
.ln-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ln-head .ln-name { font-weight: 700; font-size: 13.5px; }
.ln-head .ln-op { font-size: 11px; color: var(--muted); margin-left: auto; }
.dir { padding: 10px 12px 11px; }
.dir + .dir { border-top: 1px dashed var(--border); }
.dir-label { font-size: 12px; color: var(--text-2); font-weight: 700; margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.dir-label .dl-left { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.dir-label .dl-left.done { color: var(--faint); }
.ladder { display: grid; gap: 3px; }
.rung { display: grid; grid-template-columns: 56px 1fr auto; align-items: baseline; gap: 10px; padding: 4px 6px; border-radius: 8px; }
.rung .r-t { font-family: var(--f-num); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.rung .r-to { font-size: 13px; font-weight: 700; }
.rung .r-to small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.rung .r-left { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rung.first { background: rgba(255, 178, 63, 0.09); }
.rung.first .r-t { color: var(--accent); }
.rung.gone { opacity: 0.42; }
.rung.gone .r-left { color: var(--faint); }
.nexts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; font-size: 11.5px; color: var(--muted); align-items: center; }
.nexts span.n { font-family: var(--f-num); font-weight: 700; color: var(--text-2); padding: 1px 7px; border-radius: 6px; background: var(--panel-3); }
.none { font-size: 12.5px; color: var(--muted); padding: 2px 6px; }

/* 路線の詳細：全駅の表 */
.st-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.st-table th { position: sticky; top: 0; background: var(--panel-solid); font-size: 10.5px; color: var(--muted); font-weight: 700; text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--border); }
.st-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.st-table td.t { font-family: var(--f-num); font-weight: 700; font-size: 14px; white-space: nowrap; }
.st-table td.t small { display: block; font-family: var(--f-jp); font-weight: 400; font-size: 10.5px; color: var(--muted); }
.st-table tr.gone td.t { color: var(--faint); }
.st-table td.name { font-weight: 700; }
.st-table tr:hover td { background: var(--panel-2); cursor: pointer; }
.src { font-size: 11.5px; color: var(--muted); line-height: 1.6; padding: 14px 18px 20px; }
.src a { color: var(--text-2); word-break: break-all; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--panel-3); color: var(--text-2); margin-right: 4px; }
.tag.ok { color: var(--ok); }

/* 列車の詳細 */
.stops { list-style: none; margin: 0; padding: 0 0 0 16px; position: relative; }
.stops::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--c, #888); opacity: 0.6; }
.stops li { position: relative; display: flex; gap: 10px; padding: 4px 0; font-size: 13px; }
.stops li::before { content: ""; position: absolute; left: -15px; top: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--panel-solid); border: 2px solid var(--c, #888); }
.stops li .s-t { font-family: var(--f-num); font-weight: 700; width: 44px; }
.stops li.past { color: var(--faint); }
.stops li.here::before { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2); }
.lastnote { margin: 12px 18px 0; padding: 10px 12px; border-radius: 11px; background: rgba(255, 178, 63, 0.1); color: var(--accent); font-weight: 700; font-size: 12.5px; }

/* ---------------------------------------------------------------- 時刻バー */
.timebar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 18;
  display: grid; grid-template-columns: 208px 1fr auto; align-items: center; gap: 18px;
  height: var(--timebar-h); padding: 10px 16px 10px 20px;
  background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow);
}
.clock p { margin: 0; }
.clock-cal { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock-time { font-family: var(--f-board); font-size: 46px; font-weight: 400; line-height: 1; letter-spacing: 0.02em; margin-top: 3px !important; color: var(--accent); text-shadow: 0 0 14px rgba(255, 178, 63, 0.45); }
body.day .clock-time { text-shadow: none; }
.clock-sub { font-size: 11px; color: var(--accent); font-weight: 700; margin-top: 4px !important; min-height: 16px; white-space: nowrap; }
.track-wrap { position: relative; height: 100%; display: flex; align-items: center; }
.track { position: relative; width: 100%; height: 64px; cursor: pointer; touch-action: none; border-radius: 10px; }
#hist { position: absolute; left: 0; top: 0; width: 100%; height: 44px; display: block; }
.ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; }
.ticks span { position: absolute; transform: translateX(-50%); font-family: var(--f-num); font-size: 10.5px; font-weight: 600; color: var(--muted); }
.ticks span.major { color: var(--text-2); }
.knob { position: absolute; top: -4px; width: 2px; height: 52px; margin-left: -1px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 12px rgba(255, 178, 63, 0.6); pointer-events: none; }
.knob::after { content: ""; position: absolute; left: 50%; top: -5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 178, 63, 0.25); }
.now-mark { position: absolute; top: -2px; width: 0; height: 48px; border-left: 1px dashed var(--text-2); pointer-events: none; opacity: 0.7; }
.now-mark span { position: absolute; top: -15px; left: 0; transform: translateX(-50%); font-size: 9.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.tb-btns { display: flex; align-items: center; gap: 8px; }
.round { width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: grid; place-items: center; }
.round svg { width: 22px; height: 22px; }
.pill { height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.pill.speed { font-family: var(--f-num); min-width: 54px; }
.pill.now.live { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.seg.range { box-shadow: none; }
.seg.range button { padding: 6px 10px; font-size: 11.5px; }
.pill.now.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------------------------------------------------------------- 見方とデータ */
.about-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(3, 5, 10, 0.55); padding: 20px; }
body.day .about-wrap { background: rgba(20, 30, 50, 0.25); }
.about { position: relative; width: min(720px, 100%); max-height: min(86vh, 900px); overflow: auto; padding: 26px 28px 26px; background: var(--panel-solid); }
.about h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.about h3 { margin: 22px 0 8px; font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }
.about p, .about li { font-size: 13.5px; color: var(--text-2); }
.about ul { padding-left: 1.2em; margin: 6px 0; }
.about .src-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.about .src-table td, .about .src-table th { border-bottom: 1px solid var(--border); padding: 6px 6px; text-align: left; vertical-align: top; }
.about .src-table th { color: var(--muted); font-weight: 700; font-size: 11px; }
.about .warn { padding: 12px 14px; border-radius: 12px; background: rgba(255, 106, 85, 0.1); color: var(--text); font-size: 13px; margin-top: 14px; }

.hint {
  position: fixed; left: 50%; bottom: calc(var(--timebar-h) + 30px); z-index: 19; transform: translateX(-50%);
  margin: 0; padding: 10px 16px; max-width: min(560px, calc(100vw - 32px));
  background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow);
  font-size: 13px; color: var(--text-2); text-align: center; pointer-events: none;
  animation: rise 0.5s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

.loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity 0.5s ease, visibility 0.5s; }
.loading.done { opacity: 0; visibility: hidden; }
.loading-inner { width: 220px; text-align: center; }
.loading-title { font-family: var(--f-board); font-size: 22px; font-weight: 400; letter-spacing: 0.24em; margin: 0 0 16px; color: var(--accent); }
.loading-bar { height: 2px; background: var(--border-2); border-radius: 2px; overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.loading-msg { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

/* ---------------------------------------------------------------- 実際の列車の位置と運行情報 */
.live-stat b { color: var(--ok); }
.live-stat b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 4px; animation: blink 1.6s infinite; }
.live-note { margin: 0; font-size: 12.5px; line-height: 1.6; }
.live-note b { color: var(--ok); }
.live-note .muted { font-size: 11px; }
.tip .t-live { color: var(--ok); font-size: 11.5px; font-weight: 700; }
.info-ok { margin: 0; font-size: 12.5px; color: var(--muted); }
.info-warn { margin: 0; font-size: 12.5px; color: var(--hot); line-height: 1.6; }
.l-info { margin-left: 6px; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; color: #fff; background: var(--hot); vertical-align: 1px; }

/* ---------------------------------------------------------------- 家まで帰れる最終 */
.gohome { position: fixed; left: 16px; top: 128px; width: 336px; z-index: 16; padding: 11px 14px 12px; }
.gohome:empty { display: none; }
.gohome p { margin: 0; }
.gh-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.gh-k { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.gh-from { border: 0; background: transparent; padding: 0; font-weight: 700; font-size: 13px; color: var(--text); text-decoration: underline dotted var(--faint); text-underline-offset: 4px; }
.gh-from small { margin-left: 6px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.gh-to { font-size: 13px; color: var(--text); }
.gh-arrow { color: var(--muted); }
.gh-link { margin-left: auto; flex: none; border: 0; background: transparent; padding: 0; font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.gh-icon { margin-left: auto; flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.gh-icon:hover, .gh-link:hover { color: var(--text); }
.gh-icon svg { width: 17px; height: 17px; }
.gh-main { display: flex; align-items: baseline; gap: 6px; width: 100%; margin-top: 6px; padding: 0; border: 0; background: transparent; text-align: left; }
.gh-dep { font-family: var(--f-num); font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.gh-unit { font-size: 13px; font-weight: 700; color: var(--accent); }
.gh-left { margin-left: auto; font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.gh-sub { margin-top: 6px !important; font-size: 12px; color: var(--muted); }
.gh-msg { margin-top: 6px !important; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.gh-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gh-btn { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; font-size: 12px; font-weight: 700; color: var(--text); }
.gh-btn:hover { background: var(--panel-3); }
.gh-in { position: relative; margin-top: 8px; }
.gh-in input { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; outline: none; }
.gh-in input:focus { border-color: var(--accent); }
.gh-in input::placeholder { color: var(--faint); }
.gohome.soon { border-color: rgba(255, 106, 85, 0.55); }
.gohome.soon .gh-dep, .gohome.soon .gh-unit, .gohome.soon .gh-left { color: var(--hot); }
.gohome.gone .gh-dep, .gohome.gone .gh-unit { color: var(--muted); }
.gohome.gone .gh-left { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- 共有用の画像（?og） */
body.og .brand, body.og .stats, body.og .controls, body.og .side, body.og .detail, body.og .timebar,
body.og #labels, body.og .hint, body.og .tip, body.og .gohome { display: none !important; }
.og-card {
  position: fixed; left: 0; top: 0; bottom: 0; width: 470px; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 0 0 0 64px;
  background: linear-gradient(90deg, var(--bg) 0%, var(--bg) 62%, rgba(5, 7, 13, 0) 100%);
}
.og-card p, .og-card h1 { margin: 0; }
.og-en { font-family: var(--f-num); font-size: 15px; font-weight: 700; letter-spacing: 0.34em; color: var(--muted); }
.og-title { font-size: 76px; font-weight: 700; letter-spacing: 0.14em; line-height: 1.02; }
.og-lead { font-size: 19px; line-height: 1.65; color: var(--text-2); }
.og-clock { display: flex; align-items: baseline; gap: 14px; margin-top: 6px !important; }
.og-clock b { font-family: var(--f-board); font-size: 58px; font-weight: 400; line-height: 1; color: var(--accent); text-shadow: 0 0 18px rgba(255, 178, 63, 0.5); }
.og-clock span { font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: 0.08em; }

/* ---------------------------------------------------------------- タブレット */
@media (max-width: 1180px) {
  .side { width: 312px; }
  .detail { width: 360px; }
  .timebar { grid-template-columns: 176px 1fr auto; }
  .clock-time { font-size: 38px; }
}

/* ---------------------------------------------------------------- スマホ */
@media (max-width: 760px) {
  :root { --timebar-h: 118px; }
  body { font-size: 13.5px; }
  .brand { left: 14px; top: calc(10px + env(safe-area-inset-top)); gap: 8px; }
  .brand .mark { width: 30px; height: 30px; }
  .brand h1 { font-size: 18px; }
  .brand-en { font-size: 8px; letter-spacing: 0.22em; }
  .stats { left: 14px; top: calc(56px + env(safe-area-inset-top)); gap: 14px; }
  .stat b { font-size: 16px; }
  .stat span { font-size: 9.5px; }
  .stat:nth-child(3) { display: none; }
  .stats.live .stat:nth-child(2) { display: none; }
  .gohome { left: 10px; right: 10px; width: auto; top: calc(98px + env(safe-area-inset-top)); padding: 9px 12px 10px; z-index: 18; }
  .gh-dep { font-size: 28px; }
  .controls { right: 10px; top: calc(10px + env(safe-area-inset-top)); gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
  .controls .seg button { padding: 6px 9px; font-size: 11.5px; }
  .icon-btn { width: 34px; height: 34px; }
  #calSeg { order: 3; }

  .side {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 62vh; z-index: 30;
    border-radius: 22px 22px 0 0; transform: translateY(calc(100% - var(--peek, 0px))); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .side.open { transform: translateY(0); }
  .sheet-grip { display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 18px; border: 0; background: transparent; }
  .sheet-grip span { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border-2); margin: 7px auto 0; }
  .search { margin-top: 18px; }
  .detail { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 72vh; border-radius: 22px 22px 0 0; z-index: 35; padding-bottom: env(safe-area-inset-bottom); }
  .d-title { font-size: 22px; }

  .timebar {
    left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 4px 10px; height: var(--timebar-h); padding: 10px 12px 8px 14px; border-radius: 18px;
  }
  .clock { display: flex; align-items: baseline; gap: 10px; min-width: 0; grid-column: 1; grid-row: 1; }
  .tb-btns { grid-column: 2; grid-row: 1; }
  .clock-time { font-size: 30px; order: -1; }
  .clock-cal { font-size: 10.5px; }
  .clock-sub { display: none; }
  .tb-btns { gap: 6px; }
  .round { width: 40px; height: 40px; }
  .pill { height: 32px; padding: 0 10px; font-size: 11.5px; }
  .pill.speed { min-width: 44px; }
  .track-wrap { grid-column: 1 / -1; grid-row: 2; height: 58px; }
  .track { height: 56px; }
  #hist { height: 36px; }
  .knob { height: 44px; }
  .now-mark { height: 40px; }
  .hint { bottom: calc(var(--timebar-h) + 74px + env(safe-area-inset-bottom)); font-size: 12px; }   /* 検索欄（高さ46px）の上に出す */
  .mob-search {
    position: fixed; left: 10px; right: 10px; bottom: calc(var(--timebar-h) + 16px + env(safe-area-inset-bottom)); z-index: 19;
    display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px;
    background: var(--panel); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); color: var(--muted); font-size: 14px; font-weight: 500; text-align: left;
  }
  .mob-search svg { width: 17px; height: 17px; }
  .lbl { font-size: 10.5px; padding: 1px 6px 2px; }
}
@media (min-width: 761px) { .mob-search { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.lbl.axis { background: transparent; border: 0; color: var(--muted); font-family: var(--f-num); font-weight: 700; font-size: 11px; padding: 0 2px; }
.lbl.axis.now { color: var(--accent); background: rgba(8, 11, 20, 0.7); border: 1px solid rgba(255, 178, 63, 0.35); padding: 2px 8px; }

/* ---------------------------------------------------------------- 帰れる最終 */
.route-sec { padding-bottom: 8px; }
.route-in { position: relative; display: flex; gap: 6px; }
.route-in input { flex: 1; min-width: 0; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text); border-radius: 11px; padding: 9px 12px; font: inherit; font-size: 14px; outline: none; }
.route-in input:focus { border-color: var(--accent); }
.route-in .sugg { top: calc(100% + 4px); }
.home-btn { flex: none; border: 1px solid var(--border-2); background: transparent; border-radius: 11px; padding: 0 11px; font-size: 12px; font-weight: 700; color: var(--muted); }
.home-btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.route-card { margin-top: 10px; border: 1px solid rgba(255, 178, 63, 0.35); background: rgba(255, 178, 63, 0.07); border-radius: 14px; padding: 12px 12px 10px; }
.route-card.gone { border-color: var(--border); background: var(--panel-2); opacity: 0.7; }
.rc-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rc-dep { font-family: var(--f-num); font-weight: 800; font-size: 30px; line-height: 1; color: var(--accent); letter-spacing: -0.02em; }
.route-card.gone .rc-dep { color: var(--muted); }
.rc-mid { font-size: 13px; font-weight: 700; }
.rc-mid b { font-family: var(--f-num); font-size: 16px; }
.rc-left { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent); }
.route-card.gone .rc-left { color: var(--faint); }
.legs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.leg { display: grid; grid-template-columns: 44px 1fr; gap: 8px; font-size: 13px; align-items: start; cursor: pointer; }
.leg .lg-t { font-family: var(--f-num); font-weight: 800; font-size: 15px; }
.leg .lg-b { display: block; line-height: 1.45; }
.leg .lg-b .badge { vertical-align: -4px; margin-right: 5px; }
.leg small { display: block; color: var(--muted); font-size: 11.5px; }
.leg.walk { color: var(--text-2); font-size: 12px; cursor: default; }
.rc-note { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.d-sum .left.done { color: var(--faint); }
.dl-left.done { color: var(--faint); }
.rung.first .r-left { color: var(--accent); font-weight: 700; }
.home-card { border: 1px dashed var(--border-2); border-radius: 13px; padding: 11px 13px; margin: 0 0 6px; font-size: 12.5px; }
.home-card p { margin: 0; }
.home-card p + p { margin-top: 4px; }
.follow-row { padding-top: 10px; }
.pill.follow { height: 38px; padding: 0 16px; border-color: rgba(255, 178, 63, 0.5); color: var(--accent); }
.pill.follow.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tbl-wrap { overflow-x: auto; }
.about .src-table td:first-child { white-space: nowrap; font-weight: 700; }

.sel-all { user-select: all; -webkit-user-select: all; font-family: var(--f-num); }
