/* ============ Tokens ============ */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem;

  --radius-sm: 0.375rem; --radius-md: 0.625rem; --radius-lg: 0.875rem;
  --radius-xl: 1.125rem; --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', 'Helvetica Neue', system-ui, sans-serif;

  --content-default: 1060px;
}

:root, [data-theme="light"] {
  --color-bg: #eef2f4;
  --color-surface: #f8fafb;
  --color-surface-2: #ffffff;
  --color-surface-offset: #e3e9ec;
  --color-surface-dynamic: #d7e0e4;
  --color-divider: #dde4e8;
  --color-border: #cbd6db;
  --color-text: #16232a;
  --color-text-muted: #5c6f78;
  --color-text-faint: #93a5ad;
  --color-accent: #0f7f9b;
  --color-accent-soft: rgba(15, 127, 155, 0.12);
  --color-gen: #0d8a5f;
  --color-gen-soft: rgba(13, 138, 95, 0.12);
  --color-warn: #b3641a;
  --color-warn-soft: rgba(179, 100, 26, 0.14);
  --color-off: #7d8f97;
  --shadow-sm: 0 1px 2px rgba(10, 30, 40, 0.07);
  --shadow-md: 0 4px 14px rgba(10, 30, 40, 0.09);
  --shadow-lg: 0 12px 32px rgba(10, 30, 40, 0.13);
}

[data-theme="dark"] {
  --color-bg: #0c1218;
  --color-surface: #131b23;
  --color-surface-2: #18222b;
  --color-surface-offset: #1d2932;
  --color-surface-dynamic: #27353f;
  --color-divider: #1c2731;
  --color-border: #2c3b46;
  --color-text: #dbe6ec;
  --color-text-muted: #8ba0ab;
  --color-text-faint: #5b6e79;
  --color-accent: #52c1dd;
  --color-accent-soft: rgba(82, 193, 221, 0.13);
  --color-gen: #4fd6a2;
  --color-gen-soft: rgba(79, 214, 162, 0.13);
  --color-warn: #e6a256;
  --color-warn-soft: rgba(230, 162, 86, 0.15);
  --color-off: #5f7580;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: none; text-size-adjust: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; scroll-behavior: smooth;
  touch-action: manipulation;
}
body {
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.55;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  display: flex; flex-direction: column;
}
img, svg, canvas { display: block; max-width: 100%; }
input, button, select { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); }
button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }
a { color: var(--color-accent); }
::selection { background: var(--color-accent-soft); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
a, button {
  transition: color var(--transition-interactive), background var(--transition-interactive),
    border-color var(--transition-interactive), box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ============ Shell ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  max-width: var(--content-default); width: 100%;
  margin-inline: auto;
}
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text); }
.logo { flex-shrink: 0; height: 34px; width: auto; display: block; border-radius: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); letter-spacing: -0.01em; }
.brand-sub { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }
.topbar-actions { display: flex; gap: var(--space-2); }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}
.icon-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.icon-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app {
  width: 100%; max-width: var(--content-default);
  margin-inline: auto;
  padding: var(--space-2) var(--space-5) var(--space-10);
  flex: 1;
}

.footnote {
  max-width: var(--content-default); width: 100%;
  margin-inline: auto;
  padding: var(--space-6) var(--space-5) calc(var(--space-8) + env(safe-area-inset-bottom));
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}
.footnote p { max-width: 72ch; }
.footnote a { color: var(--color-text-muted); }

/* ============ Home ============ */
.asof {
  display: flex; align-items: center; gap: var(--space-2);
  color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 500;
  margin-bottom: var(--space-4);
}
.asof .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-gen); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.dam-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 700px) { .dam-grid { grid-template-columns: 1fr 1fr; } }

