/* ============================================================
   SPARTAN FORGE — Field Manual aesthetic
   Surveyor's notebook meets editorial: Fraunces serif heads,
   Public Sans body, JetBrains Mono data tables. Bone-ivory
   paper sidebar, oxblood + brass accents over iron-black map.
   ============================================================ */

/* Hard-defeat browser-side dark-mode forcing (Brave/Chrome force-dark). */
:root { color-scheme: only light !important; }
html, body { color-scheme: only light !important; }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: only light !important; }
}

:root {
  --ivory: #f4ecdb;
  --bone:  #ebe1cd;
  --linen: #e0d4ba;
  --rule:  rgba(26,22,20,0.10);
  --rule-strong: rgba(26,22,20,0.22);

  --ink:   #1a1614;
  --ink-2: #3d3530;
  --ash:   #6b6358;
  --ash-2: #8d8478;

  --iron:    #1c1814;
  --iron-2:  #261f1a;
  --void:    #0e0a07;

  --oxblood:  #5c1a14;
  --oxblood-d:#3f0e0a;
  --brass:    #b8923d;
  --brass-2:  #d4ad57;
  --moss:     #4a6b3a;
  --rust:     #8a3a1f;

  --paper-shadow: 0 1px 0 rgba(255,250,238,0.7) inset, 0 24px 64px -24px rgba(26,22,20,0.55);

  --display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --body:    'Public Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

html, body { height: 100%; margin: 0; padding: 0; }
html { overflow: hidden; font-size: 19px; }
body {
  background: var(--iron);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11', 'tnum';
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.scout-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ----------- MAP PANEL ----------- */
.map-panel { position: relative; background: var(--iron); }
#map { width: 100%; height: 100%; background: var(--void); }

.map-bracket {
  position: absolute;
  width: 18px; height: 18px;
  border: 1.5px solid var(--brass);
  pointer-events: none;
  z-index: 400;
  opacity: 0.55;
}
.map-bracket.tl { top: 70px; left: 12px; border-right: none; border-bottom: none; }
.map-bracket.tr { top: 70px; right: 12px; border-left: none; border-bottom: none; }
.map-bracket.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.map-bracket.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.coords-hud {
  position: absolute;
  bottom: 16px; left: 18px;
  z-index: 500;
  background: rgba(14,10,7,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(184,146,61,0.35);
  color: var(--brass-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 7px 12px;
  display: flex; gap: 12px; align-items: baseline;
}
.coords-hud .lbl {
  color: var(--ash-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* ----------- TOOLBAR ----------- */
.scout-controls {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 500;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  max-width: calc(100% - 460px);
  overflow-x: auto;
  padding: 4px;
  background: rgba(14,10,7,0.78);
  border: 1px solid rgba(184,146,61,0.28);
  border-radius: 4px;
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
.scout-controls::-webkit-scrollbar { height: 3px; }
.scout-controls::-webkit-scrollbar-thumb { background: var(--brass); }

.scout-btn {
  background: transparent;
  border: none;
  color: var(--brass-2);
  padding: 7px 12px;
  border-radius: 2px;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 120ms ease, color 120ms ease;
}
.scout-btn:hover { background: rgba(184,146,61,0.14); color: #f0e0a8; }
.scout-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  color: var(--ash);
}
.scout-btn.active {
  background: var(--brass);
  color: var(--void);
  font-weight: 600;
}

/* Dropdown */
.menu-wrap { position: relative; flex-shrink: 0; }
.menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--ivory);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  box-shadow: 0 18px 48px -8px rgba(0,0,0,0.55);
  overflow: hidden;
  z-index: 600;
}
.menu-wrap.open .menu-panel { display: block; animation: dropFade 140ms ease-out; }
@keyframes dropFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  padding: 12px 16px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 100ms ease;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bone); }
.menu-item.active { background: var(--linen); color: var(--oxblood); }
.menu-item .hint {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ash);
  margin-top: 3px;
  letter-spacing: 0.03em;
  text-transform: none;
  font-weight: 400;
}

/* ----------- ADDRESS SEARCH ----------- */
.addr-search {
  position: absolute;
  top: 14px;
  right: 60px;
  z-index: 700;
  width: min(380px, calc(100vw - 100px));
  pointer-events: auto;
  padding-top: env(safe-area-inset-top, 0);
}
@media (max-width: 900px) {
  .addr-search { top: 64px; right: 14px; left: 14px; width: auto; }
}

.addr-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ivory);
  border: 1px solid var(--oxblood);
  border-radius: 4px;
  padding: 11px 14px;
  box-shadow: 0 4px 16px rgba(92,26,20,0.18), 0 12px 32px -8px rgba(0,0,0,0.4);
  transition: border-color 140ms ease;
}
.addr-pill:focus-within { border-color: var(--brass); box-shadow: 0 4px 16px rgba(184,146,61,0.25), 0 12px 32px -8px rgba(0,0,0,0.5); }

