/* ZimWatt public website */
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.site-head { background: var(--charcoal); color: #fff; }
.site-head .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand .wordmark { font-size: 1.45rem; }
.site-nav { display: flex; gap: .2rem; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: #c9d3dc; text-decoration: none; padding: .55rem .7rem; border-radius: var(--r-1); font-weight: 600; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / .08); }
.theme-btn { background: none; border: 1px solid rgb(255 255 255 / .25); color: #fff; border-radius: var(--r-1); width: 40px; height: 40px; cursor: pointer; font-size: 1rem; }
.menu-toggle { display: none; }
/* "Report" is the one action that matters during an outage: always visible, also on phones */
.report-cta { order: 2; display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: var(--r-1);
  background: var(--brand-lime); color: var(--brand-night); font-weight: 800; text-decoration: none; font-family: var(--display); font-stretch: 112%; }
.report-cta:hover, .report-cta[aria-current="page"] { background: var(--brand-yellow); }
.site-nav { order: 1; }
.theme-btn { order: 3; }
@media (max-width: 760px) {
  .site-head .wrap { flex-wrap: wrap; padding-block: .5rem; gap: .6rem; }
  .report-cta { order: 1; margin-left: auto; }
  .menu-toggle { order: 2; display: inline-flex; align-items: center; background: none; border: 1px solid rgb(255 255 255 / .25); color: #fff; border-radius: var(--r-1); min-height: 40px; padding: 0 .8rem; font: 600 .95rem var(--body); cursor: pointer; }
  .theme-btn { order: 3; }
  .site-nav { order: 4; }
  .site-nav { display: none; width: 100%; flex-direction: column; margin: 0; padding-bottom: .5rem; }
  .site-nav.open { display: flex; }
}

main { display: block; }
.page { padding: 3rem 0 4rem; }
.prose { max-width: 68ch; }
.prose h1 { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.05; margin: 0 0 1rem; }
.prose h2 { font-family: var(--display); font-stretch: 105%; font-weight: 700; font-size: 1.35rem; margin: 2.2rem 0 .5rem; }
.prose p, .prose li { color: var(--ink-2); }
.prose .lead { font-size: 1.15rem; color: var(--ink); }
.about-banner { display: block; width: 100%; height: auto; border-radius: var(--r-2); margin: .5rem 0 1.5rem; background: #171d25; }
.note { border-left: 4px solid var(--s-unconfirmed); background: var(--surface); padding: .9rem 1.1rem; border-radius: 0 var(--r-1) var(--r-1) 0; margin: 1.25rem 0; }
.note.independent { border-left-color: var(--charcoal); }
[data-theme="dark"] .note.independent { border-left-color: var(--ink-3); }


.site-foot { background: var(--charcoal); color: #aeb9c4; padding: 2.5rem 0 3rem; font-size: .9rem; }
.site-foot a { color: #e6f2ec; }
.site-foot .cols { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.site-foot nav { display: grid; gap: .35rem; align-content: start; }
@media (max-width: 760px) { .site-foot .cols { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
details.qa { border-bottom: 1px solid var(--line); padding: .9rem 0; }
details.qa summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style-position: outside; }
details.qa p { margin: .6rem 0 0; }

/* ---------- forms (delete account) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: 1.5rem; max-width: 520px; margin: 1.5rem 0; }
.panel h2 { margin-top: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; margin-bottom: 1rem; }
.seg button { border: 0; background: none; padding: .6rem 1rem; font: 600 .95rem var(--body); color: var(--ink-2); cursor: pointer; min-height: 42px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.msg { padding: .75rem 1rem; border-radius: var(--r-1); margin: 1rem 0; }
.msg.ok { background: var(--action-soft); }
.msg.err { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.code-input { font-family: var(--display) !important; font-stretch: 115%; font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; }

/* ---------- map page ---------- */
body.map-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.map-page main { flex: 1 1 auto; position: relative; min-height: 0; }
.map-shell { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; background: var(--line-2); }
.map-sheet { position: absolute; z-index: 2; left: 1rem; top: 1rem; bottom: 1rem; width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow); display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; }
.map-sheet header { padding: 1rem 1rem .5rem; }
.map-sheet h1 { font-family: var(--display); font-stretch: 112%; font-size: 1.35rem; margin: 0; line-height: 1.1; }
.map-sheet .sub { color: var(--ink-3); font-size: .85rem; margin: .25rem 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem; padding: .25rem 1rem .75rem; border-bottom: 1px solid var(--line); }
.outage-list { list-style: none; margin: 0; padding: 0; overflow: auto; }
.outage-list li { padding: .85rem 1rem; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.outage-list li:hover, .outage-list li.sel { background: var(--action-soft); }
.outage-list .row1 { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.outage-list .conf { font-family: var(--display); font-stretch: 115%; font-weight: 800; font-size: 1.15rem; }
.outage-list p { margin: .35rem 0 0; font-size: .88rem; color: var(--ink-2); }
.map-sheet footer { padding: .7rem 1rem; font-size: .78rem; color: var(--ink-3); border-top: 1px solid var(--line); }
.empty-list { padding: 1rem; color: var(--ink-2); font-size: .92rem; }
@media (max-width: 760px) {
  .map-sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 46%; border-radius: var(--r-2) var(--r-2) 0 0; }
}
.maplibregl-popup-content { font-family: var(--body); color: #1b2420; border-radius: 8px; }

/* ---------- shared bits for signed-in pages ---------- */
.btn-wide { width: 100%; }
.btn-small { min-height: 38px; padding: .5em .85em; font-size: .88rem; }
.btn-quiet { border-color: transparent; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn-danger-outline { border-color: var(--danger); color: var(--danger); }
.linkish { background: none; border: 0; padding: .5rem 0; font: 600 .92rem var(--body); color: var(--action); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.linkish[disabled] { color: var(--ink-3); text-decoration: none; cursor: default; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .25rem 0 1rem; font-size: .95rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: .1rem 0 0; flex: none; accent-color: var(--action); }
.faint { color: var(--ink-3); }
.row { display: flex; gap: .5rem; align-items: center; }
.wrap-row { flex-wrap: wrap; }

/* ---------- sign in ---------- */
.auth-page { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 340px); gap: 4rem; align-items: start; }
.auth h1 { font-size: clamp(2.1rem, 6vw, 3rem); margin: 0 0 .75rem; }
.auth-lead { color: var(--ink-2); margin: 0 0 1.5rem; font-size: 1.05rem; }
.auth h2 { font-family: var(--display); font-stretch: 110%; margin: 0 0 .25rem; }
.auth form { margin-top: .5rem; }
.sent-to { background: var(--action-soft); padding: .8rem 1rem; border-radius: var(--r-1); margin: 0 0 1rem; }
.auth-alt { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .5rem; }
.auth-side { border-top: 4px solid var(--brand-lime); padding-top: 1rem; color: var(--ink-2); font-size: .95rem; margin-top: 4.2rem; }
.auth-side h2 { font-size: 1.05rem; margin: 0 0 .5rem; color: var(--ink); }
@media (max-width: 860px) { .auth-page { grid-template-columns: 1fr; gap: 2rem; } .auth-side { margin-top: 0; } .page.auth-page { padding-top: 1.75rem; } }

/* ---------- report: map under a fixed pin ---------- */
#rmap { position: absolute; inset: 0; background: var(--line-2); }
.pin-anchor { position: absolute; z-index: 1; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
/* exact reported point: a small dot under the pin tip */
.pin-anchor::after { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-lime); border: 2px solid var(--brand-night); }
/* 44px square rotated -45deg: its square corner (the tip) lies 31px below its centre, so top = -(22+31) */
.pin { position: absolute; left: -22px; top: -53px; width: 44px; height: 44px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--brand-night); border: 3px solid var(--brand-lime);
  box-shadow: 0 6px 14px rgb(0 0 0 / .35); display: grid; place-items: center; pointer-events: none; }
.pin img { transform: rotate(45deg); }
.locate-btn { position: absolute; z-index: 2; top: .75rem; left: .75rem; min-height: 44px; padding: 0 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .95rem var(--body); box-shadow: var(--shadow); cursor: pointer; }
.report-sheet { position: absolute; z-index: 2; right: 1rem; top: 1rem; width: 400px; max-height: calc(100% - 2rem); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow); padding: 1.1rem 1.1rem .8rem; }
.grab { display: none; }
.sheet-title { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.35rem; line-height: 1.1; margin: 0 0 .3rem; }
.sheet-hint { color: var(--ink-2); font-size: .9rem; margin: 0 0 .8rem; }
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .9rem; }
.kind { --c: var(--s-unknown); min-height: 64px; padding: .6rem .75rem; border-radius: var(--r-1); border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); font: 800 1.02rem var(--display); font-stretch: 108%; text-align: left; cursor: pointer; display: flex; align-items: center; gap: .55rem; }
.kind::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.kind[aria-checked="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: inset 0 0 0 1px var(--c); }
.k-off { --c: var(--s-high); }
.k-on { --c: var(--s-on); }
.k-low { --c: var(--s-unconfirmed); }
.k-flicker { --c: var(--s-likely); }
.since { border: 0; padding: 0; margin: 0 0 .6rem; }
.since legend { font-weight: 700; font-size: .9rem; margin-bottom: .35rem; padding: 0; }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pills span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--line); font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.pills input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pills input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.street-tools { margin: .2rem 0 .6rem; }
.street-tools .check { margin-bottom: .4rem; font-size: .9rem; }
.send { margin-top: .2rem; min-height: 52px; font-size: 1.02rem; }
.result-lines { padding-left: 1.1rem; margin: .5rem 0 1rem; color: var(--ink-2); }
.result-lines li { margin: .25rem 0; }
.save-place { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.sheet-foot { font-size: .76rem; color: var(--ink-3); margin: .75rem 0 0; }
@media (max-width: 760px) {
  .report-sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 62%; border-radius: 16px 16px 0 0; padding: .4rem 1rem calc(.8rem + env(safe-area-inset-bottom)); }
  .grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: .2rem auto .6rem; }
  .kind { min-height: 54px; font-size: .98rem; }
  .sheet-foot { display: none; }
  .locate-btn { top: .6rem; left: .6rem; }
}

/* ---------- map popup actions ---------- */
.pop-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.pop-actions .btn { font-size: .82rem; min-height: 36px; }
.pop-note { width: 100%; margin: .2rem 0 0; font-size: .82rem; }
.maplibregl-popup-content .btn { color: #1b2420; background: #fff; border-color: #cfd6d2; }
.maplibregl-popup-content .btn-primary { background: #3a7d0a; border-color: #3a7d0a; color: #fff; }
.maplibregl-popup-content .btn-quiet { background: none; border-color: transparent; color: #44514b; }

/* ---------- my account ---------- */
.account h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0 0 .3rem; }
.acct-head { display: grid; gap: .4rem; justify-items: start; margin-bottom: 1.5rem; }
.acct-head p { margin: 0 0 .5rem; }
.acct-sec { border-top: 1px solid var(--line); padding: 1.4rem 0; max-width: 760px; }
.acct-sec h2 { font-family: var(--display); font-stretch: 110%; font-size: 1.25rem; margin: 0 0 .7rem; }
.reports, .places, .devices { list-style: none; padding: 0; margin: 0 0 .8rem; }
.reports li, .places li, .devices li { display: flex; align-items: center; gap: .6rem; padding: .7rem 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.r-main { flex: 1 1 220px; min-width: 0; }
.reports a.chip { text-decoration: none; }
.empty-row { color: var(--ink-2); }
.inline-form { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; max-width: 560px; }
.inline-form .field { flex: 1 1 260px; margin: 0; }
.account .note { max-width: 760px; }
.account .note p { margin: .2rem 0 .6rem; }

/* ---------- phones: one-line header, more room for the map list ---------- */
@media (max-width: 760px) {
  .site-head .wrap { width: calc(100% - 1.5rem); gap: .45rem; min-height: 58px; }
  .brand .wordmark { font-size: 1.25rem; }
  .brand img { width: 28px; height: 28px; }
  .report-cta { padding: 0 .85rem; }
  .menu-toggle { padding: 0 .7rem; }
  .legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .6rem; }
  .legend::-webkit-scrollbar { display: none; }
}
@media (max-width: 360px) { .brand .wordmark { display: none; } }

/* street mode feedback */
.street-info { font-size: .88rem; font-weight: 700; margin: -.4rem 0 .6rem; color: var(--ink); }
.street-info:empty { display: none; }
.street-info.warn { color: var(--danger); }

/* ---------- people-count bubbles (map + report map) ---------- */
.bubble-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.report-page .bubble-btn { pointer-events: none; }
.bubble { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .5rem .18rem .4rem; border-radius: 999px;
  font: 800 .92rem/1 var(--display); font-stretch: 110%; color: #fff; background: var(--c, var(--s-high));
  box-shadow: 0 2px 6px rgb(0 0 0 / .3); border: 2px solid #fff; white-space: nowrap; }
.bubble-btn .bubble { position: relative; }
.bubble-btn .bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -5px; border: 5px solid transparent;
  border-top-color: #fff; border-bottom: 0; }
.bubble .bpart { display: inline-flex; align-items: center; gap: .18rem; }
.bubble .bi { width: 15px; height: 15px; flex: none; }
.bubble.is-off { --c: var(--s-high); }
.bubble.is-off.st-unconfirmed_outage { --c: #b97f00; }
.bubble.is-off.st-likely_outage { --c: var(--s-likely); }
.bubble.is-on { --c: #0e9f6e; }
.bubble.is-mixed { --c: var(--s-conflict); }
.bubble-btn:hover .bubble, .bubble-btn:focus-visible .bubble { transform: scale(1.08); }
.outage-list .row1 .bubble { box-shadow: none; border-width: 0; font-size: .85rem; }
.outage-list .row1 { justify-content: flex-start; }
.outage-list .row1 .conf { margin-left: auto; }
.people { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-top: .35rem; }
.people .bi { width: 17px; height: 17px; color: var(--ink-2); }
.maplibregl-popup-content .people, .maplibregl-popup-content .people .bi { color: #44514b; }

/* ---------- report: what to mark, details, places ---------- */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; margin-bottom: .6rem; }
.modes button { border: 0; background: var(--surface); color: var(--ink-2); font: 700 .9rem var(--body); min-height: 42px; cursor: pointer; }
.modes button + button { border-left: 1px solid var(--line); }
.modes button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.places-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0 0 .6rem; font-size: .88rem; }
.place-chip { border: 1px solid var(--line); cursor: pointer; min-height: 34px; font: 700 .88rem var(--body); background: #fff5c4; color: #171d25; }
.place-chip::before { --c: #ffd21f; }
.place-tag { font: 700 .75rem var(--body); background: #ffd21f; color: #171d25; padding: .1rem .4rem; border-radius: 4px; border: 1px solid #171d25; pointer-events: none; }
details.more { border: 1px solid var(--line); border-radius: var(--r-1); padding: .2rem .8rem; margin: 0 0 .8rem; }
details.more summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; gap: .4rem; }
details.more[open] { padding-bottom: .6rem; }
details.more .field { margin-bottom: .7rem; }
details.more textarea { font: 400 1rem var(--body); padding: .6em .7em; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--ink); width: 100%; resize: vertical; }
details.more .check .hint { display: block; font-weight: 400; color: var(--ink-3); font-size: .85rem; }
.privacy-note { font-size: .85rem; color: var(--ink-2); background: var(--action-soft); border-radius: var(--r-1); padding: .6rem .75rem; margin: 0 0 1rem; }

/* ---------- what people said (map popup) ---------- */
.voices { list-style: none; padding: 0; margin: .6rem 0 0; max-height: 180px; overflow: auto; border-top: 1px solid #e3e8e5; }
.voices li { padding: .4rem 0; border-bottom: 1px solid #eef1ef; font-size: .82rem; }
.voices .who { font-weight: 800; }
.voices .what { color: #44514b; }
.voices q { display: block; margin-top: .15rem; quotes: "\201C" "\201D"; color: #1b2420; }
.fault-refs { font-size: .8rem; margin-top: .4rem; color: #1b2420; }

/* outage popup: never taller than the clear part of a phone screen; scrolls inside */
.maplibregl-popup-content { max-height: min(36vh, 330px); overflow: auto; overscroll-behavior: contain; }
.voices { max-height: none; }

/* ---------- patterns: most common fault refs / comments ---------- */
.bubble-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.bref { font: 700 .68rem/1.2 var(--body); background: #171d25; color: #ffd21f; padding: .1rem .35rem; border-radius: 4px;
  border: 1px solid #ffd21f; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.patterns { margin-top: .45rem; display: grid; gap: .3rem; }
.prow { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.plabel { font-size: .72rem; font-weight: 700; color: var(--ink-3); margin-right: .15rem; }
.pchip { font-size: .78rem; padding: .1rem .45rem; border-radius: 999px; background: var(--line-2); color: var(--ink);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip.many { background: #fff1b8; color: #171d25; font-weight: 700; }
.maplibregl-popup-content .plabel { color: #6b7872; }
.maplibregl-popup-content .pchip { background: #e8ece9; color: #1b2420; }
.maplibregl-popup-content .pchip.many { background: #fff1b8; }
.fault-refs { font-weight: 700; }

/* ---------- live numbers, top left of the header ---------- */
.site-head .wrap { position: relative; }
.live { order: 0; display: inline-flex; align-items: center; gap: .15rem; background: rgb(255 255 255 / .06);
  border: 1px solid rgb(255 255 255 / .14); border-radius: 999px; padding: .25rem .35rem; color: #c9d3dc; cursor: pointer;
  font: 600 .8rem var(--body); white-space: nowrap; }
.live:hover, .live[aria-expanded="true"] { background: rgb(255 255 255 / .12); color: #fff; }
.lv { display: inline-flex; align-items: center; gap: .25rem; padding: 0 .45rem; }
.lv + .lv { border-left: 1px solid rgb(255 255 255 / .16); }
.lv b { color: #fff; font: 800 .9rem var(--display); font-stretch: 110%; }
.lv-out b { color: #ff8a80; }
.lv-on b { color: var(--brand-lime); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-lime); box-shadow: 0 0 0 0 rgb(143 212 0 / .6); animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgb(143 212 0 / .6); } 70% { box-shadow: 0 0 0 6px rgb(143 212 0 / 0); } 100% { box-shadow: 0 0 0 0 rgb(143 212 0 / 0); } }
.lv b.bump { animation: bump .6s ease-out; }
@keyframes bump { 0% { transform: translateY(-3px); color: var(--brand-yellow); } 100% { transform: none; } }
.live-panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(340px, calc(100vw - 1.5rem));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.live-panel h2 { font-family: var(--display); font-stretch: 110%; font-size: 1.1rem; margin: 0 0 .6rem; }
.live-panel dl { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; margin: 0 0 .6rem; font-size: .9rem; }
.live-panel dt { color: var(--ink-2); }
.live-panel dd { margin: 0; font-weight: 800; text-align: right; }
.live-panel p { font-size: .78rem; margin: 0 0 .6rem; }
@media (max-width: 760px) {
  .live { order: 5; width: 100%; justify-content: center; margin: 0 0 .1rem; padding: .2rem; }
  .live-panel { top: calc(100% + 2px); }
}

/* ---------- substations: top-left map tools ---------- */
.map-tools { position: absolute; z-index: 3; top: 1rem; left: calc(360px + 2rem); display: flex; gap: .4rem; flex-wrap: wrap; }
.tool { min-height: 40px; padding: 0 .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: 700 .88rem var(--body); box-shadow: var(--shadow); cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.tool[aria-pressed="true"] { background: var(--brand-night); color: #fff; border-color: var(--brand-night); }
.tool-ico { width: 14px; height: 14px; border-radius: 3px; background: #ffd21f; border: 2px solid #171d25; }
.tool[aria-pressed="true"] .tool-ico { border-color: #ffd21f; background: #171d25; }
.sub-btn { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; }
.sub-ico { width: 26px; height: 26px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .45)); }
.sub-ico.sub-transformer { width: 20px; height: 20px; }
.sub-bg { fill: #171d25; stroke: #ffd21f; stroke-width: 2; }
.sub-bolt { fill: #ffd21f; }
.sub-pending .sub-bg { fill: #fff; stroke: #171d25; stroke-dasharray: 3 2; }
.sub-pending .sub-bolt { fill: #171d25; }
.sub-card { font-size: .85rem; display: grid; gap: .3rem; }
.btn.chosen { outline: 3px solid #ffd21f; }
.pin-sub { border-color: #ffd21f; }
.sub-place { position: absolute; z-index: 4; top: 1rem; left: calc(360px + 2rem); width: min(340px, calc(100% - 2rem));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); box-shadow: var(--shadow); padding: .9rem 1rem; }
.sub-place h2 { font-family: var(--display); font-stretch: 110%; font-size: 1.1rem; margin: 0 0 .2rem; }
.sub-place .field { margin: .5rem 0; }
.small { font-size: .8rem; }
.msg-inline { color: var(--danger); font-weight: 700; font-size: .85rem; margin: .3rem 0; }
.msg-inline:empty { display: none; }
@media (max-width: 760px) {
  .map-tools { left: .6rem; top: .6rem; }
  .tool { min-height: 36px; padding: 0 .7rem; font-size: .82rem; }
  .sub-place { left: .6rem; right: .6rem; top: .6rem; width: auto; }
}

/* ---------- header with the live strip: one line on wide screens, Menu button below 1180 px ---------- */
.site-head .wrap { width: min(1280px, 100% - 2.5rem); }
.site-nav { flex-wrap: nowrap; }
.site-nav a { white-space: nowrap; }
@media (min-width: 761px) and (max-width: 1180px) {
  .site-head .wrap { flex-wrap: wrap; }
  .report-cta { order: 1; margin-left: auto; }
  .menu-toggle { order: 2; display: inline-flex; align-items: center; background: none; border: 1px solid rgb(255 255 255 / .25);
    color: #fff; border-radius: var(--r-1); min-height: 40px; padding: 0 .8rem; font: 600 .95rem var(--body); cursor: pointer; }
  .theme-btn { order: 3; }
  .site-nav { order: 4; display: none; width: 100%; flex-direction: column; margin: 0; padding-bottom: .5rem; }
  .site-nav.open { display: flex; }
}

.public-note { font-size: .78rem; color: var(--ink-3); margin: .2rem 0 .5rem; }

/* ---------- landing: intro flight into the map (home only; static/site/intro.js) ----------
 * One orchestrated moment: night veil over southern Africa, the headline lights up and "off" flickers out,
 * the camera flies into Harare, the veil lifts and the outage list slides in. Ends by 7 s. */
.intro { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 1.5rem 1.25rem 4.5rem;
  color: #fff; pointer-events: none; text-align: center; }
.intro::before { content: ""; position: absolute; inset: 0; background: var(--brand-night); opacity: .94;
  transition: opacity 1.4s ease; }
.intro.lit::before { opacity: .62; }
.intro.leaving::before { opacity: .1; transition-duration: 2.2s; }
.intro.gone::before { opacity: 0; transition-duration: .7s; }

.intro-copy { position: relative; max-width: 40rem; transition: opacity .9s ease, transform 1.6s cubic-bezier(.5, 0, .75, 0), filter 1.2s ease; }
.intro.leaving .intro-copy { opacity: 0; transform: translateY(-2.5rem) scale(.96); filter: blur(6px); }
.intro.gone .intro-copy { opacity: 0; }

.intro-mark { width: 64px; height: 64px; margin: 0 auto 1.25rem; display: block; opacity: 0; transform: scale(.6);
  transition: opacity .5s ease, transform .7s cubic-bezier(.2, 1.4, .4, 1); }
.intro.s1 .intro-mark { opacity: 1; transform: none; animation: zw-hum 2.4s ease-in-out .7s infinite; }
@keyframes zw-hum { 50% { filter: drop-shadow(0 0 14px rgb(255 210 31 / .65)); } }

.intro-title { margin: 0; font-size: clamp(2.5rem, 8.5vw, 5.6rem); font-stretch: 125%; line-height: .98; }
.intro-title span { display: block; opacity: 0; white-space: nowrap; }
.intro-title .on { transform: translateY(.35em); transition: opacity .6s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.intro.s1 .intro-title .on { opacity: 1; transform: none; text-shadow: 0 0 .5em rgb(143 212 0 / .55); }
.intro-title .off { color: #fff; }
/* the second line comes on, then the power cuts: flicker and settle dim */
.intro.s2 .intro-title .off { animation: zw-cut 1.1s steps(1, end) forwards; }
@keyframes zw-cut {
  0% { opacity: 1; color: var(--brand-yellow); }
  14% { opacity: .15; }
  22% { opacity: .95; }
  34% { opacity: .05; }
  42% { opacity: .7; }
  55% { opacity: .1; }
  100% { opacity: 1; color: #8a968f; }
}

.intro-lead, .intro-legal { text-shadow: 0 1px 10px rgb(23 29 37 / .95), 0 0 2px rgb(23 29 37 / .8); }
.intro-lead { font-size: clamp(1rem, 2.4vw, 1.2rem); color: #d6ded9; max-width: 34ch; margin: 1.4rem auto 0;
  opacity: 0; transform: translateY(.6rem); transition: opacity .7s ease, transform .7s ease; }
.intro-legal { font-size: .78rem; line-height: 1.45; color: #b3bfb9; max-width: 52ch; margin: 1rem auto 0; opacity: 0;
  transition: opacity .7s ease .15s; }
.intro.s3 .intro-lead, .intro.s3 .intro-legal { opacity: 1; transform: none; }

.intro-skip { position: absolute; right: 1rem; bottom: 1.1rem; pointer-events: auto; min-height: 40px; padding: 0 1rem;
  border-radius: 999px; border: 1px solid rgb(255 255 255 / .3); background: rgb(23 29 37 / .55); color: #fff;
  font: 600 .9rem var(--body); cursor: pointer; backdrop-filter: blur(4px); transition: opacity .4s ease; }
.intro-skip:hover { border-color: var(--brand-lime); }
.intro.gone .intro-skip, .intro.gone .intro-progress { opacity: 0; }
.intro-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgb(255 255 255 / .08);
  transition: opacity .4s ease; }
.intro-progress i { display: block; height: 100%; width: 100%; background: var(--brand-lime); transform-origin: left;
  transform: scaleX(0); animation: zw-progress 7s linear forwards; }
@keyframes zw-progress { to { transform: scaleX(1); } }

/* Harare beacon during the flight */
.harare-ping { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--brand-yellow);
  box-shadow: 0 0 0 3px rgb(23 29 37 / .6); transition: opacity .8s ease; }
.harare-ping::before, .harare-ping::after { content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--brand-yellow); animation: zw-ping 1.8s cubic-bezier(.2, .6, .4, 1) infinite; }
.harare-ping::after { animation-delay: .9s; }
@keyframes zw-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }
.harare-ping span { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); font: 800 1rem var(--display);
  font-stretch: 118%; color: #fff; text-shadow: 0 1px 8px rgb(0 0 0 / .8); white-space: nowrap; }
.harare-ping.landed { opacity: 0; }

/* map chrome waits off-stage, then arrives with the hand-over */
.intro-page .map-sheet { transition: clip-path .8s cubic-bezier(.2, .8, .2, 1); clip-path: inset(0 0 0 0 round var(--r-2)); }
.intro-page.intro-playing .map-sheet { clip-path: inset(0 100% 0 0 round var(--r-2)); }
.intro-page .maplibregl-ctrl-top-right, .intro-page .map-tools { transition: opacity .6s ease .3s; }
.intro-page.intro-playing .maplibregl-ctrl-top-right, .intro-page.intro-playing .map-tools,
.intro-page.intro-playing .maplibregl-ctrl-bottom-right { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .intro-page .map-sheet { clip-path: inset(0 0 0 0 round var(--r-2) var(--r-2) 0 0); }
  .intro-page.intro-playing .map-sheet { clip-path: inset(100% 0 0 0 round var(--r-2) var(--r-2) 0 0); }
  .intro-skip { right: 50%; transform: translateX(50%); }
  .intro-title { font-size: min(2.35rem, 9.6vw); font-stretch: 108%; }
}
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }

/* ---------- "Click here to report" tip (static/site/tips.js) ---------- */
.tip { position: fixed; z-index: 60; width: min(300px, calc(100vw - 24px)); padding: .9rem 1rem 1rem; border-radius: var(--r-2);
  background: var(--brand-yellow); color: var(--brand-night); box-shadow: 0 12px 32px rgb(0 0 0 / .35);
  opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.tip.in { opacity: 1; transform: none; }
.tip::before { content: ""; position: absolute; top: -7px; left: calc(var(--arrow-x, 50%) - 8px); width: 16px; height: 16px;
  background: inherit; transform: rotate(45deg); border-radius: 3px 0 0 0; }
.tip p { margin: 0 0 .75rem; font-size: .92rem; line-height: 1.4; }
.tip .tip-title { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.15rem; margin-bottom: .3rem; }
.tip-actions { display: flex; gap: .5rem; }
.tip .btn-primary { background: var(--brand-night); border-color: var(--brand-night); color: #fff; }
.tip .tip-ok { background: transparent; border-color: rgb(23 29 37 / .35); color: var(--brand-night); }
.report-cta { position: relative; }
.report-cta.cta-spot { background: var(--brand-yellow); animation: zw-spot 1.6s ease-out infinite; }
@keyframes zw-spot {
  0% { box-shadow: 0 0 0 0 rgb(255 210 31 / .75); }
  70% { box-shadow: 0 0 0 14px rgb(255 210 31 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(255 210 31 / 0); }
}

/* ---------- support chat box (static/site/support.js) ---------- */
.help { --help-lift: 0px; }
.help-fab { position: fixed; z-index: 40; right: 1rem; bottom: calc(1rem + var(--help-lift)); display: inline-flex; align-items: center;
  gap: .45rem; min-height: 48px; padding: 0 1.1rem 0 .95rem; border-radius: 999px; border: 1px solid rgb(255 255 255 / .14);
  background: var(--brand-night); color: #fff; font: 700 .95rem var(--body); cursor: pointer;
  box-shadow: 0 8px 24px rgb(0 0 0 / .28); transition: transform .2s ease, bottom .25s ease; }
.help-fab svg { color: var(--brand-lime); }
.help-fab:hover { transform: translateY(-2px); }
.help.open .help-fab svg { color: var(--brand-yellow); }
.intro-playing .help-fab { opacity: 0; pointer-events: none; }
.map-page .maplibregl-ctrl-bottom-right { margin-bottom: 4.5rem; }   /* keep the map attribution clear of the button */

.help-panel { position: fixed; z-index: 45; right: 1rem; bottom: calc(4.6rem + var(--help-lift)); width: min(370px, calc(100vw - 2rem));
  max-height: calc(100vh - 7rem - var(--help-lift)); max-height: calc(100dvh - 7rem - var(--help-lift));
  display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 18px 48px rgb(0 0 0 / .3); overflow: hidden;
  transform-origin: bottom right; animation: zw-help-in .22s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes zw-help-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.help-head { display: flex; align-items: center; gap: .7rem; padding: .85rem .9rem .85rem 1rem; background: var(--brand-night); color: #fff;
  border-bottom: 3px solid var(--brand-lime); }
.help-head h2 { font-family: var(--display); font-stretch: 110%; font-weight: 800; font-size: 1.05rem; margin: 0; line-height: 1.15; }
.help-head p { margin: 0; font-size: .82rem; color: #b3bfb9; }
.help-head > div { flex: 1; }
.help-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .08); color: #fff; font-size: 1.4rem;
  line-height: 1; cursor: pointer; }
.help-x:hover { background: rgb(255 255 255 / .16); }
.help-body { padding: 1rem; overflow: auto; }
.help-body .field { margin-bottom: .75rem; }
.help-body textarea { resize: vertical; min-height: 6.5rem; }
.help-bubble { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 14px 14px 14px 4px; background: var(--action-soft); color: var(--ink);
  font-size: .93rem; max-width: 92%; }
.help-account { margin: 0 0 .75rem; font-size: .88rem; color: var(--ink-2); }
.help-account .linkish { min-height: 0; padding: 0; font-size: .88rem; }
.help-fine { margin: 0 0 .6rem; font-size: .78rem; color: var(--ink-3); }
.help-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.help-done p { margin: 0 0 1rem; }
.help-done:focus { outline: none; }
@media (max-width: 560px) {
  .help-panel { left: 0; right: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; max-height: 88vh; max-height: 88dvh; }
  .help.open .help-fab { display: none; }
  .help-fab span { display: none; }
  .help-fab { padding: 0; width: 52px; justify-content: center; }
}

/* street snapping preview (report page) */
.snap-info { font-size: .88rem; margin: -.3rem 0 .4rem; color: var(--ink-2, var(--ink)); }
.snap-info::before { content: ""; display: inline-block; width: 1.1rem; height: 4px; border-radius: 2px;
  background: #2f7df6; vertical-align: middle; margin-right: .45rem; }
.snap-keep { font-size: .88rem; margin: 0 0 .6rem; }

/* ---------- Android app download (/app) ---------- */
.app-download { margin: 1.6rem 0 .5rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); display: grid; gap: 1rem; }
.app-download-btn { font-size: 1.05rem; min-height: 52px; justify-self: start; }
.app-facts { display: grid; gap: .35rem; margin: 0; font-size: .92rem; }
.app-facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; }
.app-facts dt { color: var(--ink-3); }
.app-facts dd { margin: 0; color: var(--ink); min-width: 0; }
.app-sha { font-size: .78rem; overflow-wrap: anywhere; }
@media (max-width: 520px) { .app-download-btn { justify-self: stretch; } }
