/* ===== リセット & ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ライト固定（2026-09-02 段階A）: index.html の meta color-scheme と同値の保険。
     地図の配色は意味を持つため、OS がダークでも反転させない。UI に自前の
     ダークテーマを足す場合も地図（#map-container 配下）はライト固定のまま */
  color-scheme: only light;
  --bg: #f5f2ec;
  --surface: #ffffff;
  --surface2: #f0ede8;
  --border: #d0ccc4;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #1a7d3c;
  --danger: #e53935;
  --warning: #f57f17;
  --header-h: 40px;   /* 段階G-2（2026-09-05）: 48→40px。地図・一覧に 8px 回す。PC も同じ */
}

html { height: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  /* 100vh はモバイルブラウザのアドレスバー分だけ実表示より大きく、下端の
     一覧が隠れる（2026-08-31 スマホ実測）。dvh 非対応の古いブラウザ向けに
     100vh を先に書き、対応ブラウザでは後勝ちで 100dvh が効く */
  height: 100vh;
  height: 100dvh;
  font-size: 13px;
  line-height: 1.5;
}

/* ===== ヘッダー ===== */
header {
  height: var(--header-h);
  background: #1a5c2e;
  flex-shrink: 0;
}
.header-inner {
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* タイトルは 1 行固定（段階G-2・2026-09-05）: 狭幅で 2 行に折り返してヘッダーからはみ出さないよう
   nowrap + 省略記号。min-width:0 は flex 子が内容幅以下に縮めるようにするため */
header h1 { font-size: 16px; font-weight: 700; color: #fff; flex-grow: 1; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ヘッダー常設の「ⓘ このアプリについて」（2026-08-26）: バナー再表示口。
   ヘッダーを窮屈にしないよう枠なしのリンク風・小さめ文字 */
.btn-about {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.85);
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-about:hover { background: rgba(255,255,255,.15); color: #fff; }
/* 折り返し禁止（2026-08-31: 狭幅で幅24pxに潰れテキスト縦積み176px高になり
   ヘッダー上端からはみ出していた）。狭幅ではラベルを落としⓘだけ残す */
.btn-about { white-space: nowrap; }
@media (max-width: 520px) {
  .btn-about .btn-about-label { display: none; }
}
/* ヘッダーのメニュー（2026-10-04・AdSense「ナビゲーション」対応）: 旧 ⓘ ボタンの位置の <details>。summary は .btn-about の
   見た目をそのまま使う（ヘッダーの高さ・並びは変えない）。一覧はヘッダーの下に重ねて出す（レイアウトを押し下げない）。
   z-index は URL パラメータ表示（100001）より上 */
.site-menu { position: relative; }
.site-menu > summary { list-style: none; display: inline-block; user-select: none; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 100002;
  display: flex; flex-direction: column; min-width: 190px;
  max-height: calc(100dvh - 56px); overflow-y: auto;
  background: #fff; border: 1px solid #cfd8dc; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); padding: 4px 0;
}
.site-menu-list a, .site-menu-list button {
  display: block; padding: 10px 14px; font-size: 14px; line-height: 1.3; color: #1a1a1a;
  text-decoration: none; text-align: left; white-space: nowrap;
  background: none; border: none; font-family: inherit; cursor: pointer;
}
.site-menu-list a:hover, .site-menu-list button:hover { background: #eef3ef; }
.site-menu-list a[aria-current="page"] { font-weight: 700; color: #1a5c2e; }
.site-menu-list button { border-top: 1px solid #e0e0e0; color: #555; }

/* 起動時バナー（2026-08-26）: 毎回表示。モーダルにせず通常フローの帯にして
   地図操作を妨げない（body は flex column なので .layout が自然に縮む） */
.app-notice {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: #fff8e1;
  border-bottom: 1px solid #e8dfc0;
  color: #5d4c1e;
  font-size: 12px;
}
.app-notice-text { flex: 1; }
.app-notice a { color: #1a5c2e; font-weight: 600; }
/* バナーのリンク列（2026-09-17）: 使い方・説明（/about）／出典・利用規約／ご意見・ご要望 の 3 本。
   全角スペース区切りをやめ gap で並べる。縦持ちでは折り返してよい（畳み時は nowrap のまま） */
.app-notice-links { display: inline-flex; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; }
/* リンクのタップ領域（2026-09-17）: padding と同量の負の margin で文字位置を変えずに押せる範囲だけ広げる。
   横は 2px（隣との押せる範囲の間隔 = gap 12 − 2×2 = 8px）。縦は段ごとの実測の余地まで:
   上は本文の「ドライブトラフィック」リンクの折り返し行（縦持ち）やヘッダーの ⓘ（横持ち）に触れない範囲、
   下はツールバーのチップ（縦持ち 13px 下）／期間ボタン（横持ち 9px 下）／表示チェック（PC 9px 下）に触れない範囲 */
.app-notice-links a { padding: 0 2px 8px; margin: 0 -2px -8px; position: relative; z-index: 2; }   /* 下の padding がバナーの外（ツールバーの余白）に出る分を前面に */
body[data-layout-tier="sheet"] .app-notice-links a,
body[data-layout-tier="split"] .app-notice-links a { padding-bottom: 12px; margin-bottom: -12px; }
body[data-layout-tier="two-pane"] .app-notice-links a { padding-top: 8px; margin-top: -8px; }
body[data-layout-tier="landscape"] .app-notice-links a { padding-top: 3px; margin-top: -3px; }
/* 起動時バナーの畳み（2026-09-08 横持ち・report_landscape_design.md §8）: body.notice-collapsed で本文を隠し、
   1 行の要約（省略記号）+ リンク 2 本 + ▾ だけにする。▾ は landscape 段だけ出す（縦持ちは従来どおり全文） */
.app-notice-short, #app-notice-toggle { display: none; }
body[data-layout-tier="landscape"] #app-notice-toggle { display: inline-block; }
body.notice-collapsed .app-notice { padding: 0 14px; }   /* ✕/▾ ボタンの高さ（24px）だけの 1 行 */
body.notice-collapsed .app-notice-msg { display: none; }
body.notice-collapsed .app-notice-text { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.notice-collapsed .app-notice-short { display: inline; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.notice-collapsed .app-notice-links { flex: 0 0 auto; white-space: nowrap; }
body:not(.notice-collapsed) #app-notice-toggle { transform: rotate(180deg); }   /* 展開中は ▴（畳む） */
.app-notice-close {
  background: transparent;
  border: none;
  color: #8a7a4a;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.app-notice-close:hover { background: #f0e6c8; }

.btn-primary {
  background: #fff;
  color: #1a5c2e;
  border: none;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { background: #e8f5e9; }
.btn-primary:disabled { background: #aaa; color: #666; cursor: not-allowed; }

.status-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 10px; white-space: nowrap;
  /* button 化（段階G-2・2026-09-05）: sheet/split では「最終更新」4文字に短縮しタップで全文を出す */
  border: none; font-family: inherit; line-height: normal; position: relative;
}
/* sheet/split: 見た目 32px 高（40px ヘッダー内・上下 4px 余白）・::after で当たりを上 4px/下 8px/左右 4px
   広げて画面内で 44×72px（画面上端 0〜44px。上に −6 だと 2px が画面外に出て実質 42px になる実測）。
   ヘッダー下 4px は注意バナーの padding 6px の中＝✕ボタンとは重ならない。PC は全文のまま非タップ */
body[data-layout-tier="sheet"] .status-badge,
body[data-layout-tier="split"] .status-badge,
body[data-layout-tier="landscape"] .status-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; min-width: 44px; padding: 0 10px; cursor: pointer;
}
body[data-layout-tier="sheet"] .status-badge::after,
body[data-layout-tier="split"] .status-badge::after,
body[data-layout-tier="landscape"] .status-badge::after {
  content: ""; position: absolute; left: -4px; right: -4px; top: -4px; bottom: -8px;
}
/* 「最終更新」タップで出す全文の吹き出し（工事ポップアップとは別要素・選択状態に触れない） */
#status-bubble {
  position: fixed; top: calc(var(--header-h) + 6px); right: 8px; max-width: calc(100% - 16px);
  background: rgba(40, 40, 40, .92); color: #fff;
  padding: 8px 12px; border-radius: 6px; font-size: 12px; z-index: 1200; white-space: nowrap;
}
.status-badge.loading { background: rgba(255,255,255,0.2); color: #ddd; }
.status-badge.ok      { background: rgba(255,255,255,0.25); color: #c8e6c9; }
.status-badge.error   { background: rgba(255,0,0,0.3); color: #ffcdd2; }

/* fetch失敗・データ鮮度の警告バナー（2026-07-29） */
.fetch-warning {
  margin: 4px 8px;
  padding: 6px 10px;
  background: #fff3e0;
  border: 1px solid #ffb74d;
  border-radius: 4px;
  color: #a04a00;
  font-size: 12px;
  line-height: 1.5;
}

/* ===== レイアウト ===== */
.layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  position: relative;   /* sheet/split 段のポップアップ（absolute・F-7）の基準。overflow:hidden で広告・ヘッダーに出ない */
}

/* ===== 路線図パネル ===== */
.map-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;   /* sheet/split 段のポップアップ（absolute）の基準（2026-09-04 段階F-3） */
  border-right: 1px solid var(--border);
}

.map-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.filter-label { color: var(--text-muted); font-size: 11px; }
.filter-group label {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; cursor: pointer; user-select: none;
}
.filter-group input[type="checkbox"] { accent-color: var(--accent); }

.zoom-group { display: flex; gap: 3px; }
.zoom-group button {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); width: 26px; height: 26px;
  border-radius: 3px; cursor: pointer; font-size: 14px;
}
.zoom-group button:hover { background: var(--border); }

.map-container {
  flex: 1; overflow: hidden; position: relative;
  background: #e8e4dc; cursor: grab;
  /* 320px幅でツールバーの折り返し（上部346px）に押されて flex 計算で
     高さ0に潰れ、地図と右下のOSMクレジット（ライセンス表示）が
     消えていた（2026-08-31 スマホ実測）。最低高を保証し、収まらない分は
     ページの縦スクロールに逃がす（横スクロールは発生しない） */
  min-height: 200px;
}
.map-container:active { cursor: grabbing; }

/* 地図上チップ行（2026-08-31 スマホ対応・段階2）: filter chip 型。
   sheet/split 段でのみ表示（two-pane=PC は現行ツールバーのまま非表示）。
   ON/OFF は色だけに頼らない冗長表現（塗り+枠太+太字+左ドット●）。
   active 時は枠+1px ぶん padding を詰めて外形寸法を変えない */
#map-chipbar {
  position: absolute;
  top: 6px; left: 6px; right: 46px;   /* right 46 = ⚙（right 8・幅 30）+ 余白 8 を同じ行に空ける（2026-09-06 サイズ改訂で 60→46） */
  z-index: 150;
  display: none;
  flex-wrap: wrap;
  gap: 4px;   /* 320px で4チップ1行に収めるため詰める（実測: gap6+pad10 は316pxで2行化） */
  pointer-events: none;   /* 隙間はクリックを地図へ素通し */
}
body[data-layout-tier="sheet"] #map-chipbar,
body[data-layout-tier="split"] #map-chipbar,
body[data-layout-tier="landscape"] #map-chipbar { display: flex; }
.map-chip {
  pointer-events: auto;
  background: rgba(255, 255, 255, .95);
  border: 1px solid #999;
  border-radius: 16px;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  color: #555;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.map-chip.active {
  background: #e3f0e4;
  border: 2px solid var(--accent, #2e7d32);
  padding: 6px 7px;
  color: #1a5c2e;
  font-weight: bold;
}
.map-chip.active::before {
  content: "●";
  font-size: 8px;
  margin-right: 4px;
  vertical-align: 1px;
}
/* ⭐マイルートは開閉ボタン（トグル状態を持たない）: ニュートラル表示 */
.map-chip.chip-action { color: #333; }

/* ===== sheet 段レイアウト（2026-08-31 スマホ対応・段階3） =====
   1ペイン+ボトムシート: ツールバー非表示（工事帯等はチップ行・ズームは
   フローティングが代替。IC名サイズは段階5の⚙メニューまで一時的に変更不可）。
   一覧は下部シート（標準40dvh・#sheet-toggle でヘッダーのみに縮小可）。
   two-pane（PC）はこのブロックに一切マッチせず現行のまま */
body[data-layout-tier="sheet"] .map-toolbar,
body[data-layout-tier="split"] .map-toolbar,
body[data-layout-tier="landscape"] .map-toolbar { display: none; }
/* landscape 段（2026-09-08 report_landscape_design.md・スマホ横持ち h<500）: two-pane の骨格（.layout は既定の row・
   左に地図・右に一覧）に sheet の UI（チップ行・浮動ズーム・⚙・帰属バー・地方タップ）を重ねる。一覧は固定 340px ではなく 40%
   （667 幅で 267px・932 幅で 373px）。PC ツールバーは出さない。広告は two-pane と同じ #ad-side（一覧の下端 110px）。
   シート（#sheet-grip・#sheet-toggle・--sheet-h）は使わない＝map.js の sheetTierActive は false のまま */
body[data-layout-tier="landscape"] .map-panel { flex: 1; min-width: 0; min-height: 0; }
body[data-layout-tier="landscape"] .info-panel { width: 40%; flex: 0 0 40%; min-width: 0; }
/* 取得警告（#fetch-warning・データが古い/取得失敗時）は flex 0 1 auto で縮まず、landscape の低い一覧（335px）では
   広告枠 #ad-side を画面外へ押し出した（667×375 実測: 見出し 134 + 警告 140 + 広告 110 > 335）。
   縮めて内側スクロールにし、広告枠を画面内に残す（警告が出る事象自体は todo.md の既知） */
body[data-layout-tier="landscape"] #fetch-warning { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
/* 一覧の圧迫対策（2026-09-08 ユーザー決定・report_landscape_design.md §7）: 横並びの右パネルでは見出し h2（「工事・規制情報 n件」）が
   自明なので隠す（−26px）。広告枠は 110→60px（234×60 が全サイズで入る。110 のままだと 667×375 で一覧が 1 枚も出ない）。
   期間行のラベル「表示期間：」も省き、667 幅で期間行が 2 段に折れる（49px）のを 1 段に戻す */
body[data-layout-tier="landscape"] .info-header h2 { display: none; }
/* 2026-11-24: landscape の #ad-side（60px）はやめた（幅 267px に入る広告が無い。枠ごと出さない＝下の「広告領域」の節） */
body[data-layout-tier="landscape"] .date-filter-row .filter-label { display: none; }
/* 800×360（最も低い横持ち）で先頭カード（127px）が丸ごと入るように上下の余白を詰める（§8）: バナー畳み 24px と合わせて
   一覧 149→167px。トグル行の上下 margin・見出しブロックの padding・一覧の上 padding をそれぞれ 2〜6px 縮める */
body[data-layout-tier="landscape"] #filter-toggle-row { margin: 0; }
body[data-layout-tier="landscape"] .info-header { padding: 6px 10px; }
body[data-layout-tier="landscape"] #construction-list { padding: 2px 6px 6px; }
/* 横持ちの 2 点（2026-09-08 report_landscape_design.md §10・ユーザー決定）:
   1) マイルートパネルの上限 calc(100dvh − 160px)（縦持ち向け）→ landscape は −72px（ヘッダー 40 + バナー畳み 24 + 余白 8）。
      作成中 2 点そろい（294px）が 667/852/932 で収まる（800×360 は 288 で 6px 不足＝内側スクロール）
   2) 工事ポップアップの 2 列化（案B①）: table を grid 2 列にし、行は order で 区間・種別／状況・期間／規制・情報源 の順。
      各行は「ラベル 44px + 値」の grid。自然高 184→約 120px。位置は map.js updatePopupBox が地図の下半分に固定（案C） */
body[data-layout-tier="landscape"] .myroute-panel { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); }
body[data-layout-tier="landscape"] #popup-body table { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 0; }
body[data-layout-tier="landscape"] #popup-body tbody { display: contents; }
body[data-layout-tier="landscape"] #popup-body tr { display: grid; grid-template-columns: 44px 1fr; align-items: baseline; min-width: 0; }
/* 2 列に並べるので、上の段に来る 2 つ目の行（右の列の先頭）には区切りの線を入れない（2026-11-25） */
body[data-layout-tier="landscape"] #popup-body tr:nth-child(2) td { border-top: 0; }
body[data-layout-tier="landscape"] #popup-body td { padding: 1px 4px; min-width: 0; overflow-wrap: anywhere; }
body[data-layout-tier="landscape"] #popup-body td:first-child { width: auto; }
/* 詰め（667×375 の幅 324 では 1 列 150px で「区間」「期間」が折り返し 148px になり下半分 128px を超えた）:
   余白と文字を一段小さくして 6〜7 行が下半分に無スクロールで入るようにする */
body[data-layout-tier="landscape"] .popup-inner { padding: 4px 10px 4px; font-size: 11px; }
body[data-layout-tier="landscape"] #popup-title { font-size: 12px; margin-bottom: 1px; }
body[data-layout-tier="landscape"] #popup-body td { padding: 0 3px; line-height: 1.35; }
body[data-layout-tier="landscape"] #popup-body tr.pr-sec { order: 1; }
body[data-layout-tier="landscape"] #popup-body tr.pr-type { order: 2; }
body[data-layout-tier="landscape"] #popup-body tr.pr-status { order: 3; }
body[data-layout-tier="landscape"] #popup-body tr.pr-period { order: 4; }
body[data-layout-tier="landscape"] #popup-body tr.pr-lanes { order: 5; }
body[data-layout-tier="landscape"] #popup-body tr.pr-src { order: 6; }
body[data-layout-tier="landscape"] #popup-body tr.pr-past { order: 7; }
body[data-layout-tier="landscape"] #popup-body tr.pr-orig { order: 8; }
body[data-layout-tier="sheet"] .layout,
body[data-layout-tier="split"] .layout { flex-direction: column; }
body[data-layout-tier="sheet"] .map-panel,
body[data-layout-tier="split"] .map-panel { flex: 1; min-height: 0; }
/* 地図の最小高（2026-09-05 F-6・案b）: sheet/split 段はシートを地図 60px まで上げられる
   （map.js SHEET_MAP_MIN_PX と同じ値）。60px = チップ行（6〜36）+ OSM クレジット（下 4・20px）
   が見える最小。two-pane は従来の 200px のまま */
body[data-layout-tier="sheet"] .map-container,
body[data-layout-tier="split"] .map-container { min-height: 60px; }
/* 地図が低いときの浮遊 UI（F-6・map.js updateMapHeightClasses が body にクラスを付ける）:
   ズーム群（148px+bottom 28）は 190px 未満、⚙（44px+28）と凡例は 100px 未満で非表示。
   段判定の属性セレクタと同じ特異度以上にして表示側の規則に勝たせる */
body[data-layout-tier].map-h-lt190 #float-zoom { display: none; }
/* ⚙（チップ行右端・2026-09-06）: 地図高 230px 未満ではズーム群（top = 地図高 − 176）と ⚙（下端 50）が 4px 未満まで
   近づく／重なるので ⚙ とメニューを消す（map-h-hide-settings・MAP_H_HIDE_SETTINGS_PX=230）。凡例は従来どおり 100 未満 */
body[data-layout-tier].map-h-hide-settings #fz-settings,
body[data-layout-tier].map-h-hide-settings #fz-settings-menu,
body[data-layout-tier].map-h-lt100 #legend { display: none; }
body[data-layout-tier="sheet"] .info-panel {
  width: 100%;
  /* 広告段階1（2026-09-01）: 40dvh（ビューポート基準）→ .layout 基準の
     flex-basis 40% へ変更。広告領域を body 直下に確保したとき、その分を
     地図とシートで按分して縮めるため（dvh のままだと全部地図から引かれる）。
     ※この変更単独でもシート実寸は変わる（375x812 で 325→272px 前後・
       地図は増加）。数値は report_ads.md §5 の試算前提と一致 */
  /* 段階F（2026-09-04 report_sheet_resize.md §3）: 高さは body の --sheet-h（px・
     map.js の applySheetHeight / グリップのドラッグが設定）。未設定なら従来の 40% */
  flex: 0 0 var(--sheet-h, 40%);
  border-right: none;
  border-top: 1px solid var(--border);
}
/* split 段（2026-08-31 段階4・上下分割）: 一覧は標準42%（モック実測で
   673x841 のとき地図421px・一覧305px=カード2.4枚が成立した比率）。
   段階F で split もグリップのドラッグと ▼ に対応（同じ --sheet-h） */
body[data-layout-tier="split"] .info-panel {
  width: 100%;
  flex: 0 0 var(--sheet-h, 42%);   /* 広告段階1: 42dvh → .layout 基準（sheet と同趣旨） */
  border-right: none;
  border-top: 1px solid var(--border);
}
/* シート縮小状態: グリップ+見出し行+期間フィルタ行だけ残す。高さ自体は map.js が
   --sheet-h を最小値（sheetRange().min）にして与える（旧 96px 固定は廃止） */
body[data-layout-tier="sheet"].sheet-collapsed .info-panel,
body[data-layout-tier="split"].sheet-collapsed .info-panel {
  overflow: hidden;
}
/* シートのつまみ（段階F）: sheet/split 段のみ。touch-action:none でブラウザのスクロール・
   プルリフレッシュを止め、Pointer Events（setPointerCapture）でドラッグを受ける。
   地図のパンは #map-container の mousedown/touchstart で始まるので、グリップ上で
   始まるドラッグは地図に届かない */
#sheet-grip {
  display: none;
  flex: 0 0 24px;
  align-items: center; justify-content: center;
  touch-action: none; cursor: ns-resize;
  user-select: none; -webkit-user-select: none;
  background: var(--surface);
}
#sheet-grip .grip-pill { width: 36px; height: 4px; border-radius: 2px; background: #b5b5b5; }
body[data-layout-tier="sheet"] #sheet-grip,
body[data-layout-tier="split"] #sheet-grip { display: flex; }
body.sheet-dragging { user-select: none; -webkit-user-select: none; }
body.sheet-dragging #sheet-grip .grip-pill { background: var(--accent); }
/* グリップのパルス（2026-09-12・report_sheet_min.md §5）: 縦画面の sheet 段だけ、読込後の数秒間「上下に動かせる」ことを伝える。
   map.js が body.grip-pulse を付け、animationend か 6.5 秒で外す（JS は開始・停止だけ。既読化はしない）。
   確定した見た目（2026-09-12・案 B・report_sheet_min.md §6）: グリップ行 24px・幅いっぱいの背景を薄緑（不透明度 .18）で脈打たせ、
   棒（36×4px）も同時に緑・56px・薄い輪に変化する。1 周期 2 秒 × 3 回 = 6 秒・0.5Hz（WCAG 2.3.1 の 3 回/秒をはるかに下回る）。
   点滅ではなく ease-in-out の連続変化。色はアプリの緑 --accent #1a7d3c（チップ行の枠 .map-chip.active・件数バッジ・
   ドラッグ中のつまみと同じ値。ヘッダーは #1a5c2e）。split は同じ #sheet-grip でも対象外（セレクタを sheet 段に限定）、
   landscape / two-pane はグリップ自体が無い。比較用の A（太い棒）・AB・C は確定時に削除した */
@keyframes grip-pulse {
  0%, 100% { background: #b5b5b5; width: 36px; box-shadow: 0 0 0 0 rgba(26, 125, 60, 0); }
  50%      { background: var(--accent); width: 56px; box-shadow: 0 0 0 6px rgba(26, 125, 60, .18); }
}
@keyframes grip-pulse-bg {
  0%, 100% { background: var(--surface); }
  50%      { background: rgba(26, 125, 60, .18); }
}
body[data-layout-tier="sheet"].grip-pulse #sheet-grip { animation: grip-pulse-bg 2s ease-in-out 3; }
body[data-layout-tier="sheet"].grip-pulse #sheet-grip .grip-pill { animation: grip-pulse 2s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) {
  body.grip-pulse #sheet-grip, body.grip-pulse #sheet-grip .grip-pill { animation: none; }
}

/* フローティングズーム: sheet/split 段のみ表示。44px角（WCAG 2.5.5） */
#float-zoom {
  position: absolute;
  right: 8px;
  bottom: 28px;   /* クレジット（右下 bottom:4px・高さ~20px）と重ねない */
  z-index: 140;
  display: none;
  flex-direction: column;
  gap: 8px;
}
body[data-layout-tier="sheet"] #float-zoom,
body[data-layout-tier="split"] #float-zoom,
body[data-layout-tier="landscape"] #float-zoom { display: flex; }
#float-zoom button {
  width: 44px; height: 44px;
  border-radius: 8px;
  border: 1px solid #999;
  background: rgba(255, 255, 255, .95);
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  font-family: inherit;
}

/* ⚙表示設定ボタン（2026-08-31 配置改訂）: 地図左下・ズーム群から完全分離。
   sheet/split 段のみ表示 */
/* ⚙はチップ行と同じ行の右端（2026-09-06 改訂 2）: top はチップ行と同じ 6px・right 8px。チップ行は right:60px で
   ⚙の分を空ける（320 幅では 4 チップが入らず ⭐マイルートが 2 行目に折り返す）。旧 左下固定は far の全体表示で
   沖縄インセットを覆っていた（todo.md）。ズーム群（右下・bottom 28・高さ 148）とは地図高 230px 未満で近づくので、
   その帯域は map-h-hide-settings で ⚙ を消す（ズーム群の消える 190px は変えない） */
#fz-settings {
  position: absolute;
  right: 8px;
  top: 6px;
  z-index: 140;
  display: none;
  /* 見た目はチップと同じ高さ 30px（12px×1.2 + padding 7×2 + border 1×2）の丸（2026-09-06 サイズ改訂）。
     タップ領域は ::before で四方 7px 広げて 44×44 を維持（見た目だけ縮める） */
  width: 30px; height: 30px; padding: 0;
  border-radius: 16px;
  border: 1px solid #999;
  background: rgba(255, 255, 255, .95);
  font-size: 15px; line-height: 28px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
#fz-settings::before { content: ""; position: absolute; inset: -7px; }
body[data-layout-tier="sheet"] #fz-settings,
body[data-layout-tier="split"] #fz-settings,
body[data-layout-tier="landscape"] #fz-settings { display: block; }

/* ⚙表示設定メニュー: ⚙（チップ行右端・top 6 / 高さ 30）の真下 +8 に開く */
#fz-settings-menu {
  position: absolute;
  right: 8px;
  top: 44px;
  z-index: 150;
  background: rgba(255, 255, 255, .98);
  border: 1px solid #999;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  font-size: 12px;
}
#fz-settings-menu .fzm-title { color: #666; margin-bottom: 6px; }
#fz-settings-menu button {
  width: 44px; height: 36px;
  border: 1px solid #999;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  margin-right: 4px;
}
#fz-settings-menu button.active {
  background: #e3f0e4;
  border: 2px solid var(--accent, #2e7d32);
  font-weight: bold;
}

/* 外部送信の表（2026-09-01 規約の広告対応）: パネル幅（最小 296px=320-24）でも
   横スクロールを出さないよう table-layout:fixed + 折返し。3列の幅配分は
   送信先を狭く・情報/目的を広く */
.ext-send-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
  margin: 4px 0 8px;
}
.ext-send-table th, .ext-send-table td {
  border: 1px solid var(--border);
  padding: 4px 6px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: break-word;
}
.ext-send-table th { background: var(--surface2); text-align: left; }
.ext-send-table th:first-child, .ext-send-table td:first-child { width: 24%; }
.ext-send-note { font-size: 11px; color: var(--text-muted); }

/* ===== 広告領域の事前確保（2026-09-01 広告段階2・report_ads.md） =====
   重ねずに最初から領域を引いておく方式（重なりでクリックが届かない不具合の
   構造的排除・審査前後でレイアウト不変）。段階2では空領域（枠のみ）。
   #ad-bottom: sheet/split 段の画面最下部。高さは案3=画面高700px未満60px
   （320x50系）・以上110px（320x100系）。分岐は applyLayoutTier が
   data-ad-size に出す（段判定と同じ仕組み・キーボードガードも共有）。
   #ad-side: two-pane の右パネル下端・320x100用110px固定 */
/* 2026-11-24（忍者AdMax に切り替え）: 枠の中身は map.js initAdmax がページを開いたときに 1 つだけ入れる。
   #ad-bottom: 110px＝SP 320×100・60px＝SP 320×50（どちらも上の線 1px を含む）。
   #ad-side: two-pane だけ・PC 300×250 が入る 251px（250 ＋上の線）。landscape（スマホ横・幅 267px）は枠ごと出さない。
   広告が返ってこなかった枠（.ad-empty）は出さない。広告は枠の中央に置き、はみ出した分は切る */
#ad-bottom {
  display: none;
  flex: 0 0 60px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
body[data-layout-tier="sheet"] #ad-bottom,
body[data-layout-tier="split"] #ad-bottom { display: flex; }
body[data-ad-size="large"] #ad-bottom { flex-basis: 110px; }
/* PC（two-pane）の広告の置き場所（2026-11-24・map.js decideAdPlace が body[data-ad-rail] に出す）:
   - "tall": 右パネルの右に幅 180px の列 #ad-rail（PC 160×600 を上寄せ）。幅 1200px 以上・高さ 720px 以上
   - "box" : 右パネルの右に幅 320px の列 #ad-col （PC 300×250 を上寄せ）。縦長の列が入らず、列を取ったあとの地図の
             横幅が高さの 1.6 倍以上あるとき
   - "list": 列は作らず、右パネルの一覧の中（3 件目のカードの下）に #ad-inline（PC 300×250）。map.js ensureListAd が作る
   右パネルの下の枠（旧 #ad-side）は使わない（一覧が短くなりすぎる） */
#ad-rail, #ad-col {
  display: none;
  flex: 0 0 180px;
  background: var(--surface2);
  border-left: 1px solid var(--border);
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  overflow: hidden;
}
#ad-col { flex-basis: 320px; }
body[data-layout-tier="two-pane"][data-ad-rail="tall"] #ad-rail { display: flex; }
body[data-layout-tier="two-pane"][data-ad-rail="box"] #ad-col { display: flex; }
/* 広告が返ってこなかった枠（map.js watchAdmaxBox）は閉じる */
#ad-bottom.ad-empty, #ad-rail.ad-empty, #ad-col.ad-empty { display: none !important; }
/* 一覧の中の広告（#ad-inline）: カードと同じ幅の箱。カードと見分けがつくように、左の色の線を付けず、点線の枠と「広告」の文字にする。
   カードが 0 件のとき（.ad-off）と、広告が返ってこなかったとき（.ad-empty）は出さない */
.list-ad {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 2px 0 8px;
  margin-bottom: 6px;
  text-align: center;
  overflow: hidden;
}
.list-ad .ad-label { display: block; text-align: left; padding: 0 8px 2px; font-size: 10px; color: var(--text-muted); }
.list-ad .admax-ads { min-width: 300px; min-height: 250px; vertical-align: top; }
.list-ad.ad-off, .list-ad.ad-empty { display: none; }

/* 絞り込みの折りたたみ（2026-09-05 段階F-4・F-2）: sheet/split 段だけ表示。
   info-header 148px（375）/174px（320）のうち種別行+検索欄の約 72〜90px を
   1 行 32px に畳み、一覧の高さを確保する。two-pane はトグル非表示・常に展開 */
#filter-toggle-row { display: none; gap: 6px; align-items: stretch; margin: 2px 0 4px; }
.filter-toggle {
  flex: 1 1 auto; min-width: 0; min-height: 32px;
  padding: 4px 8px; text-align: left;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 13px; cursor: pointer;
}
.filter-toggle #filter-toggle-note { color: var(--text-muted); font-size: 11px; }
/* ⭐マイルートはトグル行の右（sheet/split で map.js が移す）。押しやすさのため高さ 32px 以上 */
#filter-toggle-row .myroute-toggle { flex: 0 0 auto; min-height: 32px; }
body[data-layout-tier="sheet"] #filter-toggle-row,
body[data-layout-tier="split"] #filter-toggle-row,
body[data-layout-tier="landscape"] #filter-toggle-row { display: flex; }
body[data-layout-tier="sheet"] #filter-more.collapsed,
body[data-layout-tier="split"] #filter-more.collapsed,
body[data-layout-tier="landscape"] #filter-more.collapsed { display: none; }

/* シート開閉ボタン: sheet/split 段で表示（段階F で split にも）。
   44×32px・18px（2026-09-04 段階F。旧 41×21px・13px は指で外しやすかった） */
#sheet-toggle {
  display: none;
  float: right;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 44px; height: 32px;
  padding: 0 12px;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  color: var(--text);
}
body[data-layout-tier="sheet"] #sheet-toggle,
body[data-layout-tier="split"] #sheet-toggle { display: inline-block; }
body[data-layout-tier="sheet"].sheet-collapsed #sheet-toggle,
body[data-layout-tier="split"].sheet-collapsed #sheet-toggle { transform: rotate(180deg); }

/* 常設クレジット（2026-08-27）: 地図右下・1行。コンテナは
   pointer-events:none（クリック・ドラッグ・ホイールを下の地図へ素通し）で、
   リンク（aタグ）のみ auto にして押せるようにする。
   背景は不透過（2026-09-08・ユーザー指示）: 旧 rgba(255,255,255,.65) では名古屋 mid の縦書き IC 名
   （飛島JCT/IC・名港潮見・東海JCT/IC・大府）が透けて「© OpenStreetMap contributors｜出典・利用規約」が
   読めなかった。z-index は svg（無指定）より上・ズーム群 140 より下に明示 */
.map-credit {
  position: absolute;
  right: 6px;
  bottom: 4px;
  z-index: 130;
  font-size: 10px;
  line-height: 1.4;
  color: #555;
  background: #fff;
  border-radius: 3px;
  padding: 1px 6px;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  max-width: calc(100% - 12px);
  /* overflow は visible（2026-09-17）: リンクのタップ領域（下の padding）を箱の外まで効かせる。
     ellipsis は諦める（実測 273px 幅で 320px 端末でも収まる） */
  overflow: visible;
}
.map-credit a {
  pointer-events: auto;
  color: #555;
  text-decoration: none;
}
/* 「説明」「出典・利用規約」のタップ領域（2026-09-17）: 横 1px（隣との押せる範囲の間隔 = 10 − 2 = 8px）、
   上 14px（地図面に重なる帯は 100×14px。ズーム「全体」ボタンは x が離れていて触れない）、下 4px（地図の下端まで）。
   OSM 帰属リンクは広げない（地図のドラッグを横 150px にわたって奪わないため） */
.map-credit a[href="/about"], .map-credit a#credit-open-sources {
  display: inline-block;
  padding: 14px 1px 4px;
  margin: -14px -1px -4px;
}
/* 出典・利用規約は上 7px まで（縦持ち 360px でズーム「全体」ボタンの下端 y362 に 14px だと 5px 重なる実測） */
.map-credit a#credit-open-sources { padding-top: 7px; margin-top: -7px; }
.map-credit a:hover { text-decoration: underline; color: #1a5c2e; }

/* 出典・ライセンスパネル（2026-08-27）: 背景マスクなしの軽いオーバーレイ。
   パネル自身だけがクリックを受け、外側の地図は開いたまま操作できる */
.sources-panel {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 120px);   /* dvh非対応ブラウザのフォールバック */
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  z-index: 1000;
  font-size: 12px;
}
.sources-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 8px 8px 0 0;
}
.sources-panel-body { padding: 10px 14px; }
.sources-panel-body p { margin: 0 0 10px; }
.sources-panel-body a { color: #1a5c2e; font-weight: 600; }
/* パネル内の大見出し（2026-08-27 利用規約追加でセクションが2つになった） */
.sources-section-title {
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  margin: 14px 0 8px;
}
.sources-panel-body .sources-section-title:first-child { margin-top: 0; }

#highway-map { width: 100%; height: 100%; display: block; user-select: none; }
/* 陸地色の rect と海の path（2026-10-01 既定・map.js の applyLandMode。?land=off で旧来の描き方＝このクラスが付かない）:
   陸地 path は塗りをやめて海岸線の stroke だけ残す（属性 fill="#f2efe8" は CSS が上書き） */
#highway-map.land-rect #japan-outline path { fill: none; }
/* URL パラメータの表示（#url-params）は 2026-10-20 に削除（map.js の説明参照） */

/* ===== 凡例（SVG外・画面固定） ===== */
#legend {
  position: fixed;
  /* top はフォールバック値。実際は map.js の updateLegendTop() がツールバーの
     実高さ（getBoundingClientRect().bottom）から inline style で上書きする
     （2026-08-29: バナー追加でヘッダーが伸びて固定オフセットが破綻し、
      ツールバーのチェックボックスを覆った再発防止。要素の重なりで
      クリックが届かない不具合はこれで4回目のため、固定値をやめ実測追従に） */
  top: calc(var(--header-h) + 56px);
  /* 初期化（ui_settingsロード後の updateLegendTop 実行）までは非表示
     （2026-08-31: モバイル幅ではフォールバック位置が通知バー/ツールバーの
      上に一瞬重なるため。JSが top を実測で設定した時点で表示する） */
  visibility: hidden;
  left: 10px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.4;
  color: #333;
  pointer-events: none; /* ズーム・パン操作を妨げない */
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  min-width: 130px;
}
/* 最小化中は見出し行だけ残す（2026-08-29）。min-width も解除して小さく */
#legend.minimized #legend-body { display: none; }
#legend.minimized { min-width: 0; }

