/* Live map (assets/js/pages/map.js): the "Show on map" toggles, More drawer, Live safety panel and
   city layer popups. Classes prefixed mt- (toggles), live- (Live safety), ml- (layers and popups). */

/* ---------- Show on map: big toggles ---------- */
.mt-panel{position:absolute;left:10px;top:10px;z-index:510;width:min(360px,calc(100% - 72px));border-radius:16px;padding:0;overflow:hidden;display:flex;flex-direction:column;max-height:calc(100% - 96px)}
.mt-head{display:flex;align-items:center;gap:10px;width:100%;min-height:46px;padding:0 12px 0 14px;background:none;border:0;color:var(--fg);cursor:pointer;text-align:left;flex:0 0 auto}
.mt-h{font-family:var(--label);font-size:11.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);white-space:nowrap}
.mt-count{margin-left:auto;font-family:var(--mono);font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.mt-chev{width:18px;height:18px;flex:0 0 auto;color:var(--muted);transition:transform .2s}
[aria-expanded="true"] > .mt-chev{transform:rotate(180deg)}
.mt-body{padding:0 8px 10px;overflow-y:auto;overscroll-behavior:contain;min-height:0}
.mt-body[hidden]{display:none}
.mt-main{display:grid;gap:4px}
.mt-tog{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:7px 10px;border-radius:12px;border:1px solid transparent;background:none;color:var(--fg);text-align:left;cursor:pointer;font:inherit}
.mt-tog.big{min-height:56px}
.mt-tog:hover{background:rgba(255,255,255,.04)}
.mt-tog:focus-visible,.mt-head:focus-visible,.mt-more:focus-visible,.live-head:focus-visible{outline:2px solid var(--acc);outline-offset:-2px}
.mt-tog[aria-checked="true"]{border-color:var(--acc-line,rgba(214,178,110,.4));background:rgba(214,178,110,.08)}
/* the switch */
.mt-sw{position:relative;flex:0 0 auto;width:38px;height:22px;border-radius:999px;background:var(--panel3,#1b2536);border:1px solid var(--line2);transition:background .2s,border-color .2s}
.mt-sw::after{content:"";position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:var(--muted);transition:transform .2s,background .2s}
.mt-tog[aria-checked="true"] .mt-sw{background:var(--acc);border-color:var(--acc)}
.mt-tog[aria-checked="true"] .mt-sw::after{transform:translateX(16px);background:#0b0d10}
.mt-txt{display:grid;gap:2px;min-width:0}
.mt-l{display:flex;align-items:center;gap:8px;font-weight:600;font-size:14.5px;line-height:1.25}
.mt-tog:not(.big) .mt-l{font-weight:500;font-size:14px}
.mt-d{font-size:12px;line-height:1.3;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mt-tog[aria-checked="false"] .mt-l{color:var(--muted)}
.mt-key{display:inline-flex;gap:3px}
.mt-key i{width:9px;height:9px;border-radius:50%;display:inline-block;border:1px solid rgba(0,0,0,.4)}
.mt-tog[aria-checked="false"] .mt-key{opacity:.45}
.mt-more{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;margin-top:4px;padding:0 10px;border:0;border-top:1px solid var(--line);background:none;color:var(--fg);font:500 14px/1.2 var(--body);cursor:pointer;text-align:left}
.mt-moren{margin-left:auto;font-size:12px;color:var(--acc)}
.mt-morelist{display:grid;gap:2px;padding-top:2px}
.mt-morelist[hidden]{display:none}
.mt-keybox{margin-top:2px;border-top:1px solid var(--line)}
.mt-keybox summary{display:flex;align-items:center;min-height:44px;padding:0 10px;font-size:13px;color:var(--muted);cursor:pointer;list-style:none}
.mt-keybox summary::-webkit-details-marker{display:none}
.mt-keybox summary::after{content:"+";margin-left:auto;font-size:16px;color:var(--dim)}
.mt-keybox[open] summary::after{content:"\2212"}
.mt-legend{padding:0 10px}
.mt-legend .lg{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12.5px}
.mt-legend .lg span{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
.mt-legend .sw{width:9px;height:9px;border-radius:50%}
.mt-legend h5{margin:0 0 6px;font-size:10px;font-family:var(--label);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.mt-legend .ml-note{margin:6px 0 0;line-height:1.45}
.mt-legend a{color:var(--acc)}
.mt-legend .ml-sec + .ml-sec,.mt-legend .ml-note + .ml-sec,.mt-legend .ml-sec + .ml-note{margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}

/* ---------- Live safety ---------- */
.live-panel{position:absolute;left:10px;bottom:14px;z-index:505;width:min(380px,calc(100% - 180px));border-radius:16px;padding:0;overflow:hidden;display:flex;flex-direction:column;max-height:calc(100% - 28px)}
.live-panel.open{width:min(380px,calc(100% - 20px));max-height:min(62%,560px);z-index:515}
.live-head{display:flex;align-items:center;gap:9px;width:100%;min-height:46px;padding:0 12px 0 14px;background:none;border:0;color:var(--fg);cursor:pointer;text-align:left;flex:0 0 auto;font:inherit}
.live-h{font-weight:600;font-size:14px;white-space:nowrap}
.live-sub{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.live-head .mt-chev{margin-left:auto;transform:rotate(180deg)}
.live-head[aria-expanded="true"] .mt-chev{transform:none}
.live-panel .lamp{flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:var(--green,#46a758);box-shadow:0 0 8px 1px rgba(70,167,88,.45)}
.live-panel .lamp.amber{background:var(--acc);box-shadow:0 0 8px 1px var(--acc-glow)}
.live-panel .lamp.red{background:var(--red);box-shadow:0 0 8px 1px rgba(239,74,79,.5)}
.live-body{padding:0 14px 14px;overflow-y:auto;overscroll-behavior:contain;min-height:0;font-size:13.5px}
.live-body[hidden]{display:none}
.live-calls{padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid var(--line)}
.live-calls p{margin:0;line-height:1.45}
.live-calls p + p{margin-top:4px}
.live-calls a,.live-body a{color:var(--acc)}
.live-k{margin:14px 0 6px;font-family:var(--label);font-size:10.5px;font-weight:500;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}
.live-fresh{margin:8px 0 0;font-size:12px;color:var(--dim);line-height:1.45}
.live-note{margin:10px 0 0;font-size:12px;color:var(--dim);line-height:1.45}
.live-all{display:inline-flex;align-items:center;min-height:44px;font-weight:600}
.live-body .sh-links{margin-top:10px}
/* Phone and tablet: a pill above the Report here row, left of the locate button; opens to full width. */
@media (max-width:899px){
  .live-panel{bottom:76px;width:auto;max-width:calc(100% - 96px)}
  .live-panel.open{left:10px;right:10px;bottom:14px;width:auto;max-width:none;max-height:min(70%,560px)}
}
/* Wide screens: top right, under the zoom buttons, clear of the left panel and the bottom-right buttons. */
@media (min-width:900px){
  .live-panel,.live-panel.open{left:auto;right:10px;top:104px;bottom:auto;width:360px;max-height:calc(100% - 330px)}
  .live-head .mt-chev{transform:none}
  .live-head[aria-expanded="true"] .mt-chev{transform:rotate(180deg)}
}

/* ---------- other overlays ---------- */
.ml-hint{position:absolute;left:50%;transform:translateX(-50%);bottom:76px;z-index:500;min-height:40px;padding:7px 14px;font:500 12.5px/1.2 var(--body);color:var(--fg);cursor:pointer;white-space:nowrap}
.ml-hint:hover{border-color:var(--acc)}
.ml-hint[hidden]{display:none}

/* ---------- report popup: "Still there" first ---------- */
.still{display:grid;gap:4px;margin-top:6px}
.act.still-btn{justify-content:center;min-height:46px;width:100%;font-size:15px;font-weight:600;background:var(--acc-dim);border-color:var(--acc);color:var(--fg)}
.act.still-btn .still-n{font-weight:500;color:var(--muted)}
.act.still-btn.done{color:var(--acc)}
.act.still-btn.done .still-n{color:var(--acc)}
.still-when{text-align:center}
.leaflet-popup-content .acts .act{min-height:44px}

/* ---------- city layer popups ---------- */
.ml-pop .eyebrow{margin-bottom:2px}
.ml-pop .ml-h{font-weight:600;font-size:14.5px;line-height:1.3}
.ml-rows{margin-top:8px;max-height:220px;overflow-y:auto;overscroll-behavior:contain;display:grid;gap:8px}
.ml-row .ml-t{display:flex;gap:7px;align-items:baseline;font-size:13px;line-height:1.35}
.ml-row .ml-t a{color:var(--fg);text-decoration:underline;text-decoration-color:var(--line2);text-underline-offset:2px}
.ml-dot{flex:0 0 auto;width:8px;height:8px;border-radius:50%;display:inline-block;transform:translateY(-1px)}
.ml-row .tiny{padding-left:15px}
.ml-fact{margin:8px 0 0;color:var(--muted);line-height:1.45}
.leaflet-container .ml-pop a{color:var(--acc)}
.leaflet-container .ml-pop .ml-t a{color:var(--fg)}
.ml-go,.ml-links a{display:inline-block;margin-top:10px;font-size:12.5px;font-weight:500}
.ml-links{display:flex;flex-wrap:wrap;gap:0 14px}
/* Phones: the opened Live safety panel spans the map, so the Help agent tile steps aside until it is closed. */
@media (max-width:899px){ body[data-page="map"]:has(.live-panel.open) .as-fab, body[data-page="map"]:has(.live-panel.open) .hp-bubble{display:none} }
