:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0b3d91;
  --accent-soft: #dbe6fb;
  --on: #0b3d91;
  --off: #d1d5db;
  --warn: #b45309;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --card: #151b26;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #273042;
    --accent: #8fb4ff;
    --accent-soft: #1d2a44;
    --on: #8fb4ff;
    --off: #374151;
    --warn: #f59e0b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", "Noto Sans JP", sans-serif;
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
header {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--line);
}
main, footer { max-width: 760px; margin: 0 auto; padding: 12px 16px; }
header > * { max-width: 728px; margin-left: auto; margin-right: auto; }
#q {
  width: 100%;
  font-size: 22px;           /* 16px 以上で iOS のズームを防ぐ */
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  outline: none;
}
#q:focus { border-color: var(--accent); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.chips:empty { display: none; }
.chips.inner { padding-top: 0; }
.chip.tool { font-weight: 600; color: var(--accent); }
.chip.tool.on { background: var(--accent); color: var(--card); border-color: var(--accent); }
.tel { margin-top: 4px; font-size: 15px; letter-spacing: .04em; color: var(--accent); font-weight: 600; }
.list .crow { grid-template-columns: 3.4em 2.2em 1fr 1fr; }
.crow .ia { color: var(--muted); font-size: 14px; }
.crow .tl, .crow .nm { font-size: 14px; overflow-wrap: anywhere; }
.crow small { display: block; color: var(--muted); font-size: 12px; }
.chip {
  flex: none;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.card h2 { margin: 0; font-size: 22px; letter-spacing: .03em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.card h2 small { font-size: 14px; color: var(--muted); font-weight: normal; letter-spacing: 0; }
.leg { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.leg.notoday { opacity: .55; }
.route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.end .code { font-size: 26px; font-weight: 700; letter-spacing: .04em; }
.end .time { font-size: 24px; font-variant-numeric: tabular-nums; }
.end .name { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.end.arr { text-align: right; }
.arrow { color: var(--muted); font-size: 20px; }
.est { color: var(--muted); }
.plus {font-size: 14px; color: var(--warn); margin-left: 2px; vertical-align: super; }
.sub { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.days { display: inline-flex; gap: 3px; }
.days span {
  width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 6px; font-size: 12px; background: var(--off); color: var(--bg);
}
.days span.on { background: var(--on); }
.days span.today { outline: 2px solid var(--warn); outline-offset: 1px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list button {
  display: grid; grid-template-columns: 7.5em 1fr auto; gap: 8px; align-items: center;
  width: 100%; text-align: left; padding: 10px 14px;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit;
}
.list button:last-child { border-bottom: 0; }
.list .cs { font-weight: 700; letter-spacing: .03em; }
.list .r { color: var(--muted); font-size: 14px; }
.list .t { font-variant-numeric: tabular-nums; font-size: 14px; }
h3 { font-size: 13px; color: var(--muted); font-weight: normal; margin: 16px 2px 6px; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }
footer { color: var(--muted); font-size: 12px; text-align: center; }
