/* Hallmark · component: side-panel · genre: modern-minimal · theme: Hemut black+gold (project tokens)
 * states: default · hover · focus · active · disabled · loading · error · success
 * pre-emit critique: P5 H5 E5 S5 R5 V4 · contrast: pass
 * ─────────────────────────────────────────────────────────────────────────────
 * scout.css — Scout (field / door-to-door) UI. Uses the SHARED Hemut tokens from
 * hemut-tokens.css + styles.css :root (black + gold #FCD23B, Clash Display / Inter /
 * JetBrains Mono). Namespaced .scout-* to avoid collisions. Matches the left FILTERS
 * panel + topbar: mono-uppercase chrome, gold accents, ▚ section markers, gold sliders.
 * ───────────────────────────────────────────────────────────────────────────── */

/* Alias the shared design tokens into scout's names — NO invented colors. */
.scout-drawer {
  --sc-ink:      var(--surface-1);      /* #15151a panel base */
  --sc-panel:    var(--panel);          /* #16161a */
  --sc-panel-2:  var(--surface-2);      /* #1b1b21 nested */
  --sc-line:     var(--line);           /* #2a2a31 */
  --sc-line-2:   var(--line-soft);      /* #26262d */
  --sc-hover:    var(--surface-hover);  /* #23232b */
  --sc-text:     var(--text);           /* #ECECEC */
  --sc-dim:      var(--text-dim);       /* #A6A6AD */
  --sc-gold:     var(--gold);           /* #FCD23B brand accent */
  --sc-gold-deep:var(--gold-deep);      /* #E0B41F */
  --sc-gold-dim: var(--gold-dim);       /* #6b5410 */
  --sc-gold-ink: var(--gold-ink);       /* #1a1505 text on gold */
  --sc-visit:    var(--followup);       /* #5BB3F0 door/visit channel */
  --sc-bad:      var(--danger);         /* #EF6F6C */
  --sc-community:#2A9D8F;                /* map teal — owner community */
  --sc-broker:   #B07BCC;               /* map violet — brokers */
}

/* ── Topbar toggle — inherits .topbtn; active state = gold (like .callbtn) ────── */
#scoutBtn { color: var(--gold-text); border-color: var(--gold-deep); }
#scoutBtn:hover { background: var(--gold-dim); color: var(--gold-text); }
#scoutBtn.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-text); }
#scoutBtn .scout-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); margin-left:5px; vertical-align:middle; }
#scoutBtn.on .scout-dot { background: var(--gold-ink); box-shadow:none; }

/* ── Left-edge drawer (v60 item 6: Scout is the main feature — it owns the left) ── */
.scout-drawer {
  position: fixed; top: 52px; left: 0; bottom: 0;
  width: min(430px, 92vw);
  background: var(--sc-panel);
  border-right: 1px solid var(--sc-line);
  box-shadow: var(--elev-2);
  display: flex; flex-direction: column;
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform var(--dur-2, 200ms) var(--ease-out, cubic-bezier(.16,1,.3,1));
  font-family: var(--font-body); font-size: 14px; line-height: 1.45;
  color: var(--sc-text);
}
.scout-drawer { border-radius: 0 16px 16px 0; }
.scout-drawer.open { transform: translateX(0); }
.scout-drawer.full { top: 0; left: 0; right: 0; bottom: 0; width: 100vw; border-right: none; border-radius: 0; }
.scout-drawer.full .scout-body { max-width: 620px; margin: 0 auto; }

.scout-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--sc-line);
  background: var(--sc-panel-2);
  border-radius: 16px 0 0 0;
}
.scout-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin: 0; letter-spacing: .3px; color: var(--sc-text); }
.scout-head .scout-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--sc-dim); }
.scout-head .scout-spacer { flex: 1; }
.scout-iconbtn {
  background: var(--sc-panel); border: 1px solid var(--sc-line); color: var(--sc-dim);
  width: 30px; height: 30px; border-radius: 11px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--dur-1,120ms) var(--ease-out), border-color var(--dur-1,120ms) var(--ease-out), background var(--dur-1,120ms) var(--ease-out);
}
.scout-iconbtn:hover { background: var(--sc-hover); border-color: var(--sc-line-2); color: var(--sc-text); }
.scout-iconbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.scout-body { flex: 1; overflow-y: auto; padding: 16px 14px; }