.addr-icon {
  color: var(--oxblood);
  font-size: 21px;
  line-height: 1;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  font-family: var(--display);
}
#addrInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  font-weight: 500;
  padding: 2px 0;
  min-width: 0;
  -webkit-text-size-adjust: 100%;
}
#addrInput::placeholder { color: var(--ash); font-weight: 400; font-style: italic; }
#addrInput::-webkit-search-cancel-button { display: none; }

.addr-clear {
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  width: 22px; height: 22px;
  color: var(--ash);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.addr-clear:hover { background: var(--bone); color: var(--ink); }

.addr-suggest {
  margin-top: 6px;
  background: var(--ivory);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 16px 48px -8px rgba(0,0,0,0.45);
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.addr-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
}
.addr-row:last-child { border-bottom: none; }
.addr-row:hover, .addr-row:active { background: var(--bone); }
.addr-row-icon { color: var(--oxblood); font-size: 15px; flex-shrink: 0; }
.addr-row-text {
  flex: 1; color: var(--ink);
  font-size: 15px; font-family: var(--body); line-height: 1.4;
}
.addr-row-src {
  font-family: var(--mono); font-size: 9px;
  color: var(--ash); letter-spacing: 0.18em; flex-shrink: 0;
}
.addr-loading {
  color: var(--ash); font-size: 14px; font-style: italic;
  cursor: default; padding: 14px 16px;
}
.addr-loading:hover { background: transparent; }

.addr-pin { position: relative; pointer-events: auto; }
.addr-pin-dot {
  position: absolute; inset: 5px;
  background: var(--oxblood);
  border: 2px solid var(--ivory);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--oxblood-d);
  z-index: 2;
}
.addr-pin-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(92,26,20,0.4);
  animation: addrPulse 1.6s ease-out infinite;
  z-index: 1;
}
@keyframes addrPulse { 0% { transform: scale(0.6); opacity: 0.85; } 100% { transform: scale(2.2); opacity: 0; } }

.addr-popup-label {
  font-family: var(--display); font-size: 17px; font-weight: 600;
  color: var(--ink); margin-bottom: 4px; line-height: 1.3;
}
.addr-popup-coords {
  font-family: var(--mono); font-size: 10px;
  color: var(--ash); letter-spacing: 0.06em; margin-bottom: 10px;
}
.addr-popup-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.addr-popup-btn {
  flex: 1; min-width: 70px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--oxblood);
  border-radius: 2px;
  color: var(--oxblood);
  font-family: var(--display); font-size: 13px; font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color 100ms ease, color 100ms ease;
}
.addr-popup-btn.primary { background: var(--oxblood); color: var(--ivory); }
.addr-popup-btn:hover { background: rgba(92,26,20,0.08); }
.addr-popup-btn.primary:hover { background: var(--oxblood-d); }

/* ----------- SIDEBAR (paper) ----------- */
.scout-sidebar {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px 28px 80px !important;
  background-color: #f4ecdb !important; /* explicit hex defeats Brave force-dark */
  background-image:
    radial-gradient(rgba(26,22,20,0.025) 1px, transparent 1px),
    linear-gradient(180deg, #f4ecdb 0%, #ebe1cd 100%) !important;
  background-size: 4px 4px, 100% 100% !important;
  border-left: 1px solid rgba(26,22,20,0.22) !important;
  box-shadow: var(--paper-shadow);
  color: #1a1614 !important;
}
.scout-sidebar::-webkit-scrollbar { width: 8px; }
.scout-sidebar::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 4px; }

