/* Visual language inspired by Bénin's public digital services (ANIP):
   Montserrat, royal blue + yellow call to action + cyan accents, large
   rounded white blocks on a pale blue background. Voltao keeps its own
   identity (no official logo or emblem): it is an independent service. */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/vendor/fonts/montserrat-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/vendor/fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --pw-blue: #1f4e9e;         /* header, highlights, active states */
  --pw-blue-dark: #183d7c;
  --pw-blue-soft: #e8eef8;
  --pw-navy: #14213d;         /* headings */
  --pw-yellow: #f6c400;       /* main call to action */
  --pw-yellow-dark: #e0b200;
  --pw-cyan: #2bb3d4;         /* accents: title bars, secondary actions */
  --pw-amber: #f4a100;        /* status: conflicting reports */
  --pw-amber-soft: #fff4d6;
  --pw-bg: #eef3f9;
  --pw-card: #ffffff;
  --pw-text: #1e293b;
  --pw-muted: #5b6b82;
  --pw-border: #dde5f0;
  --pw-shadow: 0 6px 24px rgba(20, 33, 61, .06);
  --pw-green: #1f8a4c;
  --pw-terracotta: #c2502e;
  --pw-on: #1f8a4c;
  --pw-off: #c62828;
  --pw-unknown: #8a93a3;
  --pw-radius: 18px;
  --tabbar-height: 66px;
  --bs-body-font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
  background: var(--pw-bg);
  color: var(--pw-text);
  font-family: var(--bs-body-font-family);
  padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 16px);
  -webkit-tap-highlight-color: transparent;
}

.app-container { max-width: 780px; }

.skip-link {
  position: absolute; z-index: 1000; left: 8px; top: 8px;
  background: var(--pw-card); padding: 8px 12px; border-radius: 8px;
}

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 12px rgba(20, 33, 61, .18);
}
.header-top { background: var(--pw-blue); color: #fff; padding: calc(env(safe-area-inset-top) + 12px) 0 12px; }
.quicklinks, .header-main { display: none; }
.brand {
  color: #fff; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand:hover { color: #fff; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
.country-chip {
  border: 0; background: var(--pw-yellow); color: var(--pw-navy);
  border-radius: 10px; padding: 7px 14px; font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em;
}
.country-chip:hover, .country-chip:focus-visible { background: var(--pw-yellow-dark); }

.offline-banner {
  background: var(--pw-amber-soft); color: #5c4300; text-align: center;
  font-size: .85rem; font-weight: 500; padding: 6px 16px;
}

/* ---------- content ---------- */
#view { padding-top: 24px; outline: none; }

/* Big bold title with a short cyan bar under it. */
.page-title {
  font-size: 1.75rem; font-weight: 800; color: var(--pw-navy); letter-spacing: -.02em;
  margin-bottom: 14px; line-height: 1.15;
}
.page-title::after {
  content: ''; display: block; width: 48px; height: 4px; border-radius: 2px; margin-top: 10px;
  background: var(--pw-cyan);
}
.page-title .accent { color: var(--pw-blue); }
.page-subtitle { color: var(--pw-muted); margin-bottom: 22px; font-size: .95rem; }
.section-title {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--pw-blue); margin: 28px 0 10px;
}

.card-pw {
  background: var(--pw-card); border: 1px solid var(--pw-border); border-radius: var(--pw-radius);
  padding: 18px; box-shadow: var(--pw-shadow);
}

.list-pw {
  background: var(--pw-card); border: 1px solid var(--pw-border); border-radius: var(--pw-radius);
  overflow: hidden; box-shadow: var(--pw-shadow);
}
.list-pw a, .list-pw .item {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  color: inherit; text-decoration: none; border-top: 1px solid var(--pw-border);
}
.list-pw > :first-child { border-top: 0; }
.list-pw a:hover, .list-pw a:focus-visible { background: var(--pw-blue-soft); }
.list-pw .item-main { flex: 1; min-width: 0; }
.list-pw .item-title { font-weight: 700; color: var(--pw-navy); overflow-wrap: anywhere; }
.list-pw .item-meta { color: var(--pw-muted); font-size: .83rem; overflow-wrap: anywhere; }
/* The arrow in a ring, as on the service cards that inspired this design. */
.chevron {
  color: var(--pw-blue); flex-shrink: 0; width: 30px; height: 30px; padding: 6px;
  border: 1.5px solid var(--pw-border); border-radius: 50%;
}
.list-pw a:hover .chevron { border-color: var(--pw-blue); }

.type-badge {
  font-size: .7rem; font-weight: 700; color: var(--pw-blue); background: var(--pw-blue-soft);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em;
}

.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; background: var(--pw-unknown); }
.status-dot.on { background: var(--pw-on); }
.status-dot.off { background: var(--pw-off); }
.status-dot.conflict { background: var(--pw-amber); }
.status-dot.lg { width: 18px; height: 18px; box-shadow: 0 0 0 5px rgba(138, 147, 163, .15); }
.status-dot.lg.on { box-shadow: 0 0 0 5px rgba(31, 138, 76, .15); }
.status-dot.lg.off { box-shadow: 0 0 0 5px rgba(198, 40, 40, .15); }