.dam-card {
  display: block; width: 100%; text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  text-decoration: none;
}
.dam-card:hover { border-color: var(--color-border); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dam-card:active { transform: translateY(0); }

.dam-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.dam-card h2 { font-size: var(--text-lg); font-weight: 800; letter-spacing: -0.01em; }
.dam-card .tw-name { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 500; margin-top: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 700;
  padding: 4px 10px; border-radius: var(--radius-full);
  white-space: nowrap; flex-shrink: 0;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.gen { color: var(--color-gen); background: var(--color-gen-soft); }
.badge.off { color: var(--color-off); background: var(--color-surface-offset); }
.badge.spill { color: var(--color-warn); background: var(--color-warn-soft); }

.dam-card-flow { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.flow-big .val { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); line-height: 1; }
.flow-big .unit { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.spark { width: 132px; height: 40px; flex-shrink: 0; }
.spark polyline { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .fill { fill: var(--color-accent-soft); stroke: none; }

.dam-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); border-top: 1px solid var(--color-divider); padding-top: var(--space-4); }
.mini-stat .k { font-size: var(--text-xs); color: var(--color-text-faint); font-weight: 500; }
.mini-stat .v { font-size: var(--text-sm); font-weight: 700; }

/* ============ Detail ============ */
.detail-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.back-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-full); color: var(--color-text-muted);
  background: var(--color-surface); border: 1px solid var(--color-divider);
  flex-shrink: 0;
}
.back-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.detail-head h1 { font-size: var(--text-xl); font-weight: 800; letter-spacing: -0.015em; }
.detail-head .sub { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 500; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 860px) { .detail-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; } }
/* Grid/flex children must be allowed to shrink below their content's natural width,
   otherwise a wide no-wrap table (flow times) forces the whole column wider than the
   phone screen and iOS zooms the entire page out to fit it. */
.detail-grid > *, .dam-grid > *, .sponsor-row > *, .price-grid > * { min-width: 0; max-width: 100%; }
.panel { min-width: 0; max-width: 100%; }

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel-title h2 { font-size: var(--text-lg); font-weight: 800; }
.panel-title .meta { color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 500; text-align: right; }

/* Day chips */
.day-chips { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.day-chip {
  display: flex; flex-direction: column; align-items: center;
  min-width: 52px; padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
  border: 1px solid transparent;
  color: var(--color-text-muted);
  font-weight: 700; font-size: var(--text-sm);
  line-height: 1.2;
}
.day-chip .d { font-size: var(--text-xs); font-weight: 500; }
.day-chip:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.day-chip.active { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-accent); }
.day-chip.stale { opacity: 0.45; }

.stale-note {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--color-warn-soft); color: var(--color-warn);
  font-size: var(--text-xs); font-weight: 600;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

/* Schedule table */
.sched-table th {
  text-align: right; font-size: var(--text-xs); font-weight: 600;
  color: var(--color-text-faint); text-transform: uppercase; letter-spacing: 0.05em;
  padding: var(--space-1) var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.sched-table th:first-child { text-align: left; }
.sched-table td {
  text-align: right; padding: 7px var(--space-2);
  font-size: var(--text-sm); font-weight: 500;
  border-bottom: 1px solid var(--color-divider);
}
.sched-table tr:last-child td { border-bottom: none; }
.sched-table td:first-child { text-align: left; color: var(--color-text-muted); font-weight: 600; }
.sched-table tr.on td { color: var(--color-gen); font-weight: 700; }
.sched-table tr.on td:first-child { color: var(--color-gen); }
.sched-table tr.now td { background: var(--color-accent-soft); }
.sched-table tr.now td:first-child { color: var(--color-accent); position: relative; }
.sched-table tr.now td:first-child::before {
  content: ""; position: absolute; left: -2px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 2px; background: var(--color-accent);
}
.sched-summary { display: flex; gap: var(--space-4); margin-bottom: var(--space-3); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: 500; }
.sched-summary strong { color: var(--color-text); }

/* Current panel */
.current-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-3); }
.stat .k { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; margin-bottom: 2px; }
.stat .v { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; line-height: 1.1; }
.stat .v small { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); margin-left: 3px; }
.stat.hero { grid-column: 1 / -1; padding: var(--space-3) var(--space-4); background: var(--color-accent-soft); border-radius: var(--radius-lg); }
.stat.hero .v { font-size: var(--text-xl); color: var(--color-accent); }

.pool-bar { grid-column: 1 / -1; }
.pool-bar .bar { height: 8px; border-radius: var(--radius-full); background: var(--color-surface-offset); overflow: hidden; margin-top: var(--space-2); }
.pool-bar .bar span { display: block; height: 100%; border-radius: var(--radius-full); background: var(--color-accent); }
.pool-bar .lbl { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--color-text-faint); margin-top: 4px; }

.chart-wrap { margin-top: var(--space-5); }
.chart-wrap h3 { font-size: var(--text-sm); font-weight: 700; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.chart-box { height: 180px; position: relative; }

/* ============ States ============ */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-offset) 25%, var(--color-surface-dynamic) 50%, var(--color-surface-offset) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-lg);
}
.skel-card { height: 190px; }
.skel-panel { height: 420px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: var(--space-16) var(--space-8); color: var(--color-text-muted);
}
.empty-state svg { color: var(--color-text-faint); margin-bottom: var(--space-4); }
.empty-state h3 { color: var(--color-text); margin-bottom: var(--space-2); font-size: var(--text-lg); }
.empty-state p { max-width: 40ch; margin-bottom: var(--space-6); }
.btn-primary {
  background: var(--color-accent); color: #fff;
  font-weight: 700; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full);
}
.btn-primary:hover { filter: brightness(1.1); }