/* ── Sections / labels — the "▚ LABEL" left-panel pattern ─────────────────────── */
.scout-sec { margin-bottom: 20px; }
.scout-sec > .scout-label, .scout-label {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--sc-dim); margin-bottom: 10px;
}
.scout-sec > .scout-label::before, .scout-label::before { content: "▚"; color: var(--gold-text); font-size: 9px; letter-spacing: 0; }
.scout-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Inputs ──────────────────────────────────────────────────────────────────── */
.scout-input, .scout-select {
  background: var(--sc-ink); border: 1px solid var(--sc-line); color: var(--sc-text);
  border-radius: 11px; padding: 10px 12px; font-family: var(--font-body); font-size: 14px; width: 100%;
}
.scout-input::placeholder { color: var(--sc-dim); }
.scout-input:focus, .scout-select:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 2px var(--gold-dim); }

/* ── address autocomplete dropdown ───────────────────────────────────────────── */
.scout-geowrap { position: relative; }
.scout-suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--sc-panel-2); border: 1px solid var(--sc-line); border-radius: 16px;
  box-shadow: var(--elev-2); overflow-y: auto; max-height: 258px;
}
.scout-sug {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: transparent; border: none; border-bottom: 1px solid var(--sc-line);
  padding: 9px 11px; cursor: pointer; color: var(--sc-text); font-family: var(--font-body);
}
.scout-sug:last-child { border-bottom: none; }
.scout-sug:hover, .scout-sug:focus-visible { background: var(--sc-hover); outline: none; }
.scout-sug .sc-ic { color: var(--sc-gold); }
.scout-sug .sug-txt { display: flex; flex-direction: column; min-width: 0; }
.scout-sug .sug-txt b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scout-sug .sug-sub { font-size: 11.5px; color: var(--sc-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Buttons — mono-uppercase chrome, like .topbtn ───────────────────────────── */
.scout-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--sc-panel); border: 1px solid var(--sc-line); color: var(--sc-dim);
  border-radius: 11px; padding: 9px 13px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase;
  white-space: nowrap; cursor: pointer; text-decoration: none; box-shadow: var(--elev-1);
  transition: color var(--dur-1,120ms) var(--ease-out), border-color var(--dur-1,120ms) var(--ease-out), background var(--dur-1,120ms) var(--ease-out);
}
.scout-btn:hover { border-color: var(--sc-line-2); color: var(--sc-text); background: var(--sc-hover); }
.scout-btn:active { transform: translateY(1px); }
.scout-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.scout-btn.primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-text); }
.scout-btn.primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: var(--gold-ink); }
.scout-btn.block { width: 100%; }
.scout-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Chips — pill toggles; active = gold-dim/gold-deep/gold (the .callbtn pattern) */
.scout-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.scout-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--sc-ink); border: 1px solid var(--sc-line); color: var(--sc-dim);
  border-radius: var(--r-pill, 999px); padding: 7px 12px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
  cursor: pointer; user-select: none;
  transition: color var(--dur-1,120ms) var(--ease-out), border-color var(--dur-1,120ms) var(--ease-out), background var(--dur-1,120ms) var(--ease-out);
}
.scout-chip:hover { border-color: var(--sc-line-2); color: var(--sc-text); }
.scout-chip.on { background: var(--gold-dim); border-color: var(--gold-deep); color: var(--gold-text); }
.scout-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ── Segmented control (loop / one-way) ──────────────────────────────────────── */
.scout-seg { display: inline-flex; border: 1px solid var(--sc-line); border-radius: 11px; overflow: hidden; }
.scout-seg button {
  background: var(--sc-ink); border: none; color: var(--sc-dim); padding: 8px 13px; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
}
.scout-seg button.on { background: var(--gold); color: var(--gold-ink); }