.scout-head {
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.scout-head::before {
  content: 'CHAPTER I';
  position: absolute; top: 0; right: 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ash);
  letter-spacing: 0.24em;
}
.scout-head h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.0;
  color: var(--ink);
  margin: 12px 0 4px;
  letter-spacing: -0.02em;
}
.scout-head h1::first-letter {
  font-weight: 700;
  color: var(--oxblood);
}
.scout-head p {
  font-size: 14px;
  color: var(--ash);
  margin: 6px 0 0;
  font-family: var(--body);
  font-style: italic;
}
.scout-head a {
  color: var(--oxblood);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid currentColor;
}
.scout-head a:hover { color: var(--oxblood-d); }

#navLinks {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 14px; color: var(--ash);
  font-style: italic;
}
#authBar {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  color: var(--ash); letter-spacing: 0.08em;
}
#authBar button {
  background: transparent;
  border: 1px solid var(--oxblood);
  color: var(--oxblood);
  padding: 4px 10px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 2px;
}
#authBar button:hover { background: var(--oxblood); color: var(--ivory); }

.status-line {
  font-family: var(--body);
  font-style: italic;
  font-size: 14px;
  color: var(--ash);
  padding: 8px 0 14px;
  line-height: 1.4;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
}
.status-line.working {
  color: var(--oxblood);
  animation: statusPulse 1.4s ease-in-out infinite;
}
@keyframes statusPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* TEAM strip */
.team-strip {
  background-color: #ebe1cd !important;
  border: 1px solid rgba(26,22,20,0.22) !important;
  border-radius: 3px;
  padding: 14px 16px;
  margin-bottom: 18px;
  color: #1a1614 !important;
}
.team-strip-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.team-strip-head::before { content: '§ '; color: var(--oxblood); font-weight: 700; }
.team-strip-head .show-toggle {
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ash);
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.team-strip-head .show-toggle:hover { color: var(--ink); border-color: var(--ink); }
.team-strip-head .show-toggle.on { background: var(--ink); color: var(--ivory); border-color: var(--ink); }

.team-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0;
  font-size: 15px;
  border-bottom: 1px dashed var(--rule);
}
.team-row:last-child { border-bottom: none; }
.team-row .dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.team-row .name {
  flex: 1;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 600;
  font-feature-settings: 'tnum';
}
.team-row .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ash);
  font-feature-settings: 'tnum';
}
.team-row.you .name::after {
  content: ' · YOU';
  color: var(--oxblood);
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* DATA CARDS */
.card {
  background-color: #f4ecdb !important;
  border: 1px solid rgba(26,22,20,0.22) !important;
  border-left: 3px solid #5c1a14 !important;
  border-radius: 0;
  padding: 16px 18px;
  margin-bottom: 14px;
  position: relative;
  color: #1a1614 !important;
}
.card-head {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-strong);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.card-head::before {
  content: '◆';
  color: var(--brass);
  font-size: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 15px;
  border-bottom: 1px dotted var(--rule);
}
.row:last-child { border-bottom: none; }
.key {
  color: var(--ash);
  font-family: var(--body);
  font-weight: 400;
  font-style: italic;
  font-size: 14px;
}
.val {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 500;
  font-feature-settings: 'tnum', 'zero';
  font-size: 14px;
  text-align: right;
}
.val.gold { color: var(--brass); font-weight: 700; }
.val.green { color: var(--moss); font-weight: 600; }
.val.red { color: var(--rust); font-weight: 600; }

.lead-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  color: var(--ivory);
  margin-right: 14px;
  box-shadow: 0 0 0 3px var(--ivory), 0 0 0 4px currentColor;
}
.lead-row { display: flex; align-items: center; padding: 6px 0; }
.lead-info { flex: 1; }
.lead-score {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.01em;
}
.lead-score::after {
  content: ' / 100';
  font-size: 17px;
  color: var(--ash);
  font-weight: 400;
  font-style: italic;
}
.lead-reasons {
  font-family: var(--body);
  font-style: italic;
  font-size: 13px;
  color: var(--ash);
  margin-top: 4px;
}

.placeholder {
  text-align: center;
  padding: 50px 24px;
  color: var(--ash);
  font-size: 15px;
  font-family: var(--display);
  font-style: italic;
  line-height: 1.7;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
}

