/* ═══════════════════════════════════════════════════════════════════════════
   Reckon — Direction A "Clay"  v2
   Design system: near-white paper / near-black ink, clay accent spent like a
   link colour (underlines, rule-lines, one hero figure) not a paint bucket.
   Archivo for everything; Courier Prime (tabular) for every number, date,
   postcode and confidence score. No rounded cards, no drop shadows — rule-
   lines (border-top/bottom) separate sections instead. Light + dark.
   Source of truth: docs design-direction artifact "Reckon Design Direction v2".
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens · LIGHT (default) ───────────────────────────────────────────── */
:root {
  --ink:      #14110D;
  --ink-2:    #4A443C;
  --ink-3:    #7A7266;
  --paper:    #FBFAF8;
  --paper-2:  #F0EEE9;
  --paper-3:  #E7E3DA;
  --line:     #D8D3C8;
  --line-2:   #B9B2A2;

  --accent:      #C1522E;
  --accent-ink:  #7A2E17;
  --accent-tint: #F3E2DA;

  --verified:    #1F5C3D;
  --verified-bg: #DCE9E0;
  --caution:     #8A5A12;
  --caution-bg:  #EEE3CC;
  --weak:        #8C2E1D;
  --weak-bg:     #EFDCD5;

  /* generic surface/bg aliases used throughout the file — mapped onto paper */
  --bg:           var(--paper);
  --surface:      var(--paper);
  --surface-2:    var(--paper-2);
  --border:       var(--line);
  --border-hover: var(--line-2);

  --ink-4: var(--ink-3);   /* v1 had a 4th ink step; fold it into ink-3 */

  --brand:        var(--accent);
  --brand-hover:  var(--accent-ink);
  --brand-light:  var(--accent-tint);
  --brand-fg:     #ffffff;

  --success:       var(--verified);
  --success-light: var(--verified-bg);
  --success-fg:    var(--verified);

  --warn:       var(--caution);
  --warn-light: var(--caution-bg);
  --warn-fg:    var(--caution);

  --danger:       var(--weak);
  --danger-light: var(--weak-bg);
  --danger-fg:    var(--weak);

  /* No rounded soft cards, no drop shadows — rule-lines do the separating. */
  --r-sm:  0px;
  --r:     0px;
  --r-lg:  0px;

  --sh-sm: none;
  --sh:    none;
  --sh-lg: none;

  --mono:   'Courier Prime', ui-monospace, 'SFMono-Regular', monospace;
  --sans:   'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans-x: 'Archivo Expanded', 'Archivo', -apple-system, sans-serif;
  --font:   var(--sans);
  --ease: cubic-bezier(.4,0,.2,1);

  /* legacy aliases — remapped onto the Clay palette so older rules inherit it */
  --slate-900:#14110D; --slate-800:#4A443C; --slate-700:#4A443C;
  --slate-500:#7A7266; --slate-400:#7A7266; --slate-200:#D8D3C8;
  --slate-100:#F0EEE9; --slate-50:#FBFAF8;  --white:#ffffff;
  --green-900:#1F5C3D; --green-800:#1F5C3D; --green-700:#1F5C3D;
  --green-600:#1F5C3D; --green-500:#1F5C3D; --green-400:#1F5C3D;
  --green-100:#DCE9E0; --green-50:#DCE9E0;
  --amber-600:#8A5A12; --amber-500:#8A5A12; --amber-100:#EEE3CC; --amber-50:#EEE3CC;
  --red-600:#8C2E1D;   --red-500:#8C2E1D;   --red-100:#EFDCD5;   --red-50:#EFDCD5;
  /* "blue" family is repurposed as clay so accents stay cohesive */
  --blue-600:#C1522E;  --blue-500:#C1522E;  --blue-100:#F3E2DA;  --blue-50:#F3E2DA;
  --purple-500:#9a6b8c; --purple-100:#efe4ec;
  --teal-500:#3f9e91;   --teal-100:#dcefec;
  --text:var(--ink-2); --muted:var(--ink-3); --subtle:var(--ink-3);
  --surface-dim:var(--surface-2); --border-light:rgba(20,17,13,.08);

  --map-filter: none;
  color-scheme: light;
}

/* ── Tokens · DARK (same structure, lifted clay) ─────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:      #F1EDE6;
    --ink-2:    #C9C2B5;
    --ink-3:    #948C7C;
    --paper:    #14120E;
    --paper-2:  #1C1914;
    --paper-3:  #262119;
    --line:     #343026;
    --line-2:   #4A4438;

    --accent:      #E08862;
    --accent-ink:  #F0B79A;
    --accent-tint: #2E211B;

    --verified:    #7FBE9B;
    --verified-bg: #1B2A21;
    --caution:     #D8AE64;
    --caution-bg:  #2E2515;
    --weak:        #D89282;
    --weak-bg:     #2E1D17;

    --bg: var(--paper); --surface: var(--paper); --surface-2: var(--paper-2);
    --border: var(--line); --border-hover: var(--line-2); --ink-4: var(--ink-3);
    --brand: var(--accent); --brand-hover: var(--accent-ink); --brand-light: var(--accent-tint);
    --brand-fg: #1a120c;
    --success: var(--verified); --success-light: var(--verified-bg); --success-fg: var(--verified);
    --warn: var(--caution); --warn-light: var(--caution-bg); --warn-fg: var(--caution);
    --danger: var(--weak); --danger-light: var(--weak-bg); --danger-fg: var(--weak);

    --slate-900:#F1EDE6; --slate-800:#C9C2B5; --slate-700:#C9C2B5;
    --slate-500:#948C7C; --slate-400:#948C7C; --slate-200:#343026;
    --slate-100:#1C1914; --slate-50:#14120E;  --white:#14120E;
    --green-900:#7FBE9B; --green-800:#7FBE9B; --green-700:#7FBE9B;
    --green-600:#7FBE9B; --green-500:#7FBE9B; --green-400:#7FBE9B;
    --green-100:#1B2A21; --green-50:#1B2A21;
    --amber-600:#D8AE64; --amber-500:#D8AE64; --amber-100:#2E2515; --amber-50:#2E2515;
    --red-600:#D89282;   --red-500:#D89282;   --red-100:#2E1D17;   --red-50:#2E1D17;
    --blue-600:#E08862;  --blue-500:#E08862;  --blue-100:#2E211B;  --blue-50:#2E211B;
    --purple-500:#b88aaa; --purple-100:#332631;
    --teal-500:#4fb3a4;   --teal-100:#1f322f;
    --border-light:rgba(241,237,230,.08);

    /* darken bright embedded maps so they sit in the dark UI */
    --map-filter: invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(0.95);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink:      #F1EDE6;
  --ink-2:    #C9C2B5;
  --ink-3:    #948C7C;
  --paper:    #14120E;
  --paper-2:  #1C1914;
  --paper-3:  #262119;
  --line:     #343026;
  --line-2:   #4A4438;

  --accent:      #E08862;
  --accent-ink:  #F0B79A;
  --accent-tint: #2E211B;

  --verified:    #7FBE9B;
  --verified-bg: #1B2A21;
  --caution:     #D8AE64;
  --caution-bg:  #2E2515;
  --weak:        #D89282;
  --weak-bg:     #2E1D17;

  --bg: var(--paper); --surface: var(--paper); --surface-2: var(--paper-2);
  --border: var(--line); --border-hover: var(--line-2); --ink-4: var(--ink-3);
  --brand: var(--accent); --brand-hover: var(--accent-ink); --brand-light: var(--accent-tint);
  --brand-fg: #1a120c;
  --success: var(--verified); --success-light: var(--verified-bg); --success-fg: var(--verified);
  --warn: var(--caution); --warn-light: var(--caution-bg); --warn-fg: var(--caution);
  --danger: var(--weak); --danger-light: var(--weak-bg); --danger-fg: var(--weak);

  --slate-900:#F1EDE6; --slate-800:#C9C2B5; --slate-700:#C9C2B5;
  --slate-500:#948C7C; --slate-400:#948C7C; --slate-200:#343026;
  --slate-100:#1C1914; --slate-50:#14120E;  --white:#14120E;
  --green-900:#7FBE9B; --green-800:#7FBE9B; --green-700:#7FBE9B;
  --green-600:#7FBE9B; --green-500:#7FBE9B; --green-400:#7FBE9B;
  --green-100:#1B2A21; --green-50:#1B2A21;
  --amber-600:#D8AE64; --amber-500:#D8AE64; --amber-100:#2E2515; --amber-50:#2E2515;
  --red-600:#D89282;   --red-500:#D89282;   --red-100:#2E1D17;   --red-50:#2E1D17;
  --blue-600:#E08862;  --blue-500:#E08862;  --blue-100:#2E211B;  --blue-50:#2E211B;
  --purple-500:#b88aaa; --purple-100:#332631;
  --teal-500:#4fb3a4;   --teal-100:#1f322f;
  --border-light:rgba(241,237,230,.08);

  --sh-sm: none; --sh: none; --sh-lg: none;
  --map-filter: invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(0.95);
  color-scheme: dark;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button { font-family: var(--sans); cursor: pointer; }
input, select, textarea { font-family: var(--sans); }

/* Every number, price, date, sqft figure, postcode and confidence score reads
   in the data typeface, tabular so columns of figures line up. */
.tabular-nums, [style*="font-variant-numeric"], .figure-value, .stamp,
.detail-value, .comp-price, .comp-ppsf, .crime-stat-val, .vh-range, .vh-ask strong,
.aff-sum-val, .vision-score-val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ── Layout shell ───────────────────────────────────────────────────────── */
.page-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ── Top nav (mode switcher) — plain text tabs, rule-line active state ───── */
.main-nav {
  display: flex;
  gap: 18px;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  margin: 20px 0 28px;
  width: 100%;
}
.main-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 2px 10px;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  transition: all 120ms var(--ease);
}
.main-nav-btn:hover { color: var(--ink); }
.main-nav-btn.is-active {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 700;
}
.main-nav-btn.is-active svg { stroke: var(--ink); }