.fade-in { animation: fadeUp 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Sponsors ============ */
.sponsor-row {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr; gap: var(--space-4);
  margin-top: var(--space-2);
}
@media (min-width: 700px) { .sponsor-row { grid-template-columns: repeat(3, 1fr) } }

.sponsor-card, .advertise-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-5);
  text-decoration: none; color: var(--color-text);
}
.sponsor-card:hover, .advertise-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}
.sponsor-tag {
  position: absolute; top: var(--space-4); right: var(--space-4);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-text-faint); border: 1px solid var(--color-divider);
  border-radius: var(--radius-full); padding: 2px 8px;
}
/* Sponsor cards (with a logo) put the tag inline below the name instead of
   floating it absolutely, so a long sponsor name can never collide with it —
   this lets the logo run as large as the card allows at any width. */
.sponsor-tag--inline { position: static; display: inline-block; margin: 3px 0 2px; }
.sponsor-body { display: flex; align-items: flex-start; gap: var(--space-4); }
.sponsor-logo {
  width: 72px; height: 72px; border-radius: var(--radius-full); flex-shrink: 0;
  object-fit: cover;
}
.sponsor-initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-surface-offset); color: var(--color-accent);
  font-weight: 800; font-size: var(--text-base); letter-spacing: 0.02em;
}
.sponsor-name { font-weight: 700; font-size: var(--text-base); }
.sponsor-tagline { color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 2px; line-height: 1.45; }
.sponsor-cta {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--color-accent); font-weight: 700; font-size: var(--text-xs);
}
.advertise-card { border-style: dashed; background: transparent; }
.advertise-card .sponsor-tag { border-color: var(--color-accent); color: var(--color-accent); }
.advertise-title { font-weight: 800; font-size: var(--text-base); }

/* ============ Favorites & alerts ============ */
.fav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  border-radius: var(--radius-full);
  background: transparent; border: none; cursor: pointer;
  color: var(--color-text-muted);
}
.fav-btn svg { fill: none; stroke: currentColor; }
.fav-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.fav-btn.on { color: #fbbf24; }
.fav-btn.on svg { fill: #fbbf24; stroke: #fbbf24; }
.fav-btn.lg { width: 38px; height: 38px; border: 1px solid var(--color-divider); background: var(--color-surface); }
.fav-btn.lg.on { border-color: #fbbf24; }
.fav-btn.lg svg { width: 20px; height: 20px; }

#toasts {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 3000;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  background: var(--color-surface); border: 1px solid var(--color-accent);
  border-radius: var(--radius-lg); padding: 12px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.3s ease;
}
.toast.out { opacity: 0; transform: translateY(8px); transition: all 0.35s ease; }
.toast-title { font-weight: 800; font-size: var(--text-sm); }
.toast-body { color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ============ Map banner ============ */
.map-banner {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-5);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-accent);
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0.03) 55%), var(--color-surface);
  text-decoration: none; color: var(--color-text);
  transition: transform .15s ease, box-shadow .15s ease;
}
.map-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(56, 189, 248, 0.18); }
.map-banner-art { width: 150px; height: 64px; flex: none; }
.map-banner-title { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); }
.map-banner-sub { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: 2px; }
.map-banner-cta {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: var(--text-sm); color: var(--color-accent); white-space: nowrap;
}
@media (max-width: 640px) {
  .map-banner { flex-wrap: wrap; gap: var(--space-3); padding: 14px 16px; }
  .map-banner-art { width: 110px; height: 48px; }
  .map-banner-text { flex: 1 1 100%; order: 3; }
  .map-banner-cta { margin-left: 0; order: 2; margin-left: auto; }
}

/* topbar map button */
.map-btn-label { font-size: var(--text-sm); font-weight: 700; }
.icon-btn.map-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; padding: 0 14px; gap: 6px;
  color: var(--color-accent); border: 1px solid var(--color-accent);
  text-decoration: none;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}
.icon-btn.map-btn:hover { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 20%, transparent); }

/* ============ Radar ============ */
button.day-chip { font: inherit; cursor: pointer; }
.radar-chip { margin-left: auto; }
.radar-bar { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); }
.radar-play { width: 30px; height: 30px; flex-shrink: 0; }
#radar-time { font-weight: 700; color: var(--color-text); min-width: 62px; }
.radar-note { font-size: var(--text-xs); color: var(--color-text-faint); }
.wx-radar-link { color: var(--color-accent); text-decoration: none; font-weight: 600; }
.wx-radar-link:hover { text-decoration: underline; }

