/* ==========================================================================
   Barometric Pressure Map — styles
   ========================================================================== */

@font-face {
  font-family: "InterVariable";
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --surface-3: #e3e8f0;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5d6779;
  --border: #dde2ea;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-strong: #4f46e5;
  --accent-strong-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --rise: #1a62c0;
  --rise-soft: rgba(26, 98, 192, 0.12);
  --fall: #c42b31;
  --fall-soft: rgba(196, 43, 49, 0.12);
  --steady: #576274;
  --good: #137036;
  --warn: #9a4a08;
  --lvl-1: #2f9e5b;
  --lvl-2: #e09a1a;
  --lvl-3: #d9443f;
  --lvl-off: #dfe4ec;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --topbar-h: 60px;
  --tabbar-h: 0px;
  --font: "InterVariable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --surface: #121a2b;
    --surface-2: #19233a;
    --surface-3: #223050;
    --text: #e7ebf3;
    --text-2: #c3cbda;
    --muted: #93a0b8;
    --border: #243049;
    --accent: #8b85ff;
    --accent-2: #a5a1ff;
    --accent-strong: #5f56f0;
    --accent-strong-hover: #5047e0;
    --accent-soft: rgba(139, 133, 255, 0.14);
    --lvl-1: #3fbf74;
    --lvl-2: #f0b232;
    --lvl-3: #ff6b6f;
    --lvl-off: #2a3756;
    --rise: #5aa2ff;
    --rise-soft: rgba(90, 162, 255, 0.16);
    --fall: #ff6b6f;
    --fall-soft: rgba(255, 107, 111, 0.15);
    --steady: #94a3b8;
    --good: #4ade80;
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #121a2b;
  --surface-2: #19233a;
  --surface-3: #223050;
  --text: #e7ebf3;
  --text-2: #c3cbda;
  --muted: #93a0b8;
  --border: #243049;
  --accent: #8b85ff;
  --accent-2: #a5a1ff;
  --accent-strong: #5f56f0;
  --accent-strong-hover: #5047e0;
  --accent-soft: rgba(139, 133, 255, 0.14);
  --lvl-1: #3fbf74;
  --lvl-2: #f0b232;
  --lvl-3: #ff6b6f;
  --lvl-off: #2a3756;
  --rise: #5aa2ff;
  --rise-soft: rgba(90, 162, 255, 0.16);
  --fall: #ff6b6f;
  --fall-soft: rgba(255, 107, 111, 0.15);
  --steady: #94a3b8;
  --good: #4ade80;
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

img, svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 0.8em; }
code, kbd { font-family: var(--mono); font-size: 0.88em; }
kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  background: var(--surface-2);
  color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 2000;
  background: var(--accent-strong); color: #fff; padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 1000;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-name span { color: var(--accent); }
.nav-desktop { display: flex; gap: 2px; margin-left: 8px; }
.nav-desktop a {
  color: var(--muted); padding: 7px 12px; border-radius: 999px; font-weight: 550; font-size: 0.95rem;
}
.nav-desktop a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-desktop a.active { color: var(--text); background: var(--surface-3); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.search-trigger { padding: 0 8px 0 12px; color: var(--muted); min-width: 230px; justify-content: flex-start; }
.search-trigger kbd { margin-left: auto; }
.search-trigger-label { font-size: 0.93rem; }
@media (max-width: 1080px) {
  .search-trigger { min-width: 0; padding: 0 10px; }
  .search-trigger-label, .search-trigger kbd { display: none; }
  .nav-desktop a { padding: 7px 10px; }
}

/* ---------- Bottom tab bar (mobile) ---------- */

.tabbar { display: none; }

@media (max-width: 759px) {
  :root { --tabbar-h: 64px; --topbar-h: 54px; }
  .nav-desktop { display: none; }
  .search-trigger { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 0.7rem; font-weight: 600; background: none; border: 0; cursor: pointer;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--accent); }
  .tab-search svg { background: var(--accent-strong); color: #fff; stroke: #fff; border-radius: 999px; padding: 6px; width: 36px; height: 36px; margin-top: -6px; box-shadow: 0 4px 14px var(--accent-soft); }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}

/* ---------- Layout ---------- */

main { outline: none; container: main / inline-size; }
.page { max-width: 1160px; margin: 0 auto; padding: 20px 16px 48px; }
/* Data-heavy pages grow with the screen */
.page.page-wide { max-width: 1760px; }
@media (min-width: 2200px) { .page.page-wide { max-width: 2040px; } }
@media (min-width: 1280px) {
  .page { padding: 24px clamp(24px, 2.4vw, 48px) 56px; }
}
.page-head { margin: 4px 0 18px; }
.page-head h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); font-weight: 750; }
.page-head p { color: var(--muted); margin: 6px 0 0; max-width: 65ch; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 1.02rem; font-weight: 680; }
.card-sub { color: var(--muted); font-size: 0.86rem; }
.card-head .spacer { flex: 1; }
.section-title { font-size: 1.1rem; font-weight: 700; margin: 28px 0 12px; display: flex; align-items: baseline; gap: 2px 10px; flex-wrap: wrap; }
.section-title .muted { font-weight: 500; font-size: 0.88rem; }

