/* =========================================================
   東近江土木事務所 道路気象情報
   ========================================================= */
:root {
  --navy: #0d3553;
  --navy-2: #134b74;
  --lake: #1f78b4;
  --lake-soft: #e8f2fa;
  --ink: #1d2733;
  --ink-2: #4b5966;
  --muted: #8693a0;
  --line: #dde3e9;
  --bg: #f3f5f8;
  --card: #ffffff;
  --cold: #1565c0;
  --notice: #f2b705;
  --warning: #d93025;
  --special: #6a1b9a;
  --danger: #8e24aa;
  --clear: #2e7d5b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 38, 61, .06), 0 2px 8px rgba(16, 38, 61, .05);
  --font: 'BIZ UDPGothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font); }
a { color: var(--lake); }
small { font-size: .78em; }
.muted { color: var(--muted); }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover, .brand:focus { color: #fff; text-decoration: none; }
.brand__mark { width: 42px; height: 42px; color: #bfe3ff; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__sub { font-size: 12px; letter-spacing: .08em; color: #bcd3e6; }
.brand__title { font-size: 22px; font-weight: 700; letter-spacing: .06em; }
.site-header__clock { font-size: 14px; color: #cfe0ee; white-space: nowrap; }
.site-header__clock strong { font-size: 22px; color: #fff; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* 警報・注意報バー */
.alert-bar { background: var(--navy-2); border-top: 1px solid rgba(255, 255, 255, .08); }
.alert-bar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 7px 20px;
  overflow-x: auto;
}
.alert-bar__label { font-size: 13px; font-weight: 700; white-space: nowrap; color: #ffe08a; }
.alert-bar__list { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.alert-bar__more { margin-left: auto; font-size: 12px; color: #cfe0ee; white-space: nowrap; }
.alert-bar__more:hover { color: #fff; }
.warn-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  font-size: 13px;
  white-space: nowrap;
}
.warn-chip__area { font-weight: 700; }
.warn-chip__state {
  display: inline-flex;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #dfe9f2;
  font-size: 12px;
}
.warn-chip.is-clear .warn-chip__state { background: rgba(46, 125, 91, .35); color: #d6f5e5; }
.warn-chip.is-error .warn-chip__state { color: #ffcdd2; }
.warn-chip:not(.is-clear):not(.is-loading):not(.is-error) .warn-chip__state { background: transparent; padding: 0; }
.warn-tag { padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.warn-tag.is-notice { background: var(--notice); color: #3b2c00; }
.warn-tag.is-warning { background: var(--warning); color: #fff; }
.warn-tag.is-danger { background: var(--danger); color: #fff; }
.warn-tag.is-special { background: #000; color: #fff; outline: 2px solid var(--special); }

/* ---------- レイアウト ---------- */
.layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
.side-nav {
  position: sticky;
  top: 116px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 700;
  text-decoration: none;
}
.side-nav a .fa { color: var(--muted); }
.side-nav a:hover { background: #e7ecf1; color: var(--ink); }
.side-nav a.is-active { background: var(--lake-soft); color: var(--navy); }
.side-nav a.is-active .fa { color: var(--lake); }
.main { min-width: 0; }
.section + .section { margin-top: 24px; }

/* ---------- カード ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 22px;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.card__head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
}
.card__head h2 .fa { color: var(--lake); margin-right: 4px; }
.card__head h2 small { margin-left: 8px; color: var(--muted); font-weight: 400; font-size: 13px; }
.card__foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.empty { margin: 0; padding: 18px; border-radius: 8px; background: #f6f8fa; color: var(--ink-2); text-align: center; }
.notice {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--lake);
  border-radius: 6px;
  background: var(--lake-soft);
  color: var(--navy);
  font-size: 14px;
}

/* ---------- 気象予測 ---------- */
.issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--navy) 0%, var(--lake) 100%);
  color: #fff;
}
.issue__main { display: flex; flex-direction: column; }
.issue__label { font-size: 12px; letter-spacing: .1em; color: #cfe6f7; }
.issue__time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.btn-primary-lg:hover, .btn-primary-lg:focus { background: #fff8d6; color: var(--navy); text-decoration: none; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.summary { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.summary th, .summary td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.summary thead th { background: #f6f8fa; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.summary__band { border-bottom: 0 !important; }
.summary__band small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.summary__band--night { background: #e9eef7 !important; color: var(--navy) !important; }
.summary__sub th { font-size: 12px !important; }
.summary thead th.summary__point, .summary tbody th.summary__point { text-align: left; }
.summary tbody th { font-weight: 400; background: #fff; }
.summary tbody tr:hover th, .summary tbody tr:hover td { background: #fafcfe; }
.summary__night { background: #f7f9fd; }
.summary td { font-size: 17px; }
.summary td small { font-size: 11px; color: var(--muted); margin-left: 1px; }
.summary__name { display: inline-flex; flex-direction: column; vertical-align: middle; line-height: 1.3; font-weight: 700; }
.summary__name small { font-weight: 400; color: var(--muted); font-size: 11px; }
.is-cold { color: var(--cold); font-weight: 700; }
.is-snow { color: #0b6aa8; font-weight: 700; }

.pin {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
  flex: none;
}
.pin--sm { width: 22px; height: 22px; font-size: 11px; }

.road {
  display: inline-block;
  min-width: 4.2em;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.road.is-dry { background: #eef1f4; color: #5b6772; }
.road.is-wet { background: #dcecfb; color: #135a96; }
.road.is-slush { background: #d6f2ef; color: #0d6b62; }
.road.is-packed { background: #ede4f7; color: #5b2b8c; }
.road.is-frozen { background: #fde3e1; color: #b3261e; }
.road.is-none { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 12px; }
.legend .road { min-width: 0; font-size: 12px; }
.legend__note { color: var(--muted); margin-left: 6px; }

.comment-box { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; }
.comment-box h3, .history h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.comment-box p { margin: 0; }
.history { margin-top: 18px; }
.history ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.history a {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
}
.history a:hover { border-color: var(--lake); color: var(--lake); }

/* ---------- 地図 ---------- */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.map-col { min-width: 0; }

/* 時刻スライダー (雨雲・凍結予測図) */
.timebar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.timebar[hidden] { display: none; }
.timebar__play {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 14px; line-height: 36px; text-align: center;
}
.timebar__play:hover, .timebar__play:focus { background: var(--lake); outline: none; }
.timebar__range { flex: 1; min-width: 0; accent-color: var(--lake); }
.timebar__label { flex: none; min-width: 9.5em; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.timebar__label strong { color: var(--navy); font-size: 16px; }
.tag-forecast { display: inline-block; padding: 1px 6px; border-radius: 4px; background: #fff3cd; color: #7a5a00; font-size: 12px; }

/* 路線凍結予測図 (js/freeze.js) */
.demo-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 6px; background: #fff6e0; color: #7a5a00; font-size: 13px; }
.demo-note[hidden], .notice[hidden], .fz-actions[hidden] { display: none; }
.fz-actions { display: inline-flex; gap: 8px; }
.btn-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink-2); font-size: 13px; font-weight: 700;
}
.btn-pill:hover, .btn-pill:focus { border-color: var(--lake); color: var(--lake); outline: none; }
.btn-pill .fa { color: var(--lake); }
.fz-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.fz-info__issued { font-size: 14px; color: var(--ink-2); }
.fz-info__issued strong { color: var(--navy); font-size: 16px; }
.fz-info__note { margin-left: 4px; color: var(--muted); font-size: 12px; }
.freeze-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink); }
.freeze-legend i { display: inline-block; width: 22px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }

/* 地図と、地図の左の縦帯 (国道307号) */
.fz-main {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); height: 480px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff;
}
.fz-map { height: 100%; min-width: 0; z-index: 0; }
.fz-side { display: flex; flex-direction: column; min-height: 0; padding: 8px 6px 6px; border-right: 1px solid var(--line); background: #fafbfc; }
.fz-side .fz-route { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fz-route__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; line-height: 1.3; }
.fz-route__head strong { color: var(--navy); font-size: 14px; }
.fz-route__head small { color: var(--muted); font-size: 11px; }
.fz-counts { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; font-size: 11px; color: var(--ink-2); }
.fz-counts span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.fz-counts i { display: inline-block; width: 12px; height: 9px; border-radius: 2px; }
.fz-counts em { font-style: normal; }
/* 件数の幅を時刻によらず一定にする (帯の位置が時刻で動かないように) */
.fz-counts b { display: inline-block; min-width: 2ch; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.fz-side .fz-counts { display: grid; grid-template-columns: 1fr; gap: 0; }
.fz-strip { display: block; width: 100%; margin-top: 2px; user-select: none; }
.fz-strip--v { flex: 1; min-height: 0; margin-top: 4px; }
.fz-strip text { font-size: 9px; fill: var(--muted); font-family: var(--font); }
.fz-strip text.fz-strip__kp { font-size: 10px; font-weight: 700; fill: var(--ink); }
.fz-strip rect[data-s] { cursor: pointer; }
.fz-strip rect[data-s]:hover { opacity: .75; }

/* 地図の下の横帯 (国道421号。狭い画面では国道307号も横帯にしてここに並べる) */
.fz-dock { margin-top: 10px; padding: 8px 12px 4px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.fz-dock .fz-route + .fz-route { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.fz-dock .fz-route__head { gap: 2px 12px; }
.fz-dock .fz-counts { display: inline-flex; }

/* 地図上の KP・管内境のラベル */
.fz-kp span {
  display: inline-block; padding: 0 4px; border: 1px solid #8693a0; border-radius: 3px;
  background: rgba(255, 255, 255, .92); color: var(--ink); font: 10px/1.5 var(--font); white-space: nowrap;
}
.fz-kp span strong { color: var(--navy); }
.fz-kp span.is-left { transform: translateX(calc(-100% - 16px)); }
.map-pin.map-pin--sm span { width: 22px; height: 22px; font-size: 11px; }

/* 区間のポップアップ */
.fz-pop { min-width: 220px; font-family: var(--font); font-size: 12px; color: var(--ink); }
.fz-pop__title { font-size: 14px; font-weight: 700; color: var(--navy); }
.fz-pop__level { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; }
.fz-pop__level i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.fz-pop table { border-collapse: collapse; }
.fz-pop th { padding: 1px 10px 1px 0; color: var(--muted); font-weight: 400; white-space: nowrap; vertical-align: top; }
.fz-pop td { padding: 1px 0; }
.fz-pop__strip { display: flex; margin-top: 6px; }
.fz-pop__strip i { flex: 1; height: 14px; }
.fz-pop__strip i.is-now { outline: 2px solid var(--ink); outline-offset: -2px; }
.fz-pop__range { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

/* 時刻 (スライダー・ダイヤル) */
.fz-timebar { flex-wrap: wrap; gap: 6px 10px; }
.fz-step {
  flex: none; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--ink-2); font-size: 12px; line-height: 28px; text-align: center; padding: 0;
}
.fz-step:hover, .fz-step:focus { border-color: var(--lake); color: var(--lake); outline: none; }
.fz-timebar .timebar__label { min-width: 8.5em; text-align: center; }
.fz-range { flex: 1; min-width: 0; }
.fz-range .timebar__range { display: block; width: 100%; margin: 0; }
/* つまみの半幅 (約8px) だけ内側に寄せて目盛りをそろえる */
.fz-range__ticks { position: relative; height: 16px; margin: 0 8px; }
.fz-range__ticks i { position: absolute; top: 0; width: 1px; height: 4px; background: #b8c4cf; }
.fz-range__ticks i.is-day { height: 7px; background: var(--ink-2); }
.fz-range__ticks span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
/* ダイヤル式の時刻選択 (狭い画面用)：時刻の列を左右にスクロールし、中央の針の時刻を表示する */
.fz-dial-wrap { display: none; position: relative; flex: 1 1 100%; min-width: 0; }
.fz-dial {
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.fz-dial::-webkit-scrollbar { display: none; }
.fz-dial__track { display: flex; }
.fz-dial__pad { flex: none; }
.fz-dial__cell {
  flex: none; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
  width: 44px; height: 46px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px;
  scroll-snap-align: center; cursor: pointer; font-variant-numeric: tabular-nums;
}
.fz-dial__cell.is-day { border-left: 2px solid var(--ink-2); }
.fz-dial__cell i { display: block; width: 100%; height: 6px; }
.fz-dial__cell.is-on { color: var(--navy); font-weight: 700; }
.fz-dial__date { position: absolute; top: 1px; left: 3px; font-size: 10px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.fz-dial__needle { position: absolute; left: 50%; top: 14px; bottom: 0; width: 2px; margin-left: -1px; background: var(--lake); pointer-events: none; }
.fz-dial__needle::before { content: ''; position: absolute; top: -6px; left: -5px; border: 6px solid transparent; border-top-color: var(--lake); border-bottom: 0; }

/* 時空間図 (ダイアログ) */
.fz-modal {
  position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center;
  padding: 16px; background: rgba(13, 53, 83, .45);
}
.fz-modal.is-open { display: flex; }
body.fz-modal-open { overflow: hidden; }
.fz-modal__box {
  display: flex; flex-direction: column; max-width: 100%; max-height: 100%;
  background: var(--card); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.fz-modal__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.fz-modal__head h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--navy); }
.fz-modal__head h2 .fa { color: var(--lake); }
.fz-modal__note { flex: 1; min-width: 12em; font-size: 12px; color: var(--muted); }
.fz-zoom { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fz-zoom button { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink-2); font-size: 13px; }
.fz-zoom button:hover, .fz-zoom button:focus { border-color: var(--lake); color: var(--lake); outline: none; }
.fz-zoom #freeze_zoom_label { min-width: 3.2em; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fz-modal__close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef2f6; color: var(--ink-2); font-size: 16px; }
.fz-modal__close:hover, .fz-modal__close:focus { background: var(--navy); color: #fff; outline: none; }
/* 拡大・縮小はボタン・ピンチ・Ctrl+ホイールで行う (ブラウザ自体のピンチズームはここでは止める) */
.fz-modal__body {
  flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start;
  gap: 24px; padding: 14px 18px 18px; touch-action: pan-x pan-y;
}
.fz-diagram-box h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--navy); }
.fz-diagram-box h3 small { margin-left: 8px; font-weight: 400; color: var(--muted); }
.fz-diagram { display: block; }
.fz-diagram text { font-size: 9px; fill: var(--muted); font-family: var(--font); }
.fz-diagram text.fz-diagram__day { font-size: 10px; font-weight: 700; fill: var(--ink-2); }
.fz-diagram rect.fz-diagram__cell { cursor: pointer; }
.fz-diagram rect.fz-diagram__cell:hover { stroke: var(--ink); stroke-width: 1; }
.point-map { height: 440px; border-radius: 8px; border: 1px solid var(--line); z-index: 0; }
.point-list { margin: 0; padding: 0; list-style: none; }
.point-list li {
  display: flex;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  line-height: 1.35;
}
.point-list li:hover { background: #f6f9fc; }
.point-list li span:last-child { display: flex; flex-direction: column; }
.point-list small { color: var(--muted); font-size: 11px; }
.map-pin span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font: 700 13px/1 var(--font);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 400; color: var(--ink-2); cursor: pointer; }
.toggle input { margin: 0; }
.toggle__time { color: var(--muted); }

/* ---------- 準備中 ---------- */
.placeholder {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--ink-2);
}
.placeholder .fa { font-size: 40px; color: #b8c4cf; }
.placeholder p { margin: 0; }

/* ---------- カメラ ---------- */
.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.camera-tile { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.camera-tile__media { position: relative; aspect-ratio: 16 / 9; background: #1b2631; }
.camera-tile__media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.camera-tile__pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  min-height: 140px;
  color: #8fa1b3;
  font-size: 13px;
  background: repeating-linear-gradient(135deg, #1b2631 0 12px, #1f2c39 12px 24px);
}
.camera-tile__pending .fa { font-size: 26px; }
.camera-tile figcaption { display: flex; align-items: center; padding: 9px 12px; line-height: 1.35; }
.camera-tile figcaption span:last-child { display: flex; flex-direction: column; font-size: 14px; }
.camera-tile figcaption small { color: var(--muted); font-size: 11px; }

/* ---------- 観測データ ---------- */
.obs-tabs { display: flex; gap: 4px; margin: 0 0 16px; padding: 0; border-bottom: 1px solid var(--line); list-style: none; }
.obs-tabs a {
  display: block;
  padding: 8px 16px;
  border-bottom: 3px solid transparent;
  color: var(--ink-2);
  font-weight: 700;
  text-decoration: none;
}
.obs-tabs a:hover { color: var(--ink); text-decoration: none; }
.obs-tabs li.active a { border-bottom-color: var(--lake); color: var(--navy); }
.obs { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 24px; align-items: start; }
.obs__camera .camera_newest { width: 100%; padding: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: #1b2631; }
.obs__camera .camera_newest img { width: 100%; height: 100%; object-fit: cover; }
.obs__time { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.obs__main { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.obs__icon { width: 64px; height: auto; }
.obs__tmp { font-size: 46px; font-weight: 700; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.obs__tmp small { font-size: 20px; margin-left: 2px; }
.obs__list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.obs__list dt { color: var(--muted); font-weight: 400; }
.obs__list dd { margin: 0; font-weight: 700; }
.chart-box { margin-top: 18px; }
.chart-box:empty { display: none; }
.history-images { margin-top: 16px; }
.history-images summary { cursor: pointer; color: var(--lake); font-weight: 700; }
.history-images .form-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.history-images .form-control { width: 140px; }

.camera_newest_time { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.camera_newest_time:empty { display: none; }
.camera-small-images { margin-top: 12px; }
.small-image { margin-bottom: 12px; }
.small-image img { width: 100%; border-radius: 6px 6px 0 0; }
.small-image p.img-time { margin: 0; padding: 4px; background: #f6f8fa; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; text-align: center; font-size: 13px; }
.area-weather-info { padding: 4px 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; font-size: 12px; }
.area-weather-info p { margin: 0 0 2px; }

/* ---------- 気温と湿度 ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.chart-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 4px; }
.chart-card h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }

/* ---------- フッター ---------- */
.site-footer { padding: 20px; border-top: 1px solid var(--line); background: #fff; text-align: center; color: var(--muted); font-size: 12px; }
.site-footer p { margin: 0; }
.site-footer__copy { margin-top: 2px !important; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1100px) {
  .map-wrap { grid-template-columns: 1fr; }
  .point-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 12px; }
}
@media (max-width: 900px) {
  html { scroll-padding-top: 170px; }
  .layout { grid-template-columns: 1fr; gap: 16px; padding: 0 16px 32px; }
  .side-nav {
    position: sticky;
    top: 104px;
    z-index: 900;
    flex-direction: row;
    gap: 4px;
    margin: 0 -16px;
    padding: 8px 16px;
    overflow-x: auto;
    background: rgba(243, 245, 248, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
  }
  .side-nav a { flex: none; padding: 7px 12px; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
  .side-nav a .fa { display: none; }
  .obs { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .site-header__inner { padding: 8px 16px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__title { font-size: 18px; }
  .site-header__clock span { display: none; }
  .site-header__clock strong { font-size: 18px; }
  .alert-bar__inner { padding: 6px 16px; }
  .alert-bar__label .fa + * { display: none; }
  .card { padding: 16px; }
  .card__head h2 { font-size: 17px; }
  .issue__time { font-size: 18px; }
  .btn-primary-lg { width: 100%; justify-content: center; }
  .point-map { height: 340px; }
  .timebar__label { min-width: 0; }
  /* 路線凍結予測図：地図を低くし、時刻はダイヤルで選ぶ (◀▶とスライダーは隠す)
     縦帯は出さず、国道307号も横帯にして地図の下に並べる (js/freeze.js の NARROW_QUERY と同じ幅) */
  .fz-main { grid-template-columns: minmax(0, 1fr); height: 60vh; min-height: 340px; }
  .fz-side { display: none; }
  .fz-actions { width: 100%; }
  .fz-actions .btn-pill { flex: 1; justify-content: center; }
  .fz-step, .fz-range { display: none; }
  .fz-timebar .timebar__label { flex: 1; text-align: left; }
  .fz-dial-wrap { display: block; }
  .fz-dock { padding: 6px 8px 2px; }
  /* 時空間図は画面いっぱいに出し、説明文は省く */
  .fz-modal { padding: 0; }
  .fz-modal__box { width: 100%; height: 100%; border-radius: 0; }
  .fz-modal__head { padding: 8px 10px; gap: 6px 8px; }
  .fz-modal__head h2 { flex: 1; font-size: 15px; }
  .fz-modal__note { display: none; }
  .fz-modal__body { padding: 8px 10px 12px; gap: 16px; }
  .placeholder { flex-direction: column; text-align: center; }
}

@media print {
  .site-header, .side-nav, #map, #camera { display: none !important; }
  .layout { display: block; padding: 0; }
  .card { box-shadow: none; }
}

/* 横スクロール時も地点名を残す */
.summary .summary__point { position: sticky; left: 0; z-index: 1; }
.summary thead th.summary__point { background: #f6f8fa; }
@media (max-width: 600px) {
  .summary .summary__point { min-width: 128px; box-shadow: 1px 0 0 var(--line); }
}