/* ── Site header / branding ─────────────────────────────────────────────── */
.site-header { margin-bottom: 24px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
}
.brand-mark svg { stroke: var(--ink); }
.brand-name {
  font-family: var(--sans-x);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.brand-tagline {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.brand-name { font-weight: 800; letter-spacing: -0.035em; }

/* Header right-side actions: theme toggle + "Forget saved reports".
   .brand-lockup has flex-basis 0% (flex:1), so the flex wrap algorithm always
   treats it as trivially fitting and never wraps .header-actions onto its own
   line on content width alone — a narrow viewport instead squeezes
   .brand-lockup toward zero width and its overflow-visible tagline text
   renders UNDER .header-actions. flex-wrap:wrap on its own does not fix this
   (confirmed by measuring live getBoundingClientRect overlap at 390x844); the
   explicit flex-basis:100% breakpoint below is what actually forces a second
   line. */
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.brand-lockup { flex: 1; min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
@media (max-width: 560px) {
  .header-actions { flex-basis: 100%; justify-content: flex-start; }
}
.ghost-btn {
  font-family: var(--sans);
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  background: transparent; border: 1px solid var(--line-2);
  border-radius: 0; padding: 6px 11px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .03em;
  transition: all 120ms var(--ease); white-space: nowrap;
}
.ghost-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.theme-toggle {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm);
  color: var(--ink-3); cursor: pointer; transition: all 120ms var(--ease); flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun  { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-moon { display: inline; }

/* Inline button spinner (run assessment) */
.btn-spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: reckon-spin .7s linear infinite;
}
@keyframes reckon-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation: none; } }

/* Embedded Google maps / panoramas re-tint in dark mode */
.gm-tinted { filter: var(--map-filter); transition: filter .2s var(--ease); }

/* Live run progress (Phase 2c) */
.run-progress { padding: 20px 22px; }
.runp-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.runp-spin { width: 18px; height: 18px; border-width: 2.5px; color: var(--brand); flex-shrink: 0; }
.runp-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.runp-sub { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.runp-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.runp-step {
  display: flex; align-items: center; gap: 12px; padding: 7px 4px;
  font-size: 14px; color: var(--ink-4); transition: color .25s var(--ease);
}
.runp-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: all .25s var(--ease);
}
.runp-check { color: #fff; font-size: 11px; font-weight: 800; opacity: 0; transform: scale(.5); transition: all .2s var(--ease); }
.runp-step[data-state="active"] { color: var(--ink); font-weight: 600; }
.runp-step[data-state="active"] .runp-dot {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.runp-step[data-state="active"] .runp-dot::after {
  content: ""; position: absolute; inset: 2px; border-radius: 50%;
  border: 2px solid var(--brand); border-right-color: transparent;
  animation: reckon-spin .7s linear infinite;
}
.runp-step[data-state="done"] { color: var(--ink-3); }
.runp-step[data-state="done"] .runp-dot { border-color: var(--success); background: var(--success); }
.runp-step[data-state="done"] .runp-check { opacity: 1; transform: scale(1); }
.runp-step[data-state="error"] { color: var(--danger-fg); }
.runp-step[data-state="error"] .runp-dot { border-color: var(--danger); background: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  .runp-step[data-state="active"] .runp-dot::after { animation: none; }
}

/* ── Phase 3: headline valuation — a plain figure list, gov.uk-table style,
   no card wrapper. The fair-value figure is the one hero number on the page. ── */
.valuation-headline {
  background: transparent; border: none;
  border-radius: 0; box-shadow: none;
  padding: 0; margin: 0 0 4px;
}
.vh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 15px 0; border-bottom: 1px solid var(--line); }
.vh-eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.vh-range {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: var(--accent-ink); line-height: 1.05; margin-top: 4px;
}
.vh-likely { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.vh-likely strong { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.vh-read-col { text-align: right; min-width: 140px; }
.vh-read-badge {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 11px; letter-spacing: .05em;
  padding: 5px 10px; border: 1px solid currentColor; border-radius: 0; text-transform: uppercase;
}
.vh-read-badge.tone-good { color: var(--verified); }
.vh-read-badge.tone-info { color: var(--accent-ink); }
.vh-read-badge.tone-warn { color: var(--caution); }
.vh-read-badge.tone-bad  { color: var(--weak); }
.vh-ask { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.vh-ask strong { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.vh-gap { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.vh-conf { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.vh-conf-pill {
  display: inline-block; font-family: var(--mono); padding: 1px 7px; border-radius: 0;
  border: 1px solid currentColor; font-weight: 700; text-transform: capitalize; margin-left: 2px;
}
.conf-high   { color: var(--verified); }
.conf-medium { color: var(--caution); }
.conf-low, .conf-very_low { color: var(--weak); }
.vh-verdict {
  margin-top: 0; padding: 16px 0; border-bottom: 1px solid var(--line);
  font-size: 16px; line-height: 1.55; color: var(--ink);
}
/* Honest-uncertainty lead — an annotation, not an alarm banner. Shown below the
   valuation when confidence is low; the brand-core "we'd rather be honest than
   fake confidence" moment, so it leads the analysis, not buried. */
.vh-uncertainty {
  margin-top: 0; padding: 14px 0 16px 16px;
  background: transparent; border: none;
  border-left: 3px solid var(--weak); border-radius: 0;
  border-bottom: 1px solid var(--line);
}
.vh-uncertainty-h {
  margin: 0 0 6px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--weak);
}
.vh-uncertainty-body { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }

/* ── Phase 3: transparency layer ──────────────────────────────────────────── */
.transparency-section {
  background: transparent; border: none;
  border-top: 1px solid var(--line);
  border-radius: 0; box-shadow: none;
  padding: 20px 0; margin: 14px 0 0;
}
.tr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.tr-title { font-family: var(--sans-x); font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.tr-market {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; border-radius: 0;
  background: transparent; color: var(--ink-3); border: 1px solid var(--line-2); text-transform: uppercase;
}
.tr-market-hot    { color: var(--weak);     border-color: var(--weak); }
.tr-market-soft   { color: var(--accent-ink); border-color: var(--accent); }
.tr-market-normal { color: var(--verified); border-color: var(--verified); }
.tr-block { margin-top: 16px; }
.tr-h { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 8px; }
.tr-lede { font-size: 15px; line-height: 1.5; color: var(--ink); }
.tr-body { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin-top: 6px; }
/* Caveats / evidence notes — a lettered list (a. b. c.), Are.na-style, not bullets. */
.tr-list { list-style: none; margin: 0; padding: 0; counter-reset: reckon-letter; }
.tr-list li {
  counter-increment: reckon-letter;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
  padding: 8px 0 8px 26px; border-bottom: 1px solid var(--line); position: relative;
}
.tr-list li:last-child { border-bottom: none; }
.tr-list li::before {
  content: counter(reckon-letter, lower-alpha) ".";
  position: absolute; left: 0; top: 8px; font-family: var(--mono); color: var(--ink-3); font-size: 13px;
}
.tr-signals, .tr-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.tr-signal, .tr-src {
  display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--ink-2);
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.tr-signals li:last-child, .tr-sources li:last-child { border-bottom: none; }
.tr-signal-mark, .tr-src-mark {
  flex-shrink: 0; width: 18px; font-family: var(--mono); font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.tr-dir-positive .tr-signal-mark { color: var(--verified); }
.tr-dir-negative .tr-signal-mark { color: var(--weak); }
.tr-dir-neutral  .tr-signal-mark { color: var(--ink-3); }
.tr-impact { color: var(--ink-3); font-weight: 500; }
.tr-src-ok .tr-src-mark { color: var(--verified); }
.tr-src-no .tr-src-mark { color: var(--ink-3); }
.tr-src-no { color: var(--ink-3); }
.tr-unknowns { background: transparent; border: none; border-left: 3px solid var(--caution); border-radius: 0; padding: 4px 0 4px 16px; }
.tr-unknowns .tr-h { color: var(--caution); }
.tr-risks { background: transparent; border: none; border-left: 3px solid var(--weak); border-radius: 0; padding: 4px 0 4px 16px; }
.tr-risks .tr-h { color: var(--weak); }

/* Affordability toggle bar (re-skinned, dark-mode safe) */
.aff-toggle-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 14px; background: var(--accent-tint);
  border-radius: 0; border: 1px solid var(--line);
}
.aff-toggle-lbl { font-size: 12px; font-weight: 600; color: var(--accent-ink); flex: 1; min-width: 120px; }
.aff-toggle-btn {
  font-size: 12px; padding: 5px 11px; border-radius: 0; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-3); font-weight: 600;
}
.aff-toggle-btn.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.aff-toggle-go { font-size: 12px; padding: 5px 11px; background: var(--ink); color: var(--paper); border: none; border-radius: 0; cursor: pointer; font-weight: 600; }

@media (max-width: 560px) {
  .vh-read-col { text-align: left; min-width: 0; }
  .vh-range { font-size: 28px; }
}

/* ── Phase 4: History tab — price journey + timeline ──────────────────────── */
.hist-card { margin-bottom: 14px; }
.hist-sig-title { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; margin-bottom: 10px; }
/* Nearby-sales context (kept separate from the subject's own story) */
.hist-context-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin-bottom: 12px; }
.hist-context-list { display: flex; flex-direction: column; gap: 2px; }
.hist-ctx-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.hist-ctx-row:last-child { border-bottom: none; }
.hist-ctx-who { color: var(--ink-2); font-weight: 600; }
.hist-ctx-price { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.hist-ctx-date { color: var(--ink-4); font-size: 12px; white-space: nowrap; }
/* "What the history tells us" — real read */
/* ── B1-07 price-history timeline (Comps + History tabs) ───────────────── */
.timeline-card { margin-bottom: 14px; }
.tl-summary { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin: -4px 0 10px; }
.tl-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; font-size: 12.5px; color: var(--ink-3); }
.tl-stat strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-rows { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto 54px; gap: 8px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.tl-row:last-child { border-bottom: none; }
.tl-date { color: var(--ink-4); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tl-event { color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tl-tone-warn .tl-event { color: var(--warn-fg); }
.tl-tone-good .tl-event { color: var(--success-fg); }
.tl-tone-bad  .tl-event { color: var(--danger-fg); }
.tl-tone-ink  .tl-event { color: var(--ink-2); }
.tl-event-sub { display: block; font-size: 11px; color: var(--ink-4); font-weight: 500; }
.tl-note { display: block; font-size: 11px; color: var(--ink-4); font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.tl-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 5px;
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.tl-price { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.tl-pct { font-size: 12px; font-weight: 700; text-align: right; white-space: nowrap; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.tl-pct.down { color: var(--danger-fg); }
.tl-pct.up   { color: var(--success-fg); }
.tl-more { margin-top: 10px; background: none; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tl-more:hover { background: var(--surface-2); }
.tl-empty { font-size: 13px; color: var(--ink-3); line-height: 1.5; padding: 4px 0; }
/* DoD C: the one label for AI-written text (verdict, AI comp review). Never on template text. */
.ai-gen-label { display: inline-block; vertical-align: middle; margin-left: 6px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 1px 6px; border-radius: 0; color: var(--ink-3); background: transparent; border: 1px solid var(--line-2); white-space: nowrap; }
/* Open-data attribution — an annotation in the report's own voice, not footer
   small print: italic Courier Prime, same treatment as the honesty notes. */
.data-attribution { font-family: var(--mono); font-style: italic; font-size: 11px; color: var(--ink-3); line-height: 1.5; margin: 14px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
@media (max-width: 420px) {
  .tl-row { grid-template-columns: 70px minmax(0, 1fr) auto 48px; gap: 6px; font-size: 12.5px; }
  .tl-date { font-size: 11px; }
}

.hist-read { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.hist-read-line { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.hist-read-line strong { color: var(--ink); font-weight: 700; }

/* ── Phase 5: comp cards — flat rows, rule-line separated, no card box ──── */
.comp-card {
  display: block; background: transparent; border: none;
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 0; margin-bottom: 0;
  text-decoration: none; color: inherit; transition: background 120ms var(--ease);
}
.comp-list .comp-card:last-child { border-bottom: none; }
a.comp-card:hover { background: var(--paper-2); text-decoration: none; }
.comp-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.comp-status { font-family: var(--mono); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 0; border: 1px solid currentColor; }
.comp-status-sold { color: var(--verified); }
.comp-status-sstc { color: var(--caution); }
.comp-status-live { color: var(--accent-ink); }
.comp-dist { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.comp-price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); line-height: 1.1; }
.comp-specs { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.comp-figs { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.comp-sqft-tag { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 0; background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); }
.comp-sqft-tag.is-est { color: var(--ink-3); font-style: italic; }
.comp-ppsf { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.comp-addr { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.comp-recency { color: var(--ink-3); }

/* Address-modal map fallback (Maps JS unavailable) */
.adv2-map-fallback {
  display: flex; align-items: center; justify-content: center; height: 100%;
  padding: 24px; text-align: center; font-size: 13px; color: var(--ink-3);
  background: var(--surface-2);
}

/* ── Phase 6: Crime tab — real numbers, bars, comparison ──────────────────── */
.crime-stats-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.crime-stat {
  flex: 1; min-width: 150px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-sm); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px; border-left: 3px solid var(--border);
}
.crime-stat.tone-good { border-left-color: var(--success); }
.crime-stat.tone-warn { border-left-color: var(--warn); }
.crime-stat.tone-bad  { border-left-color: var(--danger); }
.crime-stat.tone-info { border-left-color: var(--brand); }
.crime-stat-label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.crime-stat-val { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.crime-stat-sub { font-size: 12px; color: var(--ink-3); }
.crime-cat-row { display: grid; grid-template-columns: 1fr 70px auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.crime-cat-name { color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.crime-cat-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.crime-cat-bar > span { display: block; height: 100%; border-radius: 999px; }
.crime-cat-count { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.crime-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.crime-compare-card { margin-top: 14px; }
.crime-compare-intro { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.crime-compare-input { display: flex; gap: 8px; margin-bottom: 12px; }
.crime-compare-input input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 14px; font-family: var(--font);
}
.crime-compare-input input:focus { outline: none; border-color: var(--brand); }
.crime-compare-input .ghost-btn { padding: 9px 16px; }
.crime-cmp-row { display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; }
.crime-cmp-name { color: var(--ink-2); font-weight: 600; }
.crime-cmp-bar { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.crime-cmp-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .4s var(--ease); }
.crime-cmp-total { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.crime-cmp-verdict { font-size: 14px; color: var(--ink-2); margin-top: 10px; line-height: 1.5; }
.crime-cmp-period { display: block; font-size: 12px; color: var(--ink-4); margin-top: 2px; }
@media (max-width: 560px) {
  .crime-cmp-row { grid-template-columns: 110px 1fr auto; }
}

/* ── Phase 8b: in-property affordability summary ──────────────────────────── */
.aff-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 18px 20px; margin: 0 0 14px;
}
.aff-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.aff-summary-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.aff-price-toggle { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.aff-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.aff-sum-cell { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r); }
.aff-sum-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.aff-sum-val { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.aff-sum-sub { font-size: 11px; color: var(--ink-4); }
.aff-summary-note { font-size: 13px; line-height: 1.5; color: var(--ink-3); margin-top: 12px; }
.aff-summary-go {
  margin-top: 12px; width: 100%; padding: 10px; border: 1px solid var(--brand);
  background: transparent; color: var(--brand); border-radius: var(--r-sm);
  font-weight: 700; font-size: 13px; cursor: pointer; transition: all 120ms var(--ease);
}
.aff-summary-go:hover { background: var(--brand-light); }
@media (max-width: 620px) { .aff-summary-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Phase 8a: richer AI-vision card ──────────────────────────────────────── */
.vision-scores { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vision-score {
  flex: 1; min-width: 130px; padding: 12px 14px; border-radius: var(--r);
  background: var(--surface-2); display: flex; flex-direction: column; gap: 3px;
}
.vision-score-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.vision-score-val { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.vision-score-val small { font-size: 13px; color: var(--ink-4); font-weight: 600; }
.vision-score-bar { height: 5px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; margin-top: 4px; }
.vision-score-bar > span { display: block; height: 100%; border-radius: 999px; }
.vision-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }
.vision-badge.finish { background: var(--brand-light); color: var(--brand); }
.vision-delta-chip { display:inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.vision-delta-chip.up { background: var(--success-light); color: var(--success-fg); }
.vision-delta-chip.down { background: var(--danger-light); color: var(--danger-fg); }
.vision-delta-chip.flat { background: var(--surface-2); color: var(--ink-3); }

/* Mode toggle (listing URL / address) — plain text tabs, rule-line active state */
.mode-toggle {
  display: flex; gap: 18px; margin-bottom: 12px; padding: 0;
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; width: 100%; max-width: 100%;
}
.mode-tab {
  border: none; background: transparent; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: var(--sans); font-weight: 600; font-size: 13px; padding: 8px 2px; border-radius: 0;
  cursor: pointer; transition: all 120ms var(--ease); white-space: nowrap;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab.is-active {
  background: transparent; color: var(--ink); box-shadow: none; border-bottom-color: var(--accent);
}

/* ── Panels / cards ─────────────────────────────────────────────────────── */
/* No rounded soft cards with drop shadows — a top rule-line separates each
   stacked section on the page instead of boxing it. */
.panel,
.result-panel {
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 20px 0;
  margin-bottom: 4px;
}
.panel:first-of-type { border-top: none; }

.card {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 16px;
}

/* ── URL input panel ────────────────────────────────────────────────────── */
.url-panel { padding: 20px 0; }
.url-panel-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.url-panel-copy h2 {
  font-family: var(--sans-x);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}
.url-panel-copy p { font-size: 13px; color: var(--ink-3); }

.extract-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
}
.extract-status-badge[data-tone="ok"]      { background: var(--success-light); color: var(--success); border-color: var(--success); }
.extract-status-badge[data-tone="warn"]    { background: var(--warn-light);    color: var(--warn);    border-color: var(--warn); }
.extract-status-badge[data-tone="working"] {
  background: var(--brand-light); color: var(--accent-ink); border-color: var(--accent);
  animation: badgePulse 1.2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.url-input-row { display: flex; gap: 8px; }
.url-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.url-icon {
  position: absolute;
  left: 12px;
  color: var(--ink-3);
  pointer-events: none;
}
.url-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 38px;
  border: 1.5px solid var(--line-2);
  border-radius: 0;
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
  outline: none;
}
.url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-tint);
}
.url-input::placeholder { color: var(--ink-3); }

.fetch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 120ms var(--ease), box-shadow 120ms var(--ease);
  box-shadow: none;
}
.fetch-btn:hover:not(:disabled) { background: var(--accent-ink); }
.fetch-btn:disabled { opacity: .55; cursor: not-allowed; }

.error-banner {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--weak-bg);
  border: 1px solid var(--weak);
  border-left: 3px solid var(--weak);
  border-radius: 0;
  color: var(--weak);
  font-size: 13px;
  display: none;
}
.error-banner:not([hidden]) { display: block; }

/* ── Listing panel ──────────────────────────────────────────────────────── */
.listing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.listing-header-left { flex: 1; min-width: 0; }
.listing-header-left h2 {
  font-family: var(--sans-x);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: var(--verified-bg);
  color: var(--verified);
  border: 1px solid var(--verified);
  white-space: nowrap;
  flex-shrink: 0;
}
.source-badge.warn,
.source-badge[data-tone="warn"] {
  background: var(--caution-bg); color: var(--caution); border-color: var(--caution);
}

/* ── Detail grid ────────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.detail-tile {
  background: var(--paper);
  border: none;
  border-radius: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.detail-tile:first-child {
  background: var(--accent-tint);
}
.detail-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.detail-tile:first-child .detail-label { color: var(--accent-ink); }
.detail-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.detail-tile:first-child .detail-value { color: var(--accent-ink); font-size: 17px; }

.sqft-estimated-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 0;
  background: var(--caution-bg);
  color: var(--caution);
  margin-left: 4px;
}
.new-build-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 0;
  background: var(--accent-tint);
  color: var(--accent-ink);
  margin-left: 4px;
}

/* ── Quick action chips ─────────────────────────────────────────────────── */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 0;
  border: 1px solid var(--line-2);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  background: transparent;
  transition: all 120ms var(--ease);
  text-decoration: none;
}
.action-chip:hover {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--ink-3);
  text-decoration: none;
}

/* ── Edit / correct details ─────────────────────────────────────────────── */
.edit-details {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.edit-details summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  background: var(--surface-2);
  list-style: none;
}
.edit-details summary:hover { color: var(--ink-2); background: var(--border); }
.edit-details[open] summary { border-bottom: 1px solid var(--border); }
.edit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
}
.edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
}
.edit-grid .span-full { grid-column: 1 / -1; }
.edit-grid input,
.edit-grid select {
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 120ms var(--ease);
}
.edit-grid input:focus,
.edit-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-tint);
}

/* ── Manual entry panel ─────────────────────────────────────────────────── */
.panel-copy { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }

/* ── Assess / run button panel ──────────────────────────────────────────── */
.assess-panel { display: flex; flex-direction: column; gap: 10px; }
.assess-intro { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* The primary CTA — solid ink, not a clay paint-bucket. Accent is spent on
   links, rule-lines and one hero figure elsewhere, not on every button fill. */
.analyze-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 120ms var(--ease), transform 80ms var(--ease);
  box-shadow: none;
}
.analyze-btn:hover:not(:disabled) { background: var(--accent-ink); transform: translateY(-1px); }
.analyze-btn:active:not(:disabled) { transform: translateY(0); }
.analyze-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Transparency panel ─────────────────────────────────────────────────── */
.transparency-panel {
  border: 1px solid var(--warn);
  background: var(--warn-light);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
}
.tp-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warn-fg);
  margin-bottom: 8px;
}
.tp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tp-list li {
  font-size: 12.5px;
  color: var(--warn-fg);
}

/* ── Result panel ───────────────────────────────────────────────────────── */
.result-panel {
  padding: 0;
  overflow: visible;
  border-top: 3px solid var(--ink);
  animation: slideUp 300ms var(--ease) both;
}
.result-panel.is-empty { animation: none; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb trail above the verdict headline (gov.uk-style) */
.result-crumb {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 14px 0 0;
  display: flex; flex-wrap: wrap; gap: 5px;
}
.result-crumb .sep { color: var(--ink-3); }

.result-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px 0 0;
  gap: 20px;
  flex-wrap: wrap;
}
/* The verdict is the headline of the page — huge, bold, carried by the same
   grotesk as the body copy (no separate "display" font), like a gov.uk title. */
.result-topbar h2 {
  font-family: var(--sans-x);
  font-weight: 800;
  font-size: clamp(24px, 4.4vw, 34px);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.08;
  max-width: 18ch;
}
/* flex-shrink:0 here (a flex CONTAINER, not a single button) demanded its full
   max-content width from .result-topbar regardless of its own flex-wrap,
   pushing the row past the viewport at narrow widths (measured scrollWidth >
   innerWidth at 390px). Letting it shrink is what actually lets its buttons
   drop to a second line instead of overflowing. */
.result-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 1; flex-wrap: wrap; min-width: 0; max-width: 100%; }

/* Confidence stamp — bordered, uppercase, slightly rotated. Independent of the
   clay brand accent: verified/caution/weak only, never the accent colour. */
.confidence-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 10px;
  border-radius: 0;
  border: 2px solid currentColor;
  transform: rotate(-2deg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink-3);
}
.confidence-pill small { font-size: 9px; letter-spacing: .06em; opacity: .8; font-weight: 700; }
.confidence-pill[data-confidence="high"]                       { color: var(--verified); }
.confidence-pill[data-confidence="medium"]                     { color: var(--caution); }
.confidence-pill[data-confidence="low"],
.confidence-pill[data-confidence="very_low"]                   { color: var(--weak); }
.confidence-pill[data-confidence="error"]                      { color: var(--weak); }

.rerun-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--line-2);
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  transition: all 120ms var(--ease);
}
.rerun-btn:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink); }

/* ── Tab bar ── plain text tabs, rule-line active state, horizontally
   scrollable so labels never truncate on narrow phones (390px etc). ─────── */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 0;
  margin-top: 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-button {
  flex-shrink: 0;
  padding: 9px 12px;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms, border-color 120ms;
  white-space: nowrap;
}
.tab-button:hover { color: var(--ink); }
.tab-button.is-active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

/* ── Tab panels ─────────────────────────────────────────────────────────── */
.tab-panel { display: none; padding: 20px 0; }
.tab-panel.is-active { display: block; }

/* ── Verdict strip ──────────────────────────────────────────────────────── */
.verdict-strip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 16px;
}
.verdict-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  margin-bottom: 4px;
}
.verdict-text {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 560px;
}
.verdict-strip-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.risk-line { font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.risk-line strong { color: var(--ink-2); }

/* ── Deal badge ─────────────────────────────────────────────────────────── */
.deal-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.deal-badge[data-assessment="attractive"],
.deal-badge[data-assessment="good deal"] {
  background: var(--success-light); color: var(--success-fg);
}
.deal-badge[data-assessment="fair"] {
  background: var(--brand-light); color: var(--brand);
}
.deal-badge[data-assessment="slight premium"] {
  background: var(--warn-light); color: var(--warn-fg);
}
.deal-badge[data-assessment="overpaying"] {
  background: var(--danger-light); color: var(--danger-fg);
}

/* ── Price scale ────────────────────────────────────────────────────────── */
.price-scale-wrap { margin-bottom: 16px; }
.scale-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  margin-bottom: 8px;
}
.price-scale-track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.price-scale-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-4);
}
.vision-delta-note {
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
}

/* ── Numbers grid ───────────────────────────────────────────────────────── */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.num-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface);
}
.num-card strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.num-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
}
.num-card p { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.num-sub { font-size: 11px; color: var(--ink-4); }

.fair-card   { background: var(--brand-light);   border-color: var(--accent); }
.fair-card strong,
.fair-card .num-label { color: var(--brand); }

.smart-card  { background: var(--success-light); border-color: var(--verified); }
.smart-card strong { color: var(--success-fg); }

.walkaway-card { background: var(--danger-light); border-color: var(--weak); }
.walkaway-card strong,
.walkaway-card .num-label { color: var(--danger); }

/* ── Insight / offer strategy ───────────────────────────────────────────── */
.insight-panel {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--surface);
}
.insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.insight-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.mode-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-4);
  border: 1px solid var(--border);
}
.insight-body {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.insight-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.flag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.flag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--border);
}