/* ---------- Buttons, chips, segmented ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: var(--accent-strong-hover); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.segmented {
  display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px;
  border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  border: 0; background: none; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 650;
  background: var(--surface); color: var(--text-2); white-space: nowrap;
  border: 1px solid var(--border); letter-spacing: 0; text-transform: none;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--dot, var(--muted)); flex: none; }
.chip.rise { --dot: var(--rise); }
.chip.fall { --dot: var(--fall); }
.chip.warn { --dot: var(--lvl-2); }
.chip.accent { --dot: var(--accent); }
.chip.good { --dot: var(--lvl-1); }

/* Swing level meter: three segments, filled up to the level */
.meter { display: inline-flex; gap: 2px; flex: none; }
.meter i { width: 9px; height: 7px; border-radius: 2px; background: var(--lvl-off); }
.meter.l1 i:nth-child(1) { background: var(--lvl-1); }
.meter.l2 i:nth-child(-n+2) { background: var(--lvl-2); }
.meter.l3 i { background: var(--lvl-3); }
.swing-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 0.86rem; color: var(--text-2); font-weight: 600; }

.rise { color: var(--rise); }
.fall { color: var(--fall); }
.steady { color: var(--steady); }

/* ---------- Ad spaces ---------- */
/* Fixed sizes so ads never push content around when they load. */
.ad { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; min-width: 0; }
.ad-label { font-size: 0.64rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ad-body { display: grid; place-items: center; width: 100%; overflow: hidden; border-radius: 10px; }
.ad:not([data-filled]) .ad-body {
  border: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.ad-ph { font-size: 0.76rem; color: var(--muted); text-align: center; padding: 0 8px; }
.ad-banner .ad-body { height: 100px; max-width: 336px; }
@container main (min-width: 760px) { .ad-banner .ad-body { height: 90px; max-width: 728px; } }
.ad-box .ad-body { width: 300px; height: 250px; max-width: 100%; }
.ad-rail .ad-body { width: 160px; height: 600px; }
.home-ad, .report-ad { margin: 24px 0 4px; }
.home-adbox { margin-top: 16px; }
.learn-ad-inline { margin: 22px 0; }

/* ---------- Home ---------- */

.home-hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 34px 24px 28px;
  background:
    radial-gradient(1200px 300px at 10% -40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(700px 300px at 100% 120%, color-mix(in srgb, var(--rise) 18%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.home-hero h1 { font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.7rem); font-weight: 780; max-width: 18ch; letter-spacing: -0.03em; }
.home-hero p.lead { color: var(--text-2); font-size: 1.06rem; margin: 10px 0 20px; max-width: 56ch; }
.hero-isobars { position: absolute; right: -40px; top: -20px; width: 420px; height: 300px; opacity: 0.5; pointer-events: none; }
.hero-isobars path { fill: none; stroke: var(--accent); stroke-width: 1.4; opacity: 0.35; }
@media (max-width: 640px) { .hero-isobars { opacity: 0.25; } }

.hero-search {
  position: relative; display: flex; gap: 10px; flex-wrap: wrap; max-width: 640px;
}
.hero-search .fake-input {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 16px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  cursor: text; font-size: 1rem; text-align: left; min-width: 0;
}
.hero-search .fake-input span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-search .fake-input svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.hero-search .btn { height: 52px; }

.place-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.place-cards.few { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.place-card {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: start;
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); position: relative;
}
.place-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.place-card .pc-name { font-weight: 680; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.place-card .pc-region { color: var(--muted); font-size: 0.82rem; grid-column: 1; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.place-card .pc-value { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 720; font-size: 1.25rem; white-space: nowrap; }
.place-card .pc-value small { font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-left: 2px; }
.place-card .pc-trend { font-size: 0.8rem; font-weight: 650; text-align: right; display: block; }
.place-card .pc-spark { grid-column: 1 / -1; height: 44px; margin-top: 8px; }
.place-card .pc-spark svg { width: 100%; height: 100%; }

.quick-links { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.quick-link {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow);
}
.quick-link:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.quick-link .ql-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.quick-link .ql-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.quick-link strong { display: block; }
.quick-link span { color: var(--muted); font-size: 0.88rem; }

.empty-note { color: var(--muted); padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }

/* ---------- Location dashboard ---------- */

.loc-head { display: flex; align-items: flex-start; gap: 12px; margin: 2px 0 16px; flex-wrap: wrap; }
.loc-head h1 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.1rem); font-weight: 760; }
.loc-head .loc-meta { color: var(--muted); font-size: 0.9rem; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.loc-head .loc-actions { margin-left: auto; display: flex; gap: 8px; }
.fav-btn[aria-pressed="true"] { color: #e0a100; border-color: color-mix(in srgb, #e0a100 50%, var(--border)); }
.fav-btn[aria-pressed="true"] svg { fill: #f5b700; stroke: #e0a100; }

.hero-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: center; align-content: start; }
.hero-card .hourly-wrap { grid-column: 1 / -1; min-width: 0; }
@container main (max-width: 900px) { .hero-card { grid-template-columns: minmax(0, 1fr); } }

.now-label { color: var(--muted); font-size: 0.82rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.big-value { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 6px; }
.big-value .v { font-size: clamp(3rem, 2.2rem + 4vw, 4.6rem); font-weight: 760; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-value .u { font-size: 1.15rem; color: var(--muted); font-weight: 650; }
.trend-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 650; }
.trend-arrow { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; flex: none; }
.trend-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.trend-arrow.rise { background: var(--rise-soft); }
.trend-arrow.fall { background: var(--fall-soft); }
.trend-arrow.steady { background: var(--surface-2); }

.hero-main { container-type: inline-size; min-width: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
@container (max-width: 470px) {
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mini-stat:last-child { grid-column: 1 / -1; }
}
.mini-stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.mini-stat .k { color: var(--muted); font-size: 0.76rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.mini-stat .val { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-stat .d { font-size: 0.8rem; font-weight: 650; }

.gauge-wrap { display: flex; flex-direction: column; align-items: center; }
.gauge { width: 100%; max-width: 300px; height: auto; }
.gauge .g-face { fill: var(--surface-2); stroke: var(--border); }
.gauge .g-tick { stroke: var(--muted); }
.gauge .g-tick.major { stroke: var(--text-2); stroke-width: 2; }
.gauge .g-label { fill: var(--muted); font-size: 11px; font-weight: 600; font-family: var(--font); }
.gauge .g-word { fill: var(--text-2); font-size: 8.6px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font); }
.gauge .g-needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; transition: transform 0.9s cubic-bezier(.2,.9,.25,1.15); }
.gauge .g-hub { fill: var(--text); }
.gauge .g-set { stroke: #c79a2b; stroke-width: 2.2; stroke-linecap: round; }
.gauge .g-fore { stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 3 3; }
.gauge .g-center-v { fill: var(--text); font-size: 15px; font-weight: 750; font-family: var(--font); font-variant-numeric: tabular-nums; }
.gauge .g-center-u { fill: var(--muted); font-size: 10px; font-weight: 650; font-family: var(--font); }
.gauge-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.gauge-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--warn-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  margin-top: 14px;
}
.alert svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--warn); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.alert.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.alert.info svg { stroke: var(--accent); }
.alert strong { display: block; }

.chart-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chart-box { position: relative; height: 290px; margin-top: 8px; }
.chart-box.main { height: 390px; }
@media (max-width: 640px) { .chart-box.main { height: 330px; } }
@media (min-width: 1280px) { .chart-box.main { height: 460px; } }
@media (min-width: 1680px) and (min-height: 960px) { .chart-box.main { height: 540px; } }
.chart-box.change { height: 96px; margin-top: 2px; }
@media (max-width: 640px) { .chart-box { height: 250px; } .chart-box.change { height: 84px; } }
.chart-caption { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); margin-top: 8px; align-items: center; }
.chart-caption i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.chart-caption i.dash { border-top-style: dashed; }
.chart-caption i.band { height: 10px; border: 1px dashed var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); border-radius: 2px; }
.chart-caption i.bars { height: 10px; width: 10px; border: 0; background: linear-gradient(90deg, var(--fall) 50%, var(--rise) 50%); border-radius: 2px; }
.change-label { font-size: 0.75rem; color: var(--muted); font-weight: 650; margin-top: 10px; text-transform: uppercase; letter-spacing: .05em; }

.outlook-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.outlook { display: flex; flex-direction: column; gap: 8px; }
.outlook .o-kicker { color: var(--muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
.outlook .o-kicker svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.outlook .o-title { font-size: 1.12rem; font-weight: 720; }
.outlook p { color: var(--text-2); font-size: 0.92rem; margin: 0; }
.outlook .o-foot { color: var(--muted); font-size: 0.78rem; margin-top: auto; }

.swing-list { list-style: none; margin: 2px 0 4px; padding: 0; }
.swing-list li {
  display: grid; grid-template-columns: 3.4em auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--border); font-size: 0.88rem;
}
.swing-list li:first-child { border-top: 0; }
.swing-list .sw-day { font-weight: 700; color: var(--text); }
.swing-list .sw-label { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swing-list .sw-range { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

.dash-cond { display: flex; flex-direction: column; }
.today-sum { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 0.88rem; }
@container main (min-width: 1200px) { .today-sum { margin-top: auto; } .dash-cond .conditions { margin-bottom: 14px; } }
.conditions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(124px, 100%), 1fr)); gap: 10px; }
.cond { background: var(--surface-2); border-radius: 12px; padding: 11px 12px; }
.cond .k { color: var(--muted); font-size: 0.76rem; font-weight: 650; display: flex; gap: 6px; align-items: center; }
.cond .k svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cond .val { font-weight: 700; font-size: 1.06rem; font-variant-numeric: tabular-nums; }
.cond .sub { color: var(--muted); font-size: 0.78rem; }

.wx-now { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.wx-now .wx-icon { width: 52px; height: 52px; }
.wx-now .t { font-size: 2rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.wx-now .desc { color: var(--text-2); font-weight: 600; }

.wx-icon { width: 28px; height: 28px; flex: none; }
.wx-icon .sun { fill: #f5b301; }
.wx-icon .moon { fill: #a4b4d6; }
.wx-icon .cloud { fill: #c7d0de; }
.wx-icon .cloud-dark { fill: #93a1b8; }
.wx-icon .rain { stroke: #3a86ff; stroke-width: 2; stroke-linecap: round; }
.wx-icon .snow { fill: #8fb8ff; }
.wx-icon .bolt { fill: #f5b301; }
.wx-icon .fog { stroke: #a9b4c4; stroke-width: 2; stroke-linecap: round; }
:root[data-theme="dark"] .wx-icon .cloud { fill: #8592a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wx-icon .cloud { fill: #8592a8; } }

.daily { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.daily th { text-align: left; color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0 8px 8px; }
.daily td { padding: 9px 8px; border-top: 1px solid var(--border); vertical-align: middle; font-size: 0.93rem; }
.daily tr.past td { color: var(--muted); }
.daily tr.today td { background: var(--accent-soft); }
.daily tr.today td:first-child { border-radius: 10px 0 0 10px; }
.daily tr.today td:last-child { border-radius: 0 10px 10px 0; }
.daily .day { font-weight: 650; white-space: nowrap; }
.daily .day small { display: block; color: var(--muted); font-weight: 500; font-size: 0.76rem; }
.daily .wx { display: flex; align-items: center; gap: 8px; }
.daily .wx span { font-size: 0.85rem; color: var(--text-2); }
.range-bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); min-width: 90px; }
.range-bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--fall), var(--accent), var(--rise)); }
.range-cell { display: flex; align-items: center; gap: 8px; }
.range-cell .lo, .range-cell .hi { font-size: 0.82rem; width: 52px; }
.range-cell .lo { text-align: right; }
@media (max-width: 640px) {
  .daily .hide-sm { display: none; }
  .range-cell .lo, .range-cell .hi { width: auto; }
  .range-bar { min-width: 44px; flex: 1; }
  .daily td, .daily th { padding-left: 4px; padding-right: 4px; }
}
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }

.mini-map { height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }

/* Place dashboard: one column on phones/tablets (order below), two on PCs */
.dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.dash > * { min-width: 0; }
.dash .alert { margin-top: 0; }
.dash-alerts { display: grid; gap: 10px; }
.dash-stale { order: 0; }
.dash-hero { order: 1; }
.dash-alerts { order: 2; }
.dash-chart { order: 3; }
.dash-ad1 { order: 4; }
.dash-outlook { order: 5; }
.dash-daily { order: 6; }
.dash-ad2 { order: 7; }
.dash-cond { order: 8; }
.dash-side { order: 9; display: grid; gap: 16px; align-content: start; min-width: 0; }
.dash-adbox { display: none; }
@container main (min-width: 1200px) {
  .dash { grid-template-columns: minmax(0, 1.9fr) minmax(360px, 1fr); }
  .dash-stale, .dash-alerts, .dash-chart, .dash-outlook, .dash-ad1 { grid-column: 1 / -1; }
  .dash-hero { order: 1; grid-column: 1; }
  .dash-cond { order: 2; grid-column: 2; }
  .dash-alerts { order: 3; }
  .dash-chart { order: 4; }
  .dash-ad1 { order: 5; }
  .dash-outlook { order: 6; }
  .dash-daily { order: 7; grid-column: 1; }
  .dash-ad2 { display: none; }
  .dash-side { order: 8; grid-column: 2; align-self: start; position: sticky; top: calc(var(--topbar-h) + 16px); }
  .dash-adbox { display: flex; }
  .dash-map .mini-map { height: clamp(380px, calc(100vh - var(--topbar-h) - 190px), 760px); }
  .ads-on .dash-map .mini-map { height: clamp(300px, calc(100vh - var(--topbar-h) - 470px), 640px); }
  .dash-outlook .outlook-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container main (min-width: 1600px) {
  .dash { grid-template-columns: minmax(0, 1.7fr) minmax(420px, 1fr); }
}

/* Next 24 hours strip */
.hourly-label { color: var(--muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; }
.hourly { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
@media (max-width: 600px) { .hourly { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; } }
.hr { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: var(--surface-2); font-variant-numeric: tabular-nums; min-width: 0; }
.hr .wx-icon { width: 26px; height: 26px; margin: 2px 0; }
.hr-t { font-size: 0.76rem; color: var(--muted); font-weight: 650; white-space: nowrap; }
.hr-temp { font-weight: 700; font-size: 0.92rem; }
.hr-p { font-size: 0.8rem; color: var(--text-2); font-weight: 650; white-space: nowrap; }
.hr-d { font-size: 0.72rem; font-weight: 650; white-space: nowrap; }

/* ---------- Skeletons ---------- */

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
  animation: shimmer 1.3s infinite; transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

.error-card { text-align: center; padding: 34px 18px; }
.error-card h2 { margin-bottom: 8px; }
.error-card p { color: var(--muted); max-width: 52ch; margin: 0 auto 16px; }

/* ---------- Dialogs ---------- */

dialog.sheet {
  border: 1px solid var(--border); border-radius: 18px; padding: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(620px, calc(100vw - 24px)); max-height: min(78vh, 720px);
  margin: 10vh auto auto;
}
dialog.sheet::backdrop { background: rgba(8, 12, 22, 0.45); backdrop-filter: blur(3px); }
@media (max-width: 640px) {
  dialog.sheet { margin: calc(env(safe-area-inset-top) + 10px) auto auto; max-height: calc(100vh - 90px); }
}
.search-box { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); }
.search-box > svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search-box input { flex: 1; border: 0; background: none; font: inherit; font-size: 1.08rem; color: var(--text); outline: none; min-width: 0; height: 40px; }
.search-box input::-webkit-search-cancel-button { display: none; }
.locate-row {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--border); background: none; padding: 13px 16px; cursor: pointer; font-weight: 600; color: var(--accent);
}
.locate-row:hover { background: var(--surface-2); }
.locate-row svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; max-height: 52vh; }
.search-results li { border-radius: 10px; }
.search-results li a, .search-results li .sr-row {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; color: var(--text); border-radius: 10px;
}
.search-results li a:hover, .search-results li[aria-selected="true"] a { background: var(--surface-2); text-decoration: none; }
.search-results .sr-flag { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 0.72rem; font-weight: 750; color: var(--muted); flex: none; }
.search-results .sr-name { font-weight: 620; }
.search-results .sr-sub { color: var(--muted); font-size: 0.84rem; }
.search-results .sr-group { color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 12px 4px; }
.search-hint { color: var(--muted); font-size: 0.82rem; padding: 4px 16px 14px; margin: 0; }

.sheet-head { display: flex; align-items: center; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { font-size: 1.15rem; flex: 1; }
.settings-body { padding: 8px 20px 20px; overflow-y: auto; }
.setting { padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting-label { font-weight: 650; margin-bottom: 8px; display: block; }
.setting-help { color: var(--muted); font-size: 0.84rem; margin: 8px 0 0; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 3000;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  transition: opacity .2s, transform .2s; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Maps (preview maps, world map) ---------- */

.leaflet-container { font-family: var(--font); background: var(--surface-2); }
.leaflet-pane.leaflet-pressure-pane canvas { pointer-events: none; }
.spinner { width: 14px; height: 14px; border-radius: 99px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow-lg); }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--text-2); }
.leaflet-control-zoom { border: 1px solid var(--border) !important; border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.me-marker { width: 16px; height: 16px; border-radius: 99px; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px var(--accent-soft), 0 1px 4px rgba(0,0,0,.4); }

/* ---------- World ---------- */

.world-map { height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
@media (max-width: 640px) { .world-map { height: 300px; } }
.world-dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.world-dash > * { min-width: 0; }
.w-map { order: 1; } .w-ad { order: 2; } .w-leaders { order: 3; } .w-table { order: 4; }
.w-leaders-title { margin-top: 8px; }
@container main (min-width: 1040px) { .w-leaders .leader-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container main (min-width: 1320px) {
  .world-dash { grid-template-columns: minmax(0, 1.6fr) minmax(460px, 1fr); }
  .w-map { grid-column: 1; }
  .w-ad { order: 3; grid-column: 1 / -1; }
  .w-table { order: 2; grid-column: 2; display: flex; flex-direction: column; min-height: 0; }
  .w-table .tall-scroll { flex: 1 1 0; max-height: none; min-height: 0; }
  .w-leaders { order: 4; grid-column: 1 / -1; }
  .world-map { height: clamp(460px, calc(100vh - 300px), 680px); }
  /* Side table: keep the essentials so nothing is cut off */
  .w-table .data-table :is(td, th):nth-child(4), .w-table .data-table :is(td, th):nth-child(6) { display: none; }
}
@container main (min-width: 1720px) { .w-table .data-table :is(td, th):nth-child(4) { display: table-cell; } }
.leader-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.leader-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.leader-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 0.93rem; }
.leader-list li:first-child { border-top: 0; }
.leader-list .rank { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 0.74rem; font-weight: 750; display: grid; place-items: center; flex: none; }
.leader-list li:nth-child(-n+3) .rank { background: var(--accent-soft); color: var(--accent); }
.leader-list a { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.leader-list a small { color: var(--muted); font-weight: 500; margin-left: 4px; }
@media (max-width: 420px) {
  .leader-list a { white-space: normal; line-height: 1.25; }
  .leader-list a small { display: block; margin-left: 0; font-size: 0.78rem; }
}
.leader-list .lv { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.data-table th { text-align: left; color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: .05em; padding: 8px; cursor: pointer; white-space: nowrap; user-select: none; position: sticky; top: 0; background: var(--surface); }
.data-table th[aria-sort] { color: var(--text); }
.data-table th.r, .data-table td.r { text-align: right; }
.data-table td { padding: 8px; border-top: 1px solid var(--border); white-space: nowrap; }
.data-table td a { color: var(--text); font-weight: 600; }
.table-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.input {
  height: 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  padding: 0 14px; font: inherit; font-size: 0.92rem; min-width: 0;
}
select.input { padding-right: 30px; }
.tall-scroll { max-height: 560px; overflow: auto; }

/* ---------- Learn ---------- */

.prose { max-width: 74ch; }
.prose h2 { font-size: 1.35rem; margin: 34px 0 10px; }
.prose h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 4px 0; }
.learn-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.learn-toc { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
.learn-toc a { color: var(--muted); padding: 5px 10px; border-radius: 8px; }
.learn-toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
@container main (max-width: 860px) { .learn-layout { grid-template-columns: minmax(0, 1fr); } .learn-toc { display: none; } }
.page.page-learn { max-width: 1480px; }
.learn-rail { display: none; }
.rail-note { display: none; }
@container main (min-width: 1340px) {
  .learn-ad-inline { display: none; }
  .learn-layout { grid-template-columns: 200px minmax(0, 780px) 360px; justify-content: center; }
  .learn-layout .prose { max-width: none; }
  .learn-rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 20px); }
  .learn-rail .converter { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
  .rail-note { display: block; }
}
.rail-bands { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.rail-bands li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); color: var(--text-2); }
.rail-bands li:first-child { border-top: 0; }
.rail-bands .num { white-space: nowrap; color: var(--text); font-weight: 600; }
.ref-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; margin: 10px 0 6px; font-size: 0.92rem; }
.ref-table th, .ref-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.ref-table th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.converter { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 12px 0; }
.converter label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 650; }
.converter input { border-radius: 10px; font-variant-numeric: tabular-nums; font-size: 1rem; }
.callout { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin: 14px 0; color: var(--text-2); font-size: 0.93rem; }

.footer { color: var(--muted); font-size: 0.82rem; text-align: center; padding: 28px 16px 36px; border-top: 1px solid var(--border); margin-top: 24px; }
.footer a { color: var(--text-2); }

/* ---------- Install banner ---------- */
.install-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.install-card p { margin: 0; flex: 1; min-width: 200px; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Home: wide layout ---------- */
.home-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.home-map { display: none; padding: 14px; flex-direction: column; min-height: 0; }
.hm-head { display: flex; align-items: center; gap: 12px; margin: 2px 4px 12px; }
.hm-head .btn { margin-left: auto; }
.home-map-el { flex: 1; min-height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
@container main (min-width: 980px) {
  .home-top { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: stretch; }
  .home-map { display: flex; }
  .home-hero { display: flex; flex-direction: column; justify-content: center; padding: 44px 36px; }
}
@media (min-width: 1680px) { .home-map-el { min-height: 360px; } }
.home-bottom { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
.ad.home-adbox { display: none; }
.home-bottom > * { min-width: 0; }
@container main (min-width: 1060px) {
  .ad.home-adbox { display: flex; }
  .home-bottom { grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); }
  .home-bottom .quick-links { grid-template-columns: minmax(0, 1fr); }
}
.wn-grid { display: grid; gap: 8px 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .wn-grid { grid-template-columns: minmax(0, 1fr); } }
@container main (min-width: 1400px) { .wn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.wn-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.wn-title .muted { font-weight: 500; font-size: 0.78rem; margin-left: 4px; }
.wn-col .leader-list li { padding: 6px 0; }
.leader-list a { white-space: normal; line-height: 1.25; }
.leader-list a small { display: block; margin-left: 0; font-size: 0.76rem; }


/* Side rails beside the page on large screens */
.ad-side { display: none; }
@media (min-width: 1280px) and (min-height: 720px) {
  body.ads-on .ad-side-right {
    display: block; position: fixed; z-index: 5; top: calc(var(--topbar-h) + 24px); right: 16px; width: 160px;
  }
  body.ads-on main { padding-right: 192px; }
}
@media (min-width: 1600px) and (min-height: 720px) {
  body.ads-on .ad-side-left {
    display: block; position: fixed; z-index: 5; top: calc(var(--topbar-h) + 24px); left: 16px; width: 160px;
  }
  body.ads-on main { padding-left: 192px; }
}
@media (min-width: 2200px) and (min-height: 820px) {
  body.ads-on .ad-side { width: 300px; }
  body.ads-on .ad-side .ad-body { width: 300px; }
  body.ads-on main { padding-left: 332px; padding-right: 332px; }
}
@media print { .ad, .ad-side { display: none !important; } }

/* ---------- Reports ---------- */
.report-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@container main (min-width: 1000px) {
  .report-layout { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
  .report-form { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; }
}
.report-form { display: flex; flex-direction: column; gap: 4px; }
.report-form fieldset { border: 0; margin: 0; padding: 0 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 12px; min-width: 0; }
.report-form legend { font-weight: 700; font-size: 0.95rem; padding: 0; margin-bottom: 10px; }
.rf-place { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; margin-bottom: 10px; }
.rf-place strong { display: block; }
.rf-pin { color: var(--accent); flex: none; margin-top: 2px; }
.rf-pin svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rf-search { position: relative; margin-bottom: 10px; }
.rf-search .input { width: 100%; }
.rf-results { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; }
.rf-results button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.rf-results button:hover { background: var(--surface-2); }
.rf-results small { display: block; color: var(--muted); font-weight: 500; }
.rf-presets { margin-bottom: 12px; }
.rf-when { display: grid; gap: 10px; margin-bottom: 8px; }
.rf-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 650; color: var(--muted); margin-bottom: 8px; }
.rf-field .input { color: var(--text); font-weight: 500; }
.rf-dt { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.rf-dt .input, .rf-field .input { width: 100%; min-width: 0; border-radius: 10px; }
.rf-field textarea.input { height: auto; padding: 10px 12px; resize: vertical; font: inherit; font-size: 0.92rem; }
.input:disabled { opacity: 0.55; }
.rf-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; padding: 4px 0; cursor: pointer; }
.rf-check input { width: 17px; height: 17px; accent-color: var(--accent-strong); flex: none; }
.rf-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }
.rf-sections { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.rf-help { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }
.rf-details { margin-bottom: 12px; }
.rf-details summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; padding: 4px 0 10px; }
.rf-details summary .muted { font-weight: 500; }
.rf-error { color: var(--fall); font-weight: 600; font-size: 0.9rem; margin: 0 0 10px; }
.rf-submit { width: 100%; }

.report-empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.report-empty h2 { color: var(--text); font-size: 1.15rem; margin-bottom: 8px; }
.report-empty p { max-width: 46ch; margin: 0 auto; }
.re-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 14px; }
.re-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.report-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 14px 18px; }
.ra-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* The preview is styled like a printed page */
.report-sheet {
  background: #ffffff; color: #0f172a; border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: clamp(16px, 3vw, 36px); font-size: 0.92rem;
  --rs-muted: #5d6779; --rs-line: #dde2ea;
}
.report-sheet h2 { font-size: 1.35rem; margin: 0; color: #0f172a; }
.report-sheet h3 { font-size: 1rem; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--rs-line); color: #0f172a; }
.rs-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 3px solid #4f46e5; }
.rs-sub { color: var(--rs-muted); margin-top: 3px; }
.rs-info { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 14px 0 0; }
.rs-info dt { color: var(--rs-muted); font-weight: 650; }
.rs-info dd { margin: 0; }
.rs-highlights { margin: 0 0 12px; padding-left: 1.1em; }
.rs-highlights li { margin: 3px 0; }
.rs-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.84rem; }
.rs-table th, .rs-table td { padding: 5px 8px; border-bottom: 1px solid var(--rs-line); text-align: right; white-space: nowrap; }
.rs-table thead th { background: #eef1f6; color: #0f172a; font-weight: 700; font-size: 0.78rem; }
.rs-table th:first-child, .rs-table td:first-child { text-align: left; }
.rs-table tbody th { font-weight: 600; }
.rs-hourly { max-height: 520px; overflow: auto; }
.rs-hourly thead th { position: sticky; top: 0; }
.rs-chart { width: 100%; height: auto; display: block; margin: 6px 0 10px; border: 1px solid var(--rs-line); border-radius: 8px; }
.rs-notes { white-space: pre-wrap; }
.rs-about { color: var(--rs-muted); font-size: 0.8rem; }
.report-sheet .table-scroll { margin: 0; padding: 0; }

@media print {
  body[data-route="report"] .topbar, body[data-route="report"] .tabbar,
  body[data-route="report"] .page-head, body[data-route="report"] .report-form,
  body[data-route="report"] .report-actions, body[data-route="report"] .footer { display: none !important; }
  body[data-route="report"] { background: #fff; padding: 0; }
  body[data-route="report"] main { padding: 0 !important; }
  body[data-route="report"] .page { padding: 0; max-width: none; }
  body[data-route="report"] .report-layout { display: block; }
  .report-sheet { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .rs-hourly { max-height: none; overflow: visible; }
  .rs-hourly thead th { position: static; }
  .rs-chart { break-inside: avoid; }
  .report-sheet h3 { break-after: avoid; }
}
.loc-actions .btn { height: 40px; }
@media (max-width: 480px) { .report-btn { padding: 0 12px; } }