/* ── Range with value badge ([ 10 mi ]) ──────────────────────────────────────── */
.scout-range { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.scout-range > span:first-child { font-family: var(--font-mono); font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--sc-dim); min-width: 66px; }
.scout-range input[type=range] { flex: 1; height: 20px; accent-color: var(--gold-ctl); cursor: pointer; background: transparent; }
.scout-range .scout-rval { font-family: var(--font-mono); font-size: 12px; color: var(--gold-text); min-width: 54px; text-align: right; }
.scout-range .scout-rval::before { content: "["; color: var(--hud-tick, #4a3f17); margin-right: 3px; }
.scout-range .scout-rval::after  { content: "]"; color: var(--hud-tick, #4a3f17); margin-left: 3px; }

/* ── Inline link-buttons ("use map area · recenter") ─────────────────────────── */
.scout-linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .4px;
  color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold-dim);
}
.scout-linkbtn:hover { text-decoration-color: var(--gold-text); }
.scout-linkbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ── Refine bar — collapsed filter summary on the home list ──────────────────── */
.scout-refinebar {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: var(--sc-panel-2); border: 1px solid var(--sc-line); border-radius: 11px;
  padding: 10px 12px; margin-bottom: 12px; cursor: pointer; text-align: left;
  transition: border-color var(--dur-1,120ms) var(--ease-out), background var(--dur-1,120ms) var(--ease-out);
}
.scout-refinebar:hover { border-color: var(--gold-deep); background: var(--sc-hover); }
.scout-refinebar:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.scout-refinebar .rf-lbl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-text); flex: none; }
.scout-refinebar .rf-sum { font-size: 12px; color: var(--sc-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.scout-refinebar .rf-caret { color: var(--sc-dim); flex: none; display: inline-flex; }

/* ── Undo toast — instant action + 5s takeback, no confirm dialogs ───────────── */
.scout-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); z-index: 2200;
  display: flex; align-items: center; gap: 14px;
  background: var(--sc-panel-2); border: 1px solid var(--sc-line); border-radius: 12px;
  box-shadow: var(--elev-2); padding: 11px 16px; font-size: 13px; color: var(--sc-text);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2,200ms) var(--ease-out), transform var(--dur-2,200ms) var(--ease-out);
}
.scout-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.scout-toast-undo {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--gold-text);
}
.scout-toast-undo:hover { color: var(--gold-deep); }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.scout-count { font-family: var(--font-mono); color: var(--sc-dim); font-size: 11px; letter-spacing: .4px; margin: 2px 0 12px; }
.scout-count b { color: var(--sc-text); }
.scout-card {
  background: var(--sc-panel-2); border: 1px solid var(--sc-line); border-radius: 16px;
  padding: 13px; margin-bottom: 10px; position: relative;
}
.scout-card.touched { opacity: .55; }
.scout-card .sc-stopnum {
  position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--elev-1);
}
.scout-card .sc-head { display: flex; align-items: baseline; gap: 8px; }
.scout-card .sc-name { font-family: var(--font-body); font-weight: 700; font-size: 14.5px; color: var(--sc-text); flex: 1; }
.scout-card .sc-dist { font-family: var(--font-mono); color: var(--gold-text); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.scout-card .sc-meta { color: var(--sc-dim); font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.scout-card .sc-meta b { color: var(--sc-text); font-weight: 600; }

.scout-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.sc-badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .5px; text-transform: uppercase; padding: 3px 8px; border-radius: 8px; font-weight: 600; }
.sc-badge.forhire   { background: var(--gold-dim); color: var(--gold-text); }
.sc-badge.private   { background: rgba(166,166,173,.14); color: var(--sc-dim); }
.sc-badge.broker    { background: rgba(176,123,204,.16); color: var(--sc-broker); }
.sc-badge.community { background: rgba(42,157,143,.18); color: var(--sc-community); }
.sc-badge.home      { background: rgba(224,180,31,.14); color: var(--gold-deep); }
.sc-badge.outcome   { background: var(--sc-ink); border: 1px solid var(--sc-line); color: var(--sc-text); }

/* item 7 (v60): hand-pick route affordances */
.sc-pick.on { background: var(--gold-dim); color: var(--gold-text); border-color: var(--gold-deep); }
.sc-soft { font-family: var(--font-mono); font-size: 10px; color: var(--sc-dim, var(--text-dim)); margin-top: 4px; letter-spacing: .2px; }

.scout-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.scout-actions .scout-btn { flex: 1; padding: 9px 8px; }
.scout-actions .sc-svbtn { flex: 0 0 auto; min-width: 42px; padding: 9px 10px; }  /* compact eye — peek at the building */

/* Street View thumbnail (prepStreetView flag + Google key) */
.sc-sv { display: block; width: 100%; height: auto; border-radius: 9px; margin-top: 10px; border: 1px solid var(--sc-line); }

.scout-note { font-size: 11.5px; color: var(--sc-dim); line-height: 1.5; margin-top: 8px; }
.scout-note.warn { color: var(--gold-deep); }

/* ── Route summary bar ───────────────────────────────────────────────────────── */
.scout-routebar {
  position: sticky; bottom: 0; margin: 14px -14px -16px; padding: 12px 14px;
  background: var(--sc-panel-2); border-top: 1px solid var(--sc-line);
  display: flex; gap: 8px; align-items: center;
}
.scout-routebar .rt-stat { font-family: var(--font-mono); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--sc-dim); }
.scout-routebar .rt-stat b { color: var(--gold-text); }

