/* PowaOn live map: a night view of Nigeria where light glows and darkness is deep.
   Glass materials and sheet behaviour follow iOS/Android conventions. */
:root {
  --bg: #04060c;
  --glass: rgba(14, 18, 30, 0.62);
  --glass-strong: rgba(14, 18, 30, 0.82);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-hi: rgba(255, 255, 255, 0.16);
  --text: #f2f4f8;
  --muted: #8d97ab;
  --lit: #ffc94d;
  --lit-2: #ff9f1c;
  --lit-glow: rgba(255, 186, 64, 0.55);
  --dark: #0a0f1f;
  --dark-edge: #2b3e6b;
  --cool: #7f97d8;
  --tg: #2aabee;
  --r-lg: 22px;
  --r-md: 14px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1); /* iOS sheet curve */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* Set from innerHeight by map.js: Android WebView resolves vh against its first, tiny layout. */
  --vh: 1vh;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Google Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

#map, #fx, .vignette { position: fixed; inset: 0; }
#fx { pointer-events: none; z-index: 1; }
.vignette {
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.muted { color: var(--muted); margin: 0; }
.small { font-size: 12.5px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  z-index: 3;
  top: calc(var(--safe-t) + 12px);
  left: 12px;
  right: 72px;
  max-width: 440px;
  height: 50px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
}
.logo {
  flex: none;
  width: 24px; height: 24px;
  fill: var(--lit);
  filter: drop-shadow(0 0 7px var(--lit-glow));
  animation: hum 3.4s ease-in-out infinite;
}
#search {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* no iOS zoom-on-focus */
}
#search::placeholder { color: var(--muted); }
#search::-webkit-search-cancel-button { filter: invert(0.7); }
.live {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 201, 77, 0.12);
  color: var(--lit);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--lit); box-shadow: 0 0 0 0 var(--lit-glow); animation: ping 2s var(--ease-out) infinite; }

.results {
  position: absolute;
  top: 58px; left: 0; right: 0;
  margin: 0; padding: 6px;
  list-style: none;
  border-radius: var(--r-md);
  background: var(--glass-strong);
  max-height: calc(var(--vh) * 50);
  overflow: auto;
  animation: drop 0.25s var(--ease-out);
}
.results li {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex; justify-content: space-between; gap: 12px;
}
.results li small { color: var(--muted); }
.results li[aria-selected="true"], .results li:hover { background: rgba(255, 255, 255, 0.07); }

/* ---------- floating buttons ---------- */
.fabs {
  position: fixed;
  z-index: 3;
  top: calc(var(--safe-t) + 12px);
  right: 12px;
  display: grid;
  gap: 10px;
}
.fab {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.25s var(--spring), background 0.2s;
}
.fab svg { width: 22px; height: 22px; fill: currentColor; }
.fab:active { transform: scale(0.92); }
.fab.busy svg { animation: spin 1s linear infinite; }

/* ---------- sheet ---------- */
.sheet {
  position: fixed;
  z-index: 4;
  left: 0; right: 0; bottom: 0;
  height: min(calc(var(--vh) * 78), 560px);
  padding: 0 18px calc(var(--safe-b) + 18px);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-bottom: 0;
  background: var(--glass-strong);
  transform: translateY(calc(100% - var(--peek, 168px)));
  transition: transform 0.5s var(--spring);
  touch-action: none;
  overflow: hidden;
}
.sheet[data-snap="half"] { transform: translateY(calc(100% - min(calc(var(--vh) * 56), 430px))); }
.sheet[data-snap="full"] { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet[data-snap="full"] .more, .sheet[data-snap="half"] .more { overflow: auto; }

.grabber { display: grid; place-items: center; height: 26px; cursor: grab; margin: 0 -18px; }
.grabber span { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.28); }

