/* 台灣即時影像地圖 — tokens follow iOS semantic roles; every text pair ≥ 4.5:1 in both appearances. */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;            /* grouped background */
  --surface: #ffffff;       /* cards, sheet */
  --fill: #f2f2f7;          /* buttons, inputs inside a surface */
  --fill-2: #e5e5ea;
  --label: #1c1c1e;         /* 17.0:1 on surface */
  --label-2: #5c5c66;       /* 6.6:1 on surface, 5.9:1 on bg */
  --line: rgba(60, 60, 67, .16);
  --accent: #0a5fd1;        /* 5.9:1 on surface */
  --danger: #d70015;        /* 5.4:1 on surface */
  --warn-bg: #fde8ea;
  --warn-fg: #b4000f;       /* 6.1:1 on warn-bg */
  --glass: rgba(255, 255, 255, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 28px rgba(0, 0, 0, .14);
  /* road-sign colours: 國道 green, 省道 blue, 市區 orange (white text ≥ 5.1:1 on each) */
  --k-fwy: #0b7a3b;
  --k-hwy: #1f5fbf;
  --k-city: #c2410c;
  --k-spot: #7c3aed;
  --k-down: #8e8e93;
  --media: #0c0c0e;
  --r-l: 22px;
  --r-m: 14px;
  --r-s: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro TC", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-family: var(--font);
  font-size: 100%;           /* 1rem follows the person's browser text size */
  color: var(--label);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --fill: #2c2c2e;
    --fill-2: #3a3a3c;
    --label: #f2f2f7;        /* 15.3:1 */
    --label-2: #aeaeb2;      /* 7.7:1 */
    --line: rgba(84, 84, 88, .55);
    --accent: #5aa9ff;       /* 6.9:1 */
    --danger: #ff6b61;       /* 6.1:1 */
    --warn-bg: #3a1517;
    --warn-fg: #ff8a80;      /* 7.1:1 */
    --glass: rgba(28, 28, 30, .78);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .5);
  }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(60, 60, 67, .5); --glass: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--surface); }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body.app { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i .fill { fill: currentColor; stroke: none; }

#map { position: fixed; inset: 0; }
.page #map { position: absolute; }

/* ---------- top: search + chips (the floating functional layer) ---------- */
.top {
  position: fixed; z-index: 20; left: 0; right: 0;
  top: 0; padding: calc(env(safe-area-inset-top) + 10px) 12px 0;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.searchbar {
  display: flex; align-items: center; gap: 2px; height: 50px; padding: 0 4px;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-radius: 25px; box-shadow: var(--shadow); color: var(--label-2);
}
.searchbar input {
  flex: 1; min-width: 0; height: 44px; border: 0; background: none; outline: none;
  font-size: 1.0625rem; color: var(--label);   /* 17px: body size, and iOS won't zoom */
}
.searchbar input::placeholder { color: var(--label-2); }
.searchbar input::-webkit-search-cancel-button { filter: grayscale(1); }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 22px; background: none; color: var(--accent);
  display: grid; place-items: center;
}
.icon-btn:active { background: var(--fill); }
.icon-btn.busy .i { animation: pulse 1s ease-in-out infinite; }

.chips {
  display: flex; gap: 8px; margin: 10px -12px 0; padding: 0 12px 6px; overflow-x: auto;
  scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: 18px; background: var(--glass); color: var(--label);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--shadow); font-size: .9375rem; text-decoration: none; white-space: nowrap;
  position: relative;
}
.chip::after { content: ""; position: absolute; inset: -4px 0; } /* 44px tall hit area */
.chip[aria-pressed="true"] { background: var(--label); color: var(--surface); }
.chip-warn { background: var(--warn-bg); color: var(--warn-fg); font-weight: 600; }

/* ---------- search results ---------- */
.results {
  margin-top: 8px; max-height: min(62dvh, 520px); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 6px 0;
}
.results h3 { margin: 10px 16px 4px; font-size: .8125rem; font-weight: 600; color: var(--label-2); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px;
  border: 0; background: none; text-align: left; color: var(--label);
}
.row + .row { box-shadow: inset 0 1px 0 var(--line); }
.row:active, .row[aria-selected="true"] { background: var(--fill); }
.row .t { flex: 1; min-width: 0; }
.row b { display: block; font-size: 1rem; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row small { display: block; font-size: .8125rem; color: var(--label-2); margin-top: 2px; }
.row .dist { flex: none; font-size: .8125rem; color: var(--label-2); font-variant-numeric: tabular-nums; }
.empty { color: var(--label-2); padding: 14px 16px; margin: 0; font-size: .9375rem; }

/* the signature: a road shield, coloured like Taiwan's road signs */
.shield {
  flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 7px;
  border-radius: 7px; color: #fff; font-size: .8125rem; font-weight: 700; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; background: var(--k-city);
}
.shield.fwy { background: var(--k-fwy); border-radius: 13px 13px 9px 9px; }
.shield.hwy { background: var(--k-hwy); }
.shield.spot { background: var(--k-spot); border-radius: 9px; }
.shield.down { background: var(--k-down); }

/* ---------- legend ---------- */
.legend {
  position: fixed; z-index: 5; left: 12px; bottom: calc(env(safe-area-inset-bottom) + 34px);
  background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 12px; box-shadow: var(--shadow); padding: 7px 11px; font-size: .75rem; color: var(--label);
  transition: opacity .2s;
}
.legend .kinds { display: flex; gap: 10px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: 0; border: 1.5px solid #fff; box-sizing: content-box; }
.k-fwy { background: var(--k-fwy); } .k-hwy { background: var(--k-hwy); } .k-city { background: var(--k-city); } .k-spot { background: var(--k-spot); }
#rainLegend { margin-top: 5px; min-width: 170px; }
#rainLegend .scale { display: flex; margin-top: 3px; border-radius: 3px; overflow: hidden; }
#rainLegend .scale span { flex: 1; height: 6px; }
#rainLegend .marks { display: flex; justify-content: space-between; color: var(--label-2); font-variant-numeric: tabular-nums; }
body.sheet-open .legend { opacity: 0; pointer-events: none; }

.pill-status, .toast {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top) + 116px);
  background: var(--label); color: var(--surface); padding: 9px 16px; border-radius: 20px;
  font-size: .9375rem; box-shadow: var(--shadow); white-space: nowrap;
}

/* ---------- sheet (camera card) ---------- */
.sheet {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(100dvh - env(safe-area-inset-top) - 56px);
  background: var(--surface); color: var(--label);
  border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: 0 -2px 30px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .38s var(--ease);
  will-change: transform;
}
.sheet.dragging { transition: none; }
.sheet-head { padding: 6px 16px 10px; flex: none; cursor: grab; touch-action: none; }
.grabber {
  display: block; width: 100%; height: 22px; border: 0; background: none; padding: 0; position: relative;
}
.grabber::before {
  content: ""; position: absolute; left: 50%; top: 8px; width: 36px; height: 5px; margin-left: -18px;
  border-radius: 3px; background: var(--fill-2);
}
.titlebar { display: flex; align-items: flex-start; gap: 10px; }
.titlebar .shield { margin-top: 3px; }
.titlebar .t { flex: 1; min-width: 0; }
.titlebar h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; font-weight: 700; }
.meta { margin: 3px 0 0; color: var(--label-2); font-size: .875rem; }
.close {
  flex: none; width: 44px; height: 44px; margin: -6px -10px 0 0; border: 0; background: none; display: grid; place-items: center;
}
.close span { width: 30px; height: 30px; border-radius: 15px; background: var(--fill); color: var(--label-2); display: grid; place-items: center; }
.close .i { width: 16px; height: 16px; stroke-width: 2.6; }
.sheet-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0 16px calc(env(safe-area-inset-bottom) + 20px); }