/* ── Metrics strip ──────────────────────────────────────────────────────── */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.metric-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
}
.metric-item strong { font-size: 14px; font-weight: 700; color: var(--ink); }

.conf-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}
.conf-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width 600ms var(--ease);
}

/* ── Reasoning card ─────────────────────────────────────────────────────── */
.reasoning-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  background: var(--surface);
}
.reasoning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.reasoning-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.reasoning-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reasoning-list li {
  font-size: 13px;
  color: var(--ink-3);
  padding-left: 16px;
  position: relative;
  line-height: 1.55;
}
.reasoning-list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--ink-4);
  font-weight: 700;
}

/* ── Status bar ─────────────────────────────────────────────────────────── */
.status-bar {
  font-size: 12px;
  color: var(--ink-4);
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Card shared ────────────────────────────────────────────────────────── */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
}
.count-badge.sold-badge  { color: var(--verified); border-color: var(--verified); }
.count-badge.sstc-badge  { color: var(--caution);  border-color: var(--caution); }
.count-badge.live-badge  { color: var(--accent-ink); border-color: var(--accent); }

/* ── Timeline (history) ─────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.timeline-event:last-child { border-bottom: none; }
.timeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-2);
  flex-shrink: 0;
  margin-top: 4px;
}
.timeline-dot.sold  { background: var(--verified); }
.timeline-dot.listed { background: var(--accent); }
.timeline-dot.reduced { background: var(--caution); }
.timeline-date  { color: var(--ink-3); white-space: nowrap; min-width: 80px; font-family: var(--mono); }
.timeline-label { font-weight: 600; color: var(--ink-2); }
.timeline-price { color: var(--ink-3); margin-left: auto; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.empty-copy { font-size: 12.5px; color: var(--ink-3); padding: 8px 0; font-style: italic; }

/* ── Stat list ──────────────────────────────────────────────────────────── */
.stat-list { display: flex; flex-direction: column; gap: 0; }
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--ink-3); }
.stat-row strong { font-weight: 700; color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Two-col grid (history tab) ─────────────────────────────────────────── */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Comps ──────────────────────────────────────────────────────────────── */
.comp-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.comp-list { display: flex; flex-direction: column; gap: 0; }
.comp-item {
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
  font-size: 12px;
  transition: background 120ms var(--ease);
}
.comp-list .comp-item:last-child { border-bottom: none; }
.comp-item:hover { background: var(--paper-2); }
.comp-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}
.comp-address {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.4;
}
.comp-price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.comp-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.comp-meta-item { font-size: 11px; color: var(--ink-3); }
.comp-grade-badge {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: 0; border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 700;
  margin-right: 2px;
}
.comp-grade-badge.grade-A { color: var(--verified); }
.comp-grade-badge.grade-B { color: var(--accent-ink); }
.comp-grade-badge.grade-C { color: var(--ink-3); }
.comp-grade-badge.grade-D { color: var(--weak); }
.comp-status-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 0; border: 1px solid currentColor;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .03em;
  font-size: 10.5px; font-weight: 700;
}
.comp-status-badge.sold     { color: var(--verified); }
.comp-status-badge.live     { color: var(--accent-ink); }
.comp-status-badge.sstc     { color: var(--caution); }
.comp-status-badge.withdrawn { color: var(--ink-3); }
.comp-ppsf { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.comp-ai-note {
  font-size: 11px;
  color: var(--ink-3);
  font-style: italic;
  margin-top: 4px;
  border-top: 1px dashed var(--line);
  padding-top: 4px;
}
/* Evidence notes — lettered (a. b. c.), not bullets. */
.bullet-list {
  list-style: none;
  margin-top: 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: reckon-letter;
}
.bullet-list li {
  counter-increment: reckon-letter;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 7px 0 7px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.bullet-list li:last-child { border-bottom: none; }
.bullet-list li::before {
  content: counter(reckon-letter, lower-alpha) ".";
  position: absolute; left: 0; font-family: var(--mono); color: var(--ink-3); font-size: 12px;
}

/* ── Price history card ─────────────────────────────────────────────────── */
.price-history-card {
  margin-bottom: 12px;
  padding: 14px 16px;
}
.ph-above-high { background: var(--danger-light); border-color: var(--weak); }
.ph-above-mid  { background: var(--warn-light);   border-color: var(--caution); }
.ph-inline     { background: var(--success-light); border-color: var(--verified); }
.ph-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.ph-verdict { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.ph-meta { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.ph-meta-item { font-size: 12px; color: var(--ink-3); }
.ph-meta-item strong { font-weight: 700; color: var(--ink-2); }

/* ── AI comp insight ────────────────────────────────────────────────────── */
.ai-comp-insight {
  border: 1px solid var(--brand-light);
  background: var(--brand-light);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--brand);
}
.ai-comp-insight-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Crime tab ──────────────────────────────────────────────────────────── */
.crime-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.crime-map-card { grid-column: 1 / -1; }
.crime-map-container {
  height: 300px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 10px;
}

/* Crime controls row */
.crime-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 2px;
}
.crime-time-btns {
  display: flex;
  gap: 4px;
}
.crime-time-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.crime-time-btn:hover { border-color: var(--brand); color: var(--brand); }
.crime-time-btn.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Trend badge */
.crime-trend-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}
.crime-trend--rising  { background: #fee2e2; color: #b91c1c; }
.crime-trend--falling { background: var(--verified-bg); color: var(--verified); }
.crime-trend--stable  { background: var(--surface-2); color: var(--ink-3); }

/* Category filter pills */
.crime-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 6px;
}
.crime-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.crime-filter-pill.is-off { opacity: 0.4; }
.crime-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Coloured dot in crime breakdown list */
.crime-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Schools panel ──────────────────────────────────────────────────────── */
.schools-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.school-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.school-row:last-child { border-bottom: none; }
.school-left { flex: 1; min-width: 0; }
.school-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.school-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.school-phase-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
}
.school-phase--primary   { background: #ede9fe; color: #6d28d9; }
.school-phase--secondary { background: #dbeafe; color: #1d4ed8; }
.school-gias-link {
  font-size: 10px;
  color: var(--ink-4);
  text-decoration: none;
}
.school-gias-link:hover { color: var(--brand); }
.school-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.ofsted-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.ofsted-na { background: var(--surface-2); color: var(--ink-4); }
.school-dist {
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
}
.schools-source-note {
  font-size: 10px;
  color: var(--ink-4);
  margin-top: 8px;
}

/* ── Intelligence tab ───────────────────────────────────────────────────── */
.intel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.intel-card { }

.epc-rating-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  background: var(--success-light);
  color: var(--success-fg);
}

.condition-bar-wrap { margin: 6px 0 10px; }
.condition-bar-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.condition-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: width 600ms var(--ease);
}
.vision-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.vision-list-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 5px; }
.vision-item-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.vision-item-list li { font-size: 12px; color: var(--ink-3); padding-left: 12px; position: relative; }
.vision-item-list li::before { content: '·'; position: absolute; left: 2px; color: var(--ink-4); }