/* Bootstrap's .btn reads its colours from --bs-btn-* variables, so set those
   rather than background/color, which its :hover/:active rules would override. */
.btn-pw, .btn-outline-pw {
  --bs-btn-font-weight: 700;
  --bs-btn-border-radius: 10px;
  --bs-btn-padding-y: 11px;
  --bs-btn-padding-x: 20px;
  --bs-btn-border-width: 1.5px;
  --bs-btn-font-family: var(--bs-body-font-family);
}
.btn-pw {
  text-transform: uppercase; letter-spacing: .03em; font-size: .85rem;
  --bs-btn-bg: var(--pw-yellow); --bs-btn-color: var(--pw-navy); --bs-btn-border-color: var(--pw-yellow);
  --bs-btn-hover-bg: var(--pw-yellow-dark); --bs-btn-hover-color: var(--pw-navy); --bs-btn-hover-border-color: var(--pw-yellow-dark);
  --bs-btn-active-bg: #c99f00; --bs-btn-active-color: var(--pw-navy); --bs-btn-active-border-color: #c99f00;
  --bs-btn-disabled-bg: var(--pw-yellow); --bs-btn-disabled-border-color: var(--pw-yellow); --bs-btn-disabled-color: var(--pw-navy);
}
.btn-outline-pw {
  --bs-btn-bg: transparent; --bs-btn-color: var(--pw-blue); --bs-btn-border-color: var(--pw-blue);
  --bs-btn-hover-bg: var(--pw-blue-soft); --bs-btn-hover-color: var(--pw-blue); --bs-btn-hover-border-color: var(--pw-blue);
  --bs-btn-active-bg: #d6e1f3; --bs-btn-active-color: var(--pw-blue); --bs-btn-active-border-color: var(--pw-blue);
}
.btn-outline-pw[aria-pressed="true"] {
  --bs-btn-bg: var(--pw-blue); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--pw-blue-dark); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--pw-blue-dark); --bs-btn-active-color: #fff;
}
.btn-outline-pw[aria-pressed="true"] .icon svg { fill: var(--pw-yellow); stroke: var(--pw-yellow); }

.search-box { position: relative; }
.search-box input {
  border-radius: 14px; padding: 14px 16px 14px 46px; border: 1.5px solid var(--pw-border);
  font-size: 1rem; box-shadow: var(--pw-shadow);
}
.search-box input:focus { border-color: var(--pw-blue); box-shadow: 0 0 0 4px rgba(31, 78, 158, .12); }
.search-box .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--pw-blue); }