.view {
  position: relative; aspect-ratio: 16 / 10; background: var(--media); border-radius: var(--r-m); overflow: hidden;
}
.view img, .view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--media); }
.view .badge {
  position: absolute; z-index: 2; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-variant-numeric: tabular-nums;
}
.view .badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; animation: pulse 2s ease-in-out infinite; }
.view .state {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; text-align: center; color: #d1d1d6; font-size: .9375rem; line-height: 1.55;
}
.view .state.loading { background: linear-gradient(100deg, #141416 30%, #22222a 50%, #141416 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.view .state button, .view .state a {
  min-height: 40px; padding: 0 18px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .16); color: #fff;
  font-weight: 600; text-decoration: none; display: inline-flex; align-items: center;
}
.view .state .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .9s linear infinite; }

.actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px;
  border: 0; border-radius: var(--r-m); background: var(--fill); color: var(--accent); text-decoration: none;
  font-size: .8125rem; font-weight: 600;
}
.action:active { background: var(--fill-2); }
.action[aria-pressed="true"] .i { fill: currentColor; }
.section-title { margin: 22px 0 8px; font-size: .8125rem; font-weight: 600; color: var(--label-2); }
.group { background: var(--fill); border-radius: var(--r-m); overflow: hidden; }
.group .row { min-height: 52px; }
.group .row:active { background: var(--fill-2); }
.foot-note { color: var(--label-2); font-size: .75rem; line-height: 1.6; margin: 16px 2px 0; }

/* alert list reuses the sheet */
.alert-row { padding: 12px 16px; }
.alert-row + .alert-row { box-shadow: inset 0 1px 0 var(--line); }
.alert-row b { color: var(--warn-fg); font-size: 1rem; }
.alert-row div { font-size: .9375rem; margin-top: 2px; }
.alert-row small { color: var(--label-2); font-size: .8125rem; }

/* ---------- map chrome ---------- */
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-bottom-right { bottom: env(safe-area-inset-bottom); }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; overflow: hidden; }
@media (pointer: coarse) { .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none !important; } }
.maplibregl-popup-content {
  background: var(--surface); color: var(--label); border-radius: var(--r-m); box-shadow: var(--shadow);
  padding: 12px 14px; font: .875rem/1.55 var(--font); max-width: 280px;
}
.maplibregl-popup-content b { font-size: .9375rem; }
.maplibregl-popup-content small { color: var(--label-2); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl-group { background: var(--surface) !important; }
  .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
  .maplibregl-ctrl-attrib { background: rgba(28, 28, 30, .7) !important; color: #aeaeb2; }
  .maplibregl-ctrl-attrib a { color: #d1d1d6 !important; }
  .maplibregl-ctrl-attrib-button { filter: invert(1); }
}

/* ---------- wide: the card becomes a side panel (Maps on iPad / Mac) ---------- */
@media (min-width: 760px) {
  .top { right: auto; width: 416px; padding-left: 16px; padding-right: 0; }
  .chips { margin-right: 0; }
  .sheet {
    left: 16px; right: auto; width: 400px; bottom: 16px; height: auto;
    top: calc(env(safe-area-inset-top) + 118px); border-radius: var(--r-l);
    transform: translateX(calc(-100% - 32px)); box-shadow: var(--shadow);
  }
  .sheet-head { cursor: default; padding-top: 16px; }
  .grabber { display: none; }
  .legend { left: auto; right: 60px; bottom: 30px; }
  body.sheet-open .legend { opacity: 1; pointer-events: auto; }
  .results { max-height: calc(100dvh - 140px); }
}

@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation-duration: 0s !important; animation-iteration-count: 1 !important; }
  .sheet { transition: none; }
}