/* ── Property intel (listing panel extras) ──────────────────────────────── */
.listing-intel-section { margin-top: 12px; }
.listing-intel-section h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 8px; }
.listing-images-strip { display: flex; gap: 6px; overflow-x: auto; }
.listing-thumb { width: 100px; height: 68px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); flex-shrink: 0; }

/* ── Listing panel extras (AI property intel) ───────────────────────────── */
.property-intel-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.intel-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; }
.intel-tile-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 2px; }
.intel-tile-value { font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* ── Affordability view ─────────────────────────────────────────────────── */
#view_affordability { padding: 0; }
.aff-shell { display: flex; flex-direction: column; gap: 12px; }
.aff-page-header { padding: 4px 0 8px; }
.aff-page-title { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 3px; }
.aff-page-sub { font-size: 13px; color: var(--ink-3); }

.aff-inputs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aff-input-card { padding: 16px 18px; }
.aff-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  margin-bottom: 12px;
}

.aff-field-list { display: flex; flex-direction: column; gap: 2px; }
.aff-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.aff-field:last-child { border-bottom: none; }
.aff-field-label {
  flex: 1;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  cursor: text;
}
.aff-field-label:focus { outline: none; color: var(--ink); }
.aff-num-wrap { display: flex; align-items: center; gap: 2px; }
.aff-cur { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.aff-num {
  width: 90px;
  height: 30px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  background: var(--surface);
  outline: none;
}
.aff-num:focus { border-color: var(--brand); }
.aff-item-remove {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-4);
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 120ms;
}
.aff-item-remove:hover { background: var(--danger-light); color: var(--danger); border-color: var(--weak); }