.sponsor-slot { margin-top: var(--space-5); display: grid; gap: var(--space-4); }
@media (min-width: 560px) {
  .sponsor-slot { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .sponsor-slot > :first-child { grid-column: 1 / -1; }
}

/* ============ Pricing ============ */
.price-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 760px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card { position: relative; display: flex; flex-direction: column; gap: var(--space-4); }
.price-card h2 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; }
.price-card .price { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.02em; }
.price-card .price small { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); margin-left: 2px; }
.price-card ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.price-card ul li { font-size: var(--text-sm); color: var(--color-text-muted); padding-left: 20px; position: relative; line-height: 1.5; }
.price-card ul li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); opacity: .7; }
.price-card .btn-primary { text-align: center; text-decoration: none; }
.price-card.featured { border-color: var(--color-accent); }
.price-badge {
  position: absolute; top: calc(-1 * var(--space-3)); left: 50%; transform: translateX(-50%);
  background: var(--color-accent); color: #fff; white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-full);
}
.adv-notes { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.adv-notes li { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.55; padding-left: 20px; position: relative; }
.adv-notes li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); opacity: .7; }
.adv-notes strong { color: var(--color-text); }
.footnote a { color: var(--color-text-muted); }

/* ---------- weather strip ---------- */
.wx-strip {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg); padding: 12px 18px; margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.wx-now { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wx-icon { width: 34px; height: 34px; color: var(--color-accent); flex: none; }
.wx-icon svg { width: 100%; height: 100%; }
.wx-temp { font-size: var(--text-xl); font-weight: 700; line-height: 1.1; }
.wx-desc { color: var(--color-text-muted); font-size: var(--text-sm); }
.wx-meta { display: flex; flex-direction: column; gap: 2px; margin-left: 10px; padding-left: 14px; border-left: 1px solid var(--color-divider); color: var(--color-text-muted); font-size: var(--text-xs); white-space: nowrap; }
.wx-periods { display: flex; gap: 4px; }
.wx-p { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: var(--radius-md); min-width: 62px; }
.wx-p:hover { background: var(--color-surface); }
.wx-p-name { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-faint); white-space: nowrap; }
.wx-p-icon { width: 20px; height: 20px; color: var(--color-text-muted); }
.wx-p-icon svg { width: 100%; height: 100%; }
.wx-p-temp { font-size: var(--text-sm); font-weight: 600; }
.wx-p-precip { font-size: 10px; color: var(--color-accent); min-height: 13px; }
.wx-hours-wrap { flex-basis: 100%; min-width: 0; border-top: 1px solid var(--color-divider); padding-top: 8px; }
.wx-hours-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-faint); margin-bottom: 4px; }
.wx-hours { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.wx-h { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: var(--radius-md); min-width: 58px; flex: 1 0 auto; }
.wx-h:hover { background: var(--color-surface-raised, rgba(127,127,127,.08)); }
.wx-h-time { font-size: 10px; text-transform: lowercase; color: var(--color-text-faint); white-space: nowrap; }
.wx-h-icon { width: 18px; height: 18px; color: var(--color-text-muted); }
.wx-h-icon svg { width: 100%; height: 100%; }
.wx-h-temp { font-size: var(--text-sm); font-weight: 700; }
.wx-h-precip { font-size: 10px; color: var(--color-accent); min-height: 13px; }
.wx-h-wind { font-size: 10px; color: var(--color-text-muted); white-space: nowrap; }

.wx-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }
.wx-chip-icon { width: 16px; height: 16px; color: var(--color-accent); display: inline-flex; }
.wx-chip-icon svg { width: 100%; height: 100%; }
@media (max-width: 640px) {
  .wx-strip { padding: 10px 12px; }
  .wx-meta { display: none; }
  .wx-periods { width: 100%; justify-content: space-between; }
  .wx-p { min-width: 0; flex: 1; padding: 6px 4px; }
}

