/* Canvassing App 3.2 — map layers sheet, quick-filter pill bar, compact legend box, zoom-out background (map/MapLayers.js, ui/MapFilterBar.js) */
#map { background: var(--map-bg); }                                     /* never a black / white void behind tiles that are still loading */
/* ---- Layers sheet (extends #basemap-menu) ---- */
.basemap-menu.layers-sheet { width: 232px; padding: 8px 0 6px; max-height: calc(100% - 190px - var(--safe-t)); overflow-y: auto; }
.layers-sheet .ls-h { margin: 4px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.layers-sheet .ls-bases { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 10px 8px; }
.layers-sheet .ls-bases button { padding: 9px 6px; border-radius: 10px; background: var(--fill); text-align: center; font-size: 14px; }
.layers-sheet .ls-bases button.on { background: var(--soft, var(--tint-red)); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.layers-sheet .ls-toggles { border-top: 1px solid var(--line); padding-top: 6px; }
.layers-sheet .ls-t { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.layers-sheet .ls-t input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
/* ---- quick-filter pill bar ---- */
.qf-bar { position: absolute; top: calc(64px + var(--safe-t)); left: 62px; right: 62px; z-index: 6; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.qf-bar::-webkit-scrollbar { display: none; }
.qf { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 7px 11px; background: var(--glass); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; white-space: nowrap; color: var(--ink); }
.qf.on { background: var(--brand); color: var(--brand-ink); }
.qf-clear { padding: 7px 10px; }
.qf-clear[hidden] { display: none; }
.qf-menu { position: absolute; top: calc(104px + var(--safe-t)); left: 62px; right: 62px; z-index: 9; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); max-height: 52%; overflow-y: auto; padding: 6px 0; }
.qf-menu[hidden] { display: none; }
.qf-menu .qf-title { margin: 4px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.qf-opt { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 12px; font-size: 14px; font-weight: 600; text-align: left; }
.qf-opt span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qf-opt b { color: var(--muted); font-weight: 700; } .qf-opt.on { background: var(--soft, var(--tint-red)); color: var(--brand); }
.qf-opt.on b { color: inherit; }
.ml-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--idle)); box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(0, 0, 0, .35); }
/* ---- compact legend box (persistent; hidden only under the door card) ---- */
.map-legend { position: absolute; right: 12px; bottom: 72px; z-index: 5; width: 132px; background: var(--glass); border-radius: 12px; box-shadow: var(--shadow); padding: 6px 4px 4px; font-size: 12px; }
.map-legend[hidden] { display: none; }
#view-map:has(.card.open) .map-legend, #view-map:has(.stamp-bar.open) .map-legend { display: none; }
.map-legend .ml-head { display: flex; justify-content: space-between; margin: 0 6px 3px; font-weight: 700; color: var(--ink); font-size: 11px; }
.ml-row, .ml-key { display: flex; align-items: center; gap: 7px; width: 100%; border: 0; background: none; margin: 0; padding: 3px 6px; font-size: 12px; font-weight: 600; text-align: left; border-radius: 8px; color: var(--ink); }
.ml-row span, .ml-key span { flex: 1; min-width: 0; white-space: nowrap; }
.ml-row b, .ml-key b { font-weight: 700; color: var(--muted); } .ml-row.on { background: var(--soft, var(--tint-red)); }
.ml-more { border: 0; background: none; color: var(--brand); font-weight: 700; font-size: 12px; padding: 3px 6px; }
.ml-pack { flex: 0 0 auto; width: 13px; height: 10px; border: 2px solid var(--map-pack); background: color-mix(in srgb, var(--map-pack) 15%, transparent); border-radius: 3px; box-sizing: border-box; }
.ml-comp { flex: 0 0 auto; width: 13px; height: 10px; border: 1.5px dashed var(--map-comp); border-radius: 2px; box-sizing: border-box;
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--map-comp) 85%, transparent) 0 1.5px, color-mix(in srgb, var(--map-comp) 16%, transparent) 1.5px 4px); }
.ring-legend { max-width: calc(100% - 172px); }                     /* rep legend (left) and the legend box (right) never overlap */
body:has(#modal-signin.open) .qf-bar, body:has(#modal-signin.open) .map-legend, body:has(#modal-signin.open) .qf-menu { visibility: hidden; }