.aff-add-item-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}
.aff-add-item-btn:hover { text-decoration: underline; }

.aff-restore-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-lg);
  z-index: 100;
  min-width: 200px;
  overflow: hidden;
}
.aff-restore-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink-2);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.aff-restore-item:last-child { border-bottom: none; }
.aff-restore-item:hover { background: var(--surface-2); }

/* Sliders */
.aff-sliders-card { padding: 18px 20px; }
.aff-sliders-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.aff-slider-wrap { display: flex; flex-direction: column; gap: 5px; }
.aff-slider-header { display: flex; align-items: center; justify-content: space-between; }
.aff-slider-label { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.aff-slider-val { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.aff-val-blue { color: var(--brand); }
.aff-val-isa  { color: var(--success); }
.aff-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
.aff-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  cursor: pointer;
}
.aff-slider-blue::-webkit-slider-thumb { background: var(--brand); }
.aff-slider-isa::-webkit-slider-thumb  { background: var(--success); }
.aff-slider-bounds { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-4); }

.aff-slider-row { }
.aff-slider-row-inner { display: flex; align-items: flex-end; gap: 8px; }
.aff-slider-row-inner .aff-slider-wrap { flex: 1; }

/* Afford bar */
.aff-bar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.aff-total-badge {
  font-size: 12px; font-weight: 700;
  background: var(--brand-light); color: var(--brand);
  padding: 4px 10px; border-radius: 20px;
}
.afford-bar { height: 36px; border-radius: var(--r-sm); overflow: hidden; display: flex; margin-bottom: 8px; }
.afford-bar-segment { height: 100%; transition: width 300ms var(--ease); }
.afford-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.afford-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }
.afford-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Tables */
.aff-tables-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aff-cash-row, .aff-cf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.aff-cash-row:last-child, .aff-cf-row:last-child { border-bottom: none; }
.aff-cash-row span, .aff-cf-row span { color: var(--ink-3); }
.aff-cash-row strong, .aff-cf-row strong { font-weight: 700; color: var(--ink-2); }
.aff-cash-row.total-row {
  background: var(--surface-2);
  border-top: 2px solid var(--border);
  border-bottom: none;
  margin: 4px -16px -16px;
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 700;
}

/* KPI cards */
.aff-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.aff-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--sh-sm);
}
.aff-kpi-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); }
.aff-kpi-val   { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1.1; }
.aff-kpi-sub   { font-size: 11px; color: var(--ink-4); }
.aff-kpi-card[data-tone="ok"]   { border-color: var(--verified); }
.aff-kpi-card[data-tone="ok"] .aff-kpi-val { color: var(--success); }
.aff-kpi-card[data-tone="warn"] { border-color: var(--caution); }
.aff-kpi-card[data-tone="warn"] .aff-kpi-val { color: var(--warn); }
.aff-kpi-card[data-tone="bad"]  { border-color: var(--weak); }
.aff-kpi-card[data-tone="bad"]  .aff-kpi-val { color: var(--danger); }

/* Advice box */
.aff-advice-box {
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
}
.aff-advice-box.ok   { background: var(--success-light); border-color: var(--verified); color: var(--success-fg); }
.aff-advice-box.warn { background: var(--warn-light);    border-color: var(--caution); color: var(--warn-fg); }
.aff-advice-box.bad  { background: var(--danger-light);  border-color: var(--weak); color: var(--danger-fg); }

/* ISA panel */
.aff-isa-panel { padding: 16px 18px; }

/* ── Address verification modal ──────────────────────────────────────────── */
.addr-verify-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.addr-verify-modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--sh-lg);
  border: 1px solid var(--border);
  animation: slideUp 200ms var(--ease) both;
}
.addr-verify-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.addr-verify-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.addr-verify-header svg { color: var(--brand); stroke: var(--brand); }
.addr-verify-sub { color: var(--ink-4); font-size: 13px; margin: 0 0 12px; }
.addr-verify-address {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.addr-verify-images { display: flex; gap: 6px; margin-bottom: 10px; }
.addr-verify-thumb { width: 100px; height: 68px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
.addr-verify-hint { font-size: 12px; color: var(--ink-4); margin: 0 0 14px; }
.addr-verify-btns { display: flex; gap: 8px; }
.addr-verify-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 120ms var(--ease);
}
.addr-verify-confirm { background: var(--success); color: white; }
.addr-verify-confirm:hover { background: var(--success-fg); filter: brightness(1.1); }
.addr-verify-edit { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--border); }
.addr-verify-edit:hover { background: var(--border); color: var(--ink); }
.addr-verify-save { background: var(--brand); color: white; flex: 0 0 auto; padding: 9px 18px; }
.addr-verify-save:hover { background: var(--brand-hover); }
.addr-verify-edit-row { display: none; gap: 8px; margin-top: 10px; align-items: center; }
.addr-verify-input {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink);
  outline: none;
}
.addr-verify-input:focus { border-color: var(--brand); }

/* Street View in addr verify */
.addr-verify-sv-wrap {
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}
.addr-verify-sv { width: 100%; height: 190px; object-fit: cover; display: block; }
.addr-verify-sv-links {
  display: flex; gap: 6px; padding: 8px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.addr-verify-sv-links--standalone { background: transparent; border-top: none; padding: 0; margin-bottom: 10px; }
.addr-verify-sv-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  color: var(--brand); text-decoration: none;
  padding: 4px 8px; border-radius: 4px;
  background: white; border: 1px solid var(--border-hover);
  transition: background 120ms;
}
.addr-verify-sv-btn:hover { background: var(--brand-light); text-decoration: none; }
.addr-verify-sv-note { font-size: 11.5px; color: var(--ink-4); margin: 0 0 10px; }