/* ── Settings (flags) ────────────────────────────────────────────────────────── */
.scout-flags { display: flex; flex-direction: column; gap: 2px; }
.scout-flag { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--sc-line); }
.scout-flag:last-child { border-bottom: none; }
.scout-flag .sf-txt { flex: 1; }
.scout-flag .sf-name { font-weight: 600; font-size: 13px; color: var(--sc-text); }
.scout-flag .sf-desc { font-size: 11.5px; color: var(--sc-dim); }
.scout-flag .sf-heavy { color: var(--gold-deep); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .8px; margin-left: 5px; }

/* switch — gold when on */
.scout-switch { position: relative; width: 40px; height: 23px; flex: none; }
.scout-switch input { opacity: 0; width: 0; height: 0; }
.scout-switch .sw-track { position: absolute; inset: 0; background: var(--sc-line); border-radius: var(--r-pill, 999px); transition: background var(--dur-1,120ms) var(--ease-out); cursor: pointer; }
.scout-switch .sw-track::before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: var(--sc-text); border-radius: 50%; transition: transform var(--dur-1,120ms) var(--ease-out); }
.scout-switch input:checked + .sw-track { background: var(--gold); }
.scout-switch input:checked + .sw-track::before { transform: translateX(17px); background: var(--gold-ink); }
.scout-switch input:focus-visible + .sw-track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Numbered route pins on the map (visiting order; done = dimmed check) ────── */
.scout-routepin {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); border: 2px solid var(--sc-ink);
  font-family: var(--font-mono); font-weight: 800; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1.5px var(--gold), 0 2px 8px rgba(0,0,0,.5);
}
.scout-routepin.done { background: #5c5c64; color: #f2f2f5; box-shadow: 0 0 0 1.5px #5c5c64, 0 2px 8px rgba(0,0,0,.4); }  /* 5.7:1 — sunlight-safe */

/* ── First-use hint — one line, dismissible, never a tour ────────────────────── */
.scout-hint {
  display: flex; align-items: center; gap: 10px;
  background: var(--gold-dim); border: 1px solid var(--gold-deep); border-radius: 11px;
  color: var(--gold-text); font-size: 12.5px; line-height: 1.45;
  padding: 9px 12px; margin-bottom: 12px;
}
.scout-hint span { flex: 1; }
.scout-hint b { color: var(--sc-text); }
.scout-hint-x { background: none; border: none; color: var(--gold-text); cursor: pointer; padding: 2px; display: inline-flex; flex: none; }
.scout-hint-x:hover { color: var(--sc-text); }

/* ── Pin-state legend on the list header ─────────────────────────────────────── */
.scout-legend { display: inline-flex; gap: 10px; margin-left: 10px; }
.scout-legend span { display: inline-flex; align-items: center; gap: 4px; }
.scout-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ── "You are here" map marker ───────────────────────────────────────────────── */
.scout-here { width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 3px solid var(--sc-ink); box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(252,210,59,.75); }

/* ── Empty / loading ─────────────────────────────────────────────────────────── */
.scout-empty { text-align: center; color: var(--sc-dim); padding: 34px 16px; font-size: 13px; line-height: 1.5; }
.scout-empty .se-emoji { display: block; margin: 0 auto 12px; color: var(--sc-dim); }
.scout-empty .se-emoji .sc-ic { width: 30px; height: 30px; }

/* inline outline icons — align with adjacent text/labels */
.sc-ic { flex: none; display: inline-block; vertical-align: -2px; }
.scout-iconbtn .sc-ic { vertical-align: middle; }

/* ── "Up next" — the one stop that matters right now in the field ────────────── */
.scout-card.sc-current { border-color: var(--gold-deep); box-shadow: 0 0 0 1px var(--gold-dim), var(--elev-1); }
.scout-card.sc-current .sc-stopnum { box-shadow: 0 0 0 2px var(--gold-dim), 0 0 10px rgba(252,210,59,.4); }
.sc-nexttag {
  position: absolute; top: -9px; right: 12px;
  background: var(--gold); color: var(--gold-ink); border-radius: 999px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 9px; box-shadow: var(--elev-1);
}
/* the focus stop's actions are the biggest thing on screen — walk-and-tap sized */
.scout-card.sc-current .scout-actions .scout-btn { min-height: 48px; font-size: 12.5px; }

/* ── Field ergonomics — full-screen mode = gloves-and-glare sizing ───────────── */
.scout-drawer.full .scout-actions .scout-btn { min-height: 52px; font-size: 13px; }
.scout-drawer.full .sc-quick .scout-chip { min-height: 46px; padding: 12px 16px; font-size: 12px; }
.scout-drawer.full .scout-routebar { padding: 14px; }
.scout-drawer.full .scout-routebar .scout-btn { min-height: 52px; font-size: 12.5px; }
.scout-drawer.full .scout-card .sc-name { font-size: 16px; }
.scout-drawer.full .scout-card .sc-dist { font-size: 14px; }

/* ── Mobile — bottom sheet, bigger tap targets ───────────────────────────────── */
@media (max-width: 640px) {
  .scout-drawer { width: 100vw; top: auto; height: 84vh; border-right: none; border-top: 1px solid var(--sc-line); border-radius: 16px 16px 0 0; transform: translateY(100%); }
  .scout-drawer.open { transform: translateY(0); }
  .scout-drawer.full { height: 100vh; border-radius: 0; transform: translateY(0); }
  /* every field control ≥48px — one-handed, walking, sunlight */
  .scout-actions .scout-btn { min-height: 48px; padding: 12px 8px; font-size: 12px; }
  .sc-quick .scout-chip { min-height: 44px; padding: 11px 14px; }
  .scout-routebar .scout-btn { min-height: 48px; }
  .scout-btn, .scout-iconbtn { min-height: 44px; }
  .scout-input { min-height: 48px; }
}