.action-btn {
  width: 100%;
  padding: 13px 16px;
  background: var(--oxblood);
  border: none;
  border-radius: 2px;
  color: var(--ivory);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 120ms ease;
}
.action-btn:hover { background: var(--oxblood-d); }
.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--oxblood);
  color: var(--oxblood);
}
.action-btn.secondary:hover { background: rgba(92,26,20,0.08); }

/* Floating panels */
#routePanel, #teamPanel {
  background: var(--ivory) !important;
  border: 1px solid var(--rule-strong) !important;
  border-left: 3px solid var(--brass) !important;
  border-radius: 3px !important;
  box-shadow: 0 18px 48px -8px rgba(0,0,0,0.55) !important;
  backdrop-filter: none !important;
}
#routePanel > div:first-child, #teamPanel > div:first-child {
  background: var(--ink) !important;
  color: var(--ivory) !important;
  border-bottom: none !important;
}
#routePanel span, #teamPanel span,
#routePanel button, #teamPanel button {
  color: inherit !important;
  font-family: var(--body) !important;
}
#routeCount {
  font-family: var(--display) !important;
  font-size: 21px !important;
  color: var(--brass) !important;
  font-weight: 600 !important;
}

/* Legend */
.legend {
  background: var(--ivory) !important;
  border: 1px solid var(--rule-strong) !important;
  border-radius: 3px !important;
  color: var(--ink) !important;
}
.legend-head {
  background: var(--ink) !important;
  color: var(--ivory) !important;
  font-family: var(--display) !important;
  padding: 10px 14px !important;
  cursor: pointer !important;
}
.legend-body { padding: 12px 14px !important; }
.legend-section { margin-bottom: 12px !important; }
.legend-title {
  font-family: var(--mono) !important;
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.18em !important;
  color: var(--ash) !important;
  margin-bottom: 6px !important;
}
.legend-row { font-size: 13px !important; color: var(--ink) !important; }
.legend-row b { font-family: var(--display); font-weight: 700; }

/* Mapbox GL JS overrides */
#map .mapboxgl-canvas { outline: none; }
.mapboxgl-popup {
  z-index: 400;
}
.mapboxgl-popup-content {
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid var(--oxblood);
  border-radius: 3px;
  box-shadow: 0 16px 48px -12px rgba(0,0,0,0.55);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  padding: 14px 16px;
  max-height: 60vh;
  overflow-y: auto;
}
.mapboxgl-popup-content b,
.mapboxgl-popup-content strong {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
}
.mapboxgl-popup-close-button {
  color: var(--ash);
  font-size: 21px;
  padding: 4px 8px;
  line-height: 1;
}
.mapboxgl-popup-close-button:hover { color: var(--ink); }
.mapboxgl-popup-tip { border-top-color: var(--ivory); }
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip { border-top-color: var(--ivory); }
.mapboxgl-popup-anchor-top .mapboxgl-popup-tip { border-bottom-color: var(--ivory); }
.mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--ivory); }
.mapboxgl-popup-anchor-right .mapboxgl-popup-tip { border-left-color: var(--ivory); }

/* Compat: popup classes used by other JS modules */
.leaflet-compat-popup .mapboxgl-popup-content {
  background: var(--ivory);
  color: var(--ink);
}

.mapboxgl-ctrl-group button {
  background: var(--ivory) !important;
  color: var(--oxblood) !important;
  border: 1px solid var(--rule-strong) !important;
}
.mapboxgl-ctrl-group button:hover { background: var(--bone) !important; }
.mapboxgl-ctrl-group button + button { border-top: 1px solid var(--rule-strong) !important; }

.mapboxgl-ctrl-attrib {
  background: rgba(244,236,219,0.85) !important;
  color: var(--ash) !important;
  font-family: var(--mono) !important;
  font-size: 10px !important;
}
.mapboxgl-ctrl-attrib a { color: var(--oxblood) !important; }

