@charset "utf-8";
:root {
  --ink: #17231f; --muted: #5b6b65; --line: #dfe5e2; --bg: #f6f8f7; --card: #fff;
  --brand: #1f5f4a; --brand-2: #2f7d63;
  --yes: #1a9850; --maybe: #e8a317; --no: #d73027; --none: #b9c3bf; --proj: #6a51a3; --toa: #3182bd;
  --panel-w: 390px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
a { color: var(--brand-2); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--brand); color: #fff; }
.brand strong { display: block; font-size: 17px; letter-spacing: .2px; }
.brand span { font-size: 12.5px; opacity: .85; }
.top nav { display: flex; gap: 10px; align-items: center; }
.top nav a { color: #fff; font-size: 14px; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9fd3c0; outline-offset: 1px; }

.stats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px;
  background: #fff; border-bottom: 1px solid var(--line); }
.stat { display: flex; align-items: baseline; gap: 5px; font-size: 13px; color: var(--muted); }
.stat b { font-size: 18px; color: var(--ink); }
.stat.yes b { color: var(--yes); } .stat.maybe b { color: #b07a00; } .stat.no b { color: var(--no); }
.bar { flex: 1 1 140px; display: flex; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; min-width: 120px; }
.bar i { display: block; height: 100%; }
.bar .yes { background: var(--yes); } .bar .maybe { background: var(--maybe); } .bar .no { background: var(--no); }
.stats small { color: var(--muted); font-size: 12px; }

main { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; right: var(--panel-w); }
.mapctl { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.legend { position: absolute; left: 10px; bottom: 28px; z-index: 2; background: rgba(255,255,255,.94);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.7; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.yes { background: var(--yes); } .sw.maybe { background: var(--maybe); } .sw.no { background: var(--no); }
.sw.none { background: #fff; border: 2px solid var(--none); } .sw.proj { background: var(--proj); opacity: .6; }
.sw.toa { background: var(--toa); opacity: .25; }
.sw.corrected { background: #fff; border: 2.5px solid #1d2a5c; }
.sw.focus { border: 2px dashed var(--brand); background: transparent; }

.panel { position: absolute; top: 0; right: 0; bottom: 0; width: var(--panel-w); background: var(--card);
  border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 18px 28px; z-index: 3; }
.grab { display: none; }
.panel h2 { font-size: 19px; margin: 4px 0 10px; }
.panel h3 { font-size: 15px; margin: 18px 0 8px; }
.panel p, .panel li { font-size: 14px; line-height: 1.5; }
.steps { padding-left: 20px; }
.fine { font-size: 12px !important; color: var(--muted); }
.close { float: right; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13.5px; margin: 8px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--line); }
.pill.yes { background: #dff3e6; color: #11703a; } .pill.maybe { background: #fcefcf; color: #8a6000; }
.pill.no { background: #fbe1de; color: #a21f16; } .pill.corrected { background: #e3e7f7; color: #1d2a5c; } .pill.toa { background: #deebf7; color: #1d5a8a; }
.callout.fixed { background: #eef0fa; border-left-color: #1d2a5c; }
.callout.warn { background: #fff7e0; border-left-color: var(--maybe); }
.callout { background: #eef6f2; border-left: 4px solid var(--brand-2); padding: 10px 12px; border-radius: 6px; font-size: 13.5px; margin: 10px 0; }

form.vote { display: grid; gap: 10px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choices label { border: 2px solid var(--line); border-radius: 8px; padding: 10px 4px; text-align: center; cursor: pointer; font-weight: 700; font-size: 14px; }
.choices input { position: absolute; opacity: 0; }
.choices label:has(input:checked).yes { border-color: var(--yes); background: #dff3e6; }
.choices label:has(input:checked).maybe { border-color: var(--maybe); background: #fcefcf; }
.choices label:has(input:checked).no { border-color: var(--no); background: #fbe1de; }
.choices label:has(input:focus-visible) { outline: 3px solid #9fd3c0; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.field span.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=tel], select { font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid #c9d2ce; border-radius: 8px; width: 100%; background: #fff; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.msg { font-size: 13.5px; padding: 8px 10px; border-radius: 6px; }
.msg.err { background: #fbe1de; color: #8d1b12; } .msg.ok { background: #dff3e6; color: #11703a; }

.meter { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 14px 0; }
.meter h3 { margin: 0 0 6px; }
.fb { display: grid; gap: 8px; } .fb-row { display: flex; gap: 8px; }
.fb .btn[aria-pressed="true"] { background: #dff3e6; border-color: var(--yes); color: var(--ink); }
.fb textarea { font: inherit; font-size: 16px; padding: 8px; border: 1px solid #c9d2ce; border-radius: 8px; width: 100%; }
.cluster { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: #fafcfb; margin-top: 6px; cursor: pointer; font: inherit; font-size: 13px; }
.cluster b { font-size: 14px; }
.meter label { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 6px; }

.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn.ghost-dark { background: transparent; border-color: transparent; color: var(--muted); padding-left: 0; }

/* guided tour */
.tour-block { position: fixed; inset: 0; z-index: 49; }
.tour-spot { position: fixed; z-index: 50; border-radius: 10px; pointer-events: none;
  border: 4px solid #e0201b; /* bold red frame around the highlighted feature */
  box-shadow: 0 0 0 4px rgba(224, 32, 27, .35), 0 0 0 9999px rgba(10, 22, 17, .58);
  transition: all .25s ease; animation: tourPulse 1.6s ease-in-out infinite; }
@keyframes tourPulse { 50% { box-shadow: 0 0 0 9px rgba(224, 32, 27, .18), 0 0 0 9999px rgba(10, 22, 17, .58); } }
.tour-card { position: fixed; z-index: 51; background: #fff; border-radius: 12px; padding: 16px 18px 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28); transition: top .25s ease, left .25s ease; }
.tour-card h3 { margin: 2px 0 6px; font-size: 17px; }
.tour-card p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; }
.tour-card .tour-count { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.tour-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-nav span { display: flex; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; animation: none; } }

.maplibregl-popup-content { font-size: 13px; max-width: 280px; }
.proj-pop b { display: block; margin-bottom: 4px; }

.top .short { display: none; }
body.fullmap .top, body.fullmap .stats, body.fullmap .panel, body.fullmap .legend { display: none; }
body.fullmap #map { right: 0; }

@media (max-width: 760px) {
  .top { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand strong { font-size: 15px; }
  .brand span { display: none; }
  .top nav { gap: 6px; }
  .top nav a { font-size: 13px; }
  .top .long { display: none; } .top .short { display: inline; }
  .stats { gap: 10px; padding: 5px 12px; flex-wrap: nowrap; overflow-x: auto; }
  .stat { font-size: 12px; white-space: nowrap; } .stat b { font-size: 15px; }
  .stats .bar, .stats small { display: none; }
  #map { right: 0; bottom: 0; }
  .legend { display: none; }
  .mapctl .btn.small { padding: 7px 10px; }
  .panel { top: auto; left: 0; right: 0; width: auto; max-height: 72dvh; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.14); padding: 0 16px calc(20px + env(safe-area-inset-bottom));
    transition: transform .25s ease; }
  .panel.collapsed { transform: translateY(calc(100% - 52px - env(safe-area-inset-bottom))); overflow: hidden; }
  .grab { display: flex; flex-direction: column; align-items: center; gap: 4px; width: calc(100% + 32px); margin: 0 -16px 6px;
    padding: 8px 0 8px; background: #fff; border: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--brand-2); cursor: pointer; }
  .grip { width: 44px; height: 5px; border-radius: 3px; background: #cbd3cf; }
  .maplibregl-ctrl-attrib.maplibregl-compact { font-size: 11px; }
  /* keep map credits and controls above the collapsed bottom sheet */
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: calc(56px + env(safe-area-inset-bottom)); }
  body.fullmap .maplibregl-ctrl-bottom-right, body.fullmap .maplibregl-ctrl-bottom-left { bottom: 0; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { .panel { transition: none; } }