/* ---------- theme pages (/typhoon) ---------- */
html:has(body.page), body.page { overflow: auto; height: auto; background: var(--bg); }
.page .topbar, .framed .topbar {
  position: sticky; top: 0; z-index: 8; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 4px) 16px 4px; min-height: 52px;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 1px 0 var(--line);
}
.brand { color: var(--label); text-decoration: none; font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; }
.updated { color: var(--label-2); font-size: .8125rem; }
.page main { max-width: 860px; margin: 0 auto; padding: 8px 16px 40px; }
.page h1 { font-size: 1.75rem; line-height: 1.3; margin: 18px 0 8px; letter-spacing: -.01em; }
.page main h2 { font-size: 1.25rem; margin: 0 0 10px; }
.page main h3 { font-size: 1rem; margin: 14px 0 8px; }
.page main section { margin-top: 30px; }
.lead { font-size: 1.0625rem; line-height: 1.7; margin: 0; }
.warning { background: var(--warn-bg); border-radius: var(--r-m); padding: 14px 16px; }
.warning h2 { color: var(--warn-fg); }
.warning p { margin: 6px 0; line-height: 1.6; font-size: .9375rem; }
.storm { background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; margin-bottom: 10px; }
.storm h3 { margin: 0 0 8px !important; font-size: 1.125rem !important; }
.storm dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: .9375rem; }
.storm dt { color: var(--label-2); }
.storm dd { margin: 0; }
.page .empty { padding: 0; }
.mapbox { position: relative; height: min(70vh, 560px); border-radius: var(--r-m); overflow: hidden; }
.page .layers { position: absolute; z-index: 3; left: 0; right: 0; top: 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 8px 6px; }
.page .layers .chip { min-height: 34px; font-size: .875rem; }
.page .legend { position: absolute; left: 8px; bottom: 28px; }
.src { color: var(--label-2); font-size: .8125rem; margin: 10px 0 0; line-height: 1.6; }
.cam-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cam-card {
  width: 100%; text-align: left; padding: 0; border: 0; border-radius: var(--r-m); overflow: hidden;
  background: var(--surface); display: flex; flex-direction: column; color: var(--label); height: 100%;
}
.cam-card img, .cam-card .play {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--media); display: flex;
  align-items: center; justify-content: center; color: #d1d1d6; font-size: .875rem;
}
.cam-card b { font-size: .9375rem; padding: 9px 11px 0; font-weight: 600; line-height: 1.35; }
.cam-card small { color: var(--label-2); font-size: .8125rem; padding: 3px 11px 11px; }
.counties { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.counties li { background: var(--surface); border-radius: var(--r-s); padding: 8px 12px; font-size: .9375rem; }
.counties b { color: var(--warn-fg); }
.page table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .9375rem; border-radius: var(--r-m); overflow: hidden; }
.page th, .page td { padding: 10px 12px; text-align: left; vertical-align: top; }
.page tbody td { box-shadow: inset 0 1px 0 var(--line); }
.page th { color: var(--label-2); font-weight: 600; font-size: .8125rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.lv1 { color: var(--danger); font-weight: 700; } .lv2 { color: #c2410c; font-weight: 700; } .lv3 { color: #a16207; font-weight: 700; }
@media (prefers-color-scheme: dark) { .lv2 { color: #fb923c; } .lv3 { color: #facc15; } }
.ev { white-space: nowrap; font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.shop ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.shop li { background: var(--surface); border-radius: var(--r-s); padding: 12px 14px; }
.shop a { color: var(--accent); font-weight: 600; }
.shop small { display: block; color: var(--label-2); }
.faq p { line-height: 1.75; }
.faq a { color: var(--accent); }
.foot { max-width: 860px; margin: 0 auto; padding: 18px 16px calc(env(safe-area-inset-bottom) + 24px); color: var(--label-2); font-size: .8125rem; line-height: 1.6; }

/* ---------- camera, county and road pages ---------- */
.page .topbar .topnav { display: flex; gap: 2px; }
.topnav a { color: var(--label); text-decoration: none; font-size: .9375rem; padding: 0 10px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 10px; }
.topnav a:active { background: var(--fill); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 4px; font-size: .8125rem; color: var(--label-2); }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs > span:not([aria-current]) { color: var(--label-2); opacity: .6; }
.cam-head { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 14px; }
.cam-head .shield { height: 30px; min-width: 48px; font-size: .9375rem; margin-top: 4px; }
.cam-head h1 { margin: 0 !important; font-size: 1.5rem !important; }
.cam-head .meta { margin-top: 4px; font-size: .9375rem; }
.page .view { max-width: 860px; }
.page .lead a, .foot-note a, .warning a { color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.tile { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile small { color: var(--label-2); font-size: .8125rem; font-weight: 600; }
.tile b { font-size: 1.0625rem; }
.tile span { color: var(--label-2); font-size: .8125rem; line-height: 1.45; }
.tile.warn { background: var(--warn-bg); }
.tile.warn b, .tile.warn small { color: var(--warn-fg); }
.page .group { background: var(--surface); }
.page .group .row:active { background: var(--fill); }
.page .section-title { font-size: .9375rem !important; margin: 26px 0 8px !important; color: var(--label); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.see-all { color: var(--accent); font-weight: 500; font-size: .875rem; text-decoration: none; white-space: nowrap; }
a.row { text-decoration: none; color: var(--label); }
a.row > :last-child:not(.t):not(.dist) { color: var(--label-2); }
.row.more b { color: var(--accent); font-weight: 600; }
.page .actions { max-width: 860px; }
.page .warning b { color: var(--warn-fg); }
.page .warning { margin-top: 14px; font-size: .9375rem; }
.ev-事故 { color: var(--danger); } .ev-災變 { color: var(--danger); } .ev-交通管制 { color: #7c3aed; } .ev-阻塞 { color: #c2410c; }
@media (prefers-color-scheme: dark) { .ev-交通管制 { color: #b794f6; } .ev-阻塞 { color: #fb923c; } }
.footnav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.footnav a { color: var(--accent); text-decoration: none; font-size: .875rem; }
.foot p { margin: 6px 0; }
@media (max-width: 420px) { .topnav a { padding: 0 7px; font-size: .875rem; } .page .topbar { padding-left: 12px; padding-right: 4px; gap: 4px; } .brand { font-size: .9375rem; } }

/* ---------- 合歡山 ---------- */
.caption { margin: 8px 2px 0; font-size: .875rem; color: var(--label-2); }
.caption a { color: var(--accent); text-decoration: none; font-weight: 600; }
.tile .temp { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile.cold .temp { color: var(--accent); }
.days { list-style: none; padding: 0; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.days::-webkit-scrollbar { display: none; }
.days li { background: var(--surface); border-radius: var(--r-m); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.days li small { color: var(--label-2); font-size: .8125rem; font-weight: 600; }
.days li b { font-size: .9375rem; font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.days li .range { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.days li span:last-child { color: var(--label-2); font-size: .8125rem; }
.days li.snow { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent); }
.days li.snow b, .days li.snow .range { color: var(--accent); }
.gauge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; background: var(--surface); border-radius: var(--r-m); overflow: hidden; text-decoration: none; color: var(--label); }
.gauge img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--media); }
.gauge span { padding: 12px 14px; font-size: .9375rem; line-height: 1.6; align-self: center; }
.gauge b { display: block; color: var(--accent); margin-top: 6px; }
@media (max-width: 520px) { .gauge { grid-template-columns: 1fr; } }
.cam-grid a.cam-card { text-decoration: none; }

/* ---------- /traffic ---------- */
.updated-line { color: var(--label-2); font-size: .8125rem; margin: 8px 0 0; }
.page .chips.filter { margin: 14px -16px 0; padding: 4px 16px 8px; -webkit-mask-image: none; }
.page .chips .chip, .page .chips.wrap .chip { box-shadow: none; background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.page .chips .chip[aria-pressed="true"] { background: var(--label); color: var(--surface); }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; -webkit-mask-image: none; }
.events { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.event { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; min-width: 0; }
.ev-top { display: flex; align-items: center; gap: 8px; }
.ev-tag { flex: none; font-size: .8125rem; padding: 2px 8px; border-radius: 6px; background: var(--fill); }
.ev-tag.ev-事故, .ev-tag.ev-災變 { background: var(--warn-bg); color: var(--warn-fg); }
.ev-tag.ev-阻塞 { background: color-mix(in srgb, #d97706 16%, var(--surface)); }
.ev-tag.ev-交通管制 { background: color-mix(in srgb, #7c3aed 14%, var(--surface)); }
.ev-place { flex: 1; min-width: 0; font-weight: 600; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event time { flex: none; color: var(--label-2); font-size: .8125rem; }
.event p { margin: 8px 0 4px; font-size: .9375rem; line-height: 1.6; overflow-wrap: anywhere; }
.ev-src { color: var(--label-2); font-size: .75rem; }
.near-cam { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; min-height: 48px; border-radius: var(--r-s); background: var(--fill); color: var(--label); text-decoration: none; font-size: .875rem; }
.near-cam > span:not(.shield) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-cam small { color: var(--label-2); margin-left: 6px; }
.near-cam:active { background: var(--fill-2); }

/* ---------- /work-school ---------- */
.ws-status { margin-top: 12px; border-radius: var(--r-m); padding: 16px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.ws-status b { font-size: 1.25rem; line-height: 1.4; }
.ws-status span { color: var(--label-2); font-size: .8125rem; }
.ws-status.stop { background: var(--warn-bg); }
.ws-status.stop b { color: var(--warn-fg); }
.ws-typhoon { display: block; margin-top: 8px; padding: 12px 16px; border-radius: var(--r-m); background: var(--surface); color: var(--accent); font-weight: 600; text-decoration: none; }
.ws-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; color: var(--label-2); font-size: .875rem; }
.ws-tools .chip { box-shadow: none; background: var(--surface); color: var(--accent); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ws-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.county { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.county.mine { box-shadow: inset 0 0 0 2px var(--accent); }
.county.mine .pin { visibility: hidden; }
.ws-head { display: flex; align-items: center; justify-content: space-between; }
.ws-head b { font-size: 1.0625rem; }
.pin { border: 0; background: none; color: var(--accent); font-size: .8125rem; min-height: 36px; padding: 0 4px; }
.ws-days { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-days div { display: flex; flex-direction: column; gap: 4px; }
.ws-days small { color: var(--label-2); font-size: .75rem; font-weight: 600; }
.st { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: .875rem; font-weight: 700; width: fit-content; }
.st-stop { background: var(--warn-bg); color: var(--warn-fg); }
.st-part { background: color-mix(in srgb, #d97706 18%, var(--surface)); color: #a14e00; }
.st-ok { background: color-mix(in srgb, #0b7a3b 14%, var(--surface)); color: #0b6b34; }
.st-none { background: var(--fill); color: var(--label-2); font-weight: 600; }
@media (prefers-color-scheme: dark) { .st-part { color: #fbbf24; } .st-ok { color: #6ee7a0; } }
.ws-lines { margin: 0; padding-left: 18px; font-size: .875rem; line-height: 1.6; }
.ws-links { display: flex; gap: 16px; font-size: .875rem; }
.ws-links a { color: var(--accent); text-decoration: none; }

/* ---------- front page ---------- */
.home main { max-width: 1080px; }
.home-hero { position: relative; padding: 18px 0 4px; }
.home-hero h1 { font-size: 2rem !important; margin: 6px 0 6px !important; letter-spacing: -.02em; }
.home-hero p { margin: 0 0 16px; color: var(--label-2); font-size: 1rem; line-height: 1.6; }
.home-search {
  display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 16px; border-radius: 27px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--label-2);
}
.home-search input { flex: 1; min-width: 0; height: 48px; border: 0; outline: none; background: none; font-size: 1.0625rem; color: var(--label); }
.home-search input::placeholder { color: var(--label-2); }
.home-results { position: absolute; z-index: 10; left: 0; right: 0; }
.home .topbar .brand { font-size: 1.0625rem; }

.today .day { display: flex; align-items: baseline; gap: 10px; font-size: 1.25rem !important; margin: 26px 0 12px !important; }
.today .day span { color: var(--label-2); font-size: .8125rem; font-weight: 500; }
.briefs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .briefs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.brief {
  display: flex; flex-direction: column; gap: 3px; min-height: 104px; padding: 13px 14px; border-radius: var(--r-m);
  background: var(--surface); color: var(--label); text-decoration: none; position: relative;
}
.brief::after { content: "›"; position: absolute; right: 12px; top: 10px; color: var(--label-2); font-size: 1.1rem; }
.brief small { color: var(--label-2); font-size: .8125rem; font-weight: 600; }
.brief b { font-size: 1.1875rem; line-height: 1.3; margin-top: 2px; }
.brief span { color: var(--label-2); font-size: .8125rem; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.brief.alert, .brief.warn { background: var(--warn-bg); }
.brief.alert b, .brief.alert small, .brief.warn b, .brief.warn small { color: var(--warn-fg); }
.brief.cold { box-shadow: inset 0 0 0 2px var(--accent); }
.brief.cold b { color: var(--accent); }
.brief:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .brief:active { transform: none; } }

.overview { display: grid; gap: 14px; margin-top: 26px; }
@media (min-width: 760px) { .overview { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } .overview .mine, .overview .near-box { grid-column: 2; } .map-card { grid-row: span 2; } }
.overview .section-title { margin-top: 0 !important; }
.map-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 16px 14px; border-radius: var(--r-l);
  background: var(--surface); color: var(--label); text-decoration: none;
}
.tw-map { width: 100%; max-width: 260px; height: auto; }
.tw-map path { fill: color-mix(in srgb, var(--label) 10%, var(--surface)); stroke: var(--surface); stroke-width: .8; stroke-linejoin: round; }
.tw-map path.w { fill: color-mix(in srgb, #ff3b30 55%, var(--surface)); }
.map-card:hover .tw-map path:not(.w) { fill: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.map-cta { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.map-cta b { color: var(--accent); font-size: 1.0625rem; }
.map-cta small { color: var(--label-2); font-size: .8125rem; }
.near-box .chip { box-shadow: none; background: var(--surface); color: var(--accent); backdrop-filter: none; -webkit-backdrop-filter: none; font-weight: 600; }
.near-hint { color: var(--label-2); font-size: .875rem; margin: 0 0 10px; }

.tile-row {
  list-style: none; padding: 0 16px 6px; margin: 0 -16px; display: grid; grid-auto-flow: column; grid-auto-columns: 168px;
  gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
}
.tile-row::-webkit-scrollbar { display: none; }
.tile-row li { scroll-snap-align: start; }
@media (min-width: 760px) { .tile-row { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); overflow: visible; margin: 0; padding: 0; } }
.tile-cam { display: flex; flex-direction: column; height: 100%; border-radius: var(--r-m); overflow: hidden; background: var(--surface); color: var(--label); text-decoration: none; }
.tile-cam .thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--media); }
.tile-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-cam .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.tile-cam .ph i { color: #c7c7cc; font-style: normal; font-size: .8125rem; }
.tile-cam .live { position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .6875rem; font-weight: 700; font-style: normal; letter-spacing: .04em; }
.tile-cam b { padding: 9px 11px 0; font-size: .9375rem; line-height: 1.35; font-weight: 600; }
.tile-cam small { padding: 2px 11px 11px; color: var(--label-2); font-size: .8125rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chips.wrap .chip .shield { height: 22px; min-width: 34px; font-size: .75rem; margin-left: -6px; }
.ev-done { flex: none; font-size: .75rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--label-2); }

/* ---------- 台灣.day brand ---------- */
.brand span, .home-hero h1 span { color: var(--accent); }
.src-inline { color: var(--label-2); font-size: .75rem; font-weight: 500; margin-left: auto; }

/* today's weather */
.wx-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .wx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .wx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wx-grid li { background: var(--surface); border-radius: var(--r-s); padding: 9px 12px; display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; align-items: baseline; }
.wx-grid b { font-size: .9375rem; }
.wx-grid .t { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.wx-grid .wx { color: var(--label-2); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-grid small { color: var(--label-2); font-size: .75rem; text-align: right; }

/* earthquake */
.quake-hero { display: flex; gap: 14px; align-items: stretch; margin-top: 14px; }
.quake-hero .mag { flex: none; width: 110px; border-radius: var(--r-m); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; }
.quake-hero.recent .mag { background: var(--warn-bg); color: var(--warn-fg); }
.quake-hero .mag small { font-size: .8125rem; color: inherit; opacity: .8; font-weight: 600; }
.quake-hero .mag b { font-size: 2.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.quake-hero .facts { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quake-hero .facts div { background: var(--surface); border-radius: var(--r-s); padding: 8px 12px; display: flex; flex-direction: column; min-width: 0; }
.quake-hero .facts small { color: var(--label-2); font-size: .75rem; font-weight: 600; }
.quake-hero .facts b { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quake-map { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 760px) { .quake-map { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } }
.quake-map .section-title { margin-top: 0 !important; }
.legend-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: .75rem; color: var(--label-2); }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
/* intensity colours: 中央氣象署's ten levels */
:root { --i0: #d9dde3; --i1: #a6dcf5; --i2: #5cc98a; --i3: #f3d642; --i4: #f5a33b;
        --i5w: #ef7a3c; --i5s: #e2492f; --i6w: #c3222f; --i6s: #9b1b3a; --i7: #6d1b8f; }
.lv-0 { --q: var(--i0); } .lv-1 { --q: var(--i1); } .lv-2 { --q: var(--i2); } .lv-3 { --q: var(--i3); } .lv-4 { --q: var(--i4); }
.lv-5w { --q: var(--i5w); } .lv-5s { --q: var(--i5s); } .lv-6w { --q: var(--i6w); } .lv-6s { --q: var(--i6s); } .lv-7 { --q: var(--i7); }
.tw-map path.i0 { --q: var(--i0); } .tw-map path.i1 { --q: var(--i1); } .tw-map path.i2 { --q: var(--i2); } .tw-map path.i3 { --q: var(--i3); }
.tw-map path.i4 { --q: var(--i4); } .tw-map path.i5w { --q: var(--i5w); } .tw-map path.i5s { --q: var(--i5s); } .tw-map path.i6w { --q: var(--i6w); }
.tw-map path.i6s { --q: var(--i6s); } .tw-map path.i7 { --q: var(--i7); }
.tw-map path[class^="i"] { fill: var(--q); }
.legend-row i, .q-legend i { background: var(--q); }
.lv { display: inline-block; min-width: 3.2em; text-align: center; padding: 1px 6px; border-radius: 6px; background: var(--q, var(--fill)); color: #1c1c1e; font-size: .8125rem; }
.speed { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn-fg); }
.alert-row b.lv, td b.lv, b.lv { color: #1c1c1e; }
b.lv.lv-5s, b.lv.lv-6w, b.lv.lv-6s, b.lv.lv-7 { color: #fff; }
.quake-hero .facts b { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quake-map { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 760px) { .quake-map { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } }
.quake-map .section-title { margin-top: 0 !important; }
.legend-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: .75rem; color: var(--label-2); }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
/* intensity colours, after 中央氣象署's scale */
.tw-map path.i1, .legend-row .i1, .lv-1 { --q: #9ad6f5; } .tw-map path.i2, .legend-row .i2, .lv-2 { --q: #5cc98a; }
.tw-map path.i3, .legend-row .i3, .lv-3 { --q: #f3d642; } .tw-map path.i4, .legend-row .i4, .lv-4 { --q: #f59a3b; }
.tw-map path.i5, .legend-row .i5, .lv-5 { --q: #e8573a; } .tw-map path.i6, .legend-row .i6, .lv-6 { --q: #c3222f; }
.tw-map path.i7, .legend-row .i7, .lv-7 { --q: #7b1fa2; }
.tw-map path[class^="i"] { fill: var(--q); }
.legend-row i { background: var(--q); }
.lv { display: inline-block; min-width: 3.2em; text-align: center; padding: 1px 6px; border-radius: 6px; background: var(--q, var(--fill)); color: #1c1c1e; font-size: .8125rem; }
.lv-5, .lv-6, .lv-7 { color: #fff; }
.speed { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn-fg); }
.alert-row b.lv, td b.lv { color: #1c1c1e; }
.alert-row b.lv-5, .alert-row b.lv-6, .alert-row b.lv-7, td b.lv-5, td b.lv-6, td b.lv-7 { color: #fff; }
.quake-hero .facts b { white-space: normal; overflow: visible; font-size: .9375rem; line-height: 1.35; }
@media (max-width: 420px) {
  .quake-hero { flex-direction: column; }
  .quake-hero .mag { width: auto; flex-direction: row; gap: 10px; justify-content: flex-start; padding: 10px 16px; }
  .brief b { font-size: 1.0625rem; }
}

/* ---------- Live brand: the red live dot ---------- */
.brand { display: inline-flex; align-items: center; gap: 6px; }
.brand span:not(.live-dot), .home-hero h1 span:not(.live-dot) { color: var(--label-2); font-weight: 600; }
.live-dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 0 .18em rgba(255, 59, 48, .22); animation: pulse 2s ease-in-out infinite; margin-right: .1em; flex: none; }
.home-hero h1 { display: flex; align-items: center; gap: .3em; }
.foot a { color: var(--accent); text-decoration: none; }
.countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 24px; }
.country { display: flex; flex-direction: column; gap: 3px; padding: 18px 16px; border-radius: var(--r-l); background: var(--surface); color: var(--label-2); text-decoration: none; }
.country b { font-size: 1.5rem; color: var(--label-2); }
.country small { font-size: .8125rem; }
.country span { font-size: .875rem; margin-top: 6px; }
.country.live { color: var(--label); box-shadow: inset 0 0 0 2px var(--accent); }
.country.live b { color: var(--label); }
.country.live span { color: var(--accent); font-weight: 600; }

/* ---------- top bar with categories ---------- */
.page .topbar, .framed .topbar { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 0; }
.bar-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.map-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.map-link .i { width: 20px; height: 20px; }
.catnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); }
.catnav::-webkit-scrollbar { display: none; }
.catnav a { flex: none; position: relative; padding: 10px 10px 12px; color: var(--label-2); text-decoration: none; font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.catnav a[aria-current="page"] { color: var(--label); }
.catnav a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--accent); }
@media (min-width: 760px) { .catnav { -webkit-mask-image: none; margin: 0; padding: 0; } }

/* 附近影像 / 天氣資訊 */
.chip.primary { background: var(--accent) !important; color: #fff !important; font-weight: 700; min-height: 44px; padding: 0 20px; }
.tile-row.grid { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); overflow: visible; margin: 14px 0 0; padding: 0; }
.wx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 14px; }
.wx-card { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.wx-card.warned { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warn-fg) 45%, transparent); }
.wx-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wx-head b { font-size: 1.0625rem; }
.wx-head .st { min-height: 24px; font-size: .75rem; }
.wx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wx-two div { display: flex; flex-direction: column; gap: 1px; }
.wx-two small { color: var(--label-2); font-size: .75rem; font-weight: 600; }
.wx-two b { font-size: .9375rem; line-height: 1.35; }
.wx-two span { color: var(--label-2); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.wx-card > a { color: var(--accent); text-decoration: none; font-size: .875rem; }

/* ---------- second round of CWA data ---------- */
#radarLegend { margin-top: 5px; font-variant-numeric: tabular-nums; }
.cwa-say { display: flex; flex-direction: column; gap: 3px; padding: 13px 16px; margin-bottom: 8px; border-radius: var(--r-m); background: var(--surface); text-decoration: none; color: var(--label); border-left: 4px solid var(--accent); }
.cwa-say small { color: var(--label-2); font-size: .75rem; font-weight: 600; }
.cwa-say b { font-size: 1.0625rem; line-height: 1.45; }
.sky { margin: 0 0 12px; color: var(--label-2); font-size: .8125rem; }
.hours { list-style: none; padding: 0 0 4px; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 8px; overflow-x: auto; scrollbar-width: none; }
.hours li { background: var(--surface); border-radius: var(--r-s); padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; }
.hours small { color: var(--label-2); font-size: .75rem; font-weight: 600; }
.hours b { font-size: .875rem; line-height: 1.3; min-height: 2.6em; }
.hours .t { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hours span:last-child { color: var(--label-2); font-size: .75rem; }
.qpf { margin: 0 0 10px; font-size: .9375rem; color: var(--label-2); }
.qpf.wet { color: var(--accent); }
.card-text { background: var(--surface); border-radius: var(--r-m); padding: 14px 16px; line-height: 1.75; font-size: .9375rem; }
.card-text .head { display: block; margin-bottom: 4px; }
.card-text p { margin: 8px 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 32px; }
.warn-text { background: var(--surface); border-radius: var(--r-m); padding: 10px 14px; margin-bottom: 8px; }
.warn-text summary { color: var(--label); }
.warn-text summary small { color: var(--label-2); font-weight: 500; }
.warn-text p { line-height: 1.75; font-size: .9375rem; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.figs figure, figure.sat { margin: 0; background: var(--surface); border-radius: var(--r-m); overflow: hidden; }
.figs img, figure.sat img { width: 100%; height: auto; display: block; }
.figs figcaption, figure.sat figcaption { padding: 8px 12px; color: var(--label-2); font-size: .8125rem; }
.wx-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wx-foot .sun { color: var(--label-2); font-size: .75rem; }
.months { list-style: none; margin: 14px 0 0; padding: 0; display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.months li { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.months .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--accent); opacity: .8; }
.months small { color: var(--label-2); font-size: .6875rem; }
.months b { font-size: .75rem; font-variant-numeric: tabular-nums; }
.warn-on { color: var(--warn-fg); }
td.hi { color: var(--warn-fg); font-weight: 700; }

/* ---------- 你的縣市現在 ---------- */
.local { margin-top: 20px; background: var(--surface); border-radius: var(--r-l); padding: 14px 14px 12px; }
.local-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.local-head h2 { margin: 0 !important; font-size: 1.25rem !important; }
.local-tools { display: flex; gap: 2px; }
.link { border: 0; background: none; color: var(--accent); font-size: .875rem; font-weight: 600; min-height: 36px; padding: 0 8px; }
.local-src { margin: 2px 0 10px; color: var(--label-2); font-size: .8125rem; }
.local-pick .chip { box-shadow: none; background: var(--fill); backdrop-filter: none; -webkit-backdrop-filter: none; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-s); background: var(--fill); color: var(--label); text-decoration: none; min-width: 0; }
.fact small { color: var(--label-2); font-size: .75rem; font-weight: 600; }
.fact b { font-size: 1rem; line-height: 1.35; }
.fact span { color: var(--label-2); font-size: .8125rem; }
.fact.warn { background: var(--warn-bg); }
.fact.warn b, .fact.warn small { color: var(--warn-fg); }
.local .tile-row { margin: 0 -14px; padding: 0 14px 6px; }
@media (min-width: 760px) { .local .tile-row { margin: 0; padding: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.local-events { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: .875rem; line-height: 1.5; }
.local-events small { color: var(--label-2); }
.local-more { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; font-size: .875rem; }
.local-more a { color: var(--accent); text-decoration: none; font-weight: 600; }
.local-more span { color: var(--label-2); margin-left: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.home-local { margin-top: 16px; }
@media (min-width: 760px) { .home-local .tile-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.local-src.warn { color: var(--warn-fg); background: var(--warn-bg); padding: 8px 10px; border-radius: var(--r-s); font-weight: 600; }

/* 附近影像, 天氣資訊: the map sits under the site's bar; --bar is the bar's height (app.js measures it) */
.framed { --bar: calc(env(safe-area-inset-top) + 96px); --over: 70px; }
.weather { --over: 116px; } /* the search bar and a row of chips float over the map */
.framed .topbar { position: fixed; left: 0; right: 0; top: 0; z-index: 35; }
.framed #map { top: var(--bar); }
.framed .top { top: var(--bar); padding-top: 10px; }
.framed .pill-status, .framed .toast { top: calc(var(--bar) + var(--over)); }
.framed .sheet { height: calc(100dvh - var(--bar) - 8px); }
@media (min-width: 760px) { .framed .sheet { top: calc(var(--bar) + var(--over)); } }
.weather .legend .kinds { display: none; }
.weather .legend:not(:has(#rainLegend:not([hidden]), #radarLegend:not([hidden]))) { display: none; }

.wx-pin {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 0 9px; height: 30px; border: 0; white-space: nowrap;
  border-radius: 15px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow); color: var(--label); font-size: .8125rem; line-height: 30px; cursor: pointer;
}
.wx-pin::after { content: ""; position: absolute; inset: -7px 0; } /* 44px tall hit area */
.wx-pin b { font-size: .8125rem; }
.wx-pin span { font-weight: 700; font-variant-numeric: tabular-nums; }
.wx-pin small { color: var(--accent); font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.wx-pin.warn { background: var(--warn-bg); }
.wx-pin.warn b { color: var(--warn-fg); }
.wx-panel .wx-two { margin-bottom: 10px; }
.wx-panel .wx-two div { background: var(--fill); border-radius: var(--r-s); padding: 10px 12px; }
.wx-sun { color: var(--label-2); font-size: .875rem; margin: 0 0 12px; }
.wx-info .lead { font-size: .9375rem; }
.wx-info .card-text, .wx-info .warn-text { background: var(--fill); }
.wx-info table { width: 100%; border-collapse: collapse; background: var(--fill); font-size: .875rem; border-radius: var(--r-m); overflow: hidden; }
.wx-info th, .wx-info td { padding: 8px 10px; text-align: left; vertical-align: top; }
.wx-info tbody td { box-shadow: inset 0 1px 0 var(--line); }
.wx-info th { color: var(--label-2); font-weight: 600; font-size: .75rem; }
.wx-info .section-title { color: var(--label); font-size: .9375rem; }

/* 地震動態 */
.q-legend { display: flex; flex-wrap: wrap; gap: 3px 8px; max-width: 250px; }
.q-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; vertical-align: 0; }
.legend-row.wide { justify-content: flex-start; font-size: .8125rem; margin-bottom: 6px; }
.quake.sheet-open .legend { opacity: 0; pointer-events: none; }
.q-epi { width: 30px; height: 30px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); pointer-events: none; }
.q-epi svg { width: 100%; height: 100%; fill: #ff3b30; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.q-facts { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.q-facts > div { background: var(--fill); border-radius: var(--r-s); padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.q-facts small { color: var(--label-2); font-size: .75rem; font-weight: 600; }
.q-facts .mag b { font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.q-facts b { font-size: 1rem; }
.q-facts .lv { align-self: flex-start; font-size: 1rem; padding: 2px 8px; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; }
.q-card .src a { color: var(--accent); font-weight: 600; text-decoration: none; }
.q-pick { width: 100%; border: 0; background: none; text-align: left; display: flex; align-items: center; gap: 10px; }

/* 天氣圖示 (web/wx/) */
.wx-ic { flex: none; display: block; }
.wx-pin { align-items: center; padding-left: 5px; }
.wx-pin .wx-ic { margin-right: -1px; }
.wx-panel .wx-two .wx-ic, .wx-fact .wx-ic { margin: 2px 0 1px; }
.row > .wx-ic { margin-right: 2px; }
.hours .wx-ic { margin: 2px 0; }
.temp .wx-ic { display: inline-block; vertical-align: -5px; margin-right: 4px; }

/* 停班停課: today and tomorrow on two maps */
.ws-maps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.ws-map { margin: 0; background: var(--surface); border-radius: var(--r-m); padding: 10px 10px 8px; display: flex; flex-direction: column; align-items: center; }
.ws-map figcaption { align-self: flex-start; font-weight: 700; font-size: 1.0625rem; margin-bottom: 4px; }
.ws-map .tw-map { max-width: 220px; }
.tw-map path.ws-full, .ws-key i.ws-full { fill: #e2492f; background: #e2492f; }
.tw-map path.ws-part, .ws-key i.ws-part { fill: #f5a33b; background: #f5a33b; }
.tw-map path.ws-ok, .ws-key i.ws-ok { fill: #5cc98a; background: #5cc98a; }
.ws-key i[class=""] { background: color-mix(in srgb, var(--label) 10%, var(--surface)); }
.ws-key { margin-top: 8px; }
.ws-isl { display: flex; gap: 6px; margin-top: 4px; }
.ws-isl .st { min-height: 22px; font-size: .75rem; }

/* 交通路況 */
.sp-legend { margin-bottom: 5px; }
.sp-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 4px; vertical-align: 2px; }
.sp-ok { background: #34c759; } .sp-slow { background: #ff9f0a; } .sp-jam { background: #ff3b30; }
.tr-info .events { padding: 0; }
.tr-info .event { background: var(--fill); }

/* 颱風動態: the page's reading inside the card */
.ty-info h2 { font-size: 1rem; margin: 22px 0 8px; }
.ty-info h3 { font-size: .9375rem; margin: 12px 0 6px; }
.ty-info .warning { background: var(--warn-bg); border-radius: var(--r-m); padding: 4px 14px 10px; }
.ty-info .warning h2 { color: var(--warn-fg); }
.ty-info .two { display: grid; gap: 10px; }
.ty-info .counties li, .ty-info .shop li { background: var(--fill); }
.ty-info .cam-card, .ty-info table { background: var(--fill); }

/* 即時熱門: a wall of pictures */
.wall { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 640px) { .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
@media (min-width: 1000px) { .page main:has(.wall) { max-width: 1180px; } .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wall-cam { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--r-s); overflow: hidden; background: var(--media); color: #fff; text-decoration: none; }
.wall-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wall-cam .ph { position: absolute; inset: 0 0 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.wall-cam .ph i { display: none; }
.wall-cam.off img { visibility: hidden; }
.wall-cam .badge { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .6); font-size: .6875rem; font-weight: 700; font-style: normal; letter-spacing: .03em; }
.wall-cam.hot .badge { background: #e2492f; }
.wall-cam .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 9px 7px; display: flex; flex-direction: column;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78)); }
.wall-cam .cap b { font-size: .8125rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-cam .cap small { font-size: .6875rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-cam:focus-visible { outline-offset: 2px; }

/* the next 24 hours (wx.js wxChart) */
:root { --temp: #d9480f; --popc: #1c7ed6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --temp: #ff922b; --popc: #4dabf7; } }
.wx-chart { overflow-x: auto; scrollbar-width: none; background: var(--surface); border-radius: var(--r-m); padding: 8px 4px 4px; }
.local .wx-chart, .sheet .wx-chart { background: var(--fill); }
.wx-chart-svg { display: block; width: 100%; min-width: 420px; max-width: 640px; height: auto; margin: 0 auto; }
.wx-chart-svg .hit { fill: transparent; }
.wx-chart-svg .col:hover .hit { fill: var(--fill-2, rgba(127, 127, 127, .08)); }
.wx-chart-svg text { text-anchor: middle; fill: var(--label); font-size: 12px; font-variant-numeric: tabular-nums; }
.wx-chart-svg .tm { fill: var(--label-2); font-size: 11px; font-weight: 600; }
.wx-chart-svg .tv { font-weight: 700; font-size: 13px; }
.wx-chart-svg .pv { fill: var(--label-2); font-size: 10.5px; }
.wx-chart-svg .tl { fill: none; stroke: var(--temp); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wx-chart-svg .tp { fill: var(--temp); stroke: var(--surface); stroke-width: 2; }
.wx-chart-svg .pb { fill: var(--popc); }
.wx-chart-svg .base { stroke: var(--line); }
.wx-chart-key { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin: 2px 8px 2px; color: var(--label-2); font-size: .75rem; }
.wx-chart-key span { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-left: 8px; }
.wx-chart-key .k-t { background: var(--temp); } .wx-chart-key .k-p { background: var(--popc); height: 9px; width: 7px; }
.local-h { font-size: .875rem; margin: 4px 0 8px; color: var(--label-2); }

/* the radar player */
#radarLegend { min-width: 210px; }
.rd-row { display: flex; align-items: center; gap: 8px; }
.rd-play { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--label); position: relative; }
.rd-play::before { content: ""; position: absolute; left: 12px; top: 9px; border-left: 11px solid var(--surface); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.rd-play.on::before { left: 11px; top: 10px; width: 3px; height: 12px; border: 0; background: var(--surface); box-shadow: 6px 0 0 var(--surface); }
.rd-play::after { content: ""; position: absolute; inset: -6px; } /* 44px hit area */
.rd-row input { flex: 1; min-width: 90px; accent-color: var(--accent); }
.rd-t { flex: none; font-variant-numeric: tabular-nums; color: var(--label-2); }
/* 地震 timeline */
.q-time { background: var(--fill); border-radius: var(--r-m); padding: 8px 8px 4px; margin-bottom: 12px; }
.q-time svg { display: block; width: 100%; height: auto; }
.q-time .g { stroke: var(--line); }
.q-time .ax { fill: var(--label-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.q-time .qd { stroke: var(--surface); stroke-width: 1.5; cursor: pointer; }
.q-time .qd:hover { stroke: var(--label); }
.q-time-note { margin: 2px 4px 2px; color: var(--label-2); font-size: .75rem; }

/* a camera page's 附近攝影機 map */
.mini-map { height: 220px; border-radius: var(--r-m); overflow: hidden; margin-bottom: 10px; background: var(--fill); }
.mini-here { width: 18px; height: 18px; border-radius: 50%; background: #ff3b30; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(255, 59, 48, .25), var(--shadow); }

/* 景點直播 */
.spot-about { margin: 4px 0 12px; color: var(--label-2); font-size: .9375rem; line-height: 1.7; }

/* ---------- the camera list beside the map (app.js renderList) ---------- */
.chip .i { width: 17px; height: 17px; margin: 0 4px 0 -2px; }
.cam-list { pointer-events: auto; }
.cam-list.docked { margin-top: 10px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: calc(100dvh - var(--bar, 0px) - 150px); overflow: hidden; }
.cl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px 4px; }
.cl-head b { font-size: 1rem; }
.cl-head span { color: var(--label-2); font-size: .75rem; }
.cl-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 10px; }
.cl-filters button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 17px;
  background: var(--fill); color: var(--label); font-size: .8125rem; font-weight: 600; position: relative; }
.cl-filters button::after { content: ""; position: absolute; inset: -5px 0; } /* 44px tall hit area */
.cl-filters button small { color: var(--label-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.cl-filters .cl-kind[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.cl-filters .cl-live[aria-pressed="true"] { background: var(--label); color: var(--surface); }
.cl-filters .dot { margin: 0; }
.cl-rows { overflow-y: auto; overscroll-behavior: contain; border-radius: 0; background: transparent; }
.cam-list.docked .cl-rows { flex: 1; min-height: 0; border-top: 1px solid var(--line); }
.cl-row { width: 100%; border: 0; background: none; text-align: left; }
.cl-row:hover, .cl-row:focus-visible { background: var(--fill); }
.cl-thumb { flex: none; width: 72px; height: 45px; object-fit: cover; border-radius: 6px; background: var(--media); }
.cl-more { margin: 8px 14px 12px; min-height: 40px; border: 0; border-radius: 10px; background: var(--fill); color: var(--accent); font-weight: 600; }
.sheet .cam-list .cl-head, .sheet .cam-list .cl-filters { padding-left: 0; padding-right: 0; }
.sheet .cam-list .cl-rows { background: var(--fill); border-radius: var(--r-m); }
#matchPill { background: var(--accent); color: #fff; font-weight: 700; }
.results .row.place .dist { color: var(--accent); font-weight: 600; }
.results .row.sub-link { min-height: 32px; padding-top: 0; }
.results .row.sub-link small { color: var(--accent); }
.results .row.show-all b { color: var(--accent); }
.bar-links { display: flex; align-items: center; gap: 2px; }

/* ---------- 多畫面 (web/multi.js) ---------- */
.multi main { max-width: none; padding: 8px 16px 24px; }
.mv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.mv-top h1 { margin: 6px 0 !important; font-size: 1.375rem !important; }
.mv-search { position: relative; flex: 1 1 280px; max-width: 520px; }
.mv-search input { width: 100%; min-height: 44px; border: 0; border-radius: 12px; padding: 0 14px; background: var(--surface); color: var(--label); font-size: 1rem; box-shadow: inset 0 0 0 1px var(--line); }
.mv-search .results { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); max-height: 60vh; overflow: auto;
  background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow); padding: 4px 0; }
.mv-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.mv-layout { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; }
.seg { min-width: 40px; min-height: 36px; border: 0; border-radius: 8px; background: none; color: var(--label); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.mv-count { color: var(--label-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
.mv-note { margin: 4px 0; color: var(--warn-fg); font-size: .875rem; min-height: 0; }
.mv-note:empty { display: none; }
.mv-grid { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
/* desktop: the wall fills the window below the bar, each tile as large as fits */
.mv-grid.fill { height: calc(100dvh - var(--multi-top, 170px)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); }
.mv-tile { position: relative; background: #000; border-radius: var(--r-s); overflow: hidden; min-height: 0; aspect-ratio: 16 / 9; }
.mv-grid.fill .mv-tile { aspect-ratio: auto; }
.mv-view { position: absolute; inset: 0 0 40px; display: flex; align-items: center; justify-content: center; }
.mv-view img, .mv-view video, .mv-view iframe { width: 100%; height: 100%; object-fit: contain; border: 0; display: block; }
.mv-badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mv-badge.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff3b30; margin-right: 5px; vertical-align: 1px; }
.mv-state { position: absolute; inset: 0 0 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #e5e5ea; font-size: .875rem; text-align: center; padding: 12px; cursor: default; }
.mv-state.wait { cursor: pointer; }
.mv-state.wait::before { content: "▶"; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .18); font-size: 1.1rem; }
.mv-state.error span::before { content: "⚠ "; color: #ffb340; }
.mv-state.loading::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin 1s linear infinite; }
.mv-retry { min-height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: #fff; color: #000; font-weight: 600; }
.mv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; align-items: center; gap: 4px; padding: 0 4px 0 8px; background: #1c1c1e; color: #fff; }
.mv-bar .shield { flex: none; transform: scale(.85); }
.mv-name { flex: 1; min-width: 0; color: #fff; text-decoration: none; font-size: .8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-name small { margin-left: 6px; color: #aeaeb2; font-weight: 500; }
.mv-btn { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: #e5e5ea; font-size: 1rem; position: relative; }
.mv-btn::after { content: ""; position: absolute; inset: -6px -2px; } /* 44px tall hit area */
.mv-btn:hover { background: rgba(255, 255, 255, .12); }
.mv-btn:disabled { opacity: .3; }
.mv-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; color: var(--label-2); font-size: .875rem; }
.mv-empty { max-width: 640px; margin: 24px auto; }
.mv-empty h2 { font-size: 1.25rem; margin: 0 0 6px; }
.mv-empty p { color: var(--label-2); line-height: 1.7; }
.mv-empty .group .row { width: 100%; border: 0; text-align: left; }
.mv-empty .dist, .mv-search .dist { color: var(--accent); font-weight: 600; }
@media (max-width: 759px) {
  .mv-layout, .mv-pager { display: none !important; }
  .mv-tools { margin-left: 0; }
  .mv-bar [data-act="left"], .mv-bar [data-act="right"] { display: none; }
}
.sheet .cl-head span { display: none; } /* phones: the count is enough; the order is the obvious one */

/* ---------- 鄉鎮市區 ---------- */
.town-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.town-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "n n" "i t" "s s"; align-items: center; gap: 2px 6px;
  padding: 9px 10px; border-radius: var(--r-s); background: var(--surface); color: var(--label); text-decoration: none; min-height: 44px; }
.town-card .n { grid-area: n; font-weight: 700; font-size: .9375rem; }
.town-card .wx-ic { grid-area: i; }
.town-card .t { grid-area: t; font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.town-card small { grid-area: s; color: var(--label-2); font-size: .75rem; }
.town-card:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.town-cams { display: grid; gap: 14px; }
@media (min-width: 760px) { .town-cams { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } }
.town-map-box { background: var(--surface); border-radius: var(--r-m); padding: 10px; }
.town-map { display: block; width: 100%; max-height: 340px; height: auto; }
.town-map path { fill: color-mix(in srgb, var(--accent) 10%, var(--surface)); stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.town-map circle { stroke: var(--surface); stroke-width: 1.5; fill: var(--k-city); }
.town-map circle.fwy { fill: var(--k-fwy); } .town-map circle.hwy { fill: var(--k-hwy); } .town-map circle.spot { fill: var(--k-spot); }
.town-map circle.down { fill: var(--k-down); }
.town-map a:hover circle { stroke: var(--label); stroke-width: 2.5; }
.town-map-box .legend-row i.k-fwy { background: var(--k-fwy); } .town-map-box .legend-row i.k-hwy { background: var(--k-hwy); }
.town-map-box .legend-row i.k-city { background: var(--k-city); } .town-map-box .legend-row i.k-spot { background: var(--k-spot); }
.town-near .chip small { margin-left: 5px; color: var(--label-2); font-weight: 500; }
.wx-pin.town { height: 26px; line-height: 26px; padding: 0 7px 0 4px; font-size: .75rem; gap: 3px; }
.wx-pin.town b { font-size: .75rem; }

.local-head { flex-wrap: wrap; }
.town-pick { min-height: 36px; padding: 0 28px 0 10px; border: 0; border-radius: 10px; background: var(--fill); color: var(--label);
  font: inherit; font-size: .875rem; font-weight: 600; margin-right: auto; margin-left: 8px; }

/* ---------- 景點 ---------- */
.attr-near { display: grid; gap: 8px; margin: 12px 0 4px; }
.attr-near:empty { display: none; }
.attr-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-m); background: var(--surface);
  color: var(--label); text-decoration: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent); }
.sheet .attr-card { background: var(--fill); }
.attr-card .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.attr-card small { color: var(--accent); font-size: .75rem; font-weight: 700; }
.attr-card b { font-size: 1rem; line-height: 1.35; }
.attr-card .t span { color: var(--label-2); font-size: .8125rem; }
.attr-thumb { flex: none; width: 76px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--media); }
.attr-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.attr-tile { display: flex; flex-direction: column; height: 100%; border-radius: var(--r-m); overflow: hidden; background: var(--surface); color: var(--label); text-decoration: none; }
.attr-tile .attr-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
.attr-tile .t { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.attr-tile b { font-size: .9375rem; line-height: 1.35; }
.attr-tile small { color: var(--label-2); font-size: .8125rem; }
.attr-head { display: grid; gap: 14px; margin-top: 10px; }
@media (min-width: 760px) { .attr-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; } }
.attr-hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-l); background: var(--media); display: block; }
.attr-head h1 { margin: 0 0 4px !important; }
.attr-head .meta { color: var(--label-2); margin: 0 0 10px; }
.attr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.attr-actions .chip { box-shadow: none; }
.more-text { margin-top: 8px; }
.more-text summary { color: var(--accent); font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.more-text p { line-height: 1.8; }
.attr-tags { margin-top: 10px; }
.chip.tag { background: var(--fill); box-shadow: none; font-size: .8125rem; min-height: 32px; }
.attr-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.attr-figs figure { margin: 0; }
.attr-figs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-s); background: var(--media); display: block; }
.attr-figs figcaption { color: var(--label-2); font-size: .75rem; margin-top: 4px; }
.facts-list { margin: 0; background: var(--surface); border-radius: var(--r-m); }
.fact-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 10px; padding: 10px 14px; }
.fact-row + .fact-row { box-shadow: inset 0 1px 0 var(--line); }
.fact-row dt { color: var(--label-2); font-size: .875rem; }
.fact-row dd { margin: 0; overflow-wrap: anywhere; }
.see-attr { margin: 14px 0 0; }
.see-attr .row { background: var(--surface); border-radius: var(--r-m); }
