/* style.css — how the page looks.
   Mobile-first: everything is sized for a phone held in one hand outdoors.
   Big tap targets (at least 48 px tall), large text, strong contrast. */

/* ---- Colors in one place ---- */
:root {
  --red: #b00020;        /* emergency banner */
  --blue: #0b57d0;       /* main action button */
  --ink: #111;           /* body text */
  --muted: #444;         /* help text (still high contrast) */
  --line: #c7c7c7;       /* borders */
  --panel: #ffffff;
  --warn-bg: #fff4d6;
  --hazard: #8a1c00;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;            /* the real visible height on phones */
  font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--panel);
}

/* ---- Emergency banner ---- */
#banner {
  flex: none;
  background: var(--red);
  padding-top: env(safe-area-inset-top);  /* stay below the phone's notch */
}
#call-link {
  display: block;
  padding: 12px 30%;               /* room for the two buttons on the sides */
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
}

/* ---- Map ---- */
#map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
}
#map {
  position: absolute;
  inset: 0;
}

#status {
  position: absolute;
  bottom: 28px;               /* above the map credits, clear of the zoom buttons */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;              /* above the map */
  width: min(92%, 520px);
  padding: 10px 14px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;       /* taps go through to the map underneath */
}
#status.error { background: var(--red); }

/* ---- Bottom panel ---- */
#panel {
  flex: none;
  max-height: 55dvh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-top: 2px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}
#panel.collapsed #panel-body { display: none; }

.panel-handle {
  flex: none;
  min-height: 44px;
  border: 0;
  background: #eee;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}

#panel-body {
  overflow-y: auto;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
}

h2 {
  margin: 16px 0 8px;
  font-size: 20px;
}

label, legend {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
}

input[type="number"], select {
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;   /* a fieldset otherwise grows to fit its widest row and spills off narrow phones */
}

/* Radio buttons shown as big tappable rows */
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin: 6px 0;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-weight: 400;
}
.choice input { width: 22px; height: 22px; }
.choice:has(input:checked) { border-color: var(--blue); background: #e8f0fe; }

.help, .note {
  margin: 6px 0;
  color: var(--muted);
  font-size: 16px;
}
.note.warn {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--ink);
}

/* ---- Buttons ---- */
button.big {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 8px 0;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}
button.big[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}
button.primary {
  margin-top: 20px;
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-size: 20px;
}
button:disabled { opacity: 0.5; }

.link-button {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > * { flex: 1; margin: 8px 0; }
.row > input, .row > select { min-width: 0; } /* text boxes shrink instead of pushing buttons off narrow phones */
.row #units { flex: 0 0 72px; }

/* ---- Familiar places list ---- */
#familiar-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
#familiar-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}
#familiar-list input {
  flex: 1;
  min-width: 0;   /* let the text box shrink so the Remove button stays on screen */
  min-height: 48px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
#familiar-list button {
  flex: none;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}

/* ---- "Check these first" list ---- */
#spots {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: spot;
}
#spots li button {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-height: 56px;
  margin: 6px 0;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.spot-num {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  line-height: 32px;
  text-align: center;
}
.spot-text strong { display: block; }
.spot-share { color: var(--muted); font-size: 16px; }
.spot-hazard { display: block; color: var(--hazard); font-weight: 700; font-size: 16px; }