/* ---------- map ---------- */
.map-link { white-space: nowrap;
  margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--color-divider); border-radius: 999px;
  color: var(--color-text); font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  transition: border-color .15s, color .15s;
}
.map-link:hover { border-color: var(--color-accent); color: var(--color-accent); }
.map-panel { padding: var(--space-4); }
.map-chips { margin-bottom: var(--space-3); }
.map-chips .day-chip { text-decoration: none; }
#map-el {
  height: min(62vh, 640px); min-height: 400px; width: 100%;
  border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-divider);
  background: var(--color-surface); z-index: 0;
}
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; color: var(--color-text-muted); font-size: var(--text-xs); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
[data-theme="light"] .legend-dot { border-color: #fff; }
.legend-dam { width: 12px; height: 12px; border-radius: 3px; background: var(--color-text); border: 2px solid var(--color-accent); }
.legend-line { width: 18px; height: 0; border-top: 4px solid var(--zl, #fde047); border-radius: 2px; }
.legend-line.dashed { border-top-style: dashed; border-top-width: 3px; }
.map-note { margin: 10px 0 0; color: var(--color-text-faint); font-size: var(--text-xs); }

.pin-dot {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--pin, #38bdf8); border: 2.5px solid rgba(255,255,255,.85);
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.pin-dam {
  display: block; width: 18px; height: 18px; border-radius: 4px;
  background: #0f172a; border: 2.5px solid #38bdf8; box-shadow: 0 1px 5px rgba(0,0,0,.55);
}

html[data-theme] .leaflet-popup-content-wrapper {
  background: var(--color-surface); color: var(--color-text);
  border-radius: var(--radius-md); border: 1px solid var(--color-divider);
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
}
html[data-theme] .leaflet-popup-tip { background: var(--color-surface); }
html[data-theme] .leaflet-popup-content { margin: 12px 14px; font: inherit; }
html[data-theme] .leaflet-container a.leaflet-popup-close-button { color: var(--color-text-faint); }
.map-pop { display: flex; flex-direction: column; gap: 6px; max-width: 230px; }
.map-pop-zone { max-width: 290px; }
.map-pop-season { font-weight: 600; color: var(--color-text); }
.map-pop-rules { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; font-size: var(--text-xs); color: var(--color-text-muted); }
.map-pop-fine { font-size: 10.5px; line-height: 1.45; color: var(--color-text-muted); opacity: .85; border-top: 1px solid var(--color-border); padding-top: 6px; }
.pin-sm { transform: scale(.72); opacity: .92; }
.map-pop-name { font-weight: 700; font-size: var(--text-sm); }
.map-pop-meta { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--color-text-muted); flex-wrap: wrap; }
.map-pop-type { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.map-pop-type::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pin, #38bdf8); }
.map-pop-note { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.45; }
.map-pop a { color: var(--color-accent); font-size: var(--text-xs); font-weight: 600; text-decoration: none; }
.map-pop a:hover { text-decoration: underline; }
.leaflet-control-attribution { background: rgba(0,0,0,.55) !important; color: #94a3b8 !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: #cbd5e1 !important; }
[data-theme="light"] .leaflet-control-attribution { background: rgba(255,255,255,.7) !important; color: #475569 !important; }
[data-theme="light"] .leaflet-control-attribution a { color: #334155 !important; }
html[data-theme] .leaflet-bar a { background: var(--color-surface) !important; color: var(--color-text) !important; border-color: var(--color-divider) !important; }

.rotation-note {
  grid-column: 1 / -1;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--color-text-muted);
  text-decoration: none; padding: 4px 2px;
}
.rotation-note:hover { color: var(--color-accent); }
/* ---------- flow-times panel ---------- */
.flow-status { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-3); line-height: 1.5; }
.flow-status strong { color: var(--color-text); }
.flow-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; }
.flow-table th, .flow-table td { white-space: nowrap; }
.flow-table td.faint, .flow-table th.faint { color: var(--color-text-faint); font-weight: 500; }
.flow-table .flow-arrive { color: var(--color-accent); font-weight: 700; }
.flow-table .flow-arrive .faint { color: var(--color-text-faint); font-weight: 500; }
.flow-note { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.55; margin-top: var(--space-3); }
.flow-note em { color: var(--color-text); font-style: normal; font-weight: 600; }
.flow-note a { color: var(--color-accent); text-decoration: none; font-weight: 600; }
.flow-note a:hover { text-decoration: underline; }

/* Phone-width flow-times table: fit the screen instead of scrolling sideways. */
@media (max-width: 520px) {
  .flow-table { table-layout: auto; font-size: 12px; }
  .flow-table th, .flow-table td { padding-left: 4px; padding-right: 4px; }
  .flow-table th:first-child, .flow-table td:first-child { white-space: normal; padding-left: 0; line-height: 1.25; }
  .flow-table th.num, .flow-table td.num { width: 1%; }
  .flow-table th { font-size: 10px; letter-spacing: .02em; }
  .flow-table th.faint, .flow-table td.faint { display: none; }
}
