/* Doorway Field v2.0 — components added in v2 (campaign pill, rings legend, filter drawer, wheel, Rapid-Stamp, lasso sheet, list, admin). Zero inline styles. */
body:not(.role-owner) .owner-only, body:not(.role-manager) .manager-only { display: none !important; }
.topbar { pointer-events: none; gap: 6px; }
.topbar .brand { font-size: 14px; padding: 6px 10px; white-space: nowrap; }
.topbar .sync { white-space: nowrap; }
button.me { max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar > * { pointer-events: auto; }
.camp { position: relative; }
.camp-pill { white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; border: 0; background: var(--toast-bg); color: #fff; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.camp-menu { display: none; position: absolute; top: 34px; left: 0; min-width: 170px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; z-index: 20; }
.camp-menu.open { display: block; }
.camp-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.camp-menu button.on { background: var(--soft); color: var(--brand); font-weight: 700; }
button.me { border: 0; cursor: pointer; }
.badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 11px; line-height: 18px; }
.pill { position: relative; }
.ring-legend { position: absolute; left: 12px; bottom: 72px; max-width: calc(100% - 24px); z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; pointer-events: none; }
#view-map:has(.card.open) .ring-legend, #view-map:has(.stamp-bar.open) .ring-legend, #view-map:has(.add-bar.open) .ring-legend { display: none; }   /* never under the card / stamp bar */
.ring-legend[hidden] { display: none; }
.lg { background: var(--glass); border-radius: 999px; padding: 2px 8px 2px 4px; font-size: 11px; font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); display: inline-flex; align-items: center; gap: 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.route-clear { position: absolute; right: 12px; bottom: 30px; z-index: 6; border: 0; background: var(--toast-bg); color: #fff; border-radius: 999px; padding: 8px 12px; font-weight: 600; box-shadow: var(--shadow); }
.route-clear[hidden] { display: none; }

/* Rapid-Stamp bar */
.stamp-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 11; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .2); padding: 8px 12px 10px; display: none; }
.stamp-bar.open { display: block; }
.stamp-bar .x { position: absolute; top: 6px; right: 10px; }
.stamp-bar .muted { display: block; padding-right: 40px; }

/* Long-press radial status wheel (centred; the map eases the pressed house under the crosshair) */
.wheel { position: absolute; inset: 0; z-index: 12; display: none; background: rgba(0, 0, 0, .25); }
.wheel.open { display: block; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .4); }
.wheel-items { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.wbtn { --n: 10; --i: 0; position: absolute; width: 56px; height: 56px; margin: -28px; border-radius: 50%; border: 3px solid #fff; background: var(--c); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; box-shadow: var(--shadow);
  transform: rotate(calc(360deg / var(--n) * var(--i))) translate(0, -118px) rotate(calc(-360deg / var(--n) * var(--i))); }
.wbtn i { font-style: normal; font-size: 16px; }
.wheel-x { position: absolute; left: 50%; top: 50%; margin: 40px 0 0 -16px; }
.wn-1{--n:1} .wn-2{--n:2} .wn-3{--n:3} .wn-4{--n:4} .wn-5{--n:5} .wn-6{--n:6} .wn-7{--n:7} .wn-8{--n:8} .wn-9{--n:9} .wn-10{--n:10} .wn-11{--n:11} .wn-12{--n:12}
.wi-0{--i:0} .wi-1{--i:1} .wi-2{--i:2} .wi-3{--i:3} .wi-4{--i:4} .wi-5{--i:5} .wi-6{--i:6} .wi-7{--i:7} .wi-8{--i:8} .wi-9{--i:9} .wi-10{--i:10} .wi-11{--i:11}

/* Bottom sheets: filters + lasso */
.sheet-modal .sheet, #filter-drawer .sheet { max-height: 86dvh; }
.sheet h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.breakdown li b { flex: 1; } .breakdown li span { font-weight: 700; }
.tog { flex: 1; text-align: left; border: 2px solid var(--c); background: var(--surface); color: var(--c); border-radius: 12px; padding: 6px 10px; font-weight: 700; opacity: .45; }
.tog.on { background: var(--c); color: #fff; opacity: 1; }
.tog i { font-style: normal; margin-right: 6px; }
.legs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; } .legs a { text-decoration: none; color: var(--ink); }
.stops { font-size: 13px; padding-left: 22px; max-height: 26dvh; overflow-y: auto; } .stops a { color: var(--brand); font-size: 12px; }
.filter-body .chk, .user-list .chk { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 15px; }
.filter-body select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px; background: var(--surface); }
.icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ig { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); opacity: .4; }
.ig i { font-style: normal; width: 38px; height: 38px; border-radius: 50%; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.ig.on { opacity: 1; color: var(--ink); }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 2px; margin: 0 6px 6px 0; }
.seg button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.custom-dates { display: flex; gap: 8px; } .custom-dates[hidden] { display: none; }
.custom-dates input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.user-list .team { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--muted); }
button.link { border: 0; background: none; padding: 0; font-size: 12px; text-transform: none; letter-spacing: 0; }