/* ---- Map markers ---- */
.map-num {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font: 800 15px/24px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.map-num.familiar { background: #6a1b9a; }

/* Wider screens: put the panel on the left so the map stays big. */
@media (min-width: 900px) {
  /* minmax(0, 1fr): the second row is exactly the space left under the banner. A plain 1fr
     grows to fit the panel's content, which made the whole page scroll on laptops. */
  body { display: grid; grid-template-columns: 420px 1fr; grid-template-rows: auto minmax(0, 1fr); }
  #banner { grid-column: 1 / -1; }
  #panel { grid-row: 2; grid-column: 1; max-height: none; min-height: 0; border-top: 0; border-right: 2px solid var(--line); }
  #map-wrap { grid-row: 2; grid-column: 2; }
}

/* ---- Screen B: first steps, areas, sightings, rings ---- */
details {
  margin: 8px 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
}
summary {
  min-height: 48px;
  padding: 12px 0;
  font-weight: 700;
  cursor: pointer;
}
h3 {
  margin: 16px 0 4px;
  font-size: 18px;
}
.call-button {
  display: block;
  min-height: 52px;
  margin: 4px 0 8px;
  padding: 13px 14px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.script { margin: 4px 0 8px; padding-left: 22px; }
.script li { margin: 4px 0; }
.checklist { margin: 0 0 12px; padding: 0; list-style: none; }
.checklist .choice:has(input:checked) { border-color: #2e7d32; background: #e8f5e9; }
.checklist .choice:has(input:checked) span { text-decoration: line-through; }
.choice input[type="checkbox"] { width: 22px; height: 22px; }

.sub-form {
  margin: 8px 0 16px;
  padding: 4px 12px 8px;
  border: 2px solid var(--blue);
  border-radius: 10px;
}
.sub-form input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

#areas { margin: 0; padding: 0; list-style: none; }
#areas > li {
  margin: 8px 0;
  border: 2px solid var(--line);
  border-radius: 10px;
}
#areas > li.selected { border-color: var(--blue); }
.area-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.area-letter {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  line-height: 32px;
  text-align: center;
}
.area-body { padding: 0 12px 10px; }
.area-searched { display: block; color: #2e7d32; font-weight: 700; font-size: 16px; }

.map-letter {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font: 800 15px/24px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.map-sighting {
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e65100;
  color: #fff;
  font: 800 17px/26px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.leaflet-tooltip.ring-label {
  padding: 1px 6px;
  border: 0;
  background: rgba(255, 255, 255, 0.85);
  color: #111;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
.leaflet-tooltip.ring-label::before { display: none; }

/* ---- Screen C: sharing, messages, hand-off sheet ---- */
#share-box input[type="text"] { margin-bottom: 4px; }
#share-link { font-size: 15px; }

#messages {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}
#messages li {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f1f3f4;
}
#messages li.mine { background: #e8f0fe; }
#messages .msg-who { font-weight: 700; }
#messages .msg-time { color: var(--muted); font-size: 14px; margin-left: 6px; }
.message-row input {
  flex: 1;
  min-height: 52px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.message-row #message-send { flex: 0 0 96px; }
.message-row #message-voice { flex: 0 0 52px; width: 52px; } /* the mic: a small square */

#handoff-dialog {
  width: min(94vw, 720px);
  max-height: 90dvh;
  padding: 12px;
  border: 0;
  border-radius: 12px;
}
#handoff-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
#handoff-text {
  max-height: 65dvh;
  overflow: auto;
  margin: 0 0 8px;
  white-space: pre-wrap;
  font: 15px/1.45 ui-monospace, Menlo, Consolas, monospace;
}

/* Printing the hand-off sheet: print only the sheet. */
@media print {
  body > *:not(#handoff-dialog) { display: none !important; }
  #handoff-dialog { position: static; width: auto; max-height: none; box-shadow: none; }
  #handoff-dialog .row { display: none; }
  #handoff-text { max-height: none; overflow: visible; }
}

/* ---- Screen D: report box ---- */
#report-text {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}
#report-voice[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
#report-read { margin-top: 8px; font-size: 18px; }

/* ---- Screen E: offline banner, home area, my-location button ---- */
#offline-banner {
  margin: 0;
  padding: 6px 16px;
  background: #ffd54f;
  color: #111;
  font-weight: 700;
  text-align: center;
}
#home-area .row input {
  flex: 1;
  min-height: 52px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
#home-area .row #home-find { flex: 0 0 96px; }
.locate-button {
  width: 44px;
  height: 44px;
  border: 0;
  background: #fff;
  color: #0b57d0;
  font-size: 24px;
  line-height: 44px;
  cursor: pointer;
}
.locate-button[aria-pressed="true"] { background: #0b57d0; color: #fff; }
/* Leaflet's zoom buttons are 30 px; make them the same big tap size as ours. */
.leaflet-touch .leaflet-bar a.leaflet-control-zoom-in,
.leaflet-touch .leaflet-bar a.leaflet-control-zoom-out,
.leaflet-bar a.leaflet-control-zoom-in,
.leaflet-bar a.leaflet-control-zoom-out { width: 44px; height: 44px; line-height: 44px; font-size: 24px; }
.map-home {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 6px;
  background: #2e7d32;
  color: #fff;
  font: 800 16px/24px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ---- Tap-the-map mode (setting the last-seen point, a familiar place, …) ---- */
/* A blue bar across the top of the map, a blue frame and a crosshair, so it's obvious
   that the next tap on the map places something. */
#tap-banner {
  position: absolute;
  bottom: 26px;               /* above the map credits */
  left: 62px;                 /* right of the zoom / GPS / search buttons, so they stay usable */
  right: 8px;
  max-width: 560px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
#tap-banner[hidden] { display: none; }
#map-wrap.picking #status { bottom: 104px; } /* messages sit above the bar */
#tap-banner p { flex: 1; margin: 0; font-size: 16px; font-weight: 700; }
#tap-banner button {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid #fff;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
}
#map-wrap.picking #map { cursor: crosshair; }
#map-wrap.picking::after {        /* the blue frame around the map */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 999;
  border: 4px solid var(--blue);
  pointer-events: none;
}
/* The button that started the mode pulses gently while the map waits for a tap. */
button.big[aria-pressed="true"] { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  50% { box-shadow: 0 0 0 6px rgba(11, 87, 208, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  button.big[aria-pressed="true"] { animation: none; }
}
.done-note { margin: 4px 0 8px; color: #1b5e20; font-weight: 700; }

/* ---- Loading bar ---- */
#progress {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  width: min(94%, 520px);
  padding: 10px 14px 12px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
#progress[hidden] { display: none; }
#progress p { margin: 0 0 8px; font-size: 16px; }
.progress-track { height: 10px; border-radius: 5px; background: #444; overflow: hidden; }
#progress-fill { width: 0; height: 100%; border-radius: 5px; background: #4caf50; transition: width 0.3s ease; }

/* ---- Legend: what the colors mean ---- */
#legend {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 900;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  max-width: 46%;
  font-size: 12px;
  line-height: 1.25;
}
@media (min-width: 600px) { #legend { font-size: 14px; max-width: none; } }
#legend[hidden] { display: none; }
#legend { pointer-events: auto; cursor: pointer; }       /* tap to fold it away */
#legend.folded p:not(.legend-title) { display: none; }
#legend .legend-title::after { content: ' ▾'; }
#legend.folded .legend-title::after { content: ' ▸'; }
/* While the map waits for a tap, the panel gets shorter so there's more map to tap on. */
body.picking #panel { max-height: 38dvh; }
@media (min-width: 900px) { body.picking #panel { max-height: none; } } /* side panel: no need to shrink */
#legend p { margin: 1px 0; display: flex; align-items: center; gap: 6px; }
#legend .legend-title { font-weight: 700; }
.swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.swatch.red { background: rgba(213, 0, 0, 0.75); }
.swatch.orange { background: rgba(255, 109, 0, 0.7); }
.swatch.yellow { background: rgba(255, 214, 0, 0.75); }
.swatch.purple { height: 5px; background: #3f1d8a; }
.swatch.teal { width: 12px; border-radius: 50%; background: #00897b; }

/* The other searchers' names next to their green dots. */
.leaflet-tooltip.searcher-label {
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 700;
  color: #004d40;
  border: 1px solid #00897b;
}

/* While the map search box is open, the loading bar moves to the bottom so it isn't hidden. */
#map-wrap.searching #progress { top: auto; bottom: 110px; }

/* ---- Direction: the arrow on the map and the pill in the panel ---- */
.field-label { margin: 14px 0 6px; font-weight: 600; }
.direction-row > .pill { flex: 1; }
.direction-row > button.small { flex: 0 0 auto; }
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.pill.unknown { background: #fff; color: var(--muted); border: 2px dashed var(--line); }
button.small {
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}
/* The arrow marker: a 180 px square centered on the last-seen point. Only the arrowhead
   takes taps, so the map underneath still works. */
.dir-arrow { position: relative; width: 180px; height: 180px; pointer-events: none; }
.dir-rotor { position: absolute; inset: 0; transform: rotate(var(--angle, 0deg)); }
.dir-shaft {
  position: absolute;
  left: 87px;
  top: 34px;
  width: 6px;
  height: 52px;
  border-radius: 3px;
  background: #b00020;
  box-shadow: 0 0 0 2px #fff;
}
.dir-head {
  position: absolute;
  left: 66px;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #b00020;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  touch-action: none;        /* dragging the arrowhead doesn't scroll the page */
  cursor: grab;
}
.dir-head::after {           /* the white triangle inside the knob */
  content: '';
  position: absolute;
  left: 50%;
  top: 9px;
  transform: translateX(-50%);
  border: 11px solid transparent;
  border-bottom: 18px solid #fff;
  border-top: 0;
}
.dir-head:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.dir-arrow.unknown .dir-shaft { background: #777; }
.dir-arrow.unknown .dir-head { background: #777; }
.dir-arrow.dragging .dir-head { cursor: grabbing; }
.dir-arrow .pill {
  position: absolute;
  left: 50%;
  top: 104px;                /* just below the last-seen dot */
  transform: translateX(-50%);
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.dir-arrow .pill.unknown { background: #fff; }

/* ---- Map search (magnifying glass) ---- */
.search-button { display: flex; align-items: center; justify-content: center; }
#tap-banner-search { display: flex; align-items: center; justify-content: center; min-width: 44px; padding: 0 8px; }
#search-box {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1003;
  width: min(94%, 560px);
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
#search-box[hidden] { display: none; }
#search-form { display: flex; gap: 6px; }
#search-input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
#search-form button {
  flex: none;
  width: 48px;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
#search-form #search-go { background: var(--blue); border-color: var(--blue); color: #fff; }
#search-msg { margin: 8px 4px 2px; color: var(--muted); }
#search-results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 45vh; overflow-y: auto; }
#search-results button {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 4px 0;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
#search-results button strong { display: block; }
#search-results button span { display: block; color: var(--muted); font-size: 14px; }
.map-found {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0b57d0;
  color: #fff;
  font: 800 18px/24px system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ---- "What you know": numbered steps that fold up after Find ---- */
/* "First steps" has 1 (call 911), so these go on from 2. */
#case-inputs { counter-reset: step 1; padding-bottom: 12px; }
#case-inputs .step::before { counter-increment: step; content: counter(step) ". "; } /* 3. 4. 5. ... */
#case-inputs[open] .recap { display: none; }  /* the short summary only shows while folded */
.recap { display: block; margin-top: 4px; font-weight: 400; font-size: 16px; color: #444; }

/* ---- Release, Nov 22: search tasks, Found, report flags, search leader -------------------- */

/* A task card's warning lines and notes (inside #areas, which keeps its old look). */
.task-warn { display: block; color: var(--hazard); font-weight: 700; font-size: 16px; }
.task-note { display: block; font-size: 16px; }
.task-urgent { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--hazard); color: #fff; font-size: 14px; font-weight: 700; }
.area-letter.held { background: #2e7d32; }
.area-body .big { margin-top: 8px; }
.unfilled { margin: 8px 0; padding-left: 20px; color: var(--hazard); font-weight: 700; }

/* "They've been found": the button, the banner on every phone, and the pin. */
button.found { border-color: #2e7d32; color: #1b5e20; }
.found-banner { margin: 8px 0; padding: 12px; border-radius: 10px; background: #1b5e20; color: #fff; font-size: 19px; font-weight: 700; }
.found-banner p { margin: 0 0 4px; }
.found-banner p:last-child { margin: 0; font-size: 16px; font-weight: 400; }
.map-found-person { width: 32px; height: 32px; border: 3px solid #fff; border-radius: 50%; background: #1b5e20; color: #fff; font-weight: 800; line-height: 26px; text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }

/* Safety flags read from a report: big and high contrast, never auto-hidden. */
.flags { margin: 8px 0; }
.flag { margin: 0 0 6px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: #000; font-size: 18px; font-weight: 700; }
.flag-emergency, .flag-water { background: #b00020; color: #fff; }
.flag-call { color: inherit; text-decoration: underline; white-space: nowrap; }

/* A field the report reader wasn't sure about: the person must check it. */
.unsure { outline: 3px solid #e69500; outline-offset: 2px; }
.unsure-mark { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--warn-bg); color: #000; font-size: 14px; font-weight: 700; }

/* The search leader's one line (fixed sentences). */
.leader { margin: 8px 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; }
.leader-line { margin: 4px 0 0; font-size: 18px; }
.leader-warnings p { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: #000; font-weight: 700; }

/* ---- Buttons on the red 911 bar: "What you know" (left) and the police sheet (right) ---- */
#banner { position: relative; }
.bar-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  max-width: 28%;
  min-height: 36px;
  padding: 4px 10px;
  border: 2px solid #fff;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  z-index: 2;
}
.bar-button[hidden] { display: none; }
.bar-left { left: 8px; }
.bar-right { right: 8px; }
@media (max-width: 480px) { .bar-button { font-size: 12px; padding: 3px 6px; } #call-link { font-size: 17px; } }

/* ---- Map toggles: their likely paths / routes to search ---- */
.map-toggles { display: flex; flex-direction: column; gap: 6px; }
.map-toggles button {
  min-height: 40px;
  padding: 6px 10px;
  border: 2px solid #3f1d8a;
  border-radius: 8px;
  background: #fff;
  color: #3f1d8a;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.map-toggles button.routes { border-color: #0b57d0; color: #0b57d0; }
.map-toggles button[aria-pressed="true"] { background: #3f1d8a; color: #fff; }
.map-toggles button.routes[aria-pressed="true"] { background: #0b57d0; color: #fff; }

/* The "Check these first" place being searched right now. */
#spots button.focused { outline: 3px solid #c5221f; outline-offset: 2px; background: #fdecea; }

/* The always-there mic on the map, and the one next to the message box. */
.map-mic {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 14px;              /* a rounded square, like the other map buttons */
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.map-mic svg { width: 30px; height: 30px; }
.mic-button { flex: none; width: 52px; padding: 0; display: flex; align-items: center; justify-content: center; color: #111; }
/* Listening: red with a white mic. */
.mic-button[aria-pressed="true"], .map-mic[aria-pressed="true"] { background: #c5221f; border-color: #c5221f; color: #fff; }

/* One question at a time in the sighting form. */
.step-progress { margin: 4px 0 8px; font-weight: 700; color: #444; }
.sighting-step[hidden], .step-nav button[hidden], #sighting-save[hidden] { display: none; }
.step-nav { gap: 8px; }
.step-nav button { flex: 1; }
/* While the map waits for a tap, the blue bar is at the bottom: the toggles and 🎤 step aside. */
#map-wrap.picking .map-toggles, #map-wrap.picking .map-mic { display: none; }

/* Phones: "Show panel" makes the panel full screen; the map comes back with "Hide panel". */
@media (max-width: 899px) {
  body.panel-full #map-wrap { display: none; }
  body.panel-full #panel { flex: 1 1 auto; max-height: none; min-height: 0; }
}