/* ── Phase 2: Address Verification Modal (adv2) ──────────────────────────── */
.adv2-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.adv2-modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  width: min(860px, 100%);
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.adv2-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.adv2-header span { font-size: 15px; font-weight: 700; color: var(--ink); flex: 1; }
.adv2-header svg  { color: var(--brand); stroke: var(--brand); flex-shrink: 0; }
.adv2-close {
  background: none; border: none; cursor: pointer; padding: 2px 6px;
  color: var(--ink-4); font-size: 16px; border-radius: var(--r-sm);
  line-height: 1;
}
.adv2-close:hover { background: var(--surface-2); color: var(--ink); }

.adv2-sub {
  font-size: 12.5px; color: var(--ink-4); margin: 0;
  padding: 8px 16px 0;
  flex-shrink: 0;
}

/* listing photo strip */
.adv2-photos {
  display: flex; gap: 6px; padding: 10px 16px 4px;
  overflow-x: auto; flex-shrink: 0;
}
.adv2-photo {
  height: 72px; width: 108px;
  object-fit: cover; border-radius: var(--r-sm);
  border: 1px solid var(--border); flex-shrink: 0;
}

/* two-column body */
.adv2-body {
  display: flex; gap: 0; flex: 1; min-height: 0;
  overflow: hidden;
}
.adv2-map-col {
  flex: 1 1 55%; display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
}
.adv2-map {
  flex: 1; min-height: 280px;
}
.adv2-map-hint {
  font-size: 11px; color: var(--ink-4); text-align: center;
  padding: 5px 8px; background: var(--surface-2);
  border-top: 1px solid var(--border); margin: 0; flex-shrink: 0;
}

/* right column — tabs + panels */
.adv2-candidates-col {
  flex: 1 1 45%; display: flex; flex-direction: column; min-height: 0;
}
.adv2-right-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px 0; border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface);
}
.adv2-tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px 7px; font-size: 12px; font-weight: 500;
  color: var(--ink-4); background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color 120ms, border-color 120ms;
}
.adv2-tab:hover { color: var(--ink-2); background: var(--surface-2); }
.adv2-tab--active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.adv2-candidates-postcode {
  margin-left: auto;
  font-size: 11.5px; color: var(--ink-4);
  background: var(--surface-2); border-radius: 4px; padding: 2px 7px;
  font-family: var(--mono, monospace); flex-shrink: 0;
}
.adv2-tab-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.adv2-tab-panel--hidden { display: none; }
/* Street View panel must not flex-collapse — the panorama needs a real height. */
#adv2-tab-streetview { min-height: 360px; overflow: auto; }
#adv2-sv-pano { width: 100%; height: 320px; min-height: 320px; flex: none; }

/* listing's own last-sold banner */
.adv2-listing-sold {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: #fef9ec; border-bottom: 1px solid #f5e7a0;
  padding: 7px 12px; font-size: 12px; color: #6b4c00; flex-shrink: 0;
}
.adv2-listing-sold svg { color: #a07000; flex-shrink: 0; }
.adv2-listing-sold strong { color: #3d2a00; font-weight: 700; }
.adv2-listing-sold-date { color: #997000; }
.adv2-listing-sold-hint {
  margin-left: auto; font-size: 11px; color: #997000;
  background: rgba(0,0,0,.05); border-radius: 3px; padding: 1px 5px;
  white-space: nowrap;
}

.adv2-candidates-list {
  flex: 1; overflow-y: auto; padding: 4px 0;
}

/* Map layer toggle (Map / Satellite) */
.adv2-map { position: relative; }
.adv2-layer-toggle {
  position: absolute; top: 8px; right: 8px; z-index: 800;
  display: flex; background: white; border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); overflow: hidden;
  border: 1px solid rgba(0,0,0,.12);
}
.adv2-layer-btn {
  padding: 4px 10px; font-size: 11.5px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); transition: background 100ms, color 100ms;
}
.adv2-layer-btn:first-child { border-right: 1px solid rgba(0,0,0,.1); }
.adv2-layer-btn--active { background: var(--brand); color: white; }
.adv2-layer-btn:not(.adv2-layer-btn--active):hover { background: var(--surface-2); color: var(--ink); }

/* Street View tab panel */
.adv2-sv-iframe {
  flex: 1; width: 100%; border: none; display: block; min-height: 320px;
}
.adv2-sv-nokey {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 24px 20px; text-align: center;
  color: var(--ink-3);
}
.adv2-sv-nokey svg { color: var(--ink-4); }
.adv2-sv-nokey p  { font-size: 13px; line-height: 1.6; margin: 0; color: var(--ink-3); }
.adv2-sv-nokey code { font-size: 12px; background: var(--surface-2); border-radius: 3px; padding: 1px 5px; }
.adv2-sv-open-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: #1a73e8; color: white !important;
  border: none; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; padding: 10px 20px;
  text-decoration: none !important; cursor: pointer;
  transition: filter 120ms; margin-top: 4px;
}
.adv2-sv-open-btn:hover { filter: brightness(1.1); }