.crumbs { font-size: .8rem; font-weight: 600; color: var(--pw-muted); margin-bottom: 8px; overflow-wrap: anywhere; }
.crumbs a { color: var(--pw-blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.empty-state { text-align: center; color: var(--pw-muted); padding: 32px 16px; }
.empty-state .icon { width: 44px; height: 44px; color: var(--pw-blue); margin-bottom: 10px; }

/* ---------- welcome ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1a3f86 0%, var(--pw-blue) 55%, #2a63bd 100%);
  color: #fff; border-radius: 24px; padding: 30px 24px; margin-bottom: 24px;
}
/* Concentric rings, a nod to the decorative circles of the inspiration. */
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .12);
  right: -80px; top: -80px; width: 240px; height: 240px;
}
.hero::after { right: -140px; top: -140px; width: 360px; height: 360px; }
.hero h1 {
  position: relative; font-size: 1.9rem; font-weight: 800; line-height: 1.12; letter-spacing: -.02em;
  text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 .accent { color: var(--pw-yellow); }
.hero h1::after {
  content: ''; display: block; width: 48px; height: 4px; border-radius: 2px; margin-top: 14px;
  background: var(--pw-cyan);
}
.hero p { position: relative; color: #dbe6f7; margin: 0; max-width: 32rem; }

.country-grid { display: grid; gap: 14px; }
@media (min-width: 640px) {
  .country-grid { grid-template-columns: repeat(3, 1fr); }
  .country-option { min-height: 160px; }
}
/* Numbered cards: small "01", arrow ring, big title, outlined numeral watermark. */
.country-option {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 118px; width: 100%; text-align: left; padding: 16px 20px;
  background: var(--pw-card); border: 1.5px solid var(--pw-border); border-radius: var(--pw-radius);
  color: var(--pw-navy); box-shadow: var(--pw-shadow); transition: border-color .15s, transform .15s;
}
.country-option:hover, .country-option:focus-visible { border-color: var(--pw-blue); transform: translateY(-2px); }
.country-option .num { font-size: .75rem; font-weight: 800; color: var(--pw-blue); letter-spacing: .05em; }
.country-option .go {
  position: absolute; right: 16px; top: 14px; width: 38px; height: 38px; padding: 9px;
  border: 1.5px solid var(--pw-border); border-radius: 50%; color: var(--pw-blue);
}
.country-option:hover .go { background: var(--pw-blue); border-color: var(--pw-blue); color: #fff; }
.country-option .name {
  position: relative; z-index: 1; font-size: 1.35rem; font-weight: 800; text-transform: uppercase;
  line-height: 1.1; letter-spacing: -.01em; margin-top: 28px;
}
.country-option .watermark {
  position: absolute; right: 10px; bottom: -22px; font-size: 6rem; font-weight: 800; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px #dfe7f3; pointer-events: none;
}

.skeleton { background: linear-gradient(90deg, #e3eaf4, #f2f6fb, #e3eaf4); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .country-option { transition: none; } }

.footer-note { color: var(--pw-muted); font-size: .8rem; text-align: center; margin-top: 32px; }
.footer-note a { color: inherit; }

/* ---------- charts & stats ---------- */
:root { --pw-chart: #3b6fd4; /* validated: lightness band, chroma floor, 3:1 contrast */ }
.chart { margin: 0; }
.chart-title { font-size: .85rem; font-weight: 700; color: var(--pw-navy); margin-bottom: 6px; }
.chart-frame { position: relative; }
.chart-max { font-size: .7rem; color: var(--pw-muted); height: 14px; }
.chart-plot {
  position: relative; display: flex; align-items: flex-end; gap: 2px;
  border-bottom: 1px solid var(--pw-border);
  background: repeating-linear-gradient(to top, transparent 0 calc(50% - 1px), #edf1f7 calc(50% - 1px) 50%);
}
.chart-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; outline: none; }
.chart-slot:focus-visible { box-shadow: inset 0 0 0 2px var(--pw-navy); border-radius: 4px; }
.chart-bar { width: 100%; max-width: 24px; background: var(--pw-chart); border-radius: 4px 4px 0 0; }
.chart-slot:hover .chart-bar, .chart-slot:focus .chart-bar { background: #2b57b0; }
.chart-ticks { display: flex; justify-content: space-between; font-size: .7rem; color: var(--pw-muted); margin-top: 4px; }
.chart-tooltip {
  position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 5;
  background: var(--pw-navy); color: #fff; font-size: .75rem; padding: 4px 8px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
}
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile {
  background: var(--pw-card); border: 1px solid var(--pw-border); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--pw-shadow);
}
/* The first figure stands out, like the highlighted card of a feature row. */
.stat-grid .stat-tile:first-child { background: var(--pw-blue); border-color: var(--pw-blue); }
.stat-grid .stat-tile:first-child .stat-value, .stat-grid .stat-tile:first-child .stat-label { color: #fff; }
.stat-value { font-size: 1.35rem; font-weight: 800; color: var(--pw-navy); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .72rem; font-weight: 600; color: var(--pw-muted); }

/* ---------- install ---------- */
.install-card { display: flex; align-items: flex-start; gap: 12px; }
.install-card img { border-radius: 10px; flex-shrink: 0; }

/* ---------- forecasts ---------- */
.forecast-day { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--pw-blue); background: var(--pw-blue-soft); padding-top: 8px !important; padding-bottom: 8px !important; }
.forecast-row { gap: 10px !important; padding-top: 10px !important; padding-bottom: 10px !important; }
.forecast-time { width: 92px; flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 600; }
.forecast-now { display: block; font-size: .7rem; color: var(--pw-cyan); font-weight: 800; text-transform: uppercase; }
.forecast-why { display: block; font-size: .7rem; color: var(--pw-muted, #5b6b80); font-weight: 600; }
.forecast-rotation { display: grid; gap: 2px; margin-bottom: 12px; padding: 10px 14px; border-left: 4px solid var(--pw-yellow, #f6c400); background: var(--pw-card, #fff); border-radius: 8px; font-size: .9rem; }
.forecast-meter { flex: 1; height: 10px; background: #e9eef6; border-radius: 5px; overflow: hidden; }
.forecast-meter span { display: block; height: 100%; background: var(--pw-chart); border-radius: 5px; }
.forecast-value { width: 40px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.forecast-level { width: 54px; font-size: .75rem; color: var(--pw-muted); }
.forecast-level.high { color: var(--pw-navy); font-weight: 800; }

/* ---------- map ---------- */
.map-box {
  /* header + title + summary + legend + tab bar ≈ 320px */
  height: calc(100vh - 400px - env(safe-area-inset-bottom)); min-height: 320px;
  border-radius: var(--pw-radius); overflow: hidden; border: 1px solid var(--pw-border); background: #e3eaf3;
  box-shadow: var(--pw-shadow);
}
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--pw-muted); margin-top: 10px; }
.map-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.map-popup { min-width: 170px; font-family: var(--bs-body-font-family); }
.status-text.off { color: var(--pw-off); }
.status-text.on { color: var(--pw-on); }
.status-text.conflict { color: #8a5a00; }

/* Map toolbar: search, shortcuts. */
.map-toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
.map-search { position: relative; }
.map-search > .icon { position: absolute; left: 14px; top: 13px; color: var(--pw-blue); z-index: 2; }
.map-search input { border-radius: 14px; padding: 12px 14px 12px 44px; border: 1.5px solid var(--pw-border); box-shadow: var(--pw-shadow); }
.map-search-results {
  position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow: auto;
  background: var(--pw-card); border: 1px solid var(--pw-border); border-radius: 14px; box-shadow: 0 12px 32px rgba(20, 33, 61, .16);
}
.map-search-results[hidden] { display: none; }
.map-search-results button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; border-top: 1px solid var(--pw-border);
}
.map-search-results button:first-child { border-top: 0; }
.map-search-results button:hover, .map-search-results button:focus-visible { background: var(--pw-blue-soft); }
.map-search-results strong { display: block; color: var(--pw-navy); }
.map-search-results span { font-size: .8rem; color: var(--pw-muted); }
.map-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.map-chips::-webkit-scrollbar { display: none; }
.map-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--pw-border); background: var(--pw-card);
  color: var(--pw-navy); border-radius: 999px; padding: 7px 13px; font-size: .82rem; font-weight: 700;
}
.map-chip .icon { width: 16px; height: 16px; color: var(--pw-blue); }
.map-chip:hover, .map-chip:focus-visible { border-color: var(--pw-blue); color: var(--pw-blue); }
.map-chip.strong { background: var(--pw-blue); border-color: var(--pw-blue); color: #fff; }
.map-chip.strong .icon { color: var(--pw-yellow); }
.map-chip[hidden] { display: none; }
.map-hint { font-size: .8rem; color: var(--pw-muted); margin: 8px 0 0; min-height: 1em; }
.map-hint:empty { margin: 0; min-height: 0; }

/* ---------- reporting ---------- */
.report-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 96px; border-radius: 16px; border: 2px solid; font-weight: 800; font-size: .95rem;
  text-transform: uppercase; letter-spacing: .02em; background: #fff; transition: transform .1s;
}
.report-btn .icon { width: 30px; height: 30px; }
.report-btn.off { color: var(--pw-off); border-color: var(--pw-off); }
.report-btn.on { color: var(--pw-on); border-color: var(--pw-on); }
.report-btn.off:hover, .report-btn.off:focus-visible { background: #fdecec; }
.report-btn.on:hover, .report-btn.on:focus-visible { background: #e8f5ee; }
.report-btn:active { transform: scale(.97); }
.report-btn:disabled { opacity: .55; }
.report-feedback { margin: 12px 0 4px; font-size: .9rem; min-height: 1.2em; }
.report-feedback:empty { margin: 0; min-height: 0; }
.report-feedback.sent { color: var(--pw-on); font-weight: 700; }
.report-feedback.queued { color: #8a5a00; font-weight: 700; }
.report-feedback.refused { color: var(--pw-off); }

.queue-banner {
  background: var(--pw-amber-soft); color: #5c4300; font-size: .85rem; font-weight: 500;
  text-align: center; padding: 6px 16px;
}

.verify-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 33, 61, .55);
  display: grid; place-items: center; padding: 16px;
}
.verify-card { max-width: 360px; width: 100%; text-align: center; }

/* ---------- icons ---------- */
.icon { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ---------- bottom dock (glass, sliding pill) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; pointer-events: none;
  padding: 0 12px calc(env(safe-area-inset-bottom) + 10px);
}
.tabbar[hidden] { display: none; }
.dock {
  pointer-events: auto; position: relative; display: flex; width: 100%; max-width: 520px;
  padding: 6px; border-radius: 22px;
  background: var(--pw-card);
  border: 1px solid var(--pw-border);
  box-shadow: 0 10px 30px rgba(20, 33, 61, .14);
}
.dock-indicator {
  position: absolute; top: 6px; left: 0; height: calc(100% - 12px); border-radius: 16px;
  background: var(--pw-blue); box-shadow: 0 6px 16px rgba(31, 78, 158, .35);
  transition: transform .25s ease, width .25s ease;
}
.dock a {
  position: relative; z-index: 1; flex: 1; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--pw-muted); text-decoration: none; font-size: .66rem; font-weight: 700;
  border-radius: 16px; transition: color .2s;
}
.dock a .icon { width: 22px; height: 22px; }
.dock a[aria-current="page"] { color: #fff; }
.dock a[aria-current="page"] .icon { color: var(--pw-yellow); }
/* Room for the dock is kept inside the footer, so its colours reach the bottom edge. */
body { padding-bottom: 0; }

/* ---------- zone state ---------- */
.state-title { font-weight: 800; font-size: 1.05rem; color: var(--pw-navy); }
.state-card[data-state="OFF"] .state-title { color: var(--pw-off); }
.state-card[data-state="ON"] .state-title { color: var(--pw-on); }
.state-card[data-state="CONFLICT"] .state-title { color: #8a5a00; }
.state-card[data-state="OFF"] { border: 2px solid var(--pw-off); }

/* "EN DIRECT" ticker. */
.ticker {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px; overflow: hidden;
  background: var(--pw-navy); color: #e8eef8; border-radius: 14px; padding: 8px 10px; font-size: .8rem;
  box-shadow: var(--pw-shadow);
}
.ticker[hidden] { display: none; }
.ticker-label {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .7rem;
  letter-spacing: .08em; color: var(--pw-navy); background: var(--pw-yellow); border-radius: 8px; padding: 4px 8px;
}
.ticker-label i { width: 7px; height: 7px; border-radius: 50%; background: #c62828; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.ticker-window {
  flex: 1; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: marquee var(--duration, 30s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-copy { display: flex; }
.ticker-item { display: inline-flex; align-items: center; gap: 6px; padding-right: 28px; white-space: nowrap; color: inherit; text-decoration: none; }
.ticker-item strong { color: #fff; }
.ticker-meta { color: #9fb2cf; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Offline / pending banners as a floating pill. */
.offline-banner, .queue-banner {
  position: sticky; top: calc(env(safe-area-inset-top) + 64px); z-index: 9; width: max-content; max-width: calc(100% - 32px);
  margin: 10px auto 0; border-radius: 999px; padding: 8px 16px; box-shadow: 0 8px 24px rgba(20, 33, 61, .18);
  background: var(--pw-navy); color: #fff; font-size: .8rem; font-weight: 600;
}
.queue-banner { background: var(--pw-yellow); color: var(--pw-navy); }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .ticker-label i { animation: none; }
  .dock-indicator { transition: none; }
  .ticker-window { overflow-x: auto; }
}

/* "En direct" panel: computers only (phones get the marquee). */
.live-panel, .live-panel[hidden] { display: none; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pw-off); margin-right: 8px; vertical-align: 1px; animation: blink 1.2s infinite; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ---------- layout helpers (one column on phones) ---------- */
.layout-2 { display: grid; gap: 16px; }
.layout-2 > * { min-width: 0; }
.col-side > :first-child { margin-top: 0 !important; }
.about-grid { display: grid; gap: 14px; }

/* ---------- computers: a real desktop layout, not a stretched phone ---------- */
@media (min-width: 992px) {
  .app-container { max-width: 1180px; }

  /* Two-level header: blue service bar, then white bar with menu and action. */
  .header-top { padding: 7px 0; }
  .header-top .brand-mobile { display: none; }
  .quicklinks { display: flex; align-items: center; flex-wrap: wrap; }
  .quicklinks a { color: #fff; text-decoration: none; font-size: .8rem; font-weight: 500; padding: 0 12px; border-left: 1px solid rgba(255, 255, 255, .35); }
  .quicklinks a:first-child { padding-left: 0; border-left: 0; }
  .quicklinks a:hover { text-decoration: underline; }
  .header-main { display: block; background: var(--pw-card); border-bottom: 1px solid var(--pw-border); padding: 12px 0; }
  .header-main .brand { color: var(--pw-navy); font-size: 1.3rem; }
  .topnav { display: flex; gap: 4px; margin-left: 12px; }
  .topnav[hidden] { display: none; }
  .topnav a {
    position: relative; padding: 9px 14px; border-radius: 10px; text-decoration: none;
    color: var(--pw-navy); font-weight: 700; font-size: .9rem;
  }
  .topnav a:hover { background: var(--pw-blue-soft); color: var(--pw-blue); }
  .topnav a[aria-current="page"] { color: var(--pw-blue); }
  .topnav a[aria-current="page"]::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; border-radius: 2px; background: var(--pw-cyan);
  }
  #report-cta[hidden] { display: none; }
  .ticker { display: none !important; }
  .live-panel:not([hidden]) { display: block; margin-top: 18px; }
  .live-panel .section-title { margin-top: 0; }

  .tabbar { display: none !important; }
  body { padding-bottom: 0; }
  #view { padding-top: 36px; }
  .offline-banner, .queue-banner { top: 124px; }

  .page-title { font-size: 2.4rem; }
  .page-subtitle { font-size: 1rem; }

  /* Main column + side column that stays in view while scrolling. */
  .layout-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .col-side { position: sticky; top: 140px; }

  /* Lists of zones become a grid of cards. */
  .list-pw.cols {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
    background: none; border: 0; box-shadow: none; overflow: visible;
  }
  .list-pw.cols > a {
    background: var(--pw-card); border: 1px solid var(--pw-border); border-radius: 16px; box-shadow: var(--pw-shadow);
    transition: border-color .15s, transform .15s;
  }
  .list-pw.cols > a:hover { background: var(--pw-card); border-color: var(--pw-blue); transform: translateY(-2px); }

  .about-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }

  .hero { padding: 52px 48px; }
  .hero h1 { font-size: 3rem; }
  .hero p { font-size: 1.05rem; }
  .country-option { min-height: 190px; padding: 22px 24px; }
  .country-option .name { font-size: 1.7rem; }

  .stat-grid { gap: 16px; }
  .stat-tile { padding: 18px 20px; }
  .stat-value { font-size: 1.9rem; }
  .map-box { height: calc(100vh - 290px); }
}
@media (prefers-reduced-motion: reduce) { .list-pw.cols > a { transition: none; } }

/* ---------- sticky footer, styled like a public service site ---------- */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
#view { flex: 1 0 auto; width: 100%; }
.site-footer { margin-top: 48px; background: var(--pw-blue); color: #dbe6f7; font-size: .88rem; }
.footer-grid { display: grid; gap: 28px; padding-top: 36px; padding-bottom: 24px; }
.footer-grid h2 { font-size: .9rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #fff; margin-bottom: 12px; }
.footer-grid > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer-grid a { color: #fff; text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-brand .brand { font-size: 1.35rem; margin-bottom: 4px; }
.footer-brand .brand-logo { width: 40px; height: 40px; }
.footer-brand p { margin: 0 0 8px; color: #dbe6f7; }
.footer-brand .btn { width: 100%; max-width: 240px; }
.footer-box {
  margin: 0 0 28px; padding: 16px 20px; border-radius: 14px; text-align: center;
  background: var(--pw-navy); color: #e8eef8; font-weight: 600;
}
.footer-bottom {
  background: var(--pw-cyan); color: var(--pw-navy); font-weight: 700; font-size: .82rem;
  padding: 12px 0 calc(12px + var(--tabbar-height) + env(safe-area-inset-bottom) + 22px);
}
@media (min-width: 992px) { .footer-bottom { padding-bottom: 12px; } }
.footer-bottom a { color: var(--pw-navy); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1.3fr; } }
@media (min-width: 992px) { .site-footer { margin-top: 64px; } }

/* ---------- legal pages ---------- */
.legal { max-width: 860px; }
.legal-section + .legal-section { margin-top: 14px; }
.legal-section h2 { font-size: 1rem; font-weight: 800; color: var(--pw-navy); margin-bottom: 10px; }
.legal-section ul { margin: 0 0 8px; padding-left: 1.2rem; }
.legal-section li + li { margin-top: 6px; }

/* ---------- "use my position" helper ---------- */
.locate-helper { margin-top: 14px; padding: 14px 18px; }
.locate-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--pw-blue); text-decoration: none; text-align: left; }
.locate-toggle .icon { color: var(--pw-cyan); }
.locate-body { margin-top: 12px; }
.locate-body[hidden] { display: none; }
.locate-result { border-top: 1px solid var(--pw-border); padding-top: 14px; }