.legend-title {
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
/* 凡例本体は pointer-events:none（地図操作を妨げない）だが、
   最小化トグルだけはクリックを受ける */
#legend-toggle {
  pointer-events: auto;
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 1px 6px;
}

.legend-section {
  font-size: 9px;
  color: #888;
  margin: 4px 0 3px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

/* 路線の見本（順序5）: 白帯＋縁 #666（border 2px）・国交省区間は中を灰 #a8a8a8 */
.legend-road {
  height: 9px !important; border: 1px solid #666; box-sizing: border-box; border-radius: 4px !important;
  /* 白 3px・中央線 1px・白 3px（§11 中央線） */
  background: linear-gradient(to bottom, #fff 0 3px, #666 3px 4px, #fff 4px 7px);
}
.legend-road-noinfo { background: #a8a8a8; }
.legend-line {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-dashed {
  background: transparent !important;
  border-top: 3px dashed;
  height: 0;
  border-radius: 0;
}
/* 凡例の「IC名の種別」の見本（2026-09-13・report_ic_label_facil2.md §14）: 地図の種別枠と同じ 11px 角＋1 文字を 13px の SVG で。
   文字は地図と同じ 0.8 倍（11px × 0.8 ≒ 9px）・太字。dasharray（四隅）は index.html の属性 */
.legend-facil { width: 13px; height: 13px; flex-shrink: 0; }
.legend-facil text { font-size: 9px; font-weight: 700; font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  text-anchor: middle; dominant-baseline: central; }
/* 1 行に「見本＋名前」を横に並べる（JCT・IC・スマートIC / SA・PA の 2 行。縦 4 行だとスマホ縦で凡例が地図の 84% を占めた） */
.legend-facil-row { gap: 10px; }
.legend-facil-pair { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }

/* ===== SVG 路線要素 ===== */
.route-line {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  cursor: pointer; transition: stroke-width .1s;
}
/* hover 強調はホバーできる入力（マウス）だけ（2026-09-03 順序3）: Chromium 系の
   タッチ端末はタップした要素に :hover を立てて次のタップまで残すため、実機で
   「タップした帯だけ濃いまま・×で閉じても濃いまま」に見えていた。
   @media (hover: hover) で包み、PC は従来どおり。対象は路線・ICドット・工事帯
   （通常と zoom-near の幅）の hover ルール */
@media (hover: hover) {
  .route-line:hover { stroke-width: 7 !important; }
  /* ケーシング後（§11）: mid/near の hover は芯 +1px（縁の内側に収める。7u 固定だと縁 7px を白がはみ出す） */
  #highway-map.zoom-mid .route-line:hover, #highway-map.zoom-near .route-line:hover { stroke-width: var(--core-hover-w, 5) !important; }
}

/* 工事情報対象外区間（国交省管理）の白破線オーバーレイ。クリックは当たり判定ラインで受ける */
.route-line-noinfo {
  fill: none; stroke-linecap: butt; pointer-events: none;
}
/* 対象外区間のクリック説明用・透明当たり判定ライン（描画に影響しない） */
.route-line-noinfo-hit {
  fill: none; cursor: pointer;
}

.ic-dot { cursor: pointer; }
@media (hover: hover) {
  .ic-dot:hover circle { r: 5; }
}
/* 点の描画順（2026-09-18・report_band_over_dots.md）: 点の図形は #ic-dots-under の .ic-dot-shape（同じ .ic-dot クラスなので
   r・縁・段の表示切替はそのまま当たる）。タップは #ic-layer 側の透明円 .ic-hit が受ける（fill none でも pointer-events: all で当たる。
   縁の規則 .ic-dot > circle { stroke: #333 } より優先して消す） */
.ic-dot-shape { pointer-events: none; }
#highway-map .ic-dot > circle.ic-hit { fill: none; stroke: none !important; pointer-events: all; }
/* IC の○と SA/PA の四角を foreignObject の HTML で描く（2026-10-11 試験 → 同日既定化・map.js の ICDOT。?icdot=svg では
   #ic-dots-under の点が従来の circle／rect に戻り、下の規則は当たらない）: 箱 .icd は画面 px で組み立て、transform: scale(--ic-u) で単位に戻す
   （--ic-u = 単位/px。applyVB がズームのたびに書き換える唯一の変数）。外径 --icd-d は、固定モードでは段ごとの定数
   （--icd-mid-d／--icd-near-d。icDotProbe が入れる）、範囲モード（svg.icd-range・?icsize=MIN-MAX）では --ic-u から
   log() で連続的に計算する（mid の始まりで MIN・最大拡大で MAX、間はズーム倍率の対数に比例。段の境目で段差なし）。
   文字 ● ○ の font-size と位置は、墨の実測の係数（--icd-o-kf 等）× 外径で決める。位置は left/top でなく transform（画素に丸められない） */
.ic-dot-fo { pointer-events: none; overflow: visible; }
.icd { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: var(--icd-d, 8px); height: var(--icd-d, 8px);
  transform: scale(var(--ic-u, 1)) translate(calc(-0.5 * var(--icd-d, 8px)), calc(-0.5 * var(--icd-d, 8px))); }
#highway-map.zoom-mid .icd { --icd-d: var(--icd-mid-d, 8px); }
#highway-map.zoom-near .icd { --icd-d: var(--icd-near-d, 7px); }
/* 範囲モード: t = ln(u0/u) / ln(u0/umin) を 0〜1 に収め、D = MIN + (MAX − MIN) × t。log() が無いブラウザでは --icd-d が無効になり
   各所の var() の既定値（8px）に落ちる */
#highway-map.icd-range .icd { --icd-t: clamp(0, calc(log(var(--icd-u0, 1) / var(--ic-u, 1)) / var(--icd-lnr, 1)), 1);
  --icd-d: calc(var(--icd-min, 4px) + (var(--icd-max, 8px) - var(--icd-min, 4px)) * var(--icd-t)); }
/* a: div（白い背景・#333 1px の border） */
.icd-a { box-sizing: border-box; background: #fff; border: 1px solid #333; border-radius: 50%; }
.icd-sq { border-radius: 0; }   /* SA/PA の四角（a と同じ div・角丸なし） */
/* b・c・d: 文字 ● ○（色は黒。c の背景・d の内側の塗りは CSS 背景の白）。font-size = 径 × kf、位置 = 径/2 − 径 × k（墨の中心を箱の中心に） */
.icd-g { font: 10px/normal sans-serif; white-space: nowrap; text-size-adjust: none; -webkit-text-size-adjust: none; }
.icd-g span { position: absolute; left: 0; top: 0; color: #000; line-height: normal; }
.icd-o { font-size: calc(var(--icd-d, 8px) * var(--icd-o-kf, 1.4));
  transform: translate(calc(var(--icd-d, 8px) * (0.5 - var(--icd-o-kx, 0.5))), calc(var(--icd-d, 8px) * (0.5 - var(--icd-o-ky, 0.9)))); }
.icd-g .icd-i { font-size: calc((var(--icd-d, 8px) - 2px) * var(--icd-o-kf, 1.4)); color: #fff;   /* 内側の白い ●（径 −2px。.icd-g span の黒より特異度を上げる） */
  transform: translate(calc(var(--icd-d, 8px) * 0.5 - (var(--icd-d, 8px) - 2px) * var(--icd-o-kx, 0.5)), calc(var(--icd-d, 8px) * 0.5 - (var(--icd-d, 8px) - 2px) * var(--icd-o-ky, 0.9))); }
.icd-r { font-size: calc(var(--icd-d, 8px) * var(--icd-r-kf, 1.4));
  transform: translate(calc(var(--icd-d, 8px) * (0.5 - var(--icd-r-kx, 0.5))), calc(var(--icd-d, 8px) * (0.5 - var(--icd-r-ky, 0.9)))); }
.icd-bg { background: #fff; border-radius: 50%; }
.icd-fill { position: absolute; left: 1px; top: 1px; width: calc(var(--icd-d, 8px) - 2px); height: calc(var(--icd-d, 8px) - 2px); background: #fff; border-radius: 50%; }
/* マイルート作成モード中はカーソルを JS（hitTest）が一元管理する（2026-08-28）:
   CSS :hover の cursor:pointer（.ic-dot / .route-line 等）は座標距離の判定と
   食い違うため、svg 配下すべてを inherit にして svg の inline cursor に従わせる */
/* svg 自身は含めない（!important は inline style より強く、onMapMove がセットする
   svg の style.cursor まで無効化してしまうため。子孫だけ inherit で svg に従わせる） */
#highway-map.mr-creating * { cursor: inherit !important; }

.ic-label {
  font-size: var(--ic-label-size, 4px);
  fill: #222; pointer-events: none;
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  /* 規制オーバーレイ等の上でも読めるよう白縁取り。太いとギザギザに見えるため
     細め0.6pxに抑え、主役は背景矩形（.ic-label-bg）に委ねる（2026-07-25） */
  paint-order: stroke;
  stroke: rgba(255,255,255,0.85);
  stroke-width: 0.3px;   /* ほぼ輪郭の気持ち程度（2026-07-26調整） */
}
/* ラベル背景矩形: 半透明白（下の路線・規制帯が薄く透ける）。縦書きは縦長に追随 */
.ic-label-bg {
  fill: rgba(255,255,255,0.55);
  pointer-events: none;
}
/* IC 名ラベルの foreignObject 版（2026-09-30 試作・2026-10-01 既定化。?labels=text で旧来の text。経緯は map.js の LABELS_FO_PARAM）:
   Samsung Internet の強制ダークで SVG の白 stroke・白矩形が明るい灰のまま残って読めないため、HTML の text-shadow の白
   （強制ダークで暗く反転する）で縁取る。overflow visible は UA 既定（hidden）だと縁取りと測定誤差ぶんが切れるため。
   pointer-events none は .ic-label から継承（HTML の div にも継承する）。文字の選択・長押しメニューは出さない。
   font-size は text と同じ CSS 変数（--ic-label-size・units）。line-height 1.5 は text の getBBox の高さ（Meiryo で字高の 1.538 倍。
   normal だと 1.227 倍で矩形が小さくなり間引きが減る）に合わせた固定値（フォントごとの差は数 % に収める）。
   縁取りの太さ 0.09em（11px で 1px）は従来の stroke 0.72px＋半透明矩形の見え方に合わせた値 */
.ic-label-fo { overflow: visible; }
.ic-label-html {
  /* block＋max-content（2026-10-02）: 旧 inline-block は foreignObject の匿名行ボックスのベースラインに揃えられ、フォントによって
     div が fo の枠より下にずれた（Noto Sans JP で縦書き「楠」が 1.35px 下＝S20 で名前同士が指定のすき間より近く見えた原因の一つ。
     Meiryo では 0）。block なら div の位置が fo の左上と一致し、間引きの矩形（fo の枠）と描画位置が揃う */
  display: block; width: max-content; white-space: nowrap; line-height: 1.5;
  font-size: var(--ic-label-size, 4px);
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  color: #222;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  text-shadow: 0.09em 0 0 #fff, -0.09em 0 0 #fff, 0 0.09em 0 #fff, 0 -0.09em 0 #fff,
               0.065em 0.065em 0 #fff, -0.065em 0.065em 0 #fff, 0.065em -0.065em 0 #fff, -0.065em -0.065em 0 #fff;
}
.ic-label-html.ic-label-v { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 0; }
/* ?labelfix=px（2026-10-12 比較用・map.js の LABEL_FIX_PX）: fo の内側が画面 px なので font-size も実 px（--ic-label-px）。
   縁取り（em）・line-height は同じ値のまま */
#highway-map.labelfix-px .ic-label-html { font-size: var(--ic-label-px, 11px); }
/* IC 名ラベルの太さ（2026-10-01 700 を既定化・map.js の LABEL_WEIGHT）: fo の div は .ic-label（foreignObject）から継承、
   ?labels=text の text・編集モードの text にもそのまま効く。比較用の ?labelweight=400 のときだけ svg に lw-400 が付き従来の太さに戻る。
   Meiryo は 400/700 の 2 書体（Android の Noto Sans CJK は 500/700）。全角は太さで幅が変わらないので間引きの結果は同じ */
.ic-label { font-weight: 700; }
#highway-map.lw-400 .ic-label { font-weight: 400; }
/* IC 名の種別枠（2026-09-13 本実装・report_ic_label_facil2.md §14。試作 A〜C と D の pal=1〜7・9 は同日削除、経緯は同 §1〜§13）:
   1 文字幅の塗りつぶし四角＋1 文字（辺・位置は map.js _placeFacilBoxes が毎回置く。角丸なし）。
   JCT [Ｊ] 赤 #A0102A 白文字・縁なし / IC・SIC [Ｉ] 黄 #FFEE00 黒文字・黒 1px の縁（IC は全周、SIC は map.js の stroke-dasharray で
   四隅だけ）/ SA [Ｓ]・PA [Ｐ] 青 #0000E0 白文字・縁なし。線幅は --dot-sw（IC 点の縁と同じ画面 1px 相当。最大拡大は下限で 1.18px）。
   黄は黒文字 17.5:1（WCAG）、橙の帯 #FF6600/#F57F17 と 1 型 48/41・2 型 31/30 で離れる。青 #0000E0 は帯・点・バッジと 3 視で ΔE 25 以上。
   ?facil=off では map.js が枠を作らないので、この規則は当たらない */
.ic-facil { pointer-events: none; }
.ic-facil .ic-facil-r { stroke: none; }
.ic-facil .ic-facil-t { fill: #fff; font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif; font-weight: 700; }
.ic-facil .ic-facil-jct .ic-facil-r { fill: #A0102A; }
.ic-facil .ic-facil-ic .ic-facil-r, .ic-facil .ic-facil-sic .ic-facil-r { fill: #FFEE00; stroke: #000; stroke-width: var(--dot-sw, 0.5); }
.ic-facil .ic-facil-ic .ic-facil-t, .ic-facil .ic-facil-sic .ic-facil-t { fill: #000; }
.ic-facil .ic-facil-sa .ic-facil-r, .ic-facil .ic-facil-pa .ic-facil-r { fill: #0000E0; }

/* 選択中の路線（バッジのクリックで選択・2026-08-23）。
   工事帯（#construction-lines）は薄くしない — 工事情報が消えて見えるため。
   対象外区間の白破線（.route-line-noinfo）は本線と同じ扱いにする（下記） */
.route-line.route-selected {
  stroke: #d81b60 !important;
  stroke-width: 8 !important;
}
.route-line.route-dimmed {
  opacity: 0.15;
}

/* 工事情報対象外区間の白破線も選択状態に追随させる（2026-08-23）。
   白破線は本線の上に重なるため、層Bを持つ21/112路線では選択色が隠れていた。
   **破線パターン・太さ・レイヤ順は変えない**ので「対象外」の記号は保たれ、
   色だけ白→選択色の淡色（#d81b60 の淡色）に変わる */
.route-line-noinfo.route-selected-noinfo {
  stroke: #f8bbd0 !important;
}
/* 非選択路線の白破線は本線と一緒に減光する。従来は減光対象外にしていたが、
   その方針は工事帯を消さないためのもので、白破線は「対象外＝そもそも工事情報が
   無い区間」の記号。本線だけ薄くなって破線が全不透明で残るのは不自然だった */
.route-line-noinfo.route-dimmed-noinfo {
  opacity: 0.15;
}

/* ===== 路線バッジ（SVG rect+text、scale()で画面固定サイズ） ===== */
/* 通常モードでもクリックを受ける（2026-08-23）: バッジのクリックで路線の
   番号+正式名称をポップアップ表示する。mousedown は握らずバブルさせるので
   #map-container のパン開始処理に届き、バッジ上からでも地図をドラッグできる
   （.route-line が以前から pointer-events:auto で同じ状態） */
.route-badge {
  pointer-events: auto;
  cursor: pointer;
}
/* 編集モード中のみバッジのドラッグを受け付ける（2026-08-21）:
   通常モードのpointer-events:noneはズーム・パンを妨げない既存設計のまま維持。
   efa3124のドラッグ実装がこのnoneでヒットテスト対象外になり
   「実操作で動かない」symptomだった（dispatchEventのシミュレートは
   pointer-eventsを素通りするため検出できなかった） */
body.edit-mode #map-container .route-badge {
  pointer-events: auto;
  cursor: move;
}

/* ===== ズームレベル別IC表示制御 ===== */
/* zoom-far: 縮小時 → 路線のみ（ICドット・名前を非表示） */
#highway-map.zoom-far .ic-dot { display: none; }
/* 路線番号バッジ（E2等）も ic-dot と同じ zoom-far 判定で非表示（2026-08-21）:
   バッジはスクリーンサイズ固定のため縮小時に地図を覆う。閾値は新設せず
   ○と同一クラスを使い回す（将来閾値変更時のズレ防止） */
#highway-map.zoom-far .route-badge { display: none; }
/* 地方ごとのクリック領域（順序5・2026-09-06・案C 境界線＋ラベル）: far だけ表示。線 1px・破線・ラベル 11px は
   画面固定（--region-line-w / --region-dash / --region-font を applyVB が units で設定）。海岸線と同系の色で
   far の路線（灰 min(8u,7px)）より細い。pointer-events none＝当たりは container click の最寄り矩形判定 */
#region-grid { display: none; pointer-events: none; }
#highway-map.zoom-far #region-grid { display: block; }
/* 地方の外周だけ（2026-09-06）: 同一地方の矩形どうしの共有辺は描かない（map.js regionOutlinePath） */
.region-outline { fill: none; stroke: #8fa8b8; stroke-width: var(--region-line-w, 1); stroke-dasharray: var(--region-dash, 5 4); }
.region-label {
  font-size: var(--region-font, 11px); font-weight: 700; fill: #3d5a6c;
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: calc(var(--region-font, 11px) * 0.25); stroke-linejoin: round;
}
/* 「路線名表示」チェックOFF（2026-08-26）: zoom-far の自動非表示とは独立の
   別ルール（両方 display:none なので競合しない。ONでも zoom-far では従来どおり
   消える）。編集モード中はバッジがドラッグ・右クリック編集の対象のため、
   map.js の syncBadgeVisibility() がクラス自体を外して強制表示する
   （badges-off の付与条件 = チェックOFF かつ 非編集モード） */
#highway-map.badges-off .route-badge { display: none; }
/* 工事帯を少しだけ太くする（2026-08-24）: 通常は 6 units で路線線 5 units に対し
   はみ出しが片側 0.5 units しかなく、zoom-far では画面上 0.12〜0.21px＝サブピクセル
   になってアンチエイリアスに溶け、「路線線と同じ太さ」に見えていた
   （実測: 全体表示 vb.w=1600 で路線2.09px / 工事2.51px）。
   10 units = 路線線の2.0倍・はみ出し片側2.5units → 全体表示で片側1.05px と
   約5倍になり視認できる。片側1px を最低ラインとして逆算した値で、
   8では0.63px・9では0.84pxと1pxに届かない。hover の 13 より細いので
   ホバー時に太くなるフィードバックは従来どおり効く。
   zoom-mid / zoom-near は問題が出ていないので現状維持。
   opacity は触らない（0.45のまま＝選択ハイライト時の減光対象外を維持） */
/* 2026-09-02 段階B・案D: zoom-far の路線を 5→8 units に。スマホ初期表示（375幅・
   vb.w=1600）で路線 5 units は 1.17px しかなく、色を変えても「1px の線」のまま
   だった（8 units で 1.9px）。帯は路線比 1.5 を保つため 10→12（mid の 8/5 と同じ比）。
   選択路線は far で通常と同じ 8 になってしまうので 12 に（比 1.5）。
   セレクタ特異度: id+class+class で .route-line:hover(7 !important) より強く、
   far では hover の太り（7）が効かなくなるが 8 より細いので実害なし */
/* far の灰線の幅（2026-09-05）: 8u 固定 → min(8u, 7px)（--far-w・applyVB）。mid の外幅と同じ式なので far→mid の境界で幅が連続
   （PC は vb 700 で 8u=11px→7px の段差があった）。選択は 1.5 倍（旧 12/8 と同じ比） */
#highway-map.zoom-far .route-line { stroke-width: var(--far-w, 8) !important; }
#highway-map.zoom-far .route-line.route-selected { stroke-width: var(--far-sel-w, 12) !important; }
#highway-map.zoom-far .construction-segment { stroke-width: 12 !important; }

/* ===== iHighway 式ケーシング（2026-09-05 順序5・report_route_casing.md §9） =====
   路線 = 縁（.route-casing #666）の上に白い芯（.route-line）。描画順は map.js が「全縁→全芯→層B」。
   far（vb.w>700）は縁を消して芯を灰 8u（C-2＝現状どおり）。mid は縁 8u・芯 5u（far の灰線 8u と外幅が同じ＝
   境界で太さが変わらない）。near は縁 11px・芯 7px 固定（--near-casing / --near-sw）。
   縁 #666: 陸 5.0・白 5.7・通行止め帯(mid 実効 #404040) 1.81。3:1 に届かせるなら通行止めの帯だけ opacity 1.0（黒 vs #666 3.66）
   にする案が残っている（未実装・実機で紛れたら入れる） */
.route-casing {
  fill: none; stroke: #666; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
/* 幅配分（2026-09-05 §11 案A）: applyVB が units で --casing-w / --core-w / --center-w を入れる。
   mid = 外幅 min(8u,7px)（縁1/白2/中央1/白2/縁1）・near = 外幅 9px（1/3/1/3/1）。far は縁・中央なし・灰 8u */
#highway-map.zoom-far  .route-casing { display: none; }
#highway-map.zoom-mid  .route-casing, #highway-map.zoom-near .route-casing { stroke-width: var(--casing-w, 5); }
#highway-map.zoom-mid  .route-line,   #highway-map.zoom-near .route-line   { stroke-width: var(--core-w, 3) !important; }
/* 芯は mid/near で白（far は属性の #8a8a8a のまま）。選択色 .route-selected の !important が勝つ */
#highway-map.zoom-mid  .route-line, #highway-map.zoom-near .route-line { stroke: #fff; }
/* 中央線（§11 ②）: 全芯の後・層Bの前。工事帯の白い芯線（上の層）が帯のある区間で覆う。far は非表示 */
.route-center { fill: none; stroke: #666; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
#highway-map.zoom-far  .route-center { display: none; }
#highway-map.zoom-mid  .route-center, #highway-map.zoom-near .route-center { stroke-width: var(--center-w, 0.7); }
.route-center.route-selected-center { stroke: #880e4f !important; }
.route-center.route-dimmed { opacity: 0.15; }
#highway-map.myroute-active .route-center { opacity: 0.15; }
/* 選択路線: 外幅 +2px（--casing-sel-w / --core-sel-w）。芯 #d81b60 は #666 に対し 1.16 しかないので
   縁と中央線を選択色の濃色 #880e4f（vs 白 8.6・vs 芯 2.3）に */
.route-casing.route-selected-casing { stroke: #880e4f !important; }
#highway-map.zoom-mid  .route-casing.route-selected-casing, #highway-map.zoom-near .route-casing.route-selected-casing { stroke-width: var(--casing-sel-w, 7); }
#highway-map.zoom-mid  .route-line.route-selected, #highway-map.zoom-near .route-line.route-selected { stroke-width: var(--core-sel-w, 5) !important; }
.route-casing.route-dimmed { opacity: 0.15; }
#highway-map.myroute-active .route-casing { opacity: 0.15; }
/* 層B（国交省管理区間）は L3: mid/near は白帯の中の灰 #a8a8a8 の実線（芯と同幅・中央線の上に描くので「中央線なし」。
   白 2.38・縁 2.41）。far は属性の白破線 3u（灰線の上）のまま。選択時の淡ピンク（.route-selected-noinfo !important）はこれより強い */
#highway-map.zoom-mid  .route-line-noinfo { stroke: #a8a8a8; stroke-width: var(--core-w, 3); stroke-dasharray: none; }
/* IC ドット（§11 案D）: 縁 #333 を 1px 画面固定（旧 白 1u は near で 4px に太り白帯上で消えた）。
   SA/PA は translate 中心の rect を CSS で 5px 角に（--sapa-half=2.5u）。編集モードの基準点（.anchor-dot）は従来色 */
/* 直下の子（>）に限定（2026-09-12・report_ic_label_facil2.md §7）: 点の circle/rect は .ic-dot の直下にある。子孫セレクタのままだと
   同じ .ic-dot の中に入れた種別枠（.ic-facil > .ic-facil-box > rect）にも x/y/width/height・stroke が当たり、JS が置いた属性が CSS の
   幾何プロパティに上書きされて枠が SVG 原点（画面外）に描かれていた（?facil の試作 A〜D で枠が一度も見えなかった原因） */
#highway-map .ic-dot:not(.anchor-dot) > circle, #highway-map .ic-dot:not(.anchor-dot) > rect { stroke: #333; stroke-width: var(--dot-sw, 0.5); }
#highway-map .ic-dot:not(.anchor-dot) > rect {
  x: calc(-1 * var(--sapa-half, 0.5)); y: calc(-1 * var(--sapa-half, 0.5));
  width: calc(2 * var(--sapa-half, 0.5)); height: calc(2 * var(--sapa-half, 0.5));
}

/* zoom-mid: 中程度 → ICドットのみ（名前は段 lstage で制御。旧 .zoom-mid .ic-label 非表示は
   段階G-3（2026-09-05）で撤去: 200〜300 の JCT 名を消してしまうため） */
/* IC 名の段階表示（段階G-3・2026-09-05・report_ic_label_staging.md §3-1 案S）:
   lstage-0（vb.w>300）ラベルなし / lstage-1（150〜300）JCT+端部（.ic-p0）/ lstage-2（90〜150）+IC（.ic-p1）/
   lstage-3（≤90）全部。種別・優先度クラスは renderICs が付与（ic-k-jct/ic/sic/sapa・ic-p0〜3・ic-end）。
   段で消したラベルは getBBox が空になるので、JS の押し出し・貪欲間引きの候補にも入らない */
#highway-map.lstage-0 .ic-label, #highway-map.lstage-0 .ic-label-bg { display: none; }
#highway-map.lstage-1 .ic-dot:not(.ic-p0) .ic-label, #highway-map.lstage-1 .ic-dot:not(.ic-p0) .ic-label-bg { display: none; }
#highway-map.lstage-2 .ic-dot.ic-p2 .ic-label, #highway-map.lstage-2 .ic-dot.ic-p2 .ic-label-bg,
#highway-map.lstage-2 .ic-dot.ic-p3 .ic-label, #highway-map.lstage-2 .ic-dot.ic-p3 .ic-label-bg { display: none; }
/* ドットは案M1（§7）: zoom-mid（200〜700）は JCT+端部のドットだけ。IC/SIC/SA/PA は near（≤200）から。
   編集モードは基準点操作のため従来どおり全部出す */
/* §11 案D（2026-09-05）: ドットの段をラベルの段に揃える。lstage-0/1（vb.w>150＝mid 全域と near の 150〜200）は
   JCT+端部のみ（旧 zoom-mid 限定では near 150〜200 で全 1,957 個が出て鎖に見えた）、lstage-2 で IC、lstage-3 で SIC・SA/PA */
body:not(.edit-mode) #highway-map.lstage-0 .ic-dot:not(.ic-p0),
body:not(.edit-mode) #highway-map.lstage-1 .ic-dot:not(.ic-p0) { display: none; }
body:not(.edit-mode) #highway-map.lstage-2 .ic-dot.ic-p2,
body:not(.edit-mode) #highway-map.lstage-2 .ic-dot.ic-p3 { display: none; }
/* ?dotst（2026-10-01 試験・map.js の DOTST_PARAM）: 点の段を名前の段と分ける。svg.dsplit のとき #ic-dots-under の点だけ dstage で隠す
   （名前側のグループ #ic-layer は lstage の規則のまま）。無指定では dsplit が付かないので当たらない */
body:not(.edit-mode) #highway-map.dsplit.dstage-0 #ic-dots-under .ic-dot:not(.ic-p0),
body:not(.edit-mode) #highway-map.dsplit.dstage-1 #ic-dots-under .ic-dot:not(.ic-p0) { display: none; }
body:not(.edit-mode) #highway-map.dsplit.dstage-2 #ic-dots-under .ic-dot.ic-p2,
body:not(.edit-mode) #highway-map.dsplit.dstage-2 #ic-dots-under .ic-dot.ic-p3 { display: none; }
/* 路線名バッジの段（段階G-4・案A）: bstage-major（400〜700）は major 路線（.badge-major）だけ。
   貪欲間引き（thinRouteBadges）で負けたバッジは .badge-thinned。編集モードは間引かない（JS 側で外す） */
#highway-map.bstage-major .route-badge:not(.badge-major) { display: none; }
#highway-map .route-badge.badge-thinned { display: none; }
/* 表示中の IC 名ラベルに当たるバッジ（thinBadgesByLabels・2026-09-08 ラベル優先）。badge-thinned と別 class で統計を分ける */
#highway-map .route-badge.badge-by-label { display: none; }
/* ICドットを画面上一定サイズにする（2026-08-24）: zoom-mid だけSVG単位固定
   （IC=3 / JCT=4）でズーム連動が無く、画面上の直径が 4.49px(vb.w=700) →
   14.96px(vb.w=210) と3.3倍に膨張していた。zoom-mid全域で
   「工事帯の半幅 < ドット半径」となり工事情報がドットに完全に覆われ、
   ○同士が数珠つなぎになって路線の形も分からなくなっていた。
   --mid-r は applyVB() が max(0.4, 3.5*vb.w/W) で設定＝画面上の直径 7px 固定（2026-09-11 案1。旧 2.0u=4px は
   v146 で地方の縮尺に IC 名が出るようになると路線線 7px の中に埋まり、ラベルの手がかりにならなかった）。
   zoom-near（--near-r=3u・直径 6px）と同じ作法。縁は共通の --dot-sw（#333 1px）。
   JCT/IC の大きさ差は失われるが zoom-near も同様で、種別は種別枠（赤い J・黄の I）が担う
   （2026-09-18: 塗りは JCT・端部も白に統一。旧 JCT #444 / IC #666 の塗り分けは廃止） */
#highway-map.zoom-mid .ic-dot circle { r: var(--mid-r, 2) !important; }
/* 工事帯: zoom-far(10) と zoom-near(6) の中間。ドット縮小だけでは vb.w=700 が
   -0.32px と僅かに隠れたままで、かつ zoom-far との境界で 5.61px→3.37px の
   1.7倍の段差ができていた。8 units で vb.w=700 でも +0.24px 露出し、
   段差も 10→8→6 となだらかになる（路線幅5に対する比は1.60） */
#highway-map.zoom-mid .construction-segment { stroke-width: 8 !important; }

/* zoom-near: 拡大時 → 路線の太さ・丸サイズをスクリーン上で一定サイズに固定 */
/* 旧 --near-sw（7px）は §11 で --core-w に統合（上の mid/near 共通規則）。--near-sw 自体は芯線等の基準として applyVB が計算し続ける */
/* 選択路線は zoom-near でも太さを保つ（2026-08-23）。上の --near-sw ルールは
   id+class+class で .route-line.route-selected（class2つ）より特異度が高く、
   選択時の 8px を上書きしてしまっていた。ここで同じ特異度+1クラスにして勝たせる。
   --near-sel-sw は applyVB() が「通常の1.6倍・下限3.5px」で設定する
   （白破線1.1pxに対し片側1.2px以上の露出を確保するため） */
/* 選択路線の near 幅も §11 で --core-sel-w（mid/near 共通規則）に統合 */
/* 層B near（順序5・L3）: 旧 1.1px 白破線 → 灰 #a8a8a8 の実線・芯と同じ 7px 固定（白帯の中の灰の道路） */
#highway-map.zoom-near .route-line-noinfo { stroke: #a8a8a8; stroke-width: var(--core-w, 1.7) !important; stroke-dasharray: none !important; }
#highway-map.zoom-near .ic-dot circle { r: var(--near-r, 1); }
/* 工事帯の芯線（2026-09-02 段階B・3-2b）: zoom-near では路線 7px の半分に画面固定
   （旧: --near-core 3.5px / far・mid 2u。2026-09-05 案A′で中央線の定義を参照する形に置換＝下の規則） */
/* 案A′（2026-09-05・§13）: 芯線は路線の中央線と同一の見た目＝中央線の定義（#666・--center-w）を参照する。
   段ごとの独自規則（mid 2u / near 3.5px）は廃止。far は中央線が無い（display:none）ので芯線も出さない。
   選択中（.construction-selected）だけ #d81b60・3px（--band-core-sel-w）で従来の選択表現を残す */
#highway-map .construction-core { stroke: #666; stroke-width: var(--center-w, 0.7) !important; }
/* 短い帯（画面上の長さ < 帯の幅 × 2）は芯線を出さない（2026-09-18・report_short_band.md。判定は map.js updateShortBands が
   ズームごとに付け外す。黒の塊の上の灰 1px が帯を灰色に見せていた） */
#highway-map .construction-core.band-short { display: none; }
#highway-map.zoom-far .construction-core:not(.construction-selected) { display: none; }
/* ホバー代替 (e)（2026-09-02 段階B）: スマホにはホバーが無いので、拡大時
   （zoom-near）は帯を自動的に薄くして下の路線・IC を見せる。CSS の opacity は
   属性 opacity(0.75) より優先。hover の opacity:1 !important と blink の
   アニメーションはこれより強いので従来どおり効く。薄すぎれば 0.6 に上げる */
#highway-map.zoom-near .construction-segment { opacity: 0.5; }
/* 工事帯の幅（2026-09-03 順序2・案3）: zoom-near は画面 14px 固定（--near-band は
   applyVB が 14*u で設定）。far 12u・mid 8u は据え置き。hover は近では 18px 固定
   （共通の 13u !important は near で 32px に膨らむため、同じ特異度で上書き） */
#highway-map.zoom-near .construction-segment { stroke-width: var(--near-band, 6) !important; }
@media (hover: hover) {
  #highway-map.zoom-near .construction-segment:hover { stroke-width: var(--near-band-hover, 8) !important; }
}
/* 選択中の工事帯（2026-09-04 案Y・report_map_visibility §9-7）: 帯・カードのタップで
   map.js の applyConstructionSelection が付ける持続クラス。hover と違いタッチ端末でも
   出る。幅は zoom ごとの id 付き !important 規則（far 12u / mid 8u / near 14px）より
   特異度を 1 クラス分上げて勝たせる: far 15u・mid 10u・near は hover と同じ 18px。
   opacity は !important にしない（!important は .blink のアニメーションより強く、
   カードタップ直後の点滅が見えなくなる）。zoom-near の 0.5（id+class）と同じ特異度に
   して後勝ちさせる。芯線は選択ピンク（路線選択 .route-selected と同じ #d81b60）:
   太さ・濃さは hover と同系統なので、hover と区別する記号は芯線の色 */
#highway-map .construction-segment.construction-selected { opacity: 1; }
#highway-map.zoom-far  .construction-segment.construction-selected { stroke-width: 15 !important; }
#highway-map.zoom-mid  .construction-segment.construction-selected { stroke-width: 10 !important; }
#highway-map.zoom-near .construction-segment.construction-selected { stroke-width: var(--near-band-hover, 8) !important; }
#highway-map .construction-core.construction-selected { stroke: #d81b60 !important; stroke-width: var(--band-core-sel-w, 1) !important; }
/* 端部のハイブリッド（2026-09-03 順序2・H2）: 長さ ≥ 2w の帯だけ butt。
   w は far 12u・mid 8u・near 14px（vb.w=150 で 5.6u）なので閾値は 24 / 16 / 11 units。
   長さクラス（len-ge*）は renderConstructions が描画時に付ける＝拡大中は変わらず、
   zoom クラスの境界（帯幅が段で変わる位置）でだけ切り替わる。短い帯は round のまま。
   芯線（construction-core）も帯と同じ端形にして先端のはみ出しを防ぐ */
#highway-map.zoom-far  .construction-segment.len-ge24, #highway-map.zoom-far  .construction-core.len-ge24,
#highway-map.zoom-mid  .construction-segment.len-ge16, #highway-map.zoom-mid  .construction-core.len-ge16,
#highway-map.zoom-near .construction-segment.len-ge11, #highway-map.zoom-near .construction-core.len-ge11 {
  stroke-linecap: butt;
}

/* 工事マーカー */
.work-marker {
  cursor: pointer;
}
.work-marker-dot {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; } 50% { opacity:.4; }
}

/* ===== 情報パネル ===== */
.info-panel {
  width: 340px; flex-shrink: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface);
}
.info-header {
  padding: 8px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.info-header h2 { font-size: 13px; margin-bottom: 6px; }
#count-badge {
  font-size: 11px; background: var(--accent); color: #fff;
  padding: 1px 7px; border-radius: 8px; margin-left: 5px;
}
#search-box {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 5px 8px; border-radius: 4px;
  /* 16px未満だと iOS Safari がフォーカス時に自動ズームし blur後も戻らない
     （2026-08-31 スマホ実測）。テキスト入力は16px以上を維持すること */
  font-size: 16px; outline: none;
}
#search-box:focus { border-color: var(--accent); }
/* 検索で絞り込まれて一覧に無いレコードの帯（2026-11-23・map.js updateBandsForSearch）: 作り直さずに隠す */
.search-hidden { display: none !important; }
/* 検索に当たった施設・路線の候補（2026-11-23・map.js renderSearchHits）: 一覧の上に横に並べる。多いときは折り返す。
   欄の高さは 2〜3 行ぶんで止め、候補の欄の中だけを縦にスクロールする（下の工事の一覧を押し下げない）。
   overscroll-behavior: contain で、欄の端まで来ても一覧・地図・ページへスクロールを渡さない。touch-action: pan-y で指の縦の動きを欄が受ける */
#search-hits { flex: 0 0 auto; padding: 6px 6px 2px; }
#search-hits[hidden] { display: none; }
.search-hits-head { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.search-hits-count { flex: 1 1 auto; min-width: 0; }
/* 開け閉めのボタン（2026-11-24）: 見出しの行のいちばん右。開いているとき「−」・閉じているとき「＋」 */
.search-hits-toggle { flex: 0 0 auto; width: 28px; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.search-hits-toggle:hover, .search-hits-toggle:focus-visible { border-color: var(--accent); }
#search-hits.search-hits-closed .search-hits-list { display: none; }
#search-hits.search-hits-closed .search-hits-head { margin-bottom: 0; }
/* 境目の行（工事の一覧のいちばん上の見出しの行）= 候補の欄の高さを変える持ち手（map.js bindSearchHitsDrag）。
   見出しの行の HTML は変えず、クラスだけで印（⋮⋮ の代わりの 2 本線）とカーソルを付ける。
   touch-action: none で、指の縦の動きを一覧のスクロールに渡さない（ドラッグとして受ける） */
.list-group-header.hits-drag-handle { cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none;
  position: sticky; padding-right: 34px; }
.list-group-header.hits-drag-handle::after { content: ""; position: absolute; right: 10px; top: 50%; width: 18px; height: 6px;
  transform: translateY(-50%); border-top: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); opacity: .7; }
.list-group-header.hits-drag-handle:hover { border-color: var(--accent); }
body.hits-dragging { cursor: ns-resize; user-select: none; -webkit-user-select: none; }
body.hits-dragging .list-group-header.hits-drag-handle { border-color: var(--accent); }
.search-hits-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; max-height: 104px; overflow-y: auto;
  overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.search-hits-list::-webkit-scrollbar { width: 5px; }
.search-hits-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.search-hit { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: inherit;
  font: inherit; font-size: 13px; line-height: 1.25; cursor: pointer; text-align: left; max-width: 100%; }
.search-hit:hover, .search-hit:focus-visible { border-color: var(--accent); }
.search-hit-name { font-weight: 600; }
.search-hit-sub { font-size: 10px; color: var(--text-muted); }

#construction-list { flex: 1; overflow-y: auto; padding: 6px; }
#construction-list::-webkit-scrollbar { width: 5px; }
#construction-list::-webkit-scrollbar-track { background: var(--bg); }
#construction-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* 選択した工事帯の点滅（2026-08-27）: 0.6秒×5回≒3秒で止まる。
   opacity は SVG属性の 0.45 を上書きして明滅させる */
/* 通行止めの帯を foreignObject の文字飾りで描く（2026-10-09 試験 → 2026-10-10 既定化。map.js の BAND_STYLE "text"。?bandstyle=svg では
   帯の path に band-text が付かず、下の規則は何も当たらない）:
   SVG の帯は当たり判定のために残して透明にする（stroke-opacity 0 は pointer-events に影響しない。opacity の規則（near 0.5・
   hover 1）は見えない帯に掛かるだけ）。foreignObject は当たり判定を持たない。点滅は帯と同じアニメーション */
.construction-segment.band-text { stroke-opacity: 0; }
/* 表示期間に入るのが未定の予備日の夜だけの帯（2026-11-22）: 同じ色のまま薄く、点線にする（実施が決まった夜と見分ける）。
   通行止めの文字飾りの帯は g ごと薄くする。選択中・点滅中も薄いまま（太さと芯線の色で選択は分かる） */
#highway-map .construction-segment.band-spare:not(.band-text) { opacity: 0.4; stroke-dasharray: 2.5 1.5; stroke-linecap: butt; }
#highway-map .construction-text.band-spare { opacity: 0.35; }
#construction-text-edges foreignObject, #construction-text-cores foreignObject { pointer-events: none; overflow: visible; }
.construction-text.blink { animation: construction-blink .6s linear 5; }
/* 箱の座標系（map.js の節の説明参照）: 長さ方向 x は箱の 1px = 0.01 単位（--L100 = 長さ×100）、幅方向 y は far/mid が 1px = 1 単位、
   near が 1px = 画面 1px（--sy = --tb-u。applyVB が near でだけ書き換える）。段ごとの定数は svg の zoom-* クラスで切り替える:
     --hh 半幅（箱の y px）／--xp 両端の余白（箱の x px。端の延長の最大より大きく取り、はみ出しは clip-path で切る）／
     --mx 幅方向 1px を長さ方向の px に直す係数（far/mid 100・near 100×--tb-u）／--ov 継ぎ目の重なり／--ee 帯の両端で縁を延ばす量
   端の延長 --x0/--x1 = 継ぎ目なら (半幅)×tan(φ/2)×--mx ＋ 重なり、帯の端なら --cap（縁は --ee・芯は 0・長さ 0 の帯は半幅）。
   箱の幅・高さは段の中では一定（レイアウトは段の切替・選択・hover のときだけ）。位置と縮尺は transform、端は clip-path */
.construction-text { --mx: 100; --sy: 1; }
#highway-map.zoom-far  .construction-text { --xp: 2000px; --ov: 100px; --ee: 200px; }
#highway-map.zoom-mid  .construction-text { --xp: 1400px; --ov: 40px;  --ee: calc(150px * var(--tbf, 1)); }
#highway-map.zoom-near .construction-text { --xp: 500px; --sy: var(--tb-u, 0.1); --mx: calc(100 * var(--tb-u, 0.1)); --ov: calc(75px * var(--tb-u, 0.1)); --ee: calc(200px * var(--tb-u, 0.1)); }
/* 半幅: 芯 = 帯の半分（far 6u・mid 4u×--tbf・near 7px）、縁 = それ＋縁（far 2u・mid 1.5u×--tbf・near 2px）。選択中 far 15u／mid 10u×--tbf／near 18px、
   hover（PC）は SVG の帯と同じ far 13u／mid 13u×--tbf／near 18px。選択と hover が重なったら選択の太さ。
   --tbf（2026-10-19・map.js の TEXT_BAND_STAGES）: mid の帯の太さの段階。svg の class tb-m0〜tb-m11（画面 px/単位 k の段階。
   map.js applyVB が付ける）で 1 → 1/1.25 ずつ小さくし、帯の芯を 11.2〜14px（道路 7px の 1.6〜2 倍）に収める。far・near は無関係 */
#highway-map.zoom-far  .tb-core-box { --hh: 6px; }   #highway-map.zoom-far  .tb-edge-box { --hh: 8px; }
#highway-map.zoom-mid  .tb-core-box { --hh: calc(4px * var(--tbf, 1)); }   #highway-map.zoom-mid  .tb-edge-box { --hh: calc(5.5px * var(--tbf, 1)); }
#highway-map.zoom-near .tb-core-box { --hh: 7px; }   #highway-map.zoom-near .tb-edge-box { --hh: 9px; }
@media (hover: hover) {
  #highway-map.zoom-far  .tb-hover .tb-core-box { --hh: 6.5px; } #highway-map.zoom-far  .tb-hover .tb-edge-box { --hh: 8.5px; }
  #highway-map.zoom-mid  .tb-hover .tb-core-box { --hh: calc(6.5px * var(--tbf, 1)); } #highway-map.zoom-mid  .tb-hover .tb-edge-box { --hh: calc(8px * var(--tbf, 1)); }
  #highway-map.zoom-near .tb-hover .tb-core-box { --hh: 9px; }   #highway-map.zoom-near .tb-hover .tb-edge-box { --hh: 11px; }
}
#highway-map.zoom-far  .construction-selected .tb-core-box { --hh: 7.5px; } #highway-map.zoom-far  .construction-selected .tb-edge-box { --hh: 9.5px; }
#highway-map.zoom-mid  .construction-selected .tb-core-box { --hh: calc(5px * var(--tbf, 1)); }   #highway-map.zoom-mid  .construction-selected .tb-edge-box { --hh: calc(6.5px * var(--tbf, 1)); }
#highway-map.zoom-near .construction-selected .tb-core-box { --hh: 9px; }   #highway-map.zoom-near .construction-selected .tb-edge-box { --hh: 11px; }
/* mid の段階ごとの倍率（map.js の TEXT_BAND_STAGES と同じ値。段 N の f = 1.25^-N。backend/test_band_stages.py が両方を照合する） */
#highway-map.tb-m0  { --tbf: 1; }      #highway-map.tb-m1  { --tbf: 0.8; }    #highway-map.tb-m2  { --tbf: 0.64; }   #highway-map.tb-m3  { --tbf: 0.512; }
#highway-map.tb-m4  { --tbf: 0.4096; } #highway-map.tb-m5  { --tbf: 0.3277; } #highway-map.tb-m6  { --tbf: 0.2621; } #highway-map.tb-m7  { --tbf: 0.2097; }
#highway-map.tb-m8  { --tbf: 0.1678; } #highway-map.tb-m9  { --tbf: 0.1342; } #highway-map.tb-m10 { --tbf: 0.1074; } #highway-map.tb-m11 { --tbf: 0.0859; }
.tb-edge-box, .tb-core-box {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  --x0: calc(var(--j0, 0) * (var(--a0, 0) * var(--hh) * var(--mx) + var(--ov)) + (1 - var(--j0, 0)) * var(--cap));
  --x1: calc(var(--j1, 0) * (var(--a1, 0) * var(--hh) * var(--mx) + var(--ov)) + (1 - var(--j1, 0)) * var(--cap));
  transform: scale(0.01, var(--sy)) translate(calc(-1 * var(--xp)), calc(-1 * var(--hh)));
  width: calc(var(--L100, 0px) + 2 * var(--xp)); height: calc(2 * var(--hh));
  clip-path: inset(0 calc(var(--xp) - var(--x1)) 0 calc(var(--xp) - var(--x0)));
}
.tb-edge-box { background: #fff; --cap: var(--ee); }
.tb-core-box { overflow: hidden; white-space: nowrap; font: 2px/normal sans-serif; text-size-adjust: none; -webkit-text-size-adjust: none; --cap: 0px; }
.tb-edge-box.tb-dot, .tb-core-box.tb-dot { --cap: calc(var(--hh) * var(--mx)); }   /* 長さ 0 の帯: 幅の四角 */
.tb-core-span {
  position: absolute; left: 0; top: 0; transform: translateY(calc(var(--hh) - var(--tb-k, 1.33px))); color: #000;
  text-decoration: line-through; text-decoration-color: #000; text-decoration-skip-ink: none;
  text-decoration-thickness: calc(2 * var(--hh)); letter-spacing: 1000px;
}
.construction-segment.blink { animation: construction-blink .6s linear 5; }
@keyframes construction-blink {
  0%, 100% { opacity: .9; }
  50%      { opacity: .05; }
}

/* ===== マイルート（2026-08-28 Phase2） ===== */
/* 経路帯: 太め半透明。工事帯(赤/橙)・路線色・選択ピンク(#d81b60)と区別できる紫 */
.myroute-path {
  fill: none;
  stroke: #673ab7;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
  pointer-events: none;   /* 経路帯がクリックを奪わない */
}
/* 経路表示中の減光: 路線バッジ選択（route-dimmed）と同じ opacity 0.15 規則を流用。
   工事帯(0.45)は減光しない */
#highway-map.myroute-active .route-line { opacity: 0.15; }
#highway-map.myroute-active .route-line-noinfo { opacity: 0.15; }

#btn-myroute { /* 見た目は #btn-edit-mode と同系（btn-edit-off クラスを共用） */ }

/* 期間フィルタ行の絞り込みトグル */
.myroute-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.myroute-toggle.active { background: #673ab7; color: #fff; border-color: #673ab7; }

/* パネル: 出典パネルと同系の軽いオーバーレイ（左側・背景マスクなし） */
.myroute-panel {
  position: fixed;
  left: 12px;
  top: 104px;
  width: 300px;
  max-height: calc(100vh - 160px);   /* dvh非対応ブラウザのフォールバック */
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  z-index: 950;
  font-size: 12px;
}
.mr-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface2); border-radius: 8px 8px 0 0;
  /* つまみ（2026-09-07 順序6）: makeDraggable でパネルを動かす。touch-action none が無いと指のドラッグがページスクロールに取られる */
  cursor: move; touch-action: none; user-select: none; -webkit-user-select: none;
}
.mr-head strong { flex: 1; white-space: nowrap; }
.mr-status { font-size: 11px; color: #673ab7; white-space: nowrap; }
.mr-head-btns { display: flex; gap: 2px; flex-shrink: 0; }
#mr-toggle { font-size: 11px; }
/* 最小化（順序6）: つまみ＋案内 1 行（.mr-guide）だけ残す。作成モードは始点・終点を待つ間この状態で開始する */
.myroute-panel.mr-min .mr-body > :not(.mr-guide) { display: none; }
.myroute-panel.mr-min .mr-body { padding: 6px 12px; }
.myroute-panel.mr-min .mr-guide { margin: 0; }
.mr-body { padding: 10px 12px; }
.mr-row { border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; margin-bottom: 8px; cursor: pointer; }
.mr-row:hover { background: var(--surface2); }
.mr-row.mr-selected { outline: 2px solid #673ab7; }
.mr-row-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.mr-row-head b { flex: 1; }
.mr-badge { font-size: 10px; color: var(--text-muted); }
/* デフォルトルートの★（1件だけ。⭐絞り込みの自動選択対象） */
.mr-fav { border: none; background: none; cursor: pointer; font-size: 14px;
  padding: 0 2px; color: var(--text-muted); line-height: 1; }
.mr-fav.active { color: #f5a623; }
.mr-row-sub { font-size: 11px; color: var(--text-muted); margin: 2px 0 4px; }
.mr-row-btns button, .mr-wide, .mr-confirm button {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 4px; padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.mr-row-btns button:hover, .mr-wide:hover { background: var(--surface2); }
.mr-wide { display: block; width: 100%; margin-top: 6px; padding: 5px 8px; }
.mr-primary { background: #673ab7; color: #fff; border-color: #673ab7; }
.mr-primary:hover { background: #5e35b1; }
.mr-guide { background: #ede7f6; border-radius: 4px; padding: 6px 8px; }
.mr-label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 6px; }
#mr-name { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; }
.mr-error { color: var(--danger); font-size: 11px; }
.mr-empty { color: var(--text-muted); }
/* 経由地の一覧（2026-10-20）: 1 行 1 経由地。▲▼× と 始点⇔終点 は 36px 四方以上（スマホで押しやすく） */
.mr-via-list { list-style: none; margin: 4px 0 0; padding: 0; }
.mr-via { display: flex; align-items: center; gap: 4px; background: var(--surface2); border-radius: 4px; padding: 2px 4px 2px 8px; margin: 0 0 4px; }
.mr-via-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-via-btn { min-width: 36px; min-height: 36px; padding: 0 6px; font-size: 14px; line-height: 1; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; }
.mr-via-btn:disabled { opacity: .35; cursor: default; }
.mr-via-btn:not(:disabled):hover { background: #ede7f6; }
.mr-swap { display: inline-block; margin-top: 4px; font-size: 12px; }
.mr-ends { margin: 8px 0 4px; }
.mr-confirm { color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* トースト（排他メッセージ等） */
#myroute-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(40, 40, 40, .92); color: #fff;
  padding: 8px 16px; border-radius: 6px; font-size: 12px; z-index: 1200;
}
/* トーストも広告領域の上へ（2026-09-03・ポップアップと同じ理由。bottom = 広告高 + 28px） */
body[data-layout-tier="sheet"] #myroute-toast,
body[data-layout-tier="split"] #myroute-toast { bottom: calc(60px + 28px); }
body[data-layout-tier="sheet"][data-ad-size="large"] #myroute-toast,
body[data-layout-tier="split"][data-ad-size="large"] #myroute-toast { bottom: calc(110px + 28px); }

/* 一覧の小見出し（2026-08-27）: 控えめな帯。スクロール中も現在ブロックが
   分かるよう sticky（top:-6px は #construction-list の padding 6px を相殺して
   上端に密着させるため） */
.list-group-header {
  position: sticky;
  top: -6px;
  z-index: 2;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
  margin: 4px 0;
}

.construction-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 4px;
  padding: 8px 10px; margin-bottom: 6px; cursor: pointer;
  transition: background .1s, transform .1s;
}
.construction-card:hover { background: var(--surface2); transform: translateX(2px); }
.construction-card.active-card  { border-left-color: var(--danger); }
.construction-card.planned-card { border-left-color: var(--warning); }
.card-selected { outline: 2px solid var(--accent); }

.card-header { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; flex-wrap: wrap; }

/* 夜間/終日タグ（2026-08-27）: schedule_kind 判定済みのレコードだけに付く */
.sched-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.tag-nightly { background: #283593; color: #fff; }
.tag-allday  { background: #6d4c41; color: #fff; }
/* 短時間（2026-08-30）: 6時間以内の continuous（1時間の実況見分等） */
.tag-short   { background: #00695c; color: #fff; }
/* 日中（2026-08-30）: 同一暦日内・開始5時以降・終了21時以前（6:00〜18:00等） */
.tag-daytime { background: #0277bd; color: #fff; }
/* 終了（2026-08-30）: 「（日付）をもって終了」宣言を検出したレコード */
.tag-ended   { background: #757575; color: #fff; }

/* カードの期間1行サマリ（2026-08-27） */
.card-period { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }

/* 種別フィルタ（2026-08-30）: 表示期間の下の1行 */
.worktype-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
                       font-size: 12px; margin: 4px 0; }
.worktype-filter-row label { display: flex; align-items: center; gap: 3px;
                             cursor: pointer; white-space: nowrap; }
/* 種別（3値排他）と終了フラグ（別の軸）の区切り（2026-08-30） */
.filter-sep { color: #bbb; user-select: none; }
.card-route  { font-weight: bold; font-size: 12px; }
.card-direction {
  font-size: 10px; background: #eee; padding: 1px 5px; border-radius: 3px; color: #555;
}
.card-type {
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
}
.card-type.工事     { background: #e3f2fd; color: #1565c0; }
.card-type.事故     { background: #ffebee; color: #b71c1c; }
.card-type.通行止め { background: #ffebee; color: #b71c1c; }
.card-type.車線規制 { background: #fff8e1; color: #e65100; }
.card-type.速度規制 { background: #e8f5e9; color: #2e7d32; }

.card-ic   { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.card-ic strong { color: var(--text); }
.card-desc { font-size: 11px; color: #444; }
.card-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* 規制の状況（2026-08-26 段B）。「開始〜終了」の生表示を置き換えたもの。
   夜間規制は枠の全期間ではなく「いま規制中か／次回いつから」を出す */
.card-status { font-size: 11px; margin-top: 3px; font-weight: 600; }
.card-status .status-sub,
td.status-now .status-sub { font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.status-now     { color: var(--danger); }
.status-next    { color: var(--warning); }
/* 順延の注記（2026-09-17・report_east_postponed.md）: 東フィードの中止夜「9/15・9/16 は中止（順延）」。
   状況行の下に 1 行。色は注意色（次回と同系）で、太字にしない */
.card-postponed { font-size: 11px; margin-top: 2px; color: #b26a00; }
td.pr-postponed { color: #b26a00; }
/* 予備日の夜（2026-11-22）。状況行「本予定は終了。予備日 …（使うか未定）」は実施が決まっていないので、次回（橙）より弱い色。
   カードの行: 確定した予備日（緑）・未定の予備日（灰の点線の枠）。ポップアップの「日ごとの状態」は状態ごとの小さい札 */
.status-spare { color: #6b7280; font-weight: 600; }
.card-spare-used { font-size: 11px; margin-top: 2px; color: #1b7f3b; }
.card-spare { font-size: 11px; margin-top: 2px; color: #6b7280; }
/* 除く日（2026-11-23）: 期間の行のすぐ下に、土日・祝日を除くのか実施するのかを小さく出す */
.card-skip { font-size: 11px; color: #555; margin-top: 1px; }
td.pr-nights { line-height: 1.7; }
.ns { display: inline-block; font-size: 10px; line-height: 1.5; padding: 0 5px; border-radius: 3px; border: 1px solid #999; white-space: nowrap; }
.ns-main { background: #222; color: #fff; border-color: #222; }
.ns-used { background: #1b7f3b; color: #fff; border-color: #1b7f3b; }
.ns-spare { background: #fff; color: #555; border-style: dashed; }
.ns-post { background: #fff3e0; color: #b26a00; border-color: #e0b070; }
/* 注意書き（根拠・実施の判断・告知の記載）は、日程の行の下に 1 つずつ小さく続ける（2026-11-25） */
.pr-nights-note { display: block; font-size: 10px; line-height: 1.45; color: #888; }
.pr-spare-item + .pr-spare-item { margin-top: 4px; }
.status-done,
.status-unknown { color: var(--text-muted); font-weight: 400; }
.card-source { font-size: 10px; color: #999; }
.src-link {
  color: inherit; text-decoration: underline dotted;
}
.src-link:hover { color: var(--accent); text-decoration: underline; }

/* ===== 日付フィルター ===== */
.date-filter-row {
  display: flex; align-items: center; gap: 5px; margin-bottom: 6px; flex-wrap: wrap;
}
.date-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 2px 9px; border-radius: 10px;
  font-size: 11px; cursor: pointer; white-space: nowrap;
}
.date-btn.active  { background: var(--accent); color: #fff; border-color: var(--accent); }
.date-btn:hover:not(.active) { background: var(--border); }

/* ===== 工事区間ライン ===== */
.construction-segment {
  fill: none; stroke-linecap: round; stroke-linejoin: round; cursor: pointer;
}
@media (hover: hover) {
  .construction-segment:hover { opacity: 1 !important; stroke-width: 13 !important; }
}
/* 工事帯の芯線（2026-09-02 段階B・3-2b）: 描画のみ。クリックは下の帯が受ける */
.construction-core {
  fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}

.empty-state {
  text-align: center; padding: 30px 16px; color: var(--text-muted);
}
/* JS 無効時の説明（2026-09-22・index.html の <noscript>）: 起動時バナーと同じ淡黄の帯。JS が動く環境では
   <noscript> の中身が DOM に出ないので、通常表示のレイアウトには一切影響しない */
.noscript-notice {
  flex-shrink: 0; padding: 10px 16px; background: #fff8e1; color: var(--text);
  font-size: 13px; line-height: 1.6; border-bottom: 1px solid var(--border);
}
.noscript-notice p { margin: 0 0 6px; }
.noscript-notice a { color: var(--accent); text-decoration: underline; }
.empty-state p { margin-bottom: 6px; }
.empty-state .hint { font-size: 11px; color: #aaa; }

/* ===== ポップアップ ===== */
.popup {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  /* z-index 100→200（2026-09-02 report_popup_overlap.md 案A）: sheet 段で
     シートを縮小すると⚙(#fz-settings 140)・ズーム群(#float-zoom 140)が
     ポップアップ上部と同じ高さ帯に下りてきて × が「全体」ボタンの下に入り
     押せなかった（375x667 で elementFromPoint 実測）。チップ行/⚙メニュー 150 より
     上・出典パネル 1000/マイルートパネル 950/トースト 1200 より下 */
  z-index: 200; min-width: 300px; max-width: 480px; pointer-events: none;
}
/* sheet/split 段ではポップアップを広告領域（#ad-bottom 60/110px）の上に置く
   （2026-09-03 report_ads.md）: Google Publisher Policies「Content obscuring
   Google-served ads」がコンテンツによる広告の一部被覆を禁止しているため、
   bottom = 広告高 + 16px にして広告と重ねない。広告高の分岐は applyLayoutTier が
   body[data-ad-size] に出している値（700px 未満=60・以上=110）と同じ。
   縮小シート時に⚙・ズーム群と幾何的に交差する範囲が広がるのは、案D
   （段階F: bottom をシート高さに連動）の前段として許容する。two-pane は
   広告が右パネル下端（#ad-side）でポップアップと重ならないため変更なし */
/* 案D・D1（2026-09-04 段階F-3・report_sheet_resize.md §6）: sheet/split 段では
   ポップアップを .map-panel 内の absolute にし、シート上端の 8px 上に置く
   （#popup は .map-panel の末尾に移した。two-pane では position:fixed のままなので
   置き場所を変えても PC の見え方は変わらない）。
   - シートの高さに自動追随＝一覧・見出し・▼・グリップを覆わない
   - left/right: 64px で左下の⚙（left 8・44px）と右のズーム群の列を空け、幾何的に
     交差しない（375 で幅 247px・320 で 192px。⚙ を右列へ寄せる整理は段階D で扱う）
   - 広告（#ad-bottom）はシートの下にあるので、旧「広告高 + 16px」の調整は不要
   - 上限: map.js の updatePopupBox が「地図パネル下端 − 8 − (チップ行/凡例の下端 + 8)」を
     inline の max-height に入れる（凡例は開いている間だけ最小化）。超えたら .popup-inner が
     内側でスクロール。ここの calc はその JS が動く前のフォールバック
   - display:flex は .hidden より特異度が高くなるため、hidden 用の規則を明示する */
/* 段階F-7（2026-09-05・9-2）: #popup は .layout 直下。left/top/max-height は map.js の
   updatePopupBox が inline で与える（初期位置は従来規則、見出しドラッグ後は利用者の位置）。
   幅は .layout − 128px（左右 64px）で固定。bottom は使わない */
body[data-layout-tier="sheet"] .popup,
body[data-layout-tier="split"] .popup,
body[data-layout-tier="landscape"] .popup {
  position: absolute; left: 64px; top: 0; right: auto; bottom: auto;
  width: calc(100% - 128px);   /* landscape は map.js の updatePopupBox が「地図パネル幅 − 12 − 64」を inline で上書き */
  transform: none; min-width: 0; max-width: none;
  display: block;
}
body[data-layout-tier="sheet"] .popup.hidden,
body[data-layout-tier="split"] .popup.hidden,
body[data-layout-tier="landscape"] .popup.hidden { display: none; }
/* two-pane（PC）も .layout 内の absolute（2026-09-12 (d)）: left/top は map.js updatePopupBox が inline で与える
   （初期位置は従来の fixed と同じ画面中央下・bottom 16px 相当。見出しドラッグで移動・広告枠 #ad-side を禁止矩形にする）。
   幅は従来どおり内容に応じて 300〜480px（.popup の min/max-width をそのまま使う） */
body[data-layout-tier="two-pane"] .popup {
  position: absolute; left: 0; top: 0; right: auto; bottom: auto; transform: none;
}
body[data-layout-tier="two-pane"] .popup.hidden { display: none; }
/* 見出し行がドラッグのつまみ（F-7）: touch-action:none でブラウザのスクロールを止める。
   × は別ボタン（absolute）なので対象外 */
body[data-layout-tier="sheet"] #popup-title,
body[data-layout-tier="split"] #popup-title,
body[data-layout-tier="landscape"] #popup-title,
body[data-layout-tier="two-pane"] #popup-title {
  cursor: move; touch-action: none; user-select: none; -webkit-user-select: none;
}
/* 内側スクロールは本文（#popup-body）だけ。.popup-inner 全体を scroll させると × と
   見出しが内容と一緒に流れて箱の外へ出る（監査で × 中心が地図に当たった実測・
   2026-09-05）。× は .popup-inner の absolute なので inner を非スクロールにすれば固定 */
/* inner は block（F-7 で column flex をやめた: column flex の中の table は Chrome が内在高さを
   低く見積もり（実測 330 vs 実高 402）、max-height に余裕があっても本文が伸びなかった）。
   本文の max-height は map.js updatePopupBox が「箱の max-height − 見出し等の高さ」を inline で入れる */
body[data-layout-tier="sheet"] .popup-inner,
body[data-layout-tier="split"] .popup-inner,
body[data-layout-tier="landscape"] .popup-inner,
body[data-layout-tier="two-pane"] .popup-inner { overflow: hidden; }
body[data-layout-tier="sheet"] #popup-body,
body[data-layout-tier="split"] #popup-body,
body[data-layout-tier="landscape"] #popup-body,
body[data-layout-tier="two-pane"] #popup-body { overflow-y: auto; }
.popup.hidden { display: none; }
.popup-inner {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; box-shadow: 0 4px 20px rgba(0,0,0,.2);
  pointer-events: all; position: relative;
}
/* × のタップ領域 44×44（2026-09-02 案B）: 旧 11.4×18.7px（14px の1文字・
   padding なし）は WCAG 2.5.8 の 24×24 にも届かず指で外していた。
   Apple HIG / WCAG 2.5.5 の 44 を採る。見た目の文字は中央に置く */
.popup-close {
  position: absolute; top: 0; right: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: #999; cursor: pointer; font-size: 18px;
  border-radius: 8px;
}
.popup-close:hover { color: #333; background: rgba(0,0,0,.05); }
/* 重なっている規制の切り替え（2026-11-16）: 「‹ 重なっている規制 1/3 ›」。タップ位置に規制が 2 つ以上あるときだけ出る。
   ボタンは 44×40（指で押せる大きさ）。題名の下に置き、ポップアップの幅いっぱいを使う。色は明示する（ライト固定のページを端末側が強制的に暗くしても、
   背景と文字が一緒に反転して読めるように、背景・文字・枠をすべて自分で持つ） */
.popup-overlap {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 6px;
  font-size: 12px; font-weight: bold; color: #333;
}
.popup-overlap.hidden { display: none; }
/* 文言は幅が足りれば 1 行、狭いポップアップ（スマホの縦持ちは左右 64px を空けるので中身は約 200px）では
   「重なっている規制」「1/3」の 2 行に折り返す（単語の途中では折らない）。ボタンの高さ 40px に 2 行が収まる */
#popup-overlap-label { flex: 1 1 auto; min-width: 0; text-align: center; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
/* overflow-wrap: anywhere は、幅 360px より狭い画面（320px 台）で「重なっている規制」が 1 行に入らないときだけ単語の途中で折る
   （折らないと右のボタンの下に文字が隠れる。本番の幅 326px で「規制」が隠れた） */
.popup-overlap-btn {
  flex: 0 0 auto; width: 44px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f3f5; color: #222; border: 1px solid #adb5bd; border-radius: 8px;
  font-size: 22px; line-height: 1; font-weight: bold; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.popup-overlap-btn:hover { background: #e2e6ea; }
.popup-overlap-btn:active { background: #ced4da; }
.popup-overlap-btn:focus-visible { outline: 2px solid #1a73e8; outline-offset: 1px; }
/* 横持ち（高さが小さい）は少し低くする */
body[data-layout-tier="landscape"] .popup-overlap { margin-bottom: 2px; }
body[data-layout-tier="landscape"] .popup-overlap-btn { height: 32px; font-size: 18px; }
/* padding-right は × の幅 44 に合わせる（旧 20px） */
#popup-title { font-size: 14px; font-weight: bold; margin-bottom: 6px; padding-right: 44px; }
#popup-body { font-size: 12px; }
#popup-body table { width: 100%; border-collapse: collapse; }
/* 項目名は中身の 1 行目と高さをそろえる（2026-11-25）: 既定の縦の中央ぞろえだと、中身が 3〜4 行の「予備日」の項目名が
   注意書きの横に来て、予備日の日程が上の「本予定」の続きに見えた。行の間には細い線を入れて項目の境目を出す。
   項目名が空の続きの行（各回の 2 行目から・「ほか N 回」＝ .pr-cont）には線を入れない */
#popup-body td { padding: 3px 6px; vertical-align: baseline; }
#popup-body td:first-child { color: var(--text-muted); width: 80px; }
#popup-body tr + tr td { border-top: 1px solid #e6e6e6; }
#popup-body tr.pr-cont td { border-top: 0; padding-top: 0; }
/* 工事情報対象外（国交省管理区間）の明示文言 */
#popup-body .noinfo-note {
  margin-top: 6px; padding: 6px 8px; border-radius: 4px;
  background: #f5f5f5; color: #555; font-size: 11px; line-height: 1.5;
}

/* ===== ローディング ===== */
.loading-spinner::before {
  content: "";
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid transparent; border-top-color: #1a5c2e;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== レスポンシブ =====
   旧 @media (max-width:860px) の縦積みルールは 2026-08-31 段階5 で撤去。
   レイアウトは body[data-layout-tier]（sheet/split/two-pane・map.js の
   decideLayoutTier）に一本化した。two-pane 判定（w>=768 かつ横長）の
   768-860px 帯が旧ルールでは縦積みに割れていた競合も解消 */

/* ===== 基準点編集モード ===== */
#btn-edit-mode {
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1.5px solid #aaa;
  background: #f0ede8;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
#btn-edit-mode:hover { background: #e0ddd8; }
#btn-edit-mode.btn-edit-on {
  background: #fff3e0;
  border-color: #e65100;
  color: #e65100;
  font-weight: bold;
  box-shadow: 0 0 0 2px #ff980044;
}

/* SVG アンカードット（CSSではなくJSで直接属性指定） */
.anchor-dot {
  cursor: grab;
}
.anchor-dot:active { cursor: grabbing; }

/* 編集モード時カーソル変更 */
body.edit-mode #map-container { cursor: crosshair; }
body.edit-mode #map-container .ic-dot { cursor: pointer; }
body.edit-mode #map-container .anchor-dot { cursor: grab; }
body.edit-mode #map-container .ic-label {
  pointer-events: auto;
  cursor: move;
  outline: none;  /* クリック時のブラウザフォーカスアウトラインを非表示 */
}
body.edit-mode #map-container .ic-label:focus {
  outline: none;
}

/* 直線化を適用ボタン */
#btn-apply-linear {
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1.5px solid #1565c0;
  background: #e3f2fd;
  color: #1565c0;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: bold;
  transition: background 0.15s;
}
#btn-apply-linear:hover { background: #bbdefb; }
#btn-apply-linear:active { background: #90caf9; }

/* 直線化を解除ボタン */
#btn-reset-linear {
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1.5px solid #c62828;
  background: #ffebee;
  color: #c62828;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: bold;
  transition: background 0.15s;
}
#btn-reset-linear:hover { background: #ffcdd2; }

/* 元に戻すボタン */
#btn-undo {
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1.5px solid #555;
  background: #f5f5f5;
  color: #333;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: background 0.15s;
}
#btn-undo:hover { background: #e0e0e0; }
#btn-undo:disabled { opacity: 0.4; cursor: not-allowed; }

/* 基準点を保存ボタン */
#btn-save-anchors {
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1.5px solid #2e7d32;
  background: #e8f5e9;
  color: #2e7d32;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: bold;
  transition: background 0.15s;
}
#btn-save-anchors:hover { background: #c8e6c9; }
#btn-save-anchors.dirty {
  background: #fff8e1;
  border-color: #e65100;
  color: #e65100;
  box-shadow: 0 0 0 2px #ff980044;
}

/* ===== ラベルコンテキストメニュー ===== */
.label-context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  padding: 4px 0;
  z-index: 2000;
  min-width: 152px;
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-size: 12px;
}
/* バッジ基準点メニュー（2026-08-21b）: 3×3グリッド+タイトル。
   メニュー枠は .label-context-menu を流用 */
.badge-menu-title {
  padding: 4px 14px 2px;
  font-size: 11px;
  color: #888;
}
.badge-anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  justify-content: center;
  gap: 2px;
  padding: 4px 8px;
}
.label-context-menu .badge-anchor-grid button {
  display: block;
  width: 34px;
  padding: 5px 0;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.label-context-menu .badge-anchor-grid button.active {
  background: #1565c0;
  color: #fff;
  border-color: #1565c0;
}
.label-context-menu button {
  display: block;
  width: 100%;
  padding: 5px 14px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: #222;
  white-space: nowrap;
}
.label-context-menu button:hover { background: #f0f4ff; }
.label-context-menu button.active { font-weight: bold; color: #1565c0; }
.label-context-menu hr { margin: 4px 0; border: none; border-top: 1px solid #e0e0e0; }

/* 未保存インジケーター */
.anchor-dirty-indicator {
  margin-left: 6px;
  font-size: 11px;
  color: #e65100;
  font-weight: bold;
  vertical-align: middle;
}