/* Leaflet compat overrides — left here for inline HTML that references leaflet classes */
.leaflet-container { background: var(--void); }
.leaflet-popup-content-wrapper {
  background: var(--ivory);
  color: var(--ink);
  border: 1px solid var(--oxblood);
  border-radius: 3px;
  box-shadow: 0 16px 48px -12px rgba(0,0,0,0.55);
}
.leaflet-popup-tip { background: var(--ivory); }
.leaflet-popup-content { font-family: var(--body); font-size: 14px; line-height: 1.45; margin: 14px 16px; }
.leaflet-popup-content b, .leaflet-popup-content strong { font-family: var(--display); font-weight: 600; color: var(--ink); }
.leaflet-popup-close-button { color: var(--ash) !important; font-size: 21px !important; padding: 6px !important; }

@media (max-width: 880px) {
  .scout-layout { grid-template-columns: 1fr; grid-template-rows: 60vh 1fr; }
  .scout-sidebar { height: auto; max-height: 40vh; border-left: none; border-top: 2px solid var(--ink); }
  .scout-controls { max-width: calc(100% - 28px); }
  .scout-head h1 { font-size: 30px; }
}

/* ============================================================
   PROPOSAL CALCULATOR — merged into sidebar from old index.html
   ============================================================ */

#proposalCard { border-left-color: #b8923d !important; }
#proposalCard .card-head { color: #b8923d !important; }

.prop-input {
  width: 100%;
  padding: 10px 12px;
  background-color: #ebe1cd !important;
  border: 1px solid rgba(26,22,20,0.22);
  border-radius: 3px;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink) !important;
  outline: none;
  transition: border-color 120ms;
  box-sizing: border-box;
}
.prop-input::placeholder { color: var(--ash); font-style: italic; }
.prop-input:focus { border-color: var(--oxblood); box-shadow: 0 0 0 3px rgba(92,26,20,0.1); }

.prop-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}

.field { margin-bottom: 10px; }
.field .key { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: 0.02em; }

.prop-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(26,22,20,0.15);
  border-radius: 2px;
  margin: 8px 0 4px;
  cursor: pointer;
}
.prop-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--oxblood);
  border: 2px solid var(--ivory);
  cursor: grab;
  box-shadow: 0 2px 8px rgba(92,26,20,0.4);
}
.prop-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--oxblood);
  border: 2px solid var(--ivory);
  cursor: grab;
  box-shadow: 0 2px 8px rgba(92,26,20,0.4);
}

/* Results block — hidden by default, revealed by results.js */
.results-block {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 300ms ease, max-height 500ms ease;
}
.results-block.show {
  opacity: 1;
  max-height: none;
}