.hero { display: flex; align-items: center; gap: 14px; }
.hero h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.ring { position: relative; width: 58px; height: 58px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.5; }
.ring .track { stroke: var(--dark); }
.ring .arc {
  stroke: url(#none) var(--lit);
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: 119.4;
  filter: drop-shadow(0 0 4px var(--lit-glow));
  transition: stroke-dashoffset 1s var(--ease-out);
}
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.stats { display: flex; gap: 10px; margin-top: 14px; }
.stat {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
}
.stat b { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.stat small { grid-column: 2; color: var(--muted); font-size: 12px; margin-top: -2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; }
.dot.lit { background: var(--lit); box-shadow: 0 0 10px var(--lit-glow); }
.dot.dark { background: var(--dark); border: 1px solid var(--dark-edge); }

/* area card */
#area { animation: rise 0.4s var(--spring); }
.area-head { display: flex; justify-content: space-between; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge.lit { background: rgba(255, 201, 77, 0.14); color: var(--lit); }
.badge.dark { background: rgba(127, 151, 216, 0.13); color: var(--cool); }
.badge.mixed { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.close {
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer;
}
#area h2 { margin: 10px 0 2px; font-size: 26px; letter-spacing: -0.02em; }
#area h2.lit { color: var(--lit); text-shadow: 0 0 18px var(--lit-glow); }
#area h2.dark { color: #c3cff0; }
.actions { display: grid; gap: 8px; margin-top: 14px; }

.actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .row .btn + .btn { margin-top: 0; }

/* area report */
#area { height: calc(100% - 26px); overflow-y: auto; overscroll-behavior: contain; margin: 0 -18px; padding: 0 18px 24px; }
#area-body { display: grid; gap: 12px; margin-top: 16px; }
.card {
  padding: 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
}
.card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.card h3 { margin: 0; font-size: 15px; font-weight: 650; }

.timeline {
  position: relative;
  height: 26px;
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 6px, transparent 6px 12px);
  overflow: hidden;
}
.timeline i { position: absolute; top: 0; bottom: 0; }
.timeline i.lit { background: linear-gradient(180deg, #ffd56b, var(--lit-2)); box-shadow: 0 0 14px var(--lit-glow); }
.timeline i.dark { background: var(--dark); box-shadow: inset 0 0 0 1px var(--dark-edge); }
.timeline .now { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; border-radius: 1px; box-shadow: 0 0 8px #fff; }
.ticks { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11px; }

.card.empty { display: grid; gap: 8px; text-align: center; padding: 20px 16px 16px; }
.card.empty h3 { font-size: 17px; }
.card.empty p { margin: 0 0 6px; line-height: 1.45; }
.empty-street { display: flex; justify-content: center; gap: 12px; margin-bottom: 6px; }
.empty-street i { width: 34px; height: 30px; border-radius: 4px 4px 3px 3px; background: var(--dark); border: 1px solid var(--dark-edge); clip-path: polygon(50% 0, 100% 38%, 100% 100%, 0 100%, 0 38%); }
.empty-street i.lit { background: radial-gradient(circle at 50% 66%, #ffe7a3 0 16%, var(--dark) 17%); box-shadow: 0 0 22px var(--lit-glow); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { filter: brightness(1.35); } }
@media (prefers-reduced-motion: reduce) { .empty-street i.lit { animation: none; } }

/* "Light here now?": two big choices with a glowing status dot, then the last hour's tally. */
.card.tap { padding: 14px 14px 12px; }
#area-tap .card { margin: 14px 0 0; }
.card.tap p { margin: 2px 0 12px; }
.tap-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tap-choices button {
  display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--stroke-hi); background: rgba(255, 255, 255, 0.04);
  color: var(--text); font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
  transition: transform 0.15s var(--ease-out), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tap-choices button:active { transform: scale(0.96); }
.tap-choices button i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.tap-choices .on i { background: var(--lit); box-shadow: 0 0 10px var(--lit-glow); }
.tap-choices .off i { background: var(--cool); box-shadow: 0 0 10px rgba(127, 151, 216, 0.55); }
.tap-choices .on[aria-pressed="true"] { background: rgba(255, 201, 77, 0.16); border-color: var(--lit); box-shadow: 0 0 22px rgba(255, 186, 64, 0.25); color: var(--lit); }
.tap-choices .off[aria-pressed="true"] { background: rgba(127, 151, 216, 0.16); border-color: var(--cool); box-shadow: 0 0 22px rgba(127, 151, 216, 0.22); color: #c3d0f2; }
.tap-choices button:disabled { opacity: 0.6; cursor: progress; }
.tally { margin-top: 12px; }
.tally .bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.tally .bar i { display: block; transition: flex-grow 0.5s var(--ease-out); }
.tally .bar .on { background: linear-gradient(90deg, var(--lit-2), #ffd56b); }
.tally .bar .off { background: var(--cool); }
.tally p { margin: 7px 0 0; }
.tap .linkish { margin-top: 10px; }
.badge.reported { background: transparent; border: 1px dashed currentColor; }
.report-cta {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 12px 14px;
  border-radius: var(--r-md); border: 1px solid rgba(255, 201, 77, 0.35); background: rgba(255, 201, 77, 0.08);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: start; cursor: pointer;
}
.report-cta:active { transform: scale(0.98); }
.report-cta .pulse { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--lit); box-shadow: 0 0 0 0 var(--lit-glow); animation: ping 2s var(--ease-out) infinite; }
@media (prefers-reduced-motion: reduce) { .report-cta .pulse { animation: none; } }

/* "Promised supply here": the regulator's bands for the place, then every feeder's streets. */
.bands .chips-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.band-chip { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke); }
.band-chip b, .feeders .bl { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 15px; font-weight: 800; border: 2px solid var(--bc); color: var(--bc); box-shadow: 0 0 12px color-mix(in srgb, var(--bc) 35%, transparent); grid-row: span 2; }
.band-chip span { font-size: 13px; font-weight: 650; }
.band-chip small { color: var(--muted); font-size: 12px; }
.band-A { --bc: #ffc94d; } .band-B { --bc: #f0a35a; } .band-C { --bc: #9aa6c0; } .band-D { --bc: #7f97d8; } .band-E { --bc: #5b6b93; }
/* Promised vs real: a big measured number, a chip against the promise, 24 hour-ticks with the promise marked. */
.promise { margin: 0 0 14px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); }
.promise .pv span { margin-inline-start: 6px; }
.promise .pv b { font-size: 28px; font-weight: 800; color: var(--lit); text-shadow: 0 0 16px var(--lit-glow); }
.promise .pv span { color: var(--muted); font-size: 13px; }
.promise .pchip { display: table; margin-top: 6px; font-style: normal; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.promise .pchip.ok { background: rgba(255, 201, 77, 0.15); color: var(--lit); }
.promise .pchip.under { background: rgba(127, 151, 216, 0.16); color: #c3d0f2; }
.promise .t24 { position: relative; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin: 30px 0 6px; }
.promise .t24 i { height: 14px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); }
.promise .t24 i.on { background: linear-gradient(180deg, #ffd56b, var(--lit-2)); box-shadow: 0 0 6px var(--lit-glow); }
.promise .t24 b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #fff; border-radius: 1px; box-shadow: 0 0 6px #fff; }
.promise .t24 b span { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; color: #fff; }
.promise small { color: var(--muted); font-size: 12px; }
.promise .linkish { display: inline-block; margin-top: 8px; padding: 0; }
.bands .short { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(127, 151, 216, 0.1); border: 1px solid rgba(127, 151, 216, 0.25); font-size: 13px; line-height: 1.4; }
.bands details { margin-top: 12px; }
.bands summary { cursor: pointer; color: var(--lit); font-size: 14px; font-weight: 600; list-style: none; }
.bands summary::-webkit-details-marker { display: none; }
.bands summary::after { content: ' ›'; display: inline-block; transition: transform 0.2s var(--ease-out); }
.bands details[open] summary::after { transform: rotate(90deg); }
.feeders { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.feeders li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13px; line-height: 1.4; }
.feeders .bl { width: 24px; height: 24px; font-size: 12px; border-width: 1.5px; }
.feeders small { display: block; color: var(--cool); margin-top: 2px; }
.bands .src { margin: 12px 0 0; }
.bands .src a { color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  display: grid;
}
.tile b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.tile small { color: var(--muted); font-size: 12px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 104px; }
.day { display: grid; grid-template-rows: 1fr auto; gap: 4px; text-align: center; }
.day small { color: var(--muted); font-size: 11px; }
.col { display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.03); }
.col i { display: block; transition: height 0.8s var(--ease-out); }
.col i.lit { background: linear-gradient(0deg, var(--lit-2), #ffd56b); box-shadow: 0 0 10px var(--lit-glow); }
.col i.dark { background: var(--dark); }

.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 34px; }
.hours i {
  border-radius: 3px;
  background: rgb(255 201 77 / calc(0.08 + var(--a) * 0.92));
  box-shadow: 0 0 calc(var(--a) * 10px) rgb(255 186 64 / calc(var(--a) * 0.6));
}

/* Arabic: the page flows right to left, but time still runs left to right on charts. */
[dir="rtl"] .timeline, [dir="rtl"] .ticks, [dir="rtl"] .week, [dir="rtl"] .hours { direction: ltr; }
[dir="rtl"] .grabber { margin: 0 -18px; }

.nearby { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.nearby .dot { width: 8px; height: 8px; }

.skeleton {
  height: 56px; border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton.short { height: 80px; }
.skeleton.tall { height: 130px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* "You are here": the iOS/Android blue dot */
/* your street: a gold pin with a soft breathing halo and a label */
.home-pin { position: relative; width: 26px; height: 34px; pointer-events: none; }
.home-pin i { position: absolute; left: 50%; bottom: -14px; width: 64px; height: 28px; margin-left: -32px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 201, 77, 0.55), rgba(255, 201, 77, 0)); animation: home-halo 2.6s ease-in-out infinite; }
.home-pin b { position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: radial-gradient(circle at 50% 50%, #fff6d8 0 22%, var(--lit) 24%); border: 2px solid #fff; box-shadow: 0 0 18px var(--lit-glow), 0 4px 10px rgba(0, 0, 0, 0.5); }
.home-pin span { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); white-space: nowrap; padding: 3px 9px; border-radius: 999px;
  background: rgba(10, 14, 26, 0.85); border: 1px solid rgba(255, 201, 77, 0.5); color: var(--lit); font-size: 12px; font-weight: 700; }
@keyframes home-halo { 0%, 100% { transform: scale(0.8); opacity: 0.7; } 50% { transform: scale(1.25); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .home-pin i { animation: none; } }
.me { width: 16px; height: 16px; border-radius: 50%; background: #3d8bff; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(61, 139, 255, 0.5); animation: me 2s infinite; }
@keyframes me { 0% { box-shadow: 0 0 0 0 rgba(61, 139, 255, 0.5); } 100% { box-shadow: 0 0 0 18px rgba(61, 139, 255, 0); } }

.more { margin-top: 16px; max-height: calc(100% - 150px); }
#area:not([hidden]) ~ .more { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit; font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s var(--spring), background 0.2s;
}
.chip:active { transform: scale(0.95); }
.chip:hover { background: rgba(255, 255, 255, 0.1); }

/* From space: a glass card with the night's date big on the left and a slider of nights on the right. */
.space {
  position: fixed; z-index: 6; top: calc(var(--safe-t) + 72px); left: 12px; right: 72px; max-width: 460px;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center;
  padding: 12px 14px 10px; border-radius: var(--r-lg);
}
.space[hidden] { display: none; }
.sp-date { display: grid; justify-items: center; min-width: 62px; padding-inline-end: 12px; border-inline-end: 1px solid var(--stroke); }
.sp-date b { font-size: 30px; line-height: 1; font-weight: 800; color: var(--lit); text-shadow: 0 0 16px var(--lit-glow); }
.sp-date span { font-size: 12px; font-weight: 650; margin-top: 2px; white-space: nowrap; }
.sp-date small { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; }
.sp-head { display: flex; align-items: center; justify-content: space-between; }
.sp-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); text-transform: uppercase; }
.sp-x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.sp-row { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 6px; margin-top: 4px; }
.sp-step { height: 28px; border-radius: 50%; border: 1px solid var(--stroke-hi); background: rgba(255, 255, 255, 0.05); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.sp-step:disabled { opacity: 0.35; cursor: default; }
#sp-range { width: 100%; accent-color: var(--lit); height: 28px; }
.sp-stops { display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; }
.sp-stops button { border: 0; background: none; padding: 2px 0; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.sp-stops button[aria-current="true"] { color: var(--lit); }
.sp-note { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.fab[aria-pressed="true"] { background: rgba(255, 201, 77, 0.18); color: var(--lit); box-shadow: 0 0 18px rgba(255, 186, 64, 0.35); }
@media (min-width: 900px) { .space { left: auto; right: 76px; } }

/* Light league */
.league { margin-bottom: 16px; }
.league ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.league li button {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 26px 1fr 72px 42px;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.league li button:hover { background: rgba(255, 255, 255, 0.05); }
.league .rank { color: var(--muted); font-size: 13px; text-align: center; }
.league li:first-child .rank { color: var(--lit); font-weight: 700; }
.league .flag { font-size: 18px; line-height: 1; }
.league .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league .lbar { height: 6px; border-radius: 3px; background: var(--dark); overflow: hidden; }
.league .lbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lit-2), var(--lit)); box-shadow: 0 0 8px var(--lit-glow); transition: width 0.8s var(--ease-out); }
.league b { text-align: end; font-size: 14px; }
/* Light across Africa: one country's power beside its neighbours'. */
.africa .seg { display: flex; gap: 4px; padding: 3px; margin-bottom: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); }
.africa .seg button { flex: 1; min-height: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.2s, color 0.2s; }
.africa .seg button[aria-selected="true"] { background: rgba(255, 201, 77, 0.16); color: var(--lit); }
.africa .insight { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.africa li { display: grid; grid-template-columns: 22px 24px 1fr 48px 82px; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 10px; }
.africa li.me { background: rgba(255, 201, 77, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 201, 77, 0.35); }
.africa li.gap { display: block; padding: 0 6px; color: var(--muted); line-height: 1; }
.africa li:first-child .rank { color: var(--muted); font-weight: 400; }
.africa b { font-size: 13px; white-space: nowrap; }
.africa .yr { color: var(--muted); font-weight: 400; font-size: 11px; }
.africa .src { margin: 8px 0 0; }
.africa.lower .lbar i { background: linear-gradient(90deg, #5b6b93, var(--cool)); box-shadow: none; }
.linkish { margin-top: 6px; border: 0; background: none; color: var(--lit); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0; font-size: 13px; color: var(--muted); }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.lit { background: var(--lit); box-shadow: 0 0 10px var(--lit-glow); }
.sw.mixed { background: linear-gradient(90deg, var(--lit) 50%, var(--dark) 50%); }
.sw.dark { background: var(--dark); border: 1px solid var(--dark-edge); }
.sw.none { border: 1px dashed #4a5368; }
.sw.band { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--lit); color: var(--lit); font-size: 9px; font-weight: 800; line-height: 13px; text-align: center; vertical-align: -3px; }
.sw.tap { background: radial-gradient(circle, var(--lit) 1.2px, transparent 1.6px) 0 0 / 5px 5px; border: 1px dashed rgba(255, 201, 77, 0.6); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke-hi);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: inherit; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--spring), filter 0.2s;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.12); }
.btn.telegram { background: var(--tg); border-color: transparent; color: #fff; box-shadow: 0 8px 24px rgba(42, 171, 238, 0.3); }
.btn.ghost { background: transparent; border-color: rgba(255, 201, 77, 0.45); color: var(--lit); margin-top: 8px; }
.btn.whatsapp { background: #25d366; border-color: transparent; color: #04210f; box-shadow: 0 8px 24px rgba(37, 211, 102, 0.25); }
.btn:focus-visible, .chip:focus-visible, .fab:focus-visible, .grabber:focus-visible { outline: 2px solid var(--lit); outline-offset: 2px; }
.foot { margin-top: 14px; text-align: center; }
.foot a { color: var(--muted); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: calc(var(--safe-t) + 72px);
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  max-width: calc(100vw - 32px);
  text-align: center;
  animation: drop 0.35s var(--spring);
}

/* ---------- MapLibre chrome ---------- */
.maplibregl-ctrl-attrib { background: rgba(4, 6, 12, 0.55) !important; color: var(--muted); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--peek, 168px) - 4px); transition: bottom 0.5s var(--spring); }

/* ---------- wide screens: the sheet becomes a floating side card (Apple Maps on iPad/Mac) ---------- */
@media (min-width: 900px) {
  .topbar { left: 20px; right: auto; width: 380px; top: 20px; }
  .fabs { top: 20px; right: 20px; }
  .sheet {
    left: 20px; right: auto; bottom: auto;
    top: 82px;
    width: 380px;
    height: auto;
    max-height: calc(var(--vh) * 100 - 110px);
    border-radius: var(--r-lg);
    border-bottom: 1px solid var(--stroke);
    padding: 18px;
    transform: none !important;
    overflow: auto;
  }
  .grabber { display: none; }
  .more { max-height: none; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}

@keyframes hum { 0%, 100% { filter: drop-shadow(0 0 5px var(--lit-glow)); } 50% { filter: drop-shadow(0 0 12px var(--lit-glow)); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 201, 77, 0.6); } 80%, 100% { box-shadow: 0 0 0 8px rgba(255, 201, 77, 0); } }
@keyframes drop { from { opacity: 0; transform: translate(var(--tx, 0), -6px); } to { opacity: 1; transform: translate(var(--tx, 0), 0); } }
.toast { --tx: -50%; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

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

/* "Usually back in about 2h" under an outage's title. */
.eta {
  display: inline-block;
  margin: 8px 0 0;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lit);
  background: rgba(255, 201, 77, 0.1);
  border: 1px solid rgba(255, 201, 77, 0.25);
}
.eta[hidden] { display: none; }
/* National grid collapse banner: under the search bar, impossible to miss, still calm. */
.grid-alert {
  position: fixed;
  top: calc(var(--safe-t) + 74px);
  left: 12px;
  right: 76px; /* clear of the round buttons on the right */
  z-index: 3;
  max-width: 560px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 107, 97, 0.45);
  background: rgba(60, 12, 10, 0.82);
  color: #ffd9d5;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.grid-alert[hidden] { display: none; }

/* When light usually comes */
.usual { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 201, 77, 0.08); border: 1px solid rgba(255, 201, 77, 0.22); color: var(--lit); font-weight: 650; font-size: 14px; }
.usual i { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--lit); box-shadow: 0 0 10px var(--lit-glow); }

/* Today's league: score, meter, podium */
.league .score { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.league .score b { font-size: 30px; font-weight: 800; color: var(--lit); text-shadow: 0 0 16px var(--lit-glow); }
.league .meter { flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.league .meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lit-2), #ffd56b); box-shadow: 0 0 12px var(--lit-glow); }
.league .lt { margin: 14px 0 8px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; }
.pod { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.pod small { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod b { font-size: 15px; }
.pod i { display: grid; place-items: center; width: 100%; border-radius: 12px 12px 4px 4px; font-style: normal; font-weight: 800; font-size: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--stroke); }
.pod.p1 i { height: 74px; background: linear-gradient(180deg, rgba(255, 201, 77, 0.35), rgba(255, 159, 28, 0.08)); border-color: rgba(255, 201, 77, 0.5); color: var(--lit); box-shadow: 0 0 24px rgba(255, 186, 64, 0.25); }
.pod.p2 i { height: 54px; }
.pod.p3 i { height: 40px; }
.ranks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.ranks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); font-size: 13px; }
.ranks li span { color: var(--muted); }
.league .btn { margin-top: 14px; }

/* Complaint helper: numbered steps */
.complain { margin: 0 0 14px; border-radius: 12px; border: 1px solid rgba(255, 120, 90, 0.28); background: rgba(255, 120, 90, 0.06); }
.complain summary { cursor: pointer; padding: 12px; font-weight: 700; font-size: 14px; }
.complain .owed { margin: 0 12px 10px; font-size: 13px; }
.complain .steps { list-style: none; counter-reset: s; margin: 0; padding: 0 12px; display: grid; gap: 12px; }
.complain .steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; row-gap: 6px; align-items: start; }
.complain .steps li::before { content: counter(s); grid-row: span 3; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: 13px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke); }
.complain .steps b { font-size: 13px; }
.complain .links { display: flex; flex-wrap: wrap; gap: 6px; }
.complain .links .btn { flex: 0 1 auto; padding: 8px 12px; font-size: 13px; }
.complain > .muted { margin: 10px 12px 12px; }
.complain .linkish { justify-self: start; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* Language switch: each language named in itself */
.langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 0; }
.langs a { padding: 5px 11px; border-radius: 999px; font-size: 12px; color: var(--muted); text-decoration: none; border: 1px solid var(--stroke); }
.langs a[aria-current] { color: var(--lit); border-color: rgba(255, 201, 77, 0.5); background: rgba(255, 201, 77, 0.08); }

/* Search: NERC streets with their band, OpenStreetMap places, and the look-up row */
.results li.hit-band, .results li.hit-geo { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; }
.results li.hit-band span, .results li.hit-geo span { display: grid; min-width: 0; }
.results li.hit-band .bl { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 800; border: 2px solid var(--bc); color: var(--bc); }
.results li.hit-geo i { font-style: normal; text-align: center; color: var(--muted); font-size: 18px; }
.results li.hit-more { color: var(--lit); font-weight: 650; }
.results li.hit-band span small, .results li.hit-geo span small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
