:root {
  /* 地と文字 */
  --bg: #f3f1ed; --surface: #ffffff; --surface-2: #f4f3f0; --text: #1a1f1d; --muted: #5c6662; --line: #e4e1db; --field-line: #c9cdc9;
  /* 入力欄の枠(白 3.5:1・地 3.1:1。四捨五入で 3:1 を割らないよう少し余裕を持たせる。E-13・レビュー M-6) */
  --input-line: #838b87;
  --shadow: 0 1px 2px rgba(40, 32, 20, .06), 0 2px 10px rgba(40, 32, 20, .06);
  /* ロゴの緑(主なボタン・リンクだけに使う) */
  --accent: #2a6f6a; --accent-ink: #ffffff; --accent-soft: #e3efed;
  /* 地域の配色(area.json の palette)で差し替える役目ごとの色。仙台は今の色のまま(--accent などの値を指す)。
     --accent は塗り(ボタンの地など)だけ、字・枠は --link、フォーカスの線は --focus(青森の主の色は白い地との比が足りず、字・線に使えないため) */
  --link: var(--accent); --focus: var(--accent);
  /* ヘッダーの地と下の線 */
  --bar-bg: var(--surface); --bar-edge: var(--band-edge);
  /* ホームの一番下の「このアプリを人に教える」(配色の黄色の地に濃い文字。明るい・暗い表示とも同じ色) */
  --share-bg: #f4c95d; --share-edge: #d9a93a; --share-hover: #efbd45; --share-ink: #1f2937;
  /* 次の便(ロゴの行き先表示の黄色) */
  --next-bg: #fff4d6; --next-edge: #f5c242;
  /* 残り時間: まもなく(3分以内)・もうすぐ(10分以内)・それより先 */
  --soon-bg: #c2410c; --soon-ink: #ffffff;
  --near-bg: #ffe6cc; --near-ink: #8a3a00;
  --later-bg: #ecebe7; --later-ink: #3d4643;
  /* 次の便の「あと○分」(10分より先でも色を付けて目立たせる) */
  --next-until-bg: #2a6f6a; --next-until-ink: #ffffff;
  /* 終バスが30分以内 */
  --warn: #9a3a00; --warn-soft: #fff0e0;
  --past: #6b7571;
  /* 遅れの文字(次の便の黄色の帯・カード・地の上でAA) */
  --late: #9a3a00;
  /* 系統の札 */
  --route-bg: #2b3438; --route-ink: #ffffff;
  /* のりばの色(Okabe–Ito を白文字4.5:1以上になるよう暗めに調整。地図の印は明るい地図の上なので明暗共通) */
  --pole-0: #0067a5; --pole-1: #b84a00; --pole-2: #00775c; --pole-3: #a63d7a;
  --pole-4: #8a6200; --pole-5: #5b4ba8; --pole-6: #7a5230; --pole-7: #4a5358; --pole-ink: #ffffff; --pin-ring: #ffffff;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1312; --surface: #1a201f; --surface-2: #232a29; --text: #eef2f0; --muted: #a7b1ad; --line: #2c3533; --field-line: #46514e; --input-line: #6b7773;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --accent: #6cc4b9; --accent-ink: #06201d; --accent-soft: #1b3532;
    --next-bg: #3a3016; --next-edge: #f5c242;
    --soon-bg: #ff8a5c; --soon-ink: #1a0800;
    --near-bg: #47280f; --near-ink: #ffc48a;
    --later-bg: #2c3432; --later-ink: #d0d8d5;
    --next-until-bg: #6cc4b9; --next-until-ink: #06201d;
    --warn: #fdba74; --warn-soft: #3a2416;
    --past: #8a9591;
    --late: #fdba74;
    --route-bg: #46545b; --route-ink: #ffffff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* iOS の「文字サイズ」設定(Dynamic Type)に合わせる(iOS だけ。Mac の Safari は -apple-system-body が13pxなので当てない)。
   標準の設定では17pxになるので、index.html の小さなスクリプトで 16/17 をかけ、今までと同じ16pxを基準にする(E レビュー M-4) */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 1rem; line-height: 1.6; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* 文字の大きさは rem(端末・ブラウザの文字サイズの設定に合わせて大きくなる。E-8)。小さい文字も、ふつうの文は14px、札は13px以上 */
/* .say: 読み上げにだけ添える言葉(「7時42分」「発」「系統」など。common.js の say・timeSay) */
.visually-hidden, .say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar { position: sticky; top: 0; z-index: 1000; background: var(--bar-bg); border-bottom: 1px solid var(--line); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.brand { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; color: var(--text); font-weight: 700; text-decoration: none; font-size: 1.0625rem; }
/* 横長のロゴ。描く高さは最大 40px(PC と同じ)。幅が足りない画面では、空いている幅いっぱいまで小さく描く(object-fit: contain)。
   上の帯の高さは前と同じ(ロゴの枠は 375px 前後で 36px・360px 以下で 28px・480px 以上で 40px)にするため、画像の上下を余白に少し重ねる(負の margin)。
   ヘッダーの「非公式」の札は外した(2026-10-24 の試し。「非公式」は題名・ホームの説明・下部の説明に出す) */
.brand img { display: block; height: 40px; margin-block: -2px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.brand picture { display: block; min-width: 0; max-width: 100%; }
@media (max-width: 360px) { .brand img { margin-block: -6px; } }
@media (min-width: 480px) { .brand img { margin-block: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
/* iPad 横・枠なしの PC など広い画面(1000px 以上)では、バス停の画面と1日の時刻表だけ本文を広げる(F-12)。
   バス停ののりばのカードは2列に、時刻表は1行に並ぶ便を増やす。見出し・切り替え・説明の文は読みやすい幅(640px)のまま */
@media (min-width: 1000px) {
  main:has(> .view-wide) { max-width: 1000px; }
  .view-wide > :not(.cards):not(.tt-section) { max-width: 640px; }
  .view-wide .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  .view-wide .cards > :not(.card) { grid-column: 1 / -1; }
}
section { margin: 0 0 24px; }
h1 { font-size: 1.5rem; font-weight: 800; margin: 4px 0; line-height: 1.3; letter-spacing: .01em; }
h2 { font-size: 1.125rem; font-weight: 800; margin: 0 0 10px; line-height: 1.4; }
h3 { font-size: 1.0625rem; font-weight: 700; margin: 0; line-height: 1.4; }
.hint { color: var(--muted); font-size: .875rem; margin: 6px 0 0; }
.back { display: inline-flex; align-items: center; min-height: 44px; }
/* バス停・区間の画面の「← ホーム」。押せる高さ(44px)は保ち、上下の余白に重ねて見出しとの間を詰める */
a.back[href="#/"] { margin: -12px 0 -8px; }

input[type=search]::placeholder { text-overflow: ellipsis; }
/* iPhone は16px未満の入力欄を押すと画面を拡大し、戻さない(右が見切れる)。端末の文字サイズを小さくしていても16px以上に */
input[type=search], select { width: 100%; font-size: max(16px, 1.0625rem); padding: 12px 14px; border: 1px solid var(--input-line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
/* 幅の狭い画面(320px)でも案内文「バス停名・施設名（ひらがなでも）」が欠けないよう、横の余白と案内文の文字を少しだけ小さく(入力した文字の大きさは変えない) */
@media (max-width: 360px) { input[type=search] { padding-left: 10px; padding-right: 10px; } input[type=search]::placeholder { font-size: 1rem; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--field-line); background: var(--surface); color: var(--text); font-size: .9375rem; text-decoration: none; cursor: pointer; }
.btn-block { width: 100%; font-size: 1rem; font-weight: 600; }
.near { margin-top: 12px; }
.btn-wide { width: 100%; font-size: 1rem; font-weight: 700; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn[aria-pressed=true], .btn.is-on { background: var(--accent-soft); border-color: var(--link); font-weight: 700; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: default; }
/* 便の行は、「もっと見る」の後にフォーカスを移すことがある(tabindex=-1)。キーボードで操作しているときだけ枠を出す */
.dep:focus:not(:focus-visible) { outline: none; }
.dep:focus-visible { outline-offset: -3px; }

.list { list-style: none; margin: 8px 0 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list:empty { display: none; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; }
.near-next { display: block; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.near-next:empty { display: none; }
.list .meta { color: var(--muted); font-size: .875rem; text-align: right; }
.list .empty { padding: 12px 14px; color: var(--muted); }
/* 角を丸めるために overflow:hidden にしている一覧では、フォーカスの枠が外側だと切れるので内側に描く */
.list a:focus-visible, .list button:focus-visible, .suggest button:focus-visible { outline-offset: -3px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border: 1px solid var(--field-line); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; }
/* 欄の見出しと、その右の「編集」(いつもの区間・最近見たバス停) */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.sec-head h2 { margin: 0; min-width: 0; }
.sec-edit { flex: none; min-width: 72px; padding: 6px 14px; font-weight: 600; }
.sec-edit[hidden] { display: none; }
/* 外す・消すボタン(編集中だけ出す) */
.btn-remove { color: var(--warn); border-color: var(--warn); font-weight: 600; }
.actions.route-remove { margin: 0 0 10px; }
.chips-edit { column-gap: 14px; }
.chips-edit li { display: inline-flex; align-items: center; gap: 4px; }
.chip-remove { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--warn); border-radius: 999px; background: var(--surface); color: var(--warn); font-size: 1.375rem; line-height: 1; cursor: pointer; }
/* 外した・消した直後の「元に戻す」 */
.undo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; margin: 0 0 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--link); }
.undo-bar p { flex: 1 1 12em; margin: 0; overflow-wrap: anywhere; }
.undo-bar .btn { flex: none; font-weight: 700; }
.recent .undo-bar { margin: 10px 0 0; }
.plain { list-style: none; padding: 0; margin: 6px 0 0; }
.plain li { padding: 4px 0; }

.card { display: block; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px; scroll-margin-top: 64px; color: var(--text); text-decoration: none; }
/* 近道一覧・地図の印から移った先ののりば(少しの間ふちどる) */
.card.is-target { box-shadow: 0 0 0 3px var(--next-edge), var(--shadow); }
.card h2:focus { outline: none; }
/* 画面を移ったときにフォーカスを移す見出し・画面の欄(main.js の focusTitle)。キーボードで操作しているときだけ枠を出す */
h1:focus:not(:focus-visible), .view:focus:not(:focus-visible) { outline: none; }
/* 見出しは Tab では止まらず(tabindex=-1)、フォーカスはプログラムで移すだけ。キーボードで開いた後(:focus-visible と判定される)でも枠を出さない */
h1[tabindex="-1"]:focus, .view[tabindex="-1"]:focus { outline: none; }
.card h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fav-head { display: flex; align-items: center; gap: 10px; }
.fav-next { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 4px; margin: 10px -14px -14px; padding: 10px 14px 12px; background: var(--next-bg); border-radius: 0 0 var(--radius) var(--radius); box-shadow: inset 0 3px 0 var(--next-edge); }
.fav-next strong { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.fav-next .fav-rest { flex-basis: 100%; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); margin: 0 0 12px; }
.notice-warn { background: var(--warn-soft); }
.notice-stale { border: 2px solid var(--warn); }
.notice-stale p { margin: 4px 0 0; }
.cache-note .btn { display: flex; width: fit-content; margin-top: 8px; }

.dia { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.filters { display: grid; gap: 8px; margin: 12px 0; }
/* 畳んだ欄(絞り込み・のりばの一覧・地図)。見出しの行だけを出し、押すと開く */
.fold { margin: 6px 0; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); }
.fold > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; cursor: pointer; font-size: .9375rem; font-weight: 600; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary > .fold-label { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 360px) { .fold { margin: 4px 0; } }
.fold > summary::before { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-right: 2px; }
.fold[open] > summary::before { transform: rotate(45deg); }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold > .filters { margin: 0; padding: 12px; }
.pole-nav-list { margin: 0; padding: 4px 0; }
.pole-nav-list li { padding: 0; }
.pole-nav-list li + li { border-top: 1px solid var(--line); }
.pole-nav-list button { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px; border: none; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pole-nav-name { font-weight: 700; }
.pole-nav-tt { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; }
.map-fold { scroll-margin-top: 64px; }
.map-picked { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.map-picked[hidden] { display: none; }
.map-picked:focus { outline: none; }
.map-picked p { margin: 0; }
.map-picked .actions { margin-top: 8px; }
.pole-pin.is-picked span { width: 36px; height: 36px; margin: -5px; font-size: 16px; border-width: 3px; box-shadow: 0 0 0 3px var(--next-edge), 0 1px 4px rgba(0, 0, 0, .5); }
.map-fold .pole-map { margin: 0; border-radius: 0; box-shadow: none; }
.map-fold > .hint { margin: 0; padding: 8px 12px 10px; }
.filter-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* バス停の画面で降りるバス停が2つ以上のとき: 一文の下に札(名前＋×)、その下に「＋ 降りるバス停を足す」と「すべて解除」 */
.alight-multi-lead { margin: 0 0 8px; }
.alight-clear-all { margin: 4px 0 0; }
.suggest { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; }
.suggest li { border: 1px solid var(--field-line); border-top: none; }
.suggest li:first-child { border-top: 1px solid var(--field-line); }
.suggest button { width: 100%; min-height: 44px; text-align: left; padding: 10px 12px; border: none; background: var(--surface); color: var(--text); font-size: 1rem; cursor: pointer; }
.suggest .empty { padding: 10px 12px; color: var(--muted); font-size: .875rem; background: var(--surface); }
/* 降りるバス停の候補のすぐ下に添える「近くのバス停」(common.js の stopChoiceItems)。一段下げた小さめの行。押せる高さは44px */
.list .near-stop > a, .list .near-stop > button, .suggest .near-stop > button { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px 8px 30px; font-size: .875rem; background: var(--surface-2); }
.near-stop-lead { color: var(--muted); }
.pair-note { display: block; color: var(--muted); font-size: .875rem; } /* 検索結果どうしで近い候補の「（○○から約220m）」 */
.suggest .meta { color: var(--muted); font-size: .875rem; text-align: right; white-space: nowrap; }
.list .near-stop .meta { white-space: nowrap; }
/* 施設の候補「施設：仙台城跡（青葉城址）」(common.js の placeChoiceItem)。押すと下に近くのバス停の行(.near-stop.place-stop)が出る */
.suggest .place-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.place-btn { align-items: center; }
.place-lead { color: var(--link); font-weight: 700; }
.place-btn .meta { white-space: nowrap; color: var(--link); }
.place-arrow { display: inline-block; margin-left: 4px; }
/* 狭い幅では、バス停名を細く折り返さず、徒歩の時間を次の行(右寄せ)へ回す */
.list .place-stop > a, .list .place-stop > button, .suggest .place-stop > button { flex-wrap: wrap; column-gap: 12px; row-gap: 2px; }
.place-stop .meta { margin-left: auto; }
.place-note { padding: 8px 12px 8px 30px; color: var(--muted); font-size: .875rem; background: var(--surface-2); }

.pole-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pole-title { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.pole-head h2 { margin: 0; word-break: keep-all; overflow-wrap: anywhere; } /* 「1番のりば」を途中で折り返さない */
.dir { display: block; font-size: .875rem; font-weight: 400; color: var(--muted); text-wrap: pretty; }
.star { flex: none; gap: 4px; padding: 6px 10px; font-size: .875rem; white-space: nowrap; }
.star span[aria-hidden] { font-size: 1.25rem; line-height: 1; color: var(--link); }
/* 幅の狭い画面では記号と文字を縦に並べ、方面の文字が細く折り返さないようにする */
@media (max-width: 360px) { .star { flex-direction: column; gap: 2px; padding: 4px 8px; font-size: .8125rem; line-height: 1.2; } }
/* のりばの丸い札(色は番号から。番号の文字でも区別できる) */
.pole-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px; background: var(--pc, var(--pole-7)); color: var(--pole-ink); font-size: .9375rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pole-head .pole-badge { margin-top: 0; }
.pc-0 { --pc: var(--pole-0); } .pc-1 { --pc: var(--pole-1); } .pc-2 { --pc: var(--pole-2); } .pc-3 { --pc: var(--pole-3); }
.pc-4 { --pc: var(--pole-4); } .pc-5 { --pc: var(--pole-5); } .pc-6 { --pc: var(--pole-6); } .pc-7 { --pc: var(--pole-7); }

.dep { display: grid; grid-template-columns: 2.9rem auto minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); margin-top: 0; }
.pole-head + .dep, .pole-head + .dep-list { margin-top: 10px; }
.dep-label { color: var(--muted); font-size: .875rem; }
.dep-time { font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.dep-until { justify-self: end; text-align: right; }
/* 1行目(時刻と残り時間の札)。札が時刻と同じ行に収まらないとき(「あと11時間17分」のような長い札・言語による長さ)は、
   札を時刻の下の行の頭へ折り返す(時刻に重ねない。全体チェック U12-1・U4-1)。収まるときは今までどおり札は右端 */
.dep-head { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: inherit; row-gap: 4px; min-width: 0; }
.dep-head .dep-until:empty { display: none; }
/* 区間の行は「7:42発 → 8:03着」が中で折り返せるので、札の幅を先にとり、時刻は残りの幅で折り返す。
   「23:59発」のような折り返せない1つの塊も入らないときだけ、札を下の行へ */
.dep-head .route-time { flex: 1 1 0; min-width: min-content; }
.dep-info { grid-column: 2 / -1; font-size: .9375rem; overflow-wrap: anywhere; }
.dep-arrline { grid-column: 2 / -1; font-size: .9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.filter-sum { margin: 0 0 10px; }
/* 遅れ・接近情報: 「7:42 → 7:45ごろ」と「約3分遅れ ・ 2つ前のバス停」 */
.dep-sched { font-size: max(.55em, .875rem); font-weight: 600; color: var(--muted); }
.dep-arrow { font-size: .55em; color: var(--muted); margin: 0 .2em; }
.dep-pred { white-space: nowrap; } /* 「22:06ごろ」を途中で折り返さない */
.dep-goro { font-size: .6em; font-weight: 700; margin-left: .1em; }
.dep-rt { grid-column: 2 / -1; font-size: .875rem; font-weight: 600; color: var(--muted); }
.dep-rt.is-late, .fav-rt.is-late, .dep-rt.is-early, .fav-rt.is-early { color: var(--late); }
.fav-rt { font-size: .875rem; font-weight: 600; color: var(--muted); }
.rt-note { margin: 8px 0; font-size: .875rem; }
/* ホームの遅れの情報の行と「更新」 */
.rt-home { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.rt-home[hidden] { display: none; }
/* 日本語以外: ボタンを右に浮かせて文を回り込ませる(home.js でボタンが先。次の行に落ちて区間のカードが下がらないように) */
html:not(:lang(ja)) .rt-home:not([hidden]) { display: flow-root; }
html:not(:lang(ja)) .rt-home .btn { float: right; margin: 0 0 4px 12px; }
html:not(:lang(ja)) .rt-home .rt-paren { display: inline; } /* 括弧の部分もボタンの横から続けて回り込ませる */
.rt-home .rt-note { margin: 0; }
.rt-home .btn { flex: none; min-height: 40px; padding: 6px 12px; font-size: .875rem; }
.rt-note.is-fail { color: var(--late); }
.rt-paren { display: inline-block; }
.rt-skew { color: var(--late); font-weight: 600; }
/* 次の便(ほかの日は最初の便。区間の一覧では、いちばん早く着く便): 黄色の帯と大きな時刻 */
.dep-first { margin-inline: -14px; padding: 10px 14px 12px; background: var(--next-bg); border-top: none; box-shadow: inset 4px 0 0 var(--next-edge); }
.dep-first + .dep { border-top: none; }
.dep-first .dep-label { color: var(--text); font-size: .9375rem; font-weight: 800; }
.dep-first .dep-time { font-size: 2.125rem; font-weight: 800; }
.dep-first .dep-info { font-size: 1rem; }
/* 次の便の「あと○分」は大きく。10分より先(灰色の札)でも、次の便は色を付ける(文字でも「あと○分」と書いてある) */
.dep-first .until { padding: 5px 14px; border-radius: 999px; font-size: 1.25rem; font-weight: 800; }
.dep-first .until-later { background: var(--next-until-bg); color: var(--next-until-ink); }
.fav-next .until { font-size: 1.125rem; font-weight: 800; padding: 3px 12px; border-radius: 999px; }
.fav-next .until-later { background: var(--next-until-bg); color: var(--next-until-ink); }
/* 遅れている便: 予想の時刻に「ごろ」。時刻表の時刻は下の一行のかっこ内(行を増やさない) */
.dep.is-delayed .dep-goro { font-size: .55em; }
/* 残り時間の札(色と文字の両方で伝える) */
.until { display: inline-block; padding: 3px 10px; border-radius: 14px; font-size: .875rem; font-weight: 700; line-height: 1.4; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.until:has(> span) { white-space: normal; }
.until > span { white-space: nowrap; }
@media (max-width: 360px) { .dep-first .dep-time { font-size: 1.875rem; } .dep { column-gap: 8px; } }

.until-soon { background: var(--soon-bg); color: var(--soon-ink); }
.until-near { background: var(--near-bg); color: var(--near-ink); }
.until-passed { background: transparent; color: var(--muted); border: 1px solid var(--field-line); padding: 2px 9px; }
.until-later { background: var(--later-bg); color: var(--later-ink); font-weight: 600; }
.route { display: inline-block; min-width: 2.6em; text-align: center; font-size: .8125rem; font-weight: 700; line-height: 1.5; padding: 0 6px; border-radius: 4px; background: var(--route-bg); color: var(--route-ink); margin-right: 6px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* 系統の札を押すと系統のページへ。札の見た目のまま下線で押せることを示し、押せる範囲を上下に広げる(見た目の大きさは変えない) */
a.route-link { position: relative; color: var(--route-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a.route-link::after { content: ''; position: absolute; inset: -10px -4px; }
a.route-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.via { display: block; color: var(--muted); font-size: .875rem; }
/* 終バス: 区切り線と薄い灰色の帯 */
.dep-last { margin: 10px -14px 0; padding: 8px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }
.dep-last .dep-label { color: var(--text); font-weight: 700; }
.dep-last .dep-time { font-size: 1.25rem; }
.dep-last.is-warn { background: var(--warn-soft); }
.dep-last.is-warn .dep-label, .dep-last.is-warn .dep-time { color: var(--warn); }
.dep-last.is-warn .until { background: var(--near-bg); color: var(--near-ink); }
/* 運休の便: 「運休」の札と取り消し線(色だけに頼らない)。次・その次には数えず、残り時間も出さない */
/* 時刻を過ぎた位置情報なしの便(発車したか遅れて来るか分からない便): 「次」の行のすぐ後に、まとめて小さな1行で控えめに。
   1本ずつは途中で折り返さず、幅が足りなければ便の区切りで次の行へ(ホームのお気に入りの1行も同じ形) */
.dep-overdue { padding: 5px 0 7px; font-size: .8125rem; line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; }
.fav-overdue, .fav-next .fav-overdue { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-label { font-weight: 600; }
.ov-item { display: inline-block; max-width: 100%; }
.dep-canceled .dep-label { justify-self: start; padding: 0 5px; border: 1px solid var(--warn); border-radius: 4px; color: var(--warn); font-size: .8125rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.dep-canceled .dep-time { font-size: 1.125rem; font-weight: 600; color: var(--muted); }
.dep-canceled s { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--warn); }
.dep-canceled .dep-info { color: var(--muted); font-size: .875rem; }
.dep-canceled .route { background: var(--later-bg); color: var(--later-ink); }
.dep-canceled .route-time small { font-size: .7em; }
.canceled-hint { font-size: .875rem; margin: 4px 0 0; }
.fav-canceled { display: inline-block; white-space: nowrap; }
/* 区間の画面: ⇄・☆、便の行「7:42発 → 8:03着」(狭いときは「→ 8:03着」で折り返す)、「早く着く」の札 */
.route-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.route-tools .btn span[aria-hidden] { font-size: 1.125rem; line-height: 1; }
.route-star span[aria-hidden] { color: var(--link); }
/* 区間の行は、残り時間の札の幅を先にとり、「7:42発 → 8:03着」は残りの幅で折り返す(大きな時刻の行で、札が着く時刻に重ならないように) */
.dep-route { grid-template-columns: 2.9rem minmax(0, 1fr) auto; }
/* ネパール語・ベトナム語の便のラベル(「त्यसपछिको」「Chuyến sau đó」)は 2.9rem の列より長く、375px で大きな時刻に接するので、列を広く。
   狭いとき(下の @media・@container)は今までどおり。ほかの言語は変えない */
html:lang(ne) .dep, html:lang(vi) .dep { grid-template-columns: 3.9rem auto minmax(0, 1fr); }
html:lang(id) .dep { grid-template-columns: 3.9rem auto minmax(0, 1fr); } /* インドネシア語のラベル「Berikut」「Setelah itu」も 2.9rem に収まらないので、ネパール語・ベトナム語と同じ幅 */
html:lang(fr) .dep, html:lang(de) .dep { grid-template-columns: 3.9rem auto minmax(0, 1fr); } /* フランス語・ドイツ語のラベル「Suivant」「Danach」も 375px で大きな時刻に接するので、インドネシア語と同じ幅(広島) */
html:lang(ne) .dep-route, html:lang(vi) .dep-route { grid-template-columns: 3.9rem minmax(0, 1fr) auto; }
html:lang(id) .dep-route { grid-template-columns: 3.9rem minmax(0, 1fr) auto; }
html:lang(fr) .dep-route, html:lang(de) .dep-route { grid-template-columns: 3.9rem minmax(0, 1fr) auto; }
.route-time { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .25em; min-width: 0; }
.route-time small { font-size: max(.55em, .875rem); font-weight: 700; margin-left: .1em; }
.route-time > .dep-arrow { font-size: .6em; }
.dep-part, .dep-arr { white-space: nowrap; }
.dep-arr { font-size: .8em; }
.dep-dur { font-size: .875rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dep-arr-none { font-size: .875rem; font-weight: 600; color: var(--muted); }
.route-pole { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; vertical-align: middle; }
.route-pole .pole-badge { min-width: 24px; height: 24px; font-size: .8125rem; padding: 0 5px; }
.last-tag { display: inline-block; font-size: .8125rem; font-weight: 700; line-height: 1.5; padding: 0 6px; margin-right: 6px; border-radius: 4px; border: 1px solid var(--text); white-space: nowrap; }
.last-tag.is-warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
/* 「前の便より早く着く」は、いちばん早く着く札よりも控えめに(枠だけ・小さめ) */
.faster { display: inline-block; font-size: .75rem; font-weight: 600; line-height: 1.4; padding: 0 5px; border-radius: 4px; border: 1px solid var(--link); color: var(--link); white-space: nowrap; }
/* いちばん早く着く便: ロゴの緑の塗りつぶしに白文字(ダークは明るい緑に濃い文字。どちらも AA) */
.dep-tags { grid-column: 2 / -1; }
.fastest-tag { display: inline-block; font-size: .875rem; font-weight: 800; line-height: 1.5; padding: 1px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
/* 後から出る便に追い越される便の一言(控えめ) */
.dep-overtaken { grid-column: 2 / -1; font-size: .8125rem; color: var(--muted); }
/* ホームの「いつもの区間」のカード(見出しのリンクと ⇄)、区間の追加の手順 */
/* 見出しの下は、のりばのカード(.pole-head + .dep-list)と同じく10px空ける(「逆向き」「この区間を外す」の枠が「次」の黄色い帯に接しないように) */
.route-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.route-card-head h3 { flex: 1; min-width: 0; }
.route-card-head h3 a { display: inline-block; padding: 8px 0; color: var(--text); overflow-wrap: anywhere; }
.route-card-swap { flex: none; min-width: 44px; padding: 8px 10px; gap: 4px; font-size: .875rem; white-space: nowrap; }
.route-hint { margin: 0 0 4px; font-size: .875rem; }
.route-card-swap span[aria-hidden] { font-size: 1.25rem; line-height: 1; }
.steps { list-style: none; margin: 8px 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; counter-reset: step; }
.steps li { counter-increment: step; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--field-line); color: var(--muted); font-size: .875rem; }
.steps li::before { content: counter(step) ". "; }
/* 済んだ手順は「✓」と文字の色で示す(E-16) */
.steps li.is-done { color: var(--text); }
.steps li.is-done::before { content: "✓ " counter(step) ". "; }
.steps li.is-current { border-color: var(--link); background: var(--accent-soft); color: var(--text); font-weight: 700; }
.route-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
/* 区間の乗る・降りるバス停を複数にする部品(stoppick.js)。選んだバス停の札(名前＋×)と、控えめな「＋ 降りるバス停を足す」 */
.route-chosen-set { margin: 0 0 12px; }
.route-chosen-set .route-chosen { margin: 0; }
.stop-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.stop-chip { display: inline-flex; align-items: center; min-height: 36px; max-width: 100%; padding: 2px 12px; border: 1px solid var(--field-line); border-radius: 999px; background: var(--surface); font-weight: 700; }
.stop-chip-name { overflow-wrap: anywhere; }
.stop-chip:has(.stop-chip-x) { padding-right: 0; }
.stop-chip-x { flex: none; min-width: 44px; min-height: 44px; margin: -4px 0; border: none; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 1.125rem; line-height: 1; cursor: pointer; }
/* 「＋ 降りるバス停を足す」は、文字だけだと見つけにくいので枠付きのボタンに */
.add-stop-btn { display: inline-flex; align-items: center; min-height: 44px; margin: 4px 0; padding: 8px 14px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--link); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.add-stop-panel { margin: 4px 0 8px; }
.add-stop-panel > .list { margin-top: 6px; }
.add-stop-close { margin: 8px 0 0; }
/* 区間の画面の「＋ 乗る・降りるバス停を足す」(ふだんは畳んでおく) */
.route-stops { margin: 4px 0 8px; }
.route-stops > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--link); font-size: .9375rem; font-weight: 600; cursor: pointer; list-style: none; }
/* 開いているときは、ボタンの下に中身の枠が続くように少し間を空ける */
.route-stops[open] > summary { margin-bottom: 8px; }
.route-stops > summary::-webkit-details-marker { display: none; }
.route-stops-body { padding: 4px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.route-stops-body > .hint { margin: 8px 0 0; }
.stop-side { margin-top: 12px; }
.stop-side-label { margin: 0 0 6px; color: var(--muted); font-size: .875rem; font-weight: 700; }
/* 乗る・降りるバス停が複数の区間の行に添える「仙台駅前から ・ 東北大学病院前で降りる」 */
.route-where { grid-column: 2 / -1; font-size: .9375rem; font-weight: 700; overflow-wrap: anywhere; }
.walk-hint { margin: 0 0 4px; font-size: .875rem; }
/* 区間の追加の「＋ 乗るバス停を足す」は、降りるバス停の検索欄の下に */
.add-stop-below { margin-top: 12px; }
.route-more-body { padding: 4px 12px 12px; }
.route-more-body .actions { margin: 8px 0 0; }
.edit-status:empty { display: none; }
.list button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 14px; border: none; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.route-register { display: grid; gap: 4px; justify-items: start; }
.route-register .hint:empty { display: none; }
/* バス停の画面で降りるバス停を選んでいるとき、畳んだ絞り込みの下に出す「…まとめて 時間順に見る」「…まとめて いつもの区間に登録」。
   同じ見た目・同じ幅で縦に並べる(依頼者 2026-10-21)。長い言語は折り返す */
.actions.route-merged { margin: 0 0 12px; }
.route-merged .route-register { width: 100%; justify-items: stretch; }
.route-merged .btn-wide { line-height: inherit; text-align: center; overflow-wrap: anywhere; }
.route-merged .seg { display: inline-block; }
.route-tip { margin: 6px 0 0; }
.pole-links { margin: 16px 0 0; }
.pole-links .plain { display: flex; flex-wrap: wrap; gap: 8px; }
.pole-links .plain li { padding: 0; }
.ended { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.btn.more { width: 100%; margin: 8px 0 0; color: var(--link); font-weight: 600; }
details.lasts { margin-top: 8px; }
details.lasts summary { cursor: pointer; color: var(--link); min-height: 44px; display: flex; align-items: center; }

.pole-map { height: 260px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 12px 0; isolation: isolate; }
.pole-map.map-msg { display: flex; align-items: center; justify-content: center; padding: 12px 14px; background: var(--surface-2); color: var(--muted); font-size: .875rem; text-align: center; }
.pole-map.map-failed { height: auto; min-height: 60px; box-shadow: none; flex-direction: column; gap: 8px; }
.pole-map.leaflet-touch .leaflet-bar a, .pole-map .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 1.375rem; }
.pole-pin span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pc, var(--pole-7)); color: var(--pole-ink); font-weight: 800; font-size: 13px; border: 2px solid var(--pin-ring); box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }

.tt { background: var(--surface); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; margin-top: 12px; }
.tt-row { display: grid; grid-template-columns: 3em minmax(0, 1fr); border-top: 1px solid var(--line); }
.tt-row:first-child { border-top: none; }
/* 列の見出し「時｜分（小さい数字は系統番号）」(F-10) */
.tt-head { background: var(--surface-2); color: var(--muted); font-size: .8125rem; font-weight: 700; }
.tt-head > div { padding: 4px 10px; }
.tt-head > div:first-child { padding: 4px 0; text-align: center; }
.tt-hour { margin: 0; padding: 8px 0; text-align: center; font-size: 1rem; font-weight: 800; line-height: 1.6; background: var(--surface-2); font-variant-numeric: tabular-nums; scroll-margin-top: 8px; }
.tt-hour:focus:not(:focus-visible) { outline: none; }
.tt-jump { margin: 10px 0 0; }
/* 「次の便」「発車済み」の見分け方(F-8) */
.tt-keys { margin: 8px 0 0; font-size: .875rem; color: var(--muted); }
.tt-key { margin-right: 2px; }
.tt-key.is-next { padding: 0 4px; border-radius: 4px; background: var(--next-bg); box-shadow: inset 0 -3px 0 var(--next-edge); color: var(--text); font-weight: 700; }
.tt-key.is-past { color: var(--past); font-weight: 700; }
/* のりばを指定しない時刻表: のりばごとに分ける(F-6) */
.tt-section + .tt-section { margin-top: 24px; padding-top: 4px; border-top: 2px solid var(--line); }
.tt-section-head { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 4px; scroll-margin-top: 8px; }
.tt-section-head:focus:not(:focus-visible) { outline: none; }
.tt-section-foot { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.tt-mins { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 10px; font-variant-numeric: tabular-nums; font-size: 1.125rem; }
.tt-mins > span { min-width: 0; overflow-wrap: anywhere; }
.tt-mins small { font-size: .8125rem; color: var(--muted); margin-left: 2px; }
.tt-mins .is-past { color: var(--past); }
.tt-mins .is-past small { color: var(--past); }
.tt-mins .is-next { font-weight: 800; color: var(--text); background: var(--next-bg); box-shadow: inset 0 -3px 0 var(--next-edge); border-radius: 4px; padding: 0 4px; margin: 0 -4px; }
/* 時刻表の「いま」の区切り(次の便の前。ここより前は発車済み) */
.tt-now { display: inline-block; margin-right: 6px; padding: 0 6px 0 4px; border-right: 3px solid var(--next-edge); color: var(--text); font-size: .8125rem; font-weight: 700; }
/* 降りるバス停を指定した時刻表: 分の下に着く時刻「→7:45」(F-2) */
.tt-mins.has-arr > span { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.3; }
.tt-arr { font-size: .875rem; color: var(--muted); }
.tt-mins .is-past .tt-arr { color: var(--past); }
.tt-mins.has-arr .tt-now { margin: 0 0 2px; border-right: none; border-bottom: 3px solid var(--next-edge); }
.tt-pole { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 700; }
/* 系統と行き先の凡例(表の上の畳める欄。F-4) */
.legend { margin-top: 12px; }
.legend > ul, .legend > p { margin: 0; padding: 8px 14px; font-size: .9375rem; }
.legend > ul + p { padding-top: 0; }
.legend li { padding: 3px 0; }
.legend .route { margin-bottom: 2px; }

.foot { max-width: 640px; margin: 24px auto 0; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); color: var(--muted); font-size: .875rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.foot p { margin: 4px 0; }
/* 下部のリンクは文の中にあって小さいので、上下に余白を足して押せる範囲を広げる(行の高さは変えない。E-16) */
.foot a { padding: 4px 0; }
/* ご意見・誤りの報告(ui/feedback.js)。フッターの1行のボタンはリンクと同じ見た目(押せる高さは 44px)。日本語の画面の今の要素には当てない */
.link-like { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--link); font: inherit; text-align: left; text-decoration: underline; cursor: pointer; }
.foot .fb-line { margin: 0; }
/* ご意見・誤りの報告の欄(フッターの下の #fb-slot。その場で開く) */
.fb-panel { max-width: 640px; margin: 0 auto; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); overflow-wrap: anywhere; scroll-margin-top: 72px; }
.fb-panel h2 { margin: 0 0 8px; font-size: 1.125rem; }
.fb-panel h3 { margin: 18px 0 6px; font-size: 1rem; }
.fb-lead { margin: 0 0 14px; }
.fb-kinds, .fb-tr-cands fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.fb-kinds legend, .fb-tr-cands legend { margin-bottom: 6px; padding: 0; font-weight: 700; }
.fb-kind-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-kind { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--field-line); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; }
.fb-kind:has(input:checked) { border-color: var(--link); background: var(--accent-soft); font-weight: 700; }
.fb-kind input, .fb-tr-cand input, .fb-attach input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--link); }
.fb-kind-hint { margin: 8px 0 0; }
.fb-kind-hint:empty, .fb-err:empty { display: none; }
.fb-err { margin: 6px 0 0; color: var(--warn); font-weight: 600; }
.fb-field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; }
.fb-field label { font-weight: 700; }
.fb-panel textarea, .fb-panel input[type=text], .fb-panel input[type=email] { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: max(16px, 1rem); }
.fb-panel textarea { resize: vertical; }
.fb-panel [aria-invalid=true] { border-color: var(--warn); }
#fb-email-note { margin: 6px 0 0; }
.fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fb-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: .875rem; }
.fb-info dt { color: var(--muted); }
.fb-info dd { margin: 0; }
.fb-attach { margin: 8px 0 0; }
.fb-attach label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.fb-privacy { margin: 12px 0 0; }
.fb-actions { margin: 16px 0 0; }
.fb-status:focus { outline: none; }
.fb-status .notice { margin: 12px 0 0; }
.fb-retry-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 0 0; }
.fb-offline p { margin: 0 0 4px; }
.fb-thanks { margin: 0; font-weight: 700; }
.fb-reply-note { margin: 6px 0 0; }
.fb-close-row { margin: 12px 0 0; }
.fb-tr-cands { margin: 10px 0 0; }
.fb-tr-cand { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.fb-tr-cand input { margin-top: 2px; }
.fb-tr-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-tr-ja { color: var(--muted); font-size: .875rem; }
/* ホームの評価の欄(ui/rating.js)。画面の下に浮かぶ(下の .rate-sheet)。★は選んだ数まで塗り、形(★/☆)も変える(色だけに頼らない) */
.rate-box { margin: 16px 0 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rate-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rate-head h2 { margin: 10px 0 0; font-size: 1rem; }
.rate-close { flex: none; width: 44px; padding: 0; }
.rate-lead { margin: 4px 0 8px; }
.rate-stars { min-width: 0; margin: 0; padding: 0; border: 0; }
.rate-stars legend { margin: 0 0 4px; padding: 0; font-size: .875rem; font-weight: 600; }
.rate-row { display: flex; gap: 4px; }
.rate-opt { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius); color: var(--link); cursor: pointer; }
.rate-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.rate-opt:has(.rate-input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.rate-star { font-size: 2rem; line-height: 1; }
.rate-ends { display: flex; justify-content: space-between; width: 256px; max-width: 100%; margin: 2px 0 0; color: var(--muted); font-size: .8125rem; }
.rate-more .fb-field { margin-top: 10px; }
.rate-box textarea { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: max(16px, 1rem); resize: vertical; }
.rate-actions { margin: 10px 0 0; }
.rate-status { margin: 8px 0 0; color: var(--warn); font-weight: 600; }
.rate-status:empty { display: none; }
.rate-thanks { margin: 8px 0 0; font-weight: 700; }
/* 評価の欄は、ホームを開いて数秒後に画面の下へ小さく浮かべる(2026-11-12)。モーダルにしない(背景を暗くしない・欄の外はそのまま使える)。
   ヘッダー(z-index 1000)・言語の選択(1001)より下。スマホの下の安全域・横向きの左右の安全域を避ける。高すぎるときは欄の中でスクロール */
.rate-sheet { position: fixed; z-index: 900; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box; max-width: 30rem; margin: 0 auto; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 6px 10px 14px; box-shadow: 0 4px 20px rgba(15, 25, 23, .18), 0 1px 3px rgba(15, 25, 23, .12); }
.rate-sheet .rate-head h2 { margin: 9px 0 0; }
.rate-sheet .rate-opt { height: 44px; }
.rate-sheet .rate-star { font-size: 1.75rem; }
.rate-sheet .rate-ends { margin: 0; }
.rate-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin: 6px 8px 0 0; }
.rate-note { flex: 1 1 12em; margin: 0; font-size: .8125rem; }
.rate-skip { flex: none; padding: 6px 14px; border-radius: 999px; font-size: .875rem; }
.rate-sheet .rate-more, .rate-sheet .rate-status, .rate-sheet .rate-thanks { margin-right: 8px; }
.rate-sheet .rate-info { margin: 8px 0 0; }
.rate-sheet .rate-thanks { margin-bottom: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .rate-sheet:not([hidden]) { animation: rate-up .2s ease-out; }
}
@keyframes rate-up { from { opacity: 0; transform: translateY(16px); } }
/* 欄が出ている間は、ページの下に欄の高さ分の余白(いちばん下の内容・キーボードで移ったフォーカスが欄の裏に隠れないように。高さは rating.js が --rate-sheet-h に入れる) */
html.has-rate-sheet { scroll-padding-bottom: calc(var(--rate-sheet-h, 0px) + 24px); }
html.has-rate-sheet body { padding-bottom: calc(var(--rate-sheet-h, 0px) + 16px + env(safe-area-inset-bottom, 0px)); }
/* ホームの短い説明(区間・お気に入りが無いときだけ) */
.intro { margin: 0 0 16px; }
.intro-lead { margin: 0; font-size: .9375rem; }
.intro-more { margin-top: 2px; font-size: .875rem; color: var(--muted); }
/* 開閉できることが分かるよう、畳んだ欄(.fold)と同じ向きの印を付ける(下線だとリンクに見えるので付けない) */
.intro-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; color: var(--link); font-weight: 600; list-style: none; }
.intro-more > summary::-webkit-details-marker { display: none; }
.intro-more > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-left: 2px; }
.intro-more[open] > summary::before { transform: rotate(45deg); }
.intro-more ul { margin: 0 0 4px; padding-left: 1.2em; line-height: 1.7; }
.filter-hint { margin: 0; }
.credits { margin: 4px 0; padding-left: 1.2em; }
.credits li { margin: 2px 0; }
/* 交通局の公式サイトへのボタン: 下に小さく「（交通局の公式サイトが開きます）」 */
.btn-ext { flex-direction: column; gap: 0; text-align: center; }
.ext-note { font-size: .875rem; color: var(--muted); font-weight: normal; }
/* 新しいタブで開くリンクの印(読み上げには「（新しいタブで開きます）」を添える。common.js の newTabMark) */
.ext-mark { display: inline-block; margin-left: .2em; font-size: .85em; font-weight: normal; text-decoration: none; }
/* ダイヤの切り替え: ボタンの下に押すと出る日付。ほかの日を表示中は帯で目立たせる */
.dia .btn { flex: 1 1 0; min-width: 0; max-width: 6rem; flex-direction: column; gap: 0; padding: 4px; line-height: 1.25; }
.dia-date { font-size: .8125rem; color: var(--muted); font-weight: normal; overflow-wrap: anywhere; } /* 文字を大きくしたときは日付を2行に */
html:lang(fr) .dia .btn > span:first-child { overflow-wrap: anywhere; hyphens: auto; } /* フランス語の「Aujourd’hui」が 320・375px で日付の札の枠からはみ出すので、語の中でも折り返せるように(広島 Task 18 の画面の確かめ) */
.dia .btn[aria-pressed="true"] .dia-date { color: inherit; }
.dia-other { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); font-size: .875rem; font-weight: 600; }
.dep-rt-none { font-weight: normal; font-size: .875rem; }
/* 遅れの情報を取れていない会社の名前(熊本だけの行 dep-rt-off)は、名前の途中で折り返さない */
.dep-rt-off .rt-op { white-space: nowrap; }
.rt-legend { margin: 6px 0 0; }
/* 区間の行で遅れているとき: 発・着それぞれの時刻の前に小さく「時刻表」「予想」 */
/* 遅れの一行に添える時刻表の時刻「（時刻表 7:31）」。かっこ内は途中で折り返さない */
.dep-was { display: inline-block; font-weight: 600; }
.dep-pos { display: inline-block; }
/* 遅れている区間の次の便は「7:35ごろ発 → 7:45ごろ着」が長くなるので、少しだけ小さく */
.dep-first.is-delayed .route-time { font-size: 1.75rem; }
/* とても狭い幅(375pxの画面を2倍に拡大したときなど)や、文字を大きくしたとき(カードの幅が16文字分に満たないとき。E-8):
   残り時間の札は時刻の下の行へ回し、区間の発・着も折り返せるようにする(横にはみ出したり、札が時刻に重なったりしないように) */
.cards .card, .route-card { container-type: inline-size; }
@media (max-width: 300px) {
  .dep, html:lang(ne) .dep, html:lang(vi) .dep { grid-template-columns: 2.9rem minmax(0, 1fr); }
  html:lang(id) .dep { grid-template-columns: 2.9rem minmax(0, 1fr); }
  html:lang(fr) .dep, html:lang(de) .dep { grid-template-columns: 2.9rem minmax(0, 1fr); }
  .dep-head { display: contents; } /* 狭いときは今までどおり、札をグリッドの下の行へ */
  .dep-head .route-time { min-width: 0; } /* 今までどおり(上の min-content は横に並べるときだけ) */
  .dep-until { grid-column: 2 / -1; justify-self: start; text-align: left; }
  .dep-until:empty { display: none; }
  .dep-part, .dep-arr { white-space: normal; }
  html:not(:lang(ja)) .dep-pred { white-space: normal; } /* 英語の「(approx.)」「dep.」が付くと長いので、狭いときは折り返す(日本語は今までどおり) */
  html:not(:lang(ja)) .dep-until .until, html:not(:lang(ja)) .dep-until .until > span { white-space: normal; } /* 英語の「Arriving soon」など長い札は、狭いときは折り返す */
  html:lang(ja) .dep-first .dep-until .until { padding-inline: 8px; } /* 日本語の次の便の大きな札「あと1時間35分」が 188px で横に 9px はみ出すので、インドネシア語と同じく左右の余白を狭く(高知。字の途中で折り返さないよう、1行のまま) */
  html:lang(ja) .fastest-tag { white-space: normal; } /* 日本語の「いちばん早く着く」の札(132px)も 188px の区間の欄(約80px)から 22px はみ出すので、vi・id・fr・de と同じく狭いときは折り返す(和歌山の check_a11y 2026-11-06。301px 以上は今のまま) */
  html:lang(vi) .fastest-tag, html:lang(vi) .dep-dur { white-space: normal; } /* ベトナム語の「Đến sớm nhất」「, đi xe khoảng 2 phút」は 188px で横にはみ出すので、狭いときは折り返す(ほかの言語は今までどおり) */
  html:lang(id) .fastest-tag, html:lang(id) .dep-dur { white-space: normal; } /* インドネシア語の「Tiba pertama」「, lama perjalanan sekitar 1 menit」も 188px で横にはみ出すので、ベトナム語と同じく狭いときは折り返す */
  html:lang(fr) .fastest-tag, html:lang(fr) .dep-dur, html:lang(de) .fastest-tag, html:lang(de) .dep-dur { white-space: normal; } /* フランス語「Arrive le premier」「, trajet environ 1 min」・ドイツ語「Kommt zuerst an」も 188px で横にはみ出すので、狭いときは折り返す(広島) */
  html:lang(fr) .dep-first.dep-route .dep-until, html:lang(de) .dep-first.dep-route .dep-until { grid-column: 1 / -1; } /* ラベル「Prochain」「Nächster」の列が広く、区間の次の便の札「À l’approche」が 188px で横にはみ出すので、札を時刻の下の行の頭から(広島) */
  html:lang(fr) .dep-first .until, html:lang(de) .dep-first .until { padding-inline: 8px; overflow-wrap: anywhere; hyphens: auto; } /* 大きな文字の1語「l’approche」が札の余白の分だけはみ出すので、インドネシア語と同じく余白を狭く、語の中でも折り返せるように(広島) */
  html:lang(fr) .dep-rt, html:lang(de) .dep-rt { overflow-wrap: anywhere; hyphens: auto; } /* 遅れの一行の長い語(ドイツ語「Verspätungsangabe」)が 188px で横にはみ出すので、語の中でも折り返せるように(広島) */
  html:lang(th) .dep-dur { white-space: normal; } /* タイ語の「, เวลาเดินทาง ประมาณ 1 นาที」も 188px で横にはみ出すので、ベトナム語・インドネシア語と同じく狭いときは折り返す */
  html:lang(de) .add-stop-btn, html:lang(de) .route-stops > summary { overflow-wrap: anywhere; hyphens: auto; } /* ドイツ語の長い合成語「Ausstiegshaltestelle」が 188px でボタンからはみ出すので、狭いときだけ語の中で折り返す(広島。設計書 4.2) */
}
@container (max-width: 18.5em) {
  /* 文字がとても大きいときは、ラベルの列を内容の幅にして、時刻や「あと○分」の幅を確保する */
  .dep, html:lang(ne) .dep { grid-template-columns: auto minmax(0, 1fr); }
  html:lang(vi) .dep { grid-template-columns: min-content minmax(0, 1fr); } /* ベトナム語のラベル「Chuyến tới」は長く、時刻の列が狭くなって 188px で横にはみ出すので、ラベルを折り返す(ほかの言語は今までどおり) */
  html:lang(id) .dep { grid-template-columns: min-content minmax(0, 1fr); } /* インドネシア語のラベル「Setelah itu」は2語で、188px では1行に収まらないので、ベトナム語と同じくラベルを折り返す */
  html:lang(fr) .dep, html:lang(de) .dep { grid-template-columns: min-content minmax(0, 1fr); } /* フランス語・ドイツ語も、ラベルの列を広げた分、インドネシア語と同じくラベルの列を内容の幅に(広島) */
  html:lang(id) .dep-first .until { padding-inline: 8px; } /* 「Segera tiba」の「Segera」は大きな文字で1語のため、188px で札の左右の余白の分だけはみ出す */
  .dep-head { display: contents; } /* 文字がとても大きいときは今までどおり、札をグリッドの下の行へ */
  .dep-head .route-time { min-width: 0; } /* 今までどおり(上の min-content は横に並べるときだけ) */
  .dep-until { grid-column: 1 / -1; justify-self: start; text-align: left; }
  .dep-until:empty { display: none; }
  .dep-part, .dep-arr { white-space: normal; }
  html:not(:lang(ja)) .dep-pred { white-space: normal; } /* 英語の「(approx.)」「dep.」が付くと長いので、狭いときは折り返す(日本語は今までどおり) */
  html:not(:lang(ja)) .dep-until .until, html:not(:lang(ja)) .dep-until .until > span { white-space: normal; } /* 英語の「Arriving soon」など長い札は、狭いときは折り返す */
  html:lang(ja) .dep-first .dep-until .until { padding-inline: 8px; } /* 日本語の次の便の大きな札「あと1時間35分」が 188px で横に 9px はみ出すので、インドネシア語と同じく左右の余白を狭く(高知。字の途中で折り返さないよう、1行のまま) */
  html:lang(vi) .fastest-tag, html:lang(vi) .dep-dur { white-space: normal; } /* ベトナム語の「Đến sớm nhất」「, đi xe khoảng 2 phút」は 188px で横にはみ出すので、狭いときは折り返す(ほかの言語は今までどおり) */
  html:lang(id) .fastest-tag, html:lang(id) .dep-dur { white-space: normal; } /* インドネシア語の「Tiba pertama」「, lama perjalanan sekitar 1 menit」も 188px で横にはみ出すので、ベトナム語と同じく狭いときは折り返す */
  html:lang(fr) .fastest-tag, html:lang(fr) .dep-dur, html:lang(de) .fastest-tag, html:lang(de) .dep-dur { white-space: normal; } /* フランス語「Arrive le premier」「, trajet environ 1 min」・ドイツ語「Kommt zuerst an」も 188px で横にはみ出すので、狭いときは折り返す(広島) */
  html:lang(fr) .dep-first.dep-route .dep-until, html:lang(de) .dep-first.dep-route .dep-until { grid-column: 1 / -1; } /* ラベル「Prochain」「Nächster」の列が広く、区間の次の便の札「À l’approche」が 188px で横にはみ出すので、札を時刻の下の行の頭から(広島) */
  html:lang(fr) .dep-first .until, html:lang(de) .dep-first .until { padding-inline: 8px; overflow-wrap: anywhere; hyphens: auto; } /* 大きな文字の1語「l’approche」が札の余白の分だけはみ出すので、インドネシア語と同じく余白を狭く、語の中でも折り返せるように(広島) */
  html:lang(fr) .dep-rt, html:lang(de) .dep-rt { overflow-wrap: anywhere; hyphens: auto; } /* 遅れの一行の長い語(ドイツ語「Verspätungsangabe」)が 188px で横にはみ出すので、語の中でも折り返せるように(広島) */
  html:lang(th) .dep-dur { white-space: normal; } /* タイ語の「, เวลาเดินทาง ประมาณ 1 นาที」も 188px で横にはみ出すので、ベトナム語・インドネシア語と同じく狭いときは折り返す */
  .star { flex-direction: column; gap: 2px; padding: 4px 8px; line-height: 1.2; }
}
/* 区間の次の便は時刻が大きく「発 → 着」の2つあるので、幅の狭いカード(320pxの画面など。文字の大きさに合わせて em で測る)では
   残り時間の札を時刻の下の行へ回す(「あと5時間48分」のような長い札が「7:11着」に重ならないように) */
@container (max-width: 18em) {
  .dep-first.dep-route .dep-until { grid-column: 2 / -1; justify-self: start; text-align: left; margin: 2px 0 4px; } /* 下の「いちばん早く着く」の札と接しないように */
  .dep-first.dep-route .dep-until:empty { display: none; }
}
/* ダーク表示では地図の画像の明るさを落とす(白い地図がまぶしくないように。印・ボタンはそのまま。E-9) */
@media (prefers-color-scheme: dark) {
  .pole-map .leaflet-tile-pane { filter: brightness(.72) contrast(1.08); }
  .pole-map.leaflet-container { background: #2a2f2e; }
}
/* ダーク表示では、のりばの丸の色がカードの地に溶けやすいので、薄い縁を付ける(番号の文字でも区別できる。E-14) */
@media (prefers-color-scheme: dark) {
  .pole-badge { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5); }
}
/* 動きを減らす設定がオンなら、スクロールや変化の動きを付けない(E-15) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== 案A「淡い緑を基調」 =====
   ロゴの緑を薄めて、欄の見出しの帯・カードの上端・主なボタンの塗りに使う。地も少し緑に寄せる。
   「次」の便の黄色の帯(ロゴの行き先表示の色)はそのまま */
:root {
  --bg: #edf3f1; --surface: #ffffff; --surface-2: #f0f6f4; --muted: #4f5e5a; --line: #d6e3df; --field-line: #a9c4be;
  --accent-soft: #e0eeeb;
  /* 欄の見出しの帯と、その文字・左の線 */
  --band-bg: #d9ebe6; --band-ink: #17433f; --band-edge: #2a6f6a;
  /* カードの上端の線 */
  --card-top: #5f9f97;
  --later-bg: #e4eeeb; --later-ink: #2f4a46;
  --route-bg: #24423f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513; --surface: #17201e; --surface-2: #1d2926; --muted: #a9b9b4; --line: #2a3a37; --field-line: #3f5753;
    --accent-soft: #1a3532;
    --band-bg: #1a3330; --band-ink: #b6e6de; --band-edge: #6cc4b9;
    --card-top: #4f978e;
    --later-bg: #22302d; --later-ink: #d0dfdb;
    --route-bg: #3d5753;
  }
}
/* 配色の調整(2026-10-19 依頼者の配色案): 主役 #115E59・アクセント #F4C95D・ページの地 #F6F8F7・カード #FFFFFF・本文 #1F2937。
   次の便の背景(--next-bg)は今のまま。暗い表示は今のまま(アクセントの黄色だけ合わせる) */
@media not all and (prefers-color-scheme: dark) {
  :root {
    --bg: #f6f8f7; --surface: #ffffff; --text: #1f2937;
    --accent: #115e59; --next-until-bg: #115e59; --band-edge: #115e59; --band-ink: #0d3f3b; --card-top: #3f827c;
  }
}
:root { --next-edge: #f4c95d; }
.bar { border-bottom: 3px solid var(--bar-edge); }
/* 欄の見出し(いつもの区間・お気に入り・バス停を探す など)を、薄い緑の帯にする */
section:not(.card) > h2, section:not(.card) > .sec-head { margin: 0 0 10px; padding: 6px 12px; border-radius: 8px; background: var(--band-bg); color: var(--band-ink); box-shadow: inset 4px 0 0 var(--band-edge); }
section:not(.card) > h2 { padding-block: 10px; }
section:not(.card) > .sec-head h2 { color: var(--band-ink); }
/* カードの上端に緑の線 */
.card { border-top: 4px solid var(--card-top); }
/* 主なボタンは緑の塗り、ふつうのボタンは緑がかった枠 */
.btn { border-color: var(--field-line); }
.btn-wide, .near .btn, .btn-block { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.btn-remove { border-color: var(--warn); } /* 外すボタンは注意の色の枠(上の .btn の色の決まりより後に置く) */
.fold { border-color: var(--field-line); }
.fold > summary::before { color: var(--link); }
.chips a { border-color: var(--field-line); }
.pole-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
/* 位置情報を許可する設定の場所(現在地が使えないときの案内) */
.geo-help { margin: 8px 0 0; }
.geo-help summary { cursor: pointer; color: var(--link); font-weight: 700; padding: 10px 0; }
.geo-help ol { margin: 4px 0 0; padding-left: 1.4em; line-height: 1.7; display: grid; gap: 4px; }

/* 旧アドレス(miraitei.life)で開いたときの移転の案内(ui/moving.js)。ヘッダーの下に1行、閉じられる */
/* 旧アドレスの移転の案内。見落とされないよう、緑の太い枠と大きめの見出しで目立たせる */
.move-note { position: relative; max-width: 640px; margin: 12px auto 0; padding: 14px 52px 14px 16px; background: var(--accent-soft); color: var(--text); border: 2px solid var(--link); border-radius: var(--radius); font-size: .9375rem; display: grid; gap: 10px; }
@media (max-width: 680px) { .move-note { margin: 12px 16px 0; } }
.move-note p { margin: 0; }
.move-note .move-title { font-size: 1.125rem; font-weight: 800; line-height: 1.5; color: var(--text); }
.move-note .move-keep { line-height: 1.7; }
.move-note .move-keep strong { color: var(--link); }
.move-note .move-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.move-close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text); font-size: 1.375rem; line-height: 1; cursor: pointer; border-radius: 8px; }
.move-close:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.move-code-box > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--link); font-weight: 600; }
.move-code-box[open] { display: grid; gap: 8px; }
.move-steps { margin: 0; padding-left: 1.4em; line-height: 1.7; }
.move-steps li + li { margin-top: 6px; }
.move-steps li > .btn { display: flex; width: fit-content; margin: 6px 0 2px; }
.move-steps li > .move-copied { margin: 2px 0 0; font-size: .875rem; color: var(--link); }
.move-code { width: 100%; font: inherit; font-size: max(16px, .875rem); padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--surface); color: var(--text); word-break: break-all; }
.move-copied:empty { display: none; }
.move-from-link { margin: 24px 0 0; font-size: .875rem; }
.move-from-link a { display: inline-flex; align-items: center; min-height: 44px; }
.import-h { font-size: 1rem; margin: 18px 0 6px; }
.import-list { margin: 0; padding-left: 1.3em; line-height: 1.7; }
.import-actions { margin-top: 18px; }

/* 英語・中国語の画面で、訳した名前に添える日本語の名前(現地の案内板と見比べられるように) */
.name-ja { display: block; margin-top: 2px; font-size: .8125rem; font-weight: 400; color: var(--muted); }
.name-ja-inline { font-size: .875em; font-weight: 400; color: var(--muted); }
/* 外国語の訳名は長く、区切りの無い並び(Kitayama→Shiheimachi(Loop))もあるので、狭い画面(188px など)では途中で折り返す */
.tr-name { overflow-wrap: anywhere; }
/* 訳名・日本語の名前を含むボタンは、flex の列に分けず、ふつうの文として折り返す */
.btn:has(> .tr-name) { display: block; text-align: center; padding-top: 10px; padding-bottom: 10px; }
.names-note { margin: 8px 0 0; }

/* ヘッダーの言語のボタン(右端)。ヘッダーは今までどおり1行(ロゴ・ボタンを横に並べる)。
   幅が足りないときは、ロゴの画像を少し小さく描く(高さの枠はそのまま。object-fit: contain)。
   ボタンは広い画面では「🌐 日本語」、430px 未満では「🌐 日」など、360px 未満では 🌐 だけ(読み上げの名前は .lang-say で補う) */
.bar { display: flex; align-items: center; gap: 6px; }
.bar .brand { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
.bar .brand picture { flex: 0 1 auto; }
/* ボタンは押しやすい 44px の高さのまま、上下の余白に少しはみ出させて、ヘッダーの高さを今までと同じにする */
.lang-switch { position: relative; flex: 0 0 auto; margin: -8px 0; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .875rem; cursor: pointer; }
.lang-btn .lang-code { display: none; }
@media (max-width: 429px) {
  .lang-btn { padding: 0 8px; }
  .lang-btn .lang-cur { display: none; }
  .lang-btn .lang-code { display: inline; }
}
@media (max-width: 359px) {
  .lang-btn { padding: 0; }
  .lang-btn .lang-code { display: none; }
}
.lang-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 1001; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 9em; }
.lang-menu button { display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lang-menu button[aria-current="true"] { font-weight: 700; color: var(--link); }
/* 中国語の画面は中国語の書体を先に(日本語の字形にならないように)。日本語の名前(lang="ja")は日本語の書体(静的ページの STOPPAGE_I18N_CSS と同じ)。
   一覧の「简体中文」「繁體中文」も、どの画面でもその言語の書体で */
:lang(zh-Hans) body, body:lang(zh-Hans), .lang-menu button[lang="zh-Hans"] { font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Hiragino Sans", "Noto Sans JP", sans-serif; }
:lang(zh-Hant) body, body:lang(zh-Hant), .lang-menu button[lang="zh-Hant"] { font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Hiragino Sans", "Noto Sans JP", sans-serif; }
/* 韓国語の画面は韓国語の書体を先に(静的ページの STOPPAGE_KO_CSS と同じ)。語の途中で折り返さない(長すぎる語だけ折る)。
   中の日本語の名前(lang="ja")は語の間に空白が無いので、今までどおり折り返す */
:lang(ko) body, body:lang(ko), .lang-menu button[lang="ko"] { font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", "Hiragino Sans", "Noto Sans JP", sans-serif; }
html:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
html:lang(ko) [lang="ja"] { word-break: normal; }
/* ネパール語の画面はデーヴァナーガリーの書体を先に(静的ページの STOPPAGE_NE_CSS と同じ)。字の上下の記号のため見出しの行を少し高く。
   本文(1.6)・ボタンの数字(line-height: 1)は変えない。中の日本語の名前(lang="ja")は今の日本語の書体(下の行) */
:lang(ne) body, body:lang(ne), .lang-menu button[lang="ne"] { font-family: system-ui, -apple-system, "Kohinoor Devanagari", "Devanagari Sangam MN", "Noto Sans Devanagari", "Nirmala UI", "Mangal", "Hiragino Sans", "Noto Sans JP", sans-serif; }
html:lang(ne) h1, html:lang(ne) h2, html:lang(ne) h3 { line-height: 1.5; }
:lang(th) body, body:lang(th), .lang-menu button[lang="th"] { font-family: system-ui, -apple-system, "Thonburi", "Sukhumvit Set", "Noto Sans Thai", "Noto Sans Thai UI", "Leelawadee UI", "Tahoma", "Hiragino Sans", "Noto Sans JP", sans-serif; }
html:lang(th) h1, html:lang(th) h2, html:lang(th) h3 { line-height: 1.5; } /* タイ文字の上下の記号(「ที่」「นี้」)が隣の行と重ならないよう、ネパール語と同じ高さ */
html:lang(th) .th-nw { white-space: nowrap; } /* 名前(アプリ名・都市名)を途中で折り返さない(js/ui/dom.js の setKeepWhole。静的ページの STOPPAGE_TH_CSS と同じ) */
html:not([lang="ja"]) [lang="ja"] { font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; }

/* ホームの乗る・降りるの欄(ui/homeform.js)。ほかの画面の見た目を変えないよう、.from-to で始まるクラスだけに書く */
.from-to-label { display: block; margin: 8px 0 4px; font-weight: 600; }
.from-to-line { display: flex; gap: 8px; align-items: stretch; }
.from-to-line input[type=search] { flex: 1 1 auto; min-width: 0; }
.from-to-near-btn { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 0 12px; white-space: nowrap; }
.from-to-go { margin-top: 12px; width: 100%; }
.from-to-msg { margin: 10px 0 0; }
.from-to-near-box { margin-top: 8px; }

/* ホームの最近調べたもの(ui/home.js の historySection)。「つぎのバスを見る」の欄の下 */
.searches { margin-top: 16px; }
/* ホームの「いつもの区間に登録」で登録したカードを、しばらく枠で示す(.from-to の続き。共通の決まり 4 章)。
   枠はカードにぴったり付け、上端の緑の線(.card の border-top)も枠の色にする(離すと上の辺だけ二重に見えた。依頼者 2026-10-25) */
.route-card.route-card-new { outline: 3px solid var(--link); outline-offset: 0; border-top-color: var(--link); }
.from-to-register { margin-top: 8px; }
.from-to-already { margin: 8px 0 0; }
/* ホームの一番下の「このアプリを人に教える」(ui/share.js)。目立つように配色の黄色の地に濃い文字(依頼者 2026-10-21。明るい・暗い表示とも同じ色)。押すとその場で欄を開く */
.share { margin-top: 8px; }
.share-toggle { width: 100%; min-height: 52px; font-size: 1rem; font-weight: 700; color: var(--share-ink); background: var(--share-bg); border-color: var(--share-edge); }
.share-toggle:hover { background: var(--share-hover); }
.share-toggle::after { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 4px; }
.share-toggle[aria-expanded=true]::after { transform: rotate(-135deg); margin-top: 3px; }
.share-panel { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.share-panel[hidden] { display: none; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-actions .btn { flex: 1 1 10em; }
.share-msg:empty { display: none; }
.share-url { margin: 12px 0 0; font-size: .875rem; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.share-field { width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface); border: 1px solid var(--input-line, var(--field-line)); border-radius: var(--radius); }
.share-qr { margin: 12px 0 0; display: flex; align-items: center; gap: 12px; }
.share-qr img { flex: none; width: 128px; height: 128px; padding: 6px; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.share-qr figcaption { font-size: .875rem; color: var(--muted); line-height: 1.5; }
/* 「元に戻す」の欄の ✕(閉じる。依頼者 2026-10-21) */
/* 右上の角に置き、文と「元に戻す」はその左の幅で折り返す(✕ だけが次の行に回らないように) */
.undo-bar { position: relative; padding-right: 50px; } /* どの欄にも ✕ があるので、:has() に頼らない(古い Safari。最終レビュー Minor 2) */
.undo-bar .undo-close { position: absolute; top: 2px; right: 2px; width: 44px; padding: 0; font-weight: 400; font-size: 1rem; color: var(--muted); background: transparent; border-color: transparent; }
/* 初めてでない人の、一番下の「このツールについて」(上の説明と同じ文を畳んで置く) */
.about-more { margin: 16px 0 0; }
.about-more > .intro-lead { margin: 4px 0 6px; color: var(--text); }
/* 訳の画面の札(依頼者 2026-10-21): 日本語の名前を訳の下の行に置くので2行になる。丸すぎないよう角は控えめに(日本語の画面は今までどおり) */
html:not(:lang(ja)) .chips a { border-radius: var(--radius); }
.chip-name { display: block; }
.chip-name .name-ja { margin-top: 0; }
/* 車いす対応の便の印(行き先の後ろ。青森 判断 D14。データに印のある地域だけに出る) */
.wc-tag { display: inline-block; font-size: .8125rem; font-weight: 600; color: var(--muted); }
/* 深夜の便の印(行き先の後ろ。熊本 設計 3.9。データに印のある地域だけに出る)。時刻表の欄は分の横に小さく */
.night-tag { display: inline-block; padding: 0 5px; border: 1px solid var(--field-line); border-radius: 4px; font-size: .75rem; font-weight: 600; line-height: 1.5; color: var(--muted); }
.tt-night { margin-left: 3px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.tt-mins .is-past .tt-night { color: var(--past); }
/* 便の注記(広島 設計 2026-10-26-hiroshima 3.7。データに注記のある便だけ)。深夜の印と同じ形。長い注記(「東観音台線・湯来線」)は折り返す */
.note-tag { display: inline-block; max-width: 100%; padding: 0 5px; border: 1px solid var(--field-line); border-radius: 4px; font-size: .75rem; font-weight: 600; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.tt-note { margin-left: 3px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.tt-mins .is-past .tt-note { color: var(--past); }
/* 予約制の停車の印「要予約」「降車は申し出」(富山の月岡西緑町。area.json に reserve のある地域だけに出る)。乗り逃しにつながるので、注意の色で深夜の印より目立たせる */
.reserve-tag { display: inline-block; max-width: 100%; padding: 0 5px; border: 1px solid var(--warn); border-radius: 4px; background: var(--warn-soft); font-size: .75rem; font-weight: 700; line-height: 1.5; color: var(--warn); overflow-wrap: anywhere; }
.tt-reserve { margin-left: 3px; font-size: .75rem; font-weight: 700; color: var(--warn); }
.tt-mins .is-past .tt-reserve { color: var(--past); }
/* 共同運行の系統の便の社の短い名前(広島 設計 4.5。系統の札の後ろに小さく。札にはバッジを付けない) */
.trip-op { font-size: .8125rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
/* 名前の参考訳・参考表記の印(広島 設計 6.5。names.json に ref のある地域だけ。アプリと静的ページ) */
/* 札は行に入らなければ札ごと次の行へ回り、それでも入らない狭い画面(188px の vi・id・fr・de)では札の中で折り返す(全体レビュー1) */
.ref-tag { display: inline-block; max-width: 100%; margin-left: 2px; padding: 0 4px; border: 1px solid var(--field-line); border-radius: 3px; font-size: .6875rem; font-weight: 600; line-height: 1.4; color: var(--muted); vertical-align: 1px; }
/* 会社のバッジ(系統の札の中。熊本 設計 4.5。operators に short のある地域だけに出る)。色は operators の color・ink(style)。
   文字を必ず入れる(色だけで分けない)。札の下線を引き継がないよう inline-block */
.op-badge { display: inline-block; margin-left: 4px; padding: 0 4px; border: 1px solid var(--field-line); border-radius: 3px; font-size: .75rem; font-weight: 700; line-height: 1.4; letter-spacing: 0; white-space: nowrap; vertical-align: 1px; }
.op-badge[style] { border-color: transparent; }
/* 系統の札の中の社名の札は、便の行の欄に入らないとき(188px の「30-4 JRバス中国」)だけ折り返す。入るときは今と同じ1行(全体レビュー1) */
.route .op-badge { white-space: normal; overflow-wrap: anywhere; }
/* 運行情報(各社の Alert。熊本 Task 9・設計 3.8。応答に alerts のある地域だけに出る)。ホームの畳んだ欄と、バス停の画面の1行 */
.alerts { padding: 4px 14px 12px; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-head { margin: 0; overflow-wrap: anywhere; }
.alert-ops { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-right: 4px; vertical-align: 1px; }
.alert-op { display: inline-block; padding: 0 6px; border: 1px solid var(--field-line); border-radius: 4px; font-size: .75rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.alert-title { font-size: .9375rem; }
/* 本文は各社の文のまま(改行もそのまま出す) */
.alert-body { margin: 6px 0 0; font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.alert-jaonly { color: var(--muted); font-weight: 400; }
.alert-routes, .alert-link { margin: 6px 0 0; font-size: .875rem; }
/* 会社全体のお知らせは小さな字で下に */
.alert-wide { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.alert-wide-head { margin: 4px 0 0; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.alert-wide .alert-title, .alert-wide .alert-body { font-size: .8125rem; }
.alert-wide .alert-body { color: var(--muted); }
/* 便ごとのお知らせ(広島。ui/common.js の tripNote): 便の行の下に小さな「お知らせ」。押すと題名と本文 */
.dep-note { grid-column: 2 / -1; font-size: .8125rem; }
.dep-note > summary { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--link); font-weight: 600; cursor: pointer; list-style: none; }
.dep-note > summary::-webkit-details-marker { display: none; }
.dep-note > summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 2px; }
.dep-note[open] > summary::after { transform: rotate(-135deg); margin: 3px 0 0 2px; }
.dep-note-list { margin: 6px 0 2px; padding: 0; list-style: none; }
.dep-note-list > li + li { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.dep-note .alert-title { font-size: .875rem; }
.dep-note .alert-body { margin-top: 2px; font-size: .8125rem; }
.dep-note .alert-link { margin: 4px 0 0; }
.alert-source { margin: 8px 0 0; }
.alert-line > summary { font-weight: 400; }
.alert-see { color: var(--link); text-decoration: underline; white-space: nowrap; }
/* バス停の画面の1行の題名は2行まで(全文は開いた中身で読める) */
.alert-line-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* ホームの乗る・降りるの欄の「最近のバス停」(ui/homeform.js。依頼者 2026-11-04。設計書 2026-11-04-recent-dropdown-design.md)。
   一覧は検索の候補(.list)と同じカード。行の右に × (ホームの履歴の .chip-remove と同じ 44px)。.from-to-recent で始まるクラスだけに書く */
.from-to-recent { margin-top: 8px; }
.from-to-recent-head { margin: 0 0 4px; font-size: .875rem; color: var(--muted); }
.from-to-recent .list { margin-top: 0; }
.from-to-recent-item { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
.from-to-recent .list .from-to-recent-pick { flex: 1 1 auto; min-width: 0; min-height: 44px; align-items: center; }
/* 名前は行の幅いっぱいに(読みは出さない)。長い名前は折り返す */
.from-to-recent-pick > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.from-to-recent .list .from-to-recent-remove { flex: none; width: 44px; height: 44px; padding: 0; justify-content: center; border: 1px solid var(--warn); border-radius: 999px; background: var(--surface); color: var(--warn); }
.from-to-recent .undo-bar { margin: 8px 0 0; }

/* PC の広い画面(計画 2026-11-19-pc-layout。templates/index.html の nav.pc-crumb と aside.pc-side)。
   上に帯「つぎバス › 仙台（仙台市営バス）」、ホームだけ右に説明の欄。スマホ・タブレットの見た目は変えないため、
   この下の @media の外に書くのは「隠す」1行だけ。PC 条件(幅 1100px 以上・マウス操作・タッチなし)を解さない古いブラウザは今の1列のまま */
.pc-crumb, .pc-side { display: none; }
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) and (not (any-pointer: coarse)) {
  .pc-crumb { display: block; padding: 6px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .875rem; line-height: 1.5; }
  .pc-crumb a { color: var(--link); }
  .pc-crumb-here { color: var(--text); }
  /* ホーム(main.js の body[data-screen])では、アプリ(640px のまま)と欄(320px)を間 28px で中央に並べる。
     帯・ヘッダーは全幅の行、下部・ご意見の欄・お引っ越しの知らせはアプリと同じ列。バス停・時刻表などの画面は今の広げ方のまま */
  body[data-screen="home"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px) 28px 320px minmax(0, 1fr); align-items: start; }
  body[data-screen="home"] > * { grid-column: 1 / -1; }
  /* 列2の要素は margin: 0 auto のままだと中身の幅に縮んで中央へ寄るので、左右の余白を 0 にして列の幅いっぱいに */
  body[data-screen="home"] > :is(main, .foot, #fb-slot, .move-note) { grid-column: 2; margin-inline: 0; }
  body[data-screen="home"] > .pc-side { display: block; grid-column: 4; }
  /* 欄はヘッダー(上に貼り付く)の下に止める。画面より高いときは欄の中で動かせる */
  .pc-side { position: sticky; top: calc(64px + 16px); max-height: calc(100vh - 64px - 32px); overflow-y: auto; margin: 16px 0; font-size: .9375rem; line-height: 1.65; }
  .pc-side > section { margin: 0 0 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  /* 見出しは箱の中の太字だけ(ホームの欄の見出しの緑の帯 section:not(.card) > h2 は当てない) */
  .pc-side > section > h2 { margin: 0 0 8px; padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font-size: 1.05rem; line-height: 1.5; }
  .pc-side p { margin: 0 0 8px; }
  .pc-side ul { margin: 0; padding-left: 1.2em; }
  .pc-side li + li { margin-top: 6px; }
  .pc-phone-row { display: flex; align-items: center; gap: 14px; }
  /* QR の画像は白い地と余白を持つ(暗い表示でも読み取れる) */
  .pc-phone-row img { flex: none; width: 112px; height: 112px; border: 1px solid var(--line); border-radius: 8px; }
  .pc-phone-row p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.6; }
  .pc-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0 4px; }
  /* 押せる高さは 44px。flex にすると「 ›」の前の空白が消えるので inline-block で上下に余白 */
  .pc-links a, .pc-links .link-like { display: inline-block; min-height: 0; padding: 10px 0; line-height: 24px; }
  .pc-links:not(:has(a, button)) { display: none; }
}

/* 地域の配色(area.json の palette から作る。手で直さない。tools/area.py) */
@media not all and (prefers-color-scheme: dark) {
  :root { --bg: #f6f7f8; --accent: #2b2b2b; --accent-ink: #ffffff; --accent-soft: #f2f2f2; --link: #2b2b2b; --focus: #2b2b2b; --bar-bg: #ffffff; --bar-edge: #2b2b2b; --band-bg: #f2f2f2; --band-ink: #2b2b2b; --band-edge: #2b2b2b; --card-top: #2b2b2b; --next-until-bg: #2b2b2b; --next-until-ink: #ffffff; --next-edge: #df4e00; --next-bg: #fff1e7; --share-bg: #ffb700; --share-edge: #d99a00; --share-hover: #ffc433; --share-ink: #1f2937; }
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #d9d9d9; --accent-ink: #1f2937; --accent-soft: #333333; --link: #d9d9d9; --focus: #d9d9d9; --bar-edge: #d9d9d9; --band-bg: #333333; --band-ink: #d9d9d9; --band-edge: #d9d9d9; --card-top: #a6a6a6; --next-until-bg: #d9d9d9; --next-until-ink: #1f2937; --next-edge: #ff8a4c; --share-bg: #ffb700; --share-edge: #d99a00; --share-hover: #ffc433; --share-ink: #1f2937; }
}
