/* Canvassing App 3.3 — compact door-card peek, Settings tab, Filter-sheet chips.
   Reuses the original Field map pills. Loaded last so these rules win. Zero inline styles. */

/* Filter pill lights up when a filter is on */
#pill-filter.on { background: var(--brand); color: var(--brand-ink); }
#pill-filter .badge { top: -4px; right: -4px; }

/* layers sheet is map type only (overlay switches live in Settings) */
.basemap-menu.layers-sheet { width: 200px; }

/* install bar stays between the map and the tab bar: it shrinks the map, never covers the map or the card */
/* (styles-v2.css already places it there; this file does not override that.) */

/* Filter sheet: Status / Rep / Pack chips live here, not on the map */
#filter-drawer .qf-bar { position: static; left: auto; right: auto; top: auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 10px; overflow: visible; z-index: auto; }
#filter-drawer .qf-menu { position: static; left: auto; right: auto; top: auto; max-height: 36vh; margin-bottom: 8px; box-shadow: none; border: 1px solid var(--line); z-index: auto; }
#filter-drawer .qf { box-shadow: none; border: 1px solid var(--line); }

/* Settings: Key + overlay switches + gestures */
#view-admin .map-legend, #view-admin .ring-legend { position: static; width: auto; max-width: 100%; bottom: auto; right: auto; left: auto; box-shadow: none; pointer-events: auto; margin: 0 0 12px; }
#view-admin .map-legend { background: var(--soft); }
#view-admin .ring-legend { display: flex; }
#settings-layers, #settings-areas { border: 0; padding: 0; display: flex; flex-direction: column; }
#settings-layers .ls-t, #settings-areas .ls-t { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
#settings-layers .ls-t input, #settings-areas .ls-t input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }

#settings-areas .ls-demo { font-style: normal; font-weight: 500; color: var(--muted); }

/* door card: compact peek (~ a third of the phone) vs expanded */
#card { max-height: 62dvh; }
#card.peek { max-height: 38dvh; overflow: hidden; }
#card.peek #card-meta, #card.peek #card-last, #card.peek #card-today, #card.peek #card-note-form,
#card.peek .card-actions, #card.peek #card-appt, #card.peek #card-intel, #card.peek .more-btn,
#card.peek #more-row, #card.peek #card-details, #card.peek #geo-note { display: none; }
#card.peek .lead-menu { padding: 6px 0 2px; }
#card.peek .doorgrid .dispo.top { min-height: 56px; }
#card.peek .doorgrid .dispo.top i { font-size: 20px; }
#card.peek .doorgrid .dispo.top span { font-size: 12px; }
#card.peek .card-head h2, #card.peek #card-name { font-size: 17px; margin: 0; }
#card.peek .address { margin: 4px 0 2px; font-size: 14px; }
#card.peek .card-head-actions { gap: 4px; }
#card-more { display: none; width: 100%; margin: 4px 0 0; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 0 2px; }
#card.peek #card-more, #card.expanded #card-more { display: block; }
#card.expanded #card-more { border-top: 1px solid var(--line); margin-top: 8px; }

/* Location pulse on Follow; stop it (and any other CSS animation) when hidden or the map has been idle 10s */
@keyframes df-gps-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 28%, transparent); } }
.pill.gps-follow { animation: df-gps-pulse 1.6s ease-in-out infinite; }
html.df-hidden *, html.df-idle * { animation-play-state: paused; }

/* v3.9.1 phone-width fixes (412px) */
#me-name { top: calc(max(var(--safe-t), 6px) + 10px); min-height: 36px; }
.viewhead { padding-top: calc(var(--safe-t) + 4px); }
.seg.team-seg { scrollbar-width: none; gap: 2px; padding: 3px; }
.seg.team-seg::-webkit-scrollbar { display: none; }
.seg.team-seg button { flex: 0 0 auto; padding: 9px 14px; font-size: 14px; white-space: nowrap; }
#settings-areas .ls-t, #settings-layers .ls-t { line-height: 1.35; min-height: 44px; }
#view-admin .muted.small { line-height: 1.45; margin: 6px 0 10px; }
#view-admin h3 { margin: 18px 0 6px; }
label:has(> #set-brand), label:has(> #set-partner), label:has(> #me-brand), label:has(> #me-partner) { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
#set-brand, #set-partner, #me-brand, #me-partner { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
@media (max-width: 480px) {
  [data-pane="pins"] .grid th, [data-pane="pins"] .grid td { padding: 6px 4px; }
  [data-pane="pins"] .grid input.i-label { width: 92px; }
  [data-pane="pins"] .grid input.i-icon { width: 32px; }
  [data-pane="pins"] .grid input.i-color { width: 34px; padding: 0; }
  [data-pane="pins"] h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
}
/* a bottom sheet never sits on the floating map buttons: on short phones the buttons step aside while a sheet is open */
@media (max-height: 780px) {
  body:has(#card.open) .pills.right, body:has(#lasso-sheet.open) .pills.right, body:has(#bulk-sheet.open) .pills.right, body:has(#turf-sheet.open) .pills.right, body:has(#hud-card:not([hidden])) .pills.right { opacity: 0; pointer-events: none; }
}

/* v3.9.1: leave room for the fixed Me chip (#me-name) so LIVE SYNC never sits under it (hybrid adds the org badge) */
.topbar { right: 100px; min-width: 0; }
.topbar .brand { flex: 0 0 auto; }
.topbar .org-badge { flex: 1 1 auto; min-width: 0; max-width: 34%; }
.sync-wrap { flex: 0 0 auto; white-space: nowrap; }
body.has-hud .sync-wrap:has(.dot-ok)::after { white-space: nowrap; }

/* v3.9.1: Pin Editor — horizontal scroll reaches Soft-lock; last column is not clipped */
#view-admin [data-pane="pins"] .pv-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; max-width: 100%; padding-bottom: 10px; }
#view-admin [data-pane="pins"] .grid { width: max-content; margin-right: 20px; }
#view-admin [data-pane="pins"] .grid th:nth-child(n+5),
#view-admin [data-pane="pins"] .grid td:nth-child(n+5) { text-align: center; padding-left: 10px; padding-right: 10px; }
