/* traffic-volume.css — 24時間交通量マップ（mount() で描く部分だけ。すべて .tv の中に閉じる）
   ソース: 交通量動的MAP/src/。awai-jikken/traffic-volume/ へは tools/publish_portal.py がコピーする。 */
.tv{
  --u:12px;   /* layout unit: 1/100 of the frame width, set from JS (clamped) */
  --tv-ink:#e8edf5; --tv-ink-sub:#a7b1c0; --tv-chip:rgba(14,19,28,.78); --tv-chip-line:rgba(255,255,255,.10);
  --tv-accent:#ffd36b; --tv-up:#7fb6ff; --tv-down:#ffb54d; --tv-miss:#7c8696; --tv-map-bg:#0f131a;
  position:relative; width:100%; height:100%; overflow:hidden; background:var(--tv-map-bg); color:var(--tv-ink);
  font-family:"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,system-ui,sans-serif; line-height:1.4;
  -webkit-text-size-adjust:100%;
}
.tv.tv--light{
  --tv-ink:#1d2430; --tv-ink-sub:#5d6675; --tv-chip:rgba(255,255,255,.88); --tv-chip-line:rgba(16,24,40,.12);
  --tv-accent:#b46a00; --tv-up:#2f6fd6; --tv-down:#d27a00; --tv-miss:#8a93a2; --tv-map-bg:#eef0f3;
}
.tv *, .tv *::before, .tv *::after{ box-sizing:border-box; }
.tv-frame{ position:absolute; inset:0; overflow:hidden; }
.tv-map{ position:absolute; inset:0; background:var(--tv-map-bg); }
.tv-dots{ position:absolute; inset:0; pointer-events:none; z-index:450; }
.tv-chip{ background:var(--tv-chip); border:1px solid var(--tv-chip-line); border-radius:10px; backdrop-filter:blur(3px); }

/* 地理院タイル（淡色地図）を暗い地図として使うときは、タイルだけを反転して暗くする */
.tv--gsi:not(.tv--light) .leaflet-tile-pane{ filter:invert(1) hue-rotate(180deg) brightness(.72) contrast(.78) saturate(.2); }
.tv--gsi.tv--light .leaflet-tile-pane{ filter:saturate(.55); }