/* Photo lightbox */
.adv2-lightbox {
  display: none; position: fixed; inset: 0; z-index: 10001;
  align-items: center; justify-content: center;
}
.adv2-lightbox--open { display: flex; }
.adv2-lb-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.88);
}
.adv2-lb-img {
  position: relative; z-index: 1;
  max-width: min(90vw, 1100px); max-height: 85vh;
  object-fit: contain; border-radius: var(--r-sm);
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.adv2-lb-close {
  position: absolute; top: 16px; right: 20px; z-index: 2;
  background: rgba(255,255,255,.15); border: none; color: white;
  font-size: 22px; width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 120ms;
}
.adv2-lb-close:hover { background: rgba(255,255,255,.3); }
.adv2-lb-prev, .adv2-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(255,255,255,.15); border: none; color: white;
  font-size: 32px; width: 48px; height: 64px; border-radius: 6px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 120ms; user-select: none;
}
.adv2-lb-prev { left: 16px; }
.adv2-lb-next { right: 16px; }
.adv2-lb-prev:hover, .adv2-lb-next:hover { background: rgba(255,255,255,.3); }
.adv2-lb-counter {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 2; background: rgba(0,0,0,.5); color: white;
  font-size: 13px; padding: 3px 12px; border-radius: 12px;
}
/* Make photo thumbnails show pointer cursor */
.adv2-photo { cursor: pointer; transition: opacity 120ms; }
.adv2-photo:hover { opacity: .85; }
.adv2-loading, .adv2-no-results {
  font-size: 12.5px; color: var(--ink-4);
  padding: 20px 14px; text-align: center; line-height: 1.5;
}
.adv2-candidate-row {
  padding: 7px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border-faint, var(--border));
  transition: background 100ms;
}
.adv2-candidate-row:hover { background: var(--surface-2); }
.adv2-candidate-row--selected { background: var(--brand-light) !important; }
.adv2-candidate-addr {
  font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3;
}
.adv2-candidate-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.adv2-type-badge {
  font-size: 10.5px; font-weight: 600; padding: 1px 5px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: .3px;
}
.adv2-type-detached     { background: #e8f4fd; color: #1e6fa8; }
.adv2-type-semidetached { background: #edf5e9; color: #2a7a3a; }
.adv2-type-terraced     { background: #fef3e2; color: #a05c00; }
.adv2-type-flat         { background: #f3ecfc; color: #6b2fa0; }
.adv2-sold-info { font-size: 11.5px; color: var(--ink-4); }

/* footer */
.adv2-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 12px; border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.adv2-selected-wrap {
  flex: 1; display: flex; align-items: baseline; gap: 6px; min-width: 0;
}
.adv2-selected-label { font-size: 11.5px; color: var(--ink-4); flex-shrink: 0; }
.adv2-selected-addr  { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adv2-footer-btns { display: flex; gap: 8px; flex-shrink: 0; }
.adv2-sv-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--ink-3); font-size: 12px; font-weight: 500;
  padding: 7px 12px; border-radius: var(--r-sm);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 120ms;
}
.adv2-sv-btn:hover { background: var(--brand-light); color: var(--brand); text-decoration: none; }
.adv2-sv-btn--hidden { display: none; }
.adv2-confirm-btn {
  background: var(--brand); color: white;
  border: none; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; padding: 8px 20px;
  cursor: pointer; white-space: nowrap;
  transition: filter 120ms;
}
.adv2-confirm-btn:hover { filter: brightness(1.1); }

/* Responsive: stack map + candidates vertically on narrow screens */
@media (max-width: 600px) {
  .adv2-body { flex-direction: column; }
  .adv2-map-col { border-right: none; border-bottom: 1px solid var(--border); }
  .adv2-map { min-height: 200px; }
  .adv2-candidates-col { max-height: 260px; }
  .adv2-sv-iframe { min-height: 200px; }
  .adv2-footer { flex-direction: column; align-items: stretch; }
  .adv2-footer-btns { justify-content: flex-end; }
}

/* ── Missing utility classes ─────────────────────────────────────────────── */

/* brand-text: flex column wrapping brand-name + brand-tagline */
.brand-text { display: flex; flex-direction: column; justify-content: center; }

/* listing-panel: alias for .panel — used on listing & manual panels */
.listing-panel { /* inherits .panel styles */ }

/* result-topbar-left: flex column for heading + deal rating */
.result-topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* verdict-strip-body: flex-1 text block inside verdict strip */
.verdict-strip-body {
  flex: 1;
  min-width: 0;
}

/* num-card variants: likely / stretch / ask — neutral tones */
.likely-card   { border-top: 3px solid var(--ink-4); }
.stretch-card  { border-top: 3px solid var(--warn); }
.ask-card      { border-top: 3px solid var(--ink-3); background: var(--surface-2); }

/* with-bar: metric-item containing a confidence bar — give it full column */
.metric-item.with-bar { grid-column: span 2; }

/* crime-stats-card: card holding crime category stats */
.crime-stats-card { padding: 0; overflow: hidden; }
.crime-stats-card .stat-row { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.crime-stats-card .stat-row:last-child { border-bottom: none; }

/* ask-card: neutral panel for asking price display */
.ask-card strong { color: var(--ink-2); }

/* ── Leasehold lease-years badges ───────────────────────────────────────── */
.lease-years {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.lease-years--ok      { color: var(--success); background: var(--success-light); }
.lease-years--warn    { color: var(--warn-fg); background: var(--warn-light); }
.lease-years--danger  { color: var(--danger-fg); background: var(--danger-light); }

/* ── Sqft estimated badge in listing panel ───────────────────────────────── */
.sqft-estimated-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warn-fg);
  background: var(--warn-light);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}

/* ── Sqft source badge (listing panel) ───────────────────────────────────── */
.sqft-source-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}
.sqft-source--confirmed {
  color: var(--success-fg);
  background: var(--success-light);
}
.sqft-source--estimated {
  color: var(--warn-fg);
  background: var(--warn-light);
}

/* ── Comp sqft source tags (comps tab) ───────────────────────────────────── */
.comp-sqft-source {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
}
.comp-sqft-epc    { color: var(--success-fg); background: var(--success-light); }
.comp-sqft-listed { color: var(--brand);      background: var(--brand-light); }
.comp-sqft-est    { color: var(--warn-fg);    background: var(--warn-light); }

/* ── Transparency panel variants ─────────────────────────────────────────── */
.transparency-panel.warn {
  background: var(--warn-light);
  border-color: #fcd34d;
  color: var(--warn-fg);
}
.transparency-panel.success {
  background: var(--success-light);
  border-color: #86efac;
  color: var(--success-fg);
}

/* ── Schools redesign ────────────────────────────────────────────────────── */
.schools-group-header { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin: 12px 0 4px; }
.schools-disclaimer { font-size: 0.72rem; color: var(--ink-4); margin-top: 10px; line-height: 1.5; }
.schools-empty { font-size: 0.8rem; color: var(--ink-4); padding: 4px 0; }
.info-tooltip { cursor: help; color: var(--ink-3); font-size: 0.8rem; }

/* ── Misc utilities ──────────────────────────────────────────────────────── */
[hidden] { display: none !important; }

.is-error .result-topbar h2 { color: var(--danger); }

/* Focus ring */
*:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .detail-grid     { grid-template-columns: repeat(2,1fr); }
  .numbers-grid    { grid-template-columns: repeat(2,1fr); }
  .metrics-strip   { grid-template-columns: repeat(2,1fr); }
  .comp-columns    { grid-template-columns: 1fr; }
  .two-col-grid    { grid-template-columns: 1fr; }
  .crime-layout    { grid-template-columns: 1fr; }
  .intel-grid      { grid-template-columns: 1fr; }
  .aff-inputs-row  { grid-template-columns: 1fr; }
  .aff-sliders-grid { grid-template-columns: 1fr; }
  .aff-tables-row  { grid-template-columns: 1fr; }
  .aff-kpi-row     { grid-template-columns: repeat(2,1fr); }
  .edit-grid       { grid-template-columns: repeat(2,1fr); }
  .crime-controls  { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ═══ Affordability — cost-card model (Phase 1) ═══════════════════════════ */
.aff2-shell { max-width: 860px; margin: 0 auto; padding: 4px 0 60px; }
.aff2-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.aff2-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.aff2-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; max-width: 520px; }
.aff2-basis { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.aff2-basis-btn { border: none; background: transparent; color: var(--ink-3); font-weight: 600; font-size: 12px; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.aff2-basis-btn.is-active { background: var(--brand); color: #fff; }
.aff2-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 18px 20px; margin-bottom: 14px; }
.aff2-section { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; margin-bottom: 12px; }
.aff2-muted { color: var(--ink-4); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 12px; }
.aff2-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.aff2-grid-2 { grid-template-columns: repeat(2, 1fr); }
.aff2-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.aff2-field > span { font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.aff2-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.aff2-input:focus-within { border-color: var(--brand); }
.aff2-input i { padding: 0 9px; color: var(--ink-4); font-style: normal; font-size: 13px; flex-shrink: 0; }
.aff2-input input { flex: 1; min-width: 0; border: none; background: transparent; padding: 9px 6px; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); outline: none; }
.aff2-select { padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); }
.aff2-hint { font-size: 11px; color: var(--ink-4); }
.aff2-tag { font-size: 11px; font-weight: 600; color: var(--brand); background: var(--brand-light); padding: 1px 7px; border-radius: 999px; }
.aff2-link { font-size: 11px; color: var(--brand); font-weight: 600; }
.aff2-seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); width: fit-content; }
.aff2-seg button { border: none; background: transparent; color: var(--ink-3); font-weight: 600; font-size: 13px; padding: 6px 16px; border-radius: 6px; cursor: pointer; }
.aff2-seg button.is-active { background: var(--brand); color: #fff; }
.aff2-takehome { margin-top: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.aff2-warn { display: inline-block; color: var(--warn-fg); background: var(--warn-light); padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; margin-top: 4px; }
/* applicants (multi-applicant tax breakdown) */
.aff2-app-intro { margin: -4px 0 12px; }
.aff2-app-list { display: flex; flex-direction: column; gap: 12px; }
.aff2-app-card { border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.aff2-app-head { display: flex; align-items: center; justify-content: space-between; }
.aff2-app-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.aff2-bd { margin-top: 2px; border-top: 1px dashed var(--border-hover); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.aff2-bd-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
.aff2-bd-row span { font-weight: 500; }
.aff2-bd-row b { font-weight: 700; color: var(--ink-2); }
.aff2-bd-net { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 5px; }
.aff2-bd-net span, .aff2-bd-net b { color: var(--ink); font-weight: 800; font-size: 13.5px; }
.aff2-bd-taper { margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--warn-fg); background: var(--warn-light); padding: 5px 8px; border-radius: 6px; line-height: 1.4; }
/* cards */
.aff2-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.aff2-card { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); }
.aff2-card.is-derived { background: var(--brand-light); border-color: transparent; }
.aff2-card-top { display: flex; align-items: center; justify-content: space-between; }
.aff2-card-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.aff2-card-x { border: none; background: transparent; color: var(--ink-4); cursor: pointer; font-size: 13px; line-height: 1; padding: 2px; }
.aff2-card-x:hover { color: var(--danger); }
.aff2-card-val { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.aff2-card-val small { font-size: 12px; color: var(--ink-4); font-weight: 600; }
.aff2-card-input { display: flex; align-items: center; margin-top: 4px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.aff2-card-input i { padding: 0 7px; color: var(--ink-4); font-style: normal; font-size: 12px; }
.aff2-card-input input { flex: 1; min-width: 0; border: none; background: transparent; padding: 6px 4px; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); outline: none; }
.aff2-card-prov { font-size: 11px; color: var(--ink-4); margin-top: 6px; line-height: 1.4; }
/* estimated badge + editable personal-card name */
.aff2-card-tags { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.aff2-est { font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  color: #b45309; background: rgba(180, 83, 9, .12); padding: 2px 7px; border-radius: 999px;
  white-space: nowrap; cursor: help; }
.aff2-card-name { flex: 1; min-width: 0; border: none; border-bottom: 1px dashed var(--border-hover);
  background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink);
  padding: 1px 2px 2px; outline: none; }
.aff2-card-name:focus { border-bottom-color: var(--brand); }
.aff2-card-name::placeholder { color: var(--ink-4); font-weight: 500; }
.aff2-menu-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-4); padding: 8px 10px 2px; margin: 0; }
.aff2-menu-custom { color: var(--brand) !important; font-weight: 600 !important; }
.aff2-addrow { position: relative; margin-top: 12px; }
.aff2-add { border: 1px dashed var(--border-hover); background: transparent; color: var(--ink-3); font-weight: 600; font-size: 13px; padding: 9px 14px; border-radius: var(--r-sm); cursor: pointer; }
.aff2-add:hover { border-color: var(--brand); color: var(--brand); }
.aff2-add-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-lg); padding: 4px; min-width: 200px; }
.aff2-add-menu button { display: block; width: 100%; text-align: left; border: none; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 500; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.aff2-add-menu button:hover { background: var(--surface-2); }
/* outputs */
.aff2-outputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.aff2-out { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--ink-4); border-radius: var(--r); box-shadow: var(--sh-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.aff2-out.good { border-left-color: var(--success); }
.aff2-out.warn { border-left-color: var(--warn); }
.aff2-out.bad  { border-left-color: var(--danger); }
.aff2-out-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.aff2-out-val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.aff2-out-sub { font-size: 11.5px; color: var(--ink-3); }
.aff2-disclaimer { font-size: 11.5px; color: var(--ink-4); line-height: 1.5; max-width: 720px; }
@media (max-width: 620px) {
  .aff2-grid, .aff2-grid-2 { grid-template-columns: 1fr 1fr; }
  .aff2-cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .aff2-grid, .aff2-grid-2 { grid-template-columns: 1fr; }
  .aff2-title { font-size: 21px; }
}

/* ── Affordability results-page CTA (single link; the inline duplicate was removed) ── */
.aff-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  text-align: left; cursor: pointer; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--brand-light); padding: 15px 18px; margin-top: 18px; }
.aff-cta:hover { border-color: var(--brand); }
.aff-cta-main { display: flex; flex-direction: column; gap: 3px; }
.aff-cta-main strong { font-size: 15px; color: var(--ink); }
.aff-cta-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.aff-cta-arrow { font-size: 20px; color: var(--brand); flex-shrink: 0; }

/* ── Buying journey ── */
.bj-scenario { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.bj-scenario-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 2px; }
.bj-scenario-note { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; line-height: 1.4; }
.bj-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.bj-seg button { flex: 1 1 auto; min-width: 86px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px 10px;
  border-radius: var(--r-sm); cursor: pointer; }
.bj-seg button:hover { border-color: var(--brand); }
.bj-seg button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.bj-realterms { font-size: 12px; color: #b45309; background: rgba(180,83,9,.10); border-radius: var(--r-sm);
  padding: 8px 10px; margin: 10px 0 0; line-height: 1.45; }
