/* パステル。路線の色を淡くした面の上に、白いカードを置く。残り1分を切ると、朱色のカードに変わる。 */
:root {
  --bg: #f4f6ff;
  --ink: #1b2733;
  --mut: #4f6072;
  --rule: #dde3f3;
  --hot: #d93a12;
  --font: "Zen Maru Gothic", "Noto Sans JP", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --num: "Sora", "Zen Maru Gothic", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #2f7dd1; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.tn { font-variant-numeric: tabular-nums; }

.app { max-width: 30rem; margin: 0 auto; min-height: 100vh; }
#view {
  display: grid; gap: 14px; align-content: start;
  padding-block: 22px calc(96px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

#view > * { min-width: 0; }
input { min-width: 0; }
.hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.nm { display: grid; min-width: 0; }
.kick { font-size: 11px; letter-spacing: 0.18em; color: var(--mut); font-weight: 500; }
.hd h1 { margin: 0; font-size: 40px; line-height: 1.05; font-weight: 900; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.meta { display: grid; justify-items: end; gap: 0; font-size: 12px; color: var(--mut); text-align: right; flex: none; }
.meta b { font-family: var(--num); font-size: 22px; font-weight: 500; color: var(--ink); line-height: 1.25; }
.walk { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.status { margin: 0; font-size: 13px; color: var(--mut); }
.status.warn { color: #b4430c; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--rule); background: #fff; font-size: 14px; font-weight: 700; }
.picker { display: grid; gap: 8px; background: #fff; border-radius: 22px; padding: 12px; }
.search { width: 100%; min-height: 44px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--rule); background: var(--bg); }
.picker-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; display: grid; }
.picker-list button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); font-weight: 700; }

/* 路線ごとの段 */
.map { display: grid; gap: 12px; }
.ln { background: var(--tint); border-radius: 32px; padding: 14px; display: grid; gap: 8px; }
.lh { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--mut); }
.lh .no { margin-left: auto; font-family: var(--num); font-size: 12px; font-weight: 500; }
.bd { width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); color: var(--i); display: inline-grid; place-items: center; flex: none; font-family: var(--num); font-weight: 700; font-size: calc(var(--s) * 0.45); }

.rail { position: relative; height: 64px; }
.rl { position: absolute; top: 23px; height: 10px; border-radius: 5px; background: var(--c); }
.en { position: absolute; top: 0; font-size: 11px; font-weight: 900; color: var(--ink); white-space: nowrap; }
.en.l { left: 0; }
.en.r { right: 0; }
.sn { position: absolute; top: 0; transform: translateX(-50%); width: 64px; display: grid; justify-items: center; }
.sn i { width: 14px; height: 14px; margin-top: 21px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.sn.cur i { width: 26px; height: 26px; margin-top: 15px; border-width: 5px; }
.sn span { margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--mut); white-space: nowrap; }
.sn.cur span { color: var(--ink); font-size: 13px; }

.dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dc { position: relative; background: #fff; border-radius: 22px; padding: 10px 12px; display: grid; gap: 1px; align-content: start; min-width: 0; }
.dc.r { text-align: right; }
.dc .sub { font-size: 11px; font-weight: 700; color: var(--mut); }
.dc .dn { font-size: 13px; line-height: 1.35; display: flex; align-items: center; gap: 4px; }
.dc.r .dn { justify-content: flex-end; }
.dc .arr { font-size: 15px; font-weight: 700; color: var(--mut); line-height: 1; }
.dc .e { font-family: var(--num); font-weight: 700; font-size: 32px; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.dc .e i { font-style: normal; opacity: 0.45; }
.dc .dep { font-size: 11px; font-weight: 700; color: var(--mut); }
.dc .nx { margin-top: 4px; padding-top: 5px; border-top: 1px solid #dfe4ef; font-size: 10px; color: var(--mut); opacity: 0.8; }
.dc .end { font-size: 12px; color: var(--mut); padding-top: 6px; }
.dc.empty { background: rgba(255, 255, 255, 0.55); display: grid; place-items: center; text-align: center; }
.dc.hot { border: 4px solid var(--hotc); padding: 6px 8px; }
.dc.hot::after { content: ""; position: absolute; inset: -4px; border-radius: 26px; border: 3px solid var(--hotc); pointer-events: none; animation: ring 1.6s ease-out infinite; }
@keyframes ring { from { opacity: 0.85; transform: scale(1); } to { opacity: 0; transform: scale(1.09); } }
@media (prefers-reduced-motion: reduce) { .dc.hot::after { animation: none; opacity: 0.35; } }

.others .sec { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.1em; color: var(--mut); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 0; background: #fff; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.chip i { font-style: normal; font-size: 12px; color: var(--mut); font-weight: 500; }
.empty-state { background: #fff; border-radius: 24px; padding: 20px 16px; color: var(--mut); }

.foot { display: grid; gap: 8px; padding-top: 4px; }
.seg { display: inline-flex; justify-self: start; border-radius: 22px; background: #fff; padding: 3px; }
.seg-btn { min-height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: none; font-size: 13px; font-weight: 700; color: var(--mut); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.note { margin: 0; font-size: 12px; color: var(--mut); overflow-wrap: anywhere; }

/* 検索タブ */
.chipsw { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.lc { flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 2px solid var(--c); background: #fff; font-size: 14px; font-weight: 700; }
.lc.on { background: var(--c); color: var(--i); }
.dt { display: flex; gap: 8px; align-items: stretch; }
.dtf { flex: 1; min-width: 0; position: relative; display: block; background: #fff; border-radius: 18px; }
.dtf input { width: 100%; min-height: 48px; border: 0; background: transparent; padding: 14px 10px 0; font-weight: 700; font-family: var(--num); font-size: 14px; }
.dtf i { position: absolute; left: 12px; top: 4px; font-style: normal; font-size: 10px; color: var(--mut); font-weight: 700; }
.split { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
.rl-box { background: #fff; border-radius: 24px; max-height: 64vh; overflow-y: auto; }
.rli { position: relative; padding: 8px 0; display: grid; }
.rli::before { content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 8px; background: var(--c); }
.rli button { position: relative; min-height: 40px; padding: 0 6px 0 42px; border: 0; background: none; text-align: left; font-size: 13px; font-weight: 700; color: var(--mut); display: flex; align-items: center; }
.rli button::before { content: ""; position: absolute; left: 16px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.rli button.on { color: var(--ink); font-size: 15px; background: var(--tint); }
.rli button.on::before { left: 13px; width: 20px; height: 20px; border-width: 4px; }
.res { display: grid; gap: 10px; min-width: 0; align-content: start; }
.res h2 { margin: 0; font-size: 22px; font-weight: 900; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rb { background: #fff; border-radius: 20px; padding: 10px 12px; display: grid; gap: 8px; }
.rh { display: flex; align-items: center; gap: 8px; }
.rh b { font-size: 13px; line-height: 1.35; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rh small { font-weight: 500; color: var(--mut); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border-radius: 14px; background: #eef1fb; padding: 3px 10px; font-family: var(--num); font-size: 13px; font-weight: 500; display: grid; justify-items: center; line-height: 1.3; }
.pill em { font-style: normal; font-family: var(--font); font-size: 9px; color: var(--mut); }
.pill.f { background: var(--ink); color: #fff; font-weight: 700; }
.pill.f em { color: #d6dde6; }

/* 下のタブ */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 30rem); z-index: 5;
  display: flex; background: #fff; border-top: 1px solid var(--rule);
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.tabbar button { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--mut); font-size: 11px; font-weight: 700; }
.tabbar button.on { color: var(--ink); }