/* List, stats, admin */
.filters { flex-wrap: wrap; align-items: center; }
.colmenu { display: none; background: var(--soft); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.colmenu.open { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--tint-red); border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.bulk[hidden] { display: none; } .bulk select { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--surface); }
.pv-scroll.tall { max-height: calc(100dvh - 260px); }
.list-grid td small { display: block; color: var(--muted); } .list-grid .jump { padding: 5px 9px; font-size: 12px; }
.hide-rep .c-rep, .hide-campaign .c-campaign, .hide-dist .c-dist, .hide-appt .c-appt, .hide-phone .c-phone { display: none; }
.tiles.five { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px) { .tiles.five { grid-template-columns: repeat(5, 1fr); } }
#stats-campaign, .inline select, .inline input, #sync-url, #camp-name { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); }
#sync-url { flex: 1; min-width: 200px; }
.inline { display: inline-flex; align-items: center; gap: 6px; margin: 4px 10px 4px 0; font-size: 13px; color: var(--muted); }
.pill-count { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; background: var(--tint-ok); color: var(--ok); text-transform: none; letter-spacing: 0; }
.pill-count.warn { background: var(--tint-warn); color: var(--on-warn); }
.camp-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip-c { background: var(--soft); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.grid td small { display: block; color: var(--muted); }
.grid input.i-label { width: 130px; } .grid input.i-icon { width: 36px; text-align: center; }
.card-actions .btn { padding: 9px 6px; }
h3 .btn { text-transform: none; letter-spacing: 0; padding: 4px 10px; font-size: 12px; margin-left: 6px; }
/* v2 compact card + pills: the open card never covers the map pills on a 390 × 664 phone */
.pills { gap: 8px; } .pill { width: 42px; height: 42px; font-size: 18px; }
.card { padding: 4px 14px 10px; } .grab { margin: 2px auto 6px; }
.card-head h2 { font-size: 18px; margin-bottom: 2px; }
.address { margin: 4px 0 0; font-size: 14px; } #card-meta { margin: 0; font-size: 12px; }
.card .lead-menu { padding-top: 6px; padding-bottom: 6px; } .card .dispo { min-width: 52px; padding: 4px 6px; }
.card-actions { margin: 2px 0 6px; } .card-actions .btn { padding: 7px 6px; font-size: 13px; }
.note-bar { padding-top: 6px; } .note-bar input { padding: 7px 9px; }
.sheet label.chk { flex-direction: row; align-items: center; margin: 0; color: var(--ink); font-size: 15px; }
.sheet label.chk input { width: 18px; height: 18px; }
/* v2.1 Status Pin Inventory visual editor */
.pin-pv { border: 0; background: none; padding: 0; vertical-align: middle; cursor: pointer; } .pin-pv img { width: 34px; height: 34px; display: block; }
.pin-studio { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin: 8px 0; background: var(--surface); }
.pin-studio[hidden] { display: none; }
.ps-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .ps-head b { flex: 1; } .ps-pin { width: 46px; height: 46px; }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-bottom: 8px; }
.ps-grid button { border: 2px solid transparent; border-radius: 12px; background: var(--soft); padding: 2px; cursor: pointer; } .ps-grid button img { width: 34px; height: 34px; display: block; margin: 0 auto; }
.ps-grid button.on { border-color: var(--brand); background: var(--surface); }
.small { font-size: 12px; margin: 2px 0 6px; }
/* v2.2 add pin + turf zones + geo search */
.add-bar { top: auto; bottom: 26px; left: 12px; right: 12px; padding: 10px; gap: 8px; align-items: center; grid-template-columns: auto 1fr 1fr auto; }
.add-bar.open { display: grid; } .add-bar input { grid-column: 2 / 4; min-width: 0; } .add-bar .x { grid-column: 4; grid-row: 1; }
.add-bar #add-gps { grid-column: 1 / 3; grid-row: 2; } .add-bar #add-center { grid-column: 3 / 5; grid-row: 2; }
.center-cross { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 4; pointer-events: none; }
.center-cross::before, .center-cross::after { content: ''; position: absolute; background: var(--surface); box-shadow: 0 0 0 1.5px rgba(0,0,0,.6); }
.center-cross::before { left: 16px; top: 0; width: 2px; height: 34px; } .center-cross::after { top: 16px; left: 0; height: 2px; width: 34px; }
.center-cross[hidden] { display: none; }
#search-results li.geo b { color: var(--brand); }
/* v2.3 controls lower + mode label, install banner, history feed */
.pills.right { top: calc(108px + var(--safe-t)); align-items: flex-end; }
.pill.mode-pill { width: auto; min-width: 42px; padding: 0 12px; border-radius: 21px; font-size: 14px; white-space: nowrap; }
.install-banner { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 12; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; height: 48px; box-sizing: border-box; display: flex; gap: 8px; align-items: center; background: var(--surface); padding: 6px 12px; font-weight: 600; }
.install-banner span { flex: 1; } .install-banner[hidden], .install-banner [hidden] { display: none; }
body:has(#install-banner:not([hidden])) #app { bottom: calc(var(--nav-h) + var(--safe-b) + 48px); }   /* v3.1: the install bar sits BELOW the map (it shrinks the map, never covers it or the legend) */
.card .last { font-size: 13px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-chip { background: var(--fill); color: #fff; }
.timeline .h-note p { font-weight: 600; }
#search-geo { margin: 6px 0 0; width: 100%; } #search-geo[hidden] { display: none; }
/* v2.4.4 pin drawer velocity + follow-ups */
.card-score { display: flex; gap: 10px; align-items: center; font-size: 12px; line-height: 18px; color: var(--muted); margin: 0 0 2px; } .card-score b { color: var(--ink); font-size: 13px; } .card-score .small { margin-left: auto; padding: 0 10px; font-size: 12px; line-height: 18px; }
.card .lead-menu { padding-top: 3px; padding-bottom: 3px; } .note-bar { padding-top: 4px; } .note-bar input { padding: 6px 9px; } .card-actions { margin: 2px 0 4px; }
.icon-btn[hidden] { display: none; } .icon-btn.call { background: var(--ok); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--info); color: #fff; text-decoration: none; font-size: 16px; margin-right: 6px; }
#card-address { cursor: pointer; } #card-address.copied::after { content: '  ✓ Copied'; color: var(--ok); font-weight: 700; }
#forms-groupme.copied::after { content: ' ✓'; }
.followups { margin: 8px 0; } .followups[hidden] { display: none; } .fu-list { list-style: none; padding: 0; margin: 4px 0 10px; }
.fu-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); } .fu-act { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.badge-n { font-size: 12px; }
.card-head > div:first-child { min-width: 0; flex: 1; } .card-head h2, .card-head .status-chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
.card-head .status-chip { display: inline-block; } .card-head-actions { gap: 6px; flex-shrink: 0; } .card-head-actions .icon-btn { width: 30px; height: 30px; font-size: 14px; margin-right: 0; }
.card-head-actions .pill-outline { padding: 4px 10px; font-size: 13px; } .card-actions .btn { white-space: nowrap; padding: 7px 4px; font-size: 13px; }
.basemap-menu { position: absolute; right: 12px; top: calc(156px + var(--safe-t)); z-index: 9; display: none; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; min-width: 160px; }
.basemap-menu.open { display: flex; } .basemap-menu button { border: 0; background: none; padding: 12px 14px; text-align: left; font-weight: 600; font-size: 15px; } .basemap-menu button.on { background: var(--soft); color: var(--brand); }
/* v2.5 turf lasso toggle (pink), v2.5.1 black Sharpie line + summary, GPS modes, update banner, sign-in banner, team card */
.pill.turf-draw { background: var(--draw); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--draw) 35%, transparent); }
.turf-badge { position: absolute; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 8; background: var(--draw); color: #fff; font-weight: 700; padding: 8px 14px; border-radius: 20px; box-shadow: var(--shadow); pointer-events: none; }
.turf-badge[hidden] { display: none; }
.pill.gps-follow { background: var(--info); color: #fff; } .pill.gps-live { color: var(--info); }
.update-banner { position: fixed; left: 12px; right: 12px; top: calc(8px + var(--safe-t)); z-index: 60; background: var(--info); color: #fff; font-weight: 700; text-align: center; padding: 12px; border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; }
.update-banner[hidden] { display: none; }
.signin-banner { background: var(--tint-warn); color: var(--on-warn); border-radius: 10px; padding: 8px 10px; font-weight: 600; margin: 0 0 8px; } .signin-banner[hidden] { display: none; }
.team-form { flex-wrap: wrap; } .team-form input, .team-form select { min-width: 110px; } .team-form[hidden] { display: none; }
.ts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 6px; } .ts-grid div { background: var(--fill); border-radius: 10px; padding: 6px; text-align: center; }
.ts-grid dt { font-size: 11px; color: var(--muted); } .ts-grid dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; } .ts-by { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
/* v2.5.2 sign-in reset link + drawer reset */
.btn.link { display: block; width: 100%; margin-top: 10px; background: none; border: 0; color: var(--muted); text-decoration: underline; font-size: 13px; }
#drawer-reset { margin-top: 18px; }
/* v2.6 Blitz Board, knock streak, follow-up nudges */
.pill-outline.blitz { margin-left: 4px; } .pill-outline.blitz.hot { background: var(--hot); color: #fff; border-color: var(--hot); }
table.blitz { width: 100%; border-collapse: collapse; font-size: 14px; } table.blitz th, table.blitz td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
table.blitz th:nth-child(2), table.blitz td:nth-child(2) { text-align: left; } table.blitz tr.me td { font-weight: 800; background: var(--tint-warn); } .blitz .streak { color: var(--hot); font-weight: 700; }
.nudge { display: inline-block; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 8px; margin-left: 4px; background: var(--fill); color: var(--ink); }
.nudge.n-due { background: var(--danger); color: #fff; } .nudge.n-prime { background: var(--tint-warn); color: var(--on-warn); } .nudge.n-second { background: var(--tint-info); color: var(--on-info); }