.bj-hpi-context { font-size: 12px; color: var(--ink-4); margin: 8px 0 0; line-height: 1.45; }
.bj-sell { margin-top: 16px; }
.bj-slider-row { display: flex; flex-direction: column; gap: 6px; }
.bj-slider-row label { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.bj-slider-row label strong { color: var(--brand); font-size: 16px; }
.bj-slider { width: 100%; accent-color: var(--brand); }
.bj-headline { margin-top: 12px; }
.bj-head-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: var(--r); border-left: 4px solid var(--brand); background: var(--surface-2); }
.bj-head-main.good { border-left-color: var(--success); }
.bj-head-main.warn { border-left-color: #b45309; }
.bj-head-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bj-head-val { font-size: 26px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.bj-head-sub, .bj-head-spent { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }
.bj-head-spent strong { color: var(--ink); }
.bj-muted { color: var(--ink-4); }
.bj-breakeven { font-size: 13px; color: var(--ink-2); background: var(--brand-light); border-radius: var(--r-sm);
  padding: 10px 12px; margin-top: 12px; line-height: 1.5; }
.bj-block { margin-top: 18px; }
.bj-block-title { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.bj-amort-row { display: grid; grid-template-columns: 44px 1fr; grid-template-areas: "yr bar" "yr fig" "yr eq";
  gap: 2px 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); }
.bj-amort-row.is-sel { background: var(--brand-light); border-radius: var(--r-sm); padding: 7px 8px; }
.bj-amort-yr { grid-area: yr; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bj-amort-bar { grid-area: bar; display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--surface); }
.bj-amort-int { background: #d9a066; }
.bj-amort-cap { background: var(--brand); }
.bj-amort-fig { grid-area: fig; font-size: 11.5px; color: var(--ink-3); }
.bj-amort-eq { grid-area: eq; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.bj-rent-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.bj-rent-field span:first-child { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.bj-rent-input { max-width: 200px; }
.bj-rb-head { font-size: 13px; color: var(--ink-2); margin: 0 0 10px; line-height: 1.5; }
.bj-rb-row { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; padding: 4px 0; }
.bj-rb-row.is-sel .bj-rb-yr { color: var(--brand); font-weight: 800; }
.bj-rb-yr { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.bj-rb-bars { display: flex; flex-direction: column; gap: 3px; }
.bj-rb-bar { height: 7px; border-radius: 999px; min-width: 2px; }
.bj-rb-bar.buy { background: var(--brand); }
.bj-rb-bar.rent { background: var(--ink-4); }
.bj-rb-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
.bj-rb-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; margin-right: 5px; vertical-align: middle; }
.bj-rb-legend .dot.buy { background: var(--brand); }
.bj-rb-legend .dot.rent { background: var(--ink-4); }
@media (max-width: 480px) {
  .bj-head-val { font-size: 22px; }
  .bj-head-main { flex-direction: column; align-items: flex-start; gap: 2px; }
  .bj-seg button { min-width: 0; flex: 1 1 30%; }
}

/* ── Buying journey: dynamic assumption controls ── */
.bj-assume-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.bj-assume-row.bj-assume-inline { flex-wrap: wrap; }
.bj-assume-label { font-size: 13px; font-weight: 600; color: var(--ink-2); flex: 0 0 auto; min-width: 140px; }
.bj-assume-label small { display: block; font-size: 12px; font-weight: 700; color: var(--brand); }
.bj-assume-row .bj-slider { flex: 1 1 auto; min-width: 80px; }
.bj-mini { flex: 0 0 auto; max-width: 130px; }
.bj-mini input { width: 56px; }
.bj-assume-hint { font-size: 11.5px; color: var(--ink-4); margin: 4px 0 0; line-height: 1.4; }
.bj-assume-hint2 { font-size: 11.5px; color: var(--ink-3); flex: 1 1 100%; }
.bj-assume-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.bj-mini-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.bj-mini-field .bj-mini { max-width: none; }
.bj-mini-field .bj-mini input { width: 100%; }

/* net position — gain vs loss */
.bj-np-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bj-np-col { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); }
.bj-np-col.gain { border-left: 3px solid var(--success); }
.bj-np-col.loss { border-left: 3px solid #b45309; }
.bj-np-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); margin: 0 0 7px; }
.bj-np-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); padding: 3px 0; }
.bj-np-line b { color: var(--ink); font-weight: 700; white-space: nowrap; }
.bj-np-net { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px;
  padding: 11px 13px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; }
.bj-np-net.good { background: rgba(34,139,90,.10); color: var(--ink); }
.bj-np-net.warn { background: rgba(180,83,9,.10); color: var(--ink); }
.bj-np-net strong { font-size: 18px; }
.bj-np-real { font-size: 12px; color: var(--ink-3); margin: 9px 0 0; line-height: 1.5; }
@media (max-width: 480px) {
  .bj-assume-label { min-width: 110px; }
  .bj-assume-grid { grid-template-columns: 1fr; }
  .bj-np-cols { grid-template-columns: 1fr; }
}
.bj-hpi-context strong { color: var(--ink-2); }
.bj-ctx-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 999px; margin-right: 6px; }

/* Always-visible estimate disclaimer (legal, non-negotiable) — an annotation
   in the report's own voice, not a boxed legal footnote. */
.value-disclaimer { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin: 16px 0 0;
  padding: 4px 0 4px 14px; background: transparent; border: none; border-left: 3px solid var(--ink); border-radius: 0; }
.value-disclaimer strong { color: var(--ink); font-family: var(--sans-x); font-weight: 800; display: block; margin-bottom: 3px; }

/* Calibration honesty note — the AVM is not yet inside its accuracy gate.
   Same annotation family as the disclaimer above; never a scary red banner. */
.calibration-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin: 10px 0 0;
  padding: 4px 0 4px 14px; background: transparent; border: none; border-left: 3px solid var(--caution); border-radius: 0; }
.calibration-note strong { color: var(--ink-2); font-weight: 700; }

/* Honest-degradation notice — calm/informational, never alarming */
.data-note { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2);
  line-height: 1.5; margin: 12px 0 0; padding: 4px 0 4px 14px; border-radius: 0;
  background: transparent; border: none; border-left: 3px solid var(--accent); }
.data-note-icon { color: var(--accent-ink); font-weight: 700; flex-shrink: 0; font-size: 14px; line-height: 1.4; }
.data-note strong { color: var(--ink); }

/* Change-over-time — shown only when we've analysed this property before (informational) */
.change-since { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2);
  line-height: 1.5; margin: 12px 0 0; padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--brand-light); border: 1px solid var(--border); }
.change-since-icon { color: var(--brand); font-weight: 700; flex-shrink: 0; font-size: 14px; line-height: 1.4; }
.change-since strong { color: var(--ink); }
.cs-delta { font-weight: 600; white-space: nowrap; }
.cs-delta.down { color: var(--success-fg); }   /* asking came down — favourable to a buyer */
.cs-delta.up   { color: var(--danger-fg); }     /* asking rose */
.cs-delta.flat { color: var(--ink-3); font-weight: 500; }

/* Privacy note under the analyse button */
.privacy-note { font-size: 11px; color: var(--ink-4); line-height: 1.5; margin: 10px 0 0; max-width: 640px; }


/* ── Sign-in / account ─────────────────────────────────────────────────── */
.auth-slot { display: flex; align-items: center; }
.auth-btn { font-weight: 600; }
.account-menu { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: 7px; max-width: 200px; }
.account-btn #account_label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--sh-lg); padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.account-dropdown[hidden] { display: none; }
.account-email { margin: 4px 8px 0; font-size: 13px; color: var(--ink-2); font-weight: 600; word-break: break-all; }
.account-tier { margin: 0 8px 6px; font-size: 12px; color: var(--ink-3); }
.account-item {
  text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 9px 8px;
  font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.account-item:hover { background: var(--surface-2); }
.account-item.is-danger { color: var(--danger-fg); }

.auth-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(34, 29, 24, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.auth-backdrop[hidden] { display: none; }
.auth-card {
  position: relative; width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  padding: 26px 22px 20px;
}
.auth-card h2 { margin: 0 28px 6px 0; font-size: 20px; }
.auth-reason { margin: 0 0 16px; font-size: 14px; color: var(--ink-3); line-height: 1.45; }
.auth-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-3);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.auth-close:hover { background: var(--surface-2); color: var(--ink); }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.auth-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
  color: var(--ink);
}
.auth-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.auth-primary { width: 100%; justify-content: center; margin-top: 4px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--ink-4); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-google { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; font-weight: 600; }
.auth-status { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.auth-status[hidden] { display: none; }
.auth-status.is-ok { background: var(--success-light); color: var(--success-fg); }
.auth-status.is-error { background: var(--danger-light); color: var(--danger-fg); }
.auth-fineprint { margin: 14px 0 0; font-size: 12px; color: var(--ink-4); line-height: 1.45; }
@media (max-width: 480px) {
  .account-btn { max-width: 120px; }
  .auth-card { padding: 22px 16px 16px; }
}

/* ── Tier upgrade cards ─────────────────────────────────────────────────── */
.upgrade-card { border: 1px dashed var(--brand); background: var(--brand-light); border-radius: var(--r); padding: 16px; margin: 12px 0; }
.upgrade-card[hidden] { display: none; }
.upgrade-title { margin: 0 0 6px; font-weight: 700; font-size: 15px; color: var(--ink); }
.upgrade-copy { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.upgrade-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upgrade-btn { justify-content: center; }
.upgrade-link { text-decoration: none; display: inline-flex; align-items: center; }
.watch-btn { font-size: 12px; padding: 6px 10px; }
.watch-btn.is-watching { border-color: var(--success); color: var(--success-fg); background: var(--success-light); }

/* ── Evidence pack (print) ─────────────────────────────────────────────── */
.print-footer { display: none; }
.pack-btn { font-size: 12px; padding: 6px 10px; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .main-nav, .header-actions, .mode-toggle, .url-panel, #listing_panel, #manual_panel, #assess_panel, #run_progress,
  .tab-bar, .rerun-btn, .watch-btn, .pack-btn, .theme-toggle, #auth_modal, .upgrade-card, #quota_card, #view_affordability,
  .crime-map, #crime_map, .leaflet-container, button, .ghost-btn { display: none !important; }
  #view_analysis, #result_card { display: block !important; }
  #result_card { border: 0; box-shadow: none; padding: 0; }
  .tab-panel { display: block !important; page-break-inside: avoid; margin-bottom: 18px; border-top: 1px solid #ccc; padding-top: 12px; }
  .tab-panel::before { content: attr(data-print-title); display: block; font-weight: 700; font-size: 13pt; margin-bottom: 8px; }
  .card, .panel { border: 1px solid #ddd; box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  .print-footer { display: block !important; margin-top: 24px; padding-top: 10px; border-top: 2px solid #000; font-size: 9.5pt; color: #222; }
  .print-footer-title { font-weight: 700; }
}

.pricing-line { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