.tv-clock{ position:absolute; left:10px; top:10px; z-index:900; padding:8px 12px; pointer-events:none; max-width:calc(100% - 20px); }
.tv-clock-time{ font-size:44px; font-weight:800; line-height:1; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.tv-data-date{ margin-top:5px; font-size:13px; font-weight:700; line-height:1.3; color:var(--tv-ink); }
.tv-data-date:empty{ display:none; }
.tv-clock-sub{ margin-top:4px; font-size:12px; color:var(--tv-ink-sub); display:flex; flex-wrap:wrap; align-items:center; gap:2px 0; }
.tv-sel{ pointer-events:auto; font:inherit; font-size:12px; color:var(--tv-ink); background:transparent; border:1px solid var(--tv-chip-line);
         border-radius:6px; padding:1px 2px; margin:0 2px; cursor:pointer; max-width:11em; }
.tv-date-sel{ max-width:none; }
.tv-sel option{ color:#1d2430; background:#fff; }
.tv-sel:focus-visible, .tv button:focus-visible, .tv input:focus-visible{ outline:2px solid var(--tv-accent); outline-offset:2px; }
.tv-name{ display:none; }
.tv-spark{ display:block; margin-top:6px; width:150px; height:30px; }
.tv-spark rect{ fill:var(--tv-ink-sub); opacity:.45; }
.tv-spark rect.now{ fill:var(--tv-accent); opacity:1; }
.tv-spark-cap{ font-size:10px; color:var(--tv-ink-sub); margin-top:2px; }

.tv-bottom{ position:absolute; left:10px; right:10px; bottom:10px; z-index:900; display:flex; flex-direction:column; gap:6px; pointer-events:none; }
.tv-info{ display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:6px; }
.tv-legend{ padding:6px 10px; display:flex; align-items:center; gap:10px; font-size:12px; }
.tv-legend svg{ flex:none; overflow:visible; }
.tv-legend .lab{ font-size:10px; fill:var(--tv-ink-sub); }
.tv-credit{ padding:5px 9px; font-size:10px; line-height:1.45; color:var(--tv-ink-sub); margin-left:auto; text-align:right; pointer-events:auto; }
.tv-credit a{ color:inherit; }
.tv-controls{ pointer-events:auto; display:flex; align-items:center; gap:10px; padding:8px 12px; }
.tv-play{ flex:none; width:40px; height:40px; border-radius:50%; border:none; cursor:pointer; font-size:16px;
          background:var(--tv-accent); color:#1b1f27; display:flex; align-items:center; justify-content:center; }
.tv--light .tv-play{ color:#fff; }
.tv-slider-wrap{ flex:1; min-width:0; display:flex; flex-direction:column; }
.tv-slider{ width:100%; min-width:0; accent-color:var(--tv-accent); height:28px; margin:0; }
.tv-ticks{ display:flex; justify-content:space-between; font-size:10px; color:var(--tv-ink-sub); margin-top:-4px; padding:0 2px; }
.tv-btn{ flex:none; font:inherit; font-size:11px; padding:5px 9px; border-radius:999px; cursor:pointer;
         color:var(--tv-ink-sub); background:transparent; border:1px solid var(--tv-chip-line); }
.tv-btn[hidden]{ display:none; }
.tv-status{ position:absolute; inset:0; z-index:950; display:flex; align-items:center; justify-content:center; padding:20px; text-align:center;
            font-size:14px; color:var(--tv-ink-sub); pointer-events:none; }
.tv-status[hidden]{ display:none; }

.tv .leaflet-container{ background:var(--tv-map-bg); font-family:inherit; }
.tv .leaflet-control-attribution{ display:none; } /* the credit chip carries the same attribution and is always visible */
.tv:not(.tv--light) .leaflet-bar a{ background:#1d2430; color:#e6eaf0; border-bottom-color:#38424f; }
.tv .leaflet-popup-content-wrapper, .tv .leaflet-popup-tip{ background:var(--tv-chip); color:var(--tv-ink); box-shadow:0 3px 14px rgba(0,0,0,.45); backdrop-filter:blur(4px); }
.tv:not(.tv--light) .leaflet-popup-content-wrapper, .tv:not(.tv--light) .leaflet-popup-tip{ background:#1a212c; }
.tv .leaflet-container a.leaflet-popup-close-button{ color:var(--tv-ink-sub); }
.tv .leaflet-popup-content{ margin:10px 12px; font-size:12px; line-height:1.45; }
.tv .pp-head{ font-weight:700; font-size:12.5px; }
.tv .pp-sub{ color:var(--tv-ink-sub); font-size:11px; }
.tv .pp-key{ display:flex; gap:10px; font-size:10.5px; color:var(--tv-ink-sub); margin:4px 0 2px; }
.tv .pp-key i{ display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:3px; vertical-align:-1px; }
.tv .pp-chart text{ font-size:9px; fill:var(--tv-ink-sub); }

/* ---------- 撮影モード: only the frame (map + time + legend + credit) is shown ---------- */
.tv.tv--shot{ background:#05070b; }
.tv--shot .tv-frame{ inset:auto; left:50%; top:50%; transform:translate(-50%,-50%); width:var(--fw); height:var(--fh); }
.tv--shot .tv-controls, .tv--shot .leaflet-control-container, .tv--shot .leaflet-popup-pane{ display:none !important; }
.tv--shot .tv-sel{ display:none; }
.tv--shot .tv-name{ display:inline; }
.tv--shot .tv-clock{ left:calc(var(--u)*1.6); top:calc(var(--u)*1.6); padding:calc(var(--u)*.9) calc(var(--u)*1.4); border-radius:calc(var(--u)*1); }
.tv--shot .tv-clock-time{ font-size:calc(var(--u)*6.4); }
.tv--shot .tv-data-date{ font-size:calc(var(--u)*1.6); margin-top:calc(var(--u)*.6); white-space:nowrap; }
.tv--shot .tv-clock-sub{ font-size:calc(var(--u)*1.35); margin-top:calc(var(--u)*.5); flex-wrap:nowrap; white-space:nowrap; }
.tv--shot .tv-spark{ width:calc(var(--u)*17); height:calc(var(--u)*3.4); margin-top:calc(var(--u)*.7); }
.tv--shot .tv-spark-cap{ font-size:calc(var(--u)*1.05); }
.tv--shot .tv-bottom{ left:calc(var(--u)*1.6); right:calc(var(--u)*1.6); bottom:calc(var(--u)*1.6); }
.tv--shot .tv-legend{ font-size:calc(var(--u)*1.3); padding:calc(var(--u)*.6) calc(var(--u)*1); border-radius:calc(var(--u)*.8); }
.tv--shot .tv-credit{ font-size:calc(var(--u)*1.0); padding:calc(var(--u)*.5) calc(var(--u)*.9); border-radius:calc(var(--u)*.8); }
.tv--shot.tv--portrait .tv-info{ flex-direction:column; align-items:flex-start; }
.tv--shot.tv--portrait .tv-credit{ margin-left:0; text-align:left; }

/* narrow frames (phones, or a narrow box on a page) */
.tv--narrow .tv-clock{ left:8px; top:8px; padding:6px 10px; }
.tv--narrow .tv-clock-time{ font-size:34px; }
.tv--narrow .tv-data-date{ font-size:12px; margin-top:4px; }
.tv--narrow .tv-spark{ width:120px; height:24px; }
.tv--narrow .tv-bottom{ left:8px; right:8px; bottom:8px; gap:5px; }
.tv--narrow .tv-info{ flex-direction:column; align-items:stretch; gap:5px; }
.tv--narrow .tv-legend{ font-size:11px; padding:5px 8px; }
.tv--narrow .tv-credit{ margin-left:0; text-align:left; font-size:9.5px; }
.tv--narrow .tv-controls{ padding:6px 10px; gap:8px; }
.tv--narrow .tv-btn{ padding:4px 7px; font-size:10.5px; }
.tv--narrow .leaflet-control-zoom{ display:none; }   /* phones pinch-zoom; the buttons would sit under the clock card */
@media (prefers-reduced-motion: reduce){ .tv *{ transition:none !important; } }

/* ---------- ポータルのページ（awai-jikken/traffic-volume/）用。#traffic-volume の箱の高さと、出典の注記 ---------- */
.viz-container#traffic-volume{ height:min(78vh, 720px); min-height:460px; }
@media (max-width: 560px){ .viz-container#traffic-volume{ height:80svh; min-height:520px; } }
.source-note{ font-size:var(--text-sm, 14px); color:var(--color-text-muted, #566074); margin:var(--space-3, 12px) 0 0; }