.hero-card { border-left-color: #4a6b3a !important; }
.hero-card .card-head { color: #4a6b3a !important; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}
.hero-cell {
  padding: 10px 12px;
  background-color: #ebe1cd !important;
  border-radius: 3px;
  border: 1px solid rgba(26,22,20,0.08);
}
.hero-cell .lead-reasons {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-style: normal;
}
.hero-number {
  font-family: var(--display) !important;
  font-size: 26px !important;
  font-weight: 700;
  color: var(--oxblood);
  line-height: 1;
  font-feature-settings: 'tnum';
}

#buildBtn:disabled { opacity: 0.6; cursor: wait; }
#buildBtn.loading { background-color: var(--brass) !important; color: var(--void) !important; }

/* ============================================================
   DISPOSITION SYSTEM — knock tracking, plan mode, Enzy sync
   ============================================================ */

/* KNOCK COUNTER HUD — floating pill on map */
.knock-counter {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: rgba(14,10,7,0.88);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(184,146,61,0.30);
  border-radius: 4px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--brass-2);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
.kc-item { display: inline-flex; align-items: center; gap: 4px; }
.kc-icon { font-size: 13px; }
.kc-sep { color: rgba(184,146,61,0.3); margin: 0 10px; font-size: 11px; }
.kc-knocked { color: var(--brass-2); }
.kc-appts { color: #2d8a5e; }
.kc-sales { color: #d4a843; font-weight: 700; }
.kc-planned { color: #4b7bec; }

@media (max-width: 880px) {
  .knock-counter {
    bottom: auto;
    top: 108px;
    left: 14px;
    right: 14px;
    transform: none;
    width: auto;
    justify-content: center;
    font-size: 11px;
    padding: 6px 12px;
  }
}

/* PLAN MODE TOGGLE — pill next to address search */
.plan-mode-toggle {
  position: absolute;
  top: 14px;
  right: 450px;
  z-index: 700;
  pointer-events: auto;
  padding-top: env(safe-area-inset-top, 0);
}
@media (max-width: 900px) {
  .plan-mode-toggle { top: 64px; right: auto; left: 14px; }
}
.plan-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ivory);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ash);
  transition: all 140ms ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  user-select: none;
  -webkit-user-select: none;
}
.plan-pill:hover { border-color: #4b7bec; color: #4b7bec; }
.plan-pill.active {
  background: #4b7bec;
  color: #fff;
  border-color: #4b7bec;
  box-shadow: 0 4px 16px rgba(75,123,236,0.35);
}
.plan-pill .plan-dot {
  width: 10px; height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transition: background 140ms ease;
}
.plan-pill.active .plan-dot {
  background: #fff;
  border-color: #fff;
}

/* DISPOSITION BAR — bottom of parcel card */
.disposition-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--rule-strong);
}
.dispo-btn {
  flex: 1 1 calc(33.333% - 4px);
  min-width: 90px;
  min-height: 48px;
  padding: 10px 6px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  transition: all 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.dispo-btn:active { transform: scale(0.95); }

.dispo-btn.gray {
  background: rgba(120,112,104,0.12);
  border-color: #787068;
  color: #787068;
}
.dispo-btn.gray:hover { background: rgba(120,112,104,0.25); }

.dispo-btn.red {
  background: rgba(196,64,64,0.10);
  border-color: #c44040;
  color: #c44040;
}
.dispo-btn.red:hover { background: rgba(196,64,64,0.22); }

.dispo-btn.green {
  background: rgba(45,138,94,0.10);
  border-color: #2d8a5e;
  color: #2d8a5e;
}
.dispo-btn.green:hover { background: rgba(45,138,94,0.22); }

.dispo-btn.gold {
  background: rgba(212,168,67,0.12);
  border-color: #d4a843;
  color: #b8923d;
}
.dispo-btn.gold:hover { background: rgba(212,168,67,0.28); }

.dispo-btn.black {
  background: rgba(26,22,20,0.08);
  border-color: #1a1614;
  color: #1a1614;
}
.dispo-btn.black:hover { background: rgba(26,22,20,0.18); }

.dispo-btn.purple {
  background: rgba(124,58,237,0.10);
  border-color: #7c3aed;
  color: #7c3aed;
}
.dispo-btn.purple:hover { background: rgba(124,58,237,0.22); }

/* Active/current state indicator on dispo buttons */
.dispo-btn.current {
  box-shadow: 0 0 0 3px rgba(184,146,61,0.4);
  font-weight: 700;
}

/* SYNC BUTTON — shown in knock counter area when items pending */
.sync-btn {
  pointer-events: auto;
  background: transparent;
  border: 1px solid var(--brass);
  color: var(--brass);
  padding: 4px 10px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  margin-left: 12px;
}
.sync-btn:hover { background: var(--brass); color: var(--void); }

/* Disposition map pin styles (Leaflet overrides) */
.dispo-pin-planned {
  border: 2px dashed #4b7bec !important;
  background: transparent !important;
}
.dispo-pin-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.dispo-pin-x::before,
.dispo-pin-x::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 2px;
  background: #fff;
  top: 50%;
  left: 15%;
}
.dispo-pin-x::before { transform: rotate(45deg); }
.dispo-pin-x::after { transform: rotate(-45deg); }

/* ========== Accessibility: visible keyboard focus ========== */
:focus:not(:focus-visible) { outline: none; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #d4a843;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(212, 168, 67, 0.28);
}

/* ---- Scoped focus-visible (amber ring for forge-specific controls) ---- */
.scout-btn:focus-visible,
.action-btn:focus-visible,
.dispo-btn:focus-visible,
.plan-pill:focus-visible,
.sync-btn:focus-visible,
.addr-clear:focus-visible,
.addr-popup-btn:focus-visible,
.show-toggle:focus-visible {
  outline: 2px solid #ffb547;
  outline-offset: 2px;
}
.prop-input:focus-visible,
.prop-slider:focus-visible,
#addrInput:focus-visible {
  outline: 2px solid #ffb547;
  outline-offset: 1px;
}

/* a11y — global keyboard focus ring for any interactive element not styled above */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="menuitem"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #ffb547;
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
