@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── RESET & BASE ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:           #f0ede8;
  --surface:      #ffffff;
  --border:       #e8e4df;
  --border-mid:   #cdc9e8;
  --text:         #1a1714;
  --muted:        #615e5a;
  --dim:          #928d87;
  --accent:       #e8294c;
  --accent-hover: #c8203e;
  --accent-light: #fff5f6;
  --accent-mid:   #c7d2fe;
  --negotiate:    #e8294c;
  --push:         #16a34a;
  --warn:         #d97706;
  --danger:       #dc2626;
  --sans:         'Inter', system-ui, -apple-system, sans-serif;
  --mono:         'JetBrains Mono', 'SF Mono', monospace;
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 17.7px;
  line-height: 1.5;
  min-height: 100vh;
  background-image: radial-gradient(circle at 1px 1px, #ddd9f5 1px, transparent 0);
  background-size: 28px 28px;
}

/* ── LAYOUT ───────────────────────────────────────────────────────────────── */
.app-shell   { display: flex; flex-direction: column; min-height: 100vh; }
.top-bar     { background: rgba(255,255,255,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.top-bar-logo { font-weight: 800; font-size: 22.8px; letter-spacing: -0.5px; color: var(--accent); }
.top-bar-sub  { font-size: 13.9px; color: var(--muted); }
.logo-wrap    { display: flex; align-items: center; gap: 10px; }
.logo-mark    { width: 37px; height: 37px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; font-weight: 800; flex-shrink: 0; }
.main         { display: flex; flex: 1; gap: 0; }
.left-panel   { width: 260px; min-width: 220px; background: var(--surface); border-right: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; }
.center-panel { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.right-panel  { width: 370px; min-width: 320px; background: var(--surface); border-left: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; }

/* ── NAV ──────────────────────────────────────────────────────────────────── */
.top-bar-nav  { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link     { padding: 6px 12px; border-radius: 6px; font-size: 16.4px; font-weight: 500; color: var(--muted); background: transparent; border: none; cursor: pointer; transition: all 0.15s; }
.nav-link:hover { color: var(--text); background: var(--bg); }
.nav-divider  { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.nav-btn      { padding: 7px 16px; border-radius: 6px; font-size: 16.4px; font-weight: 700; color: #fff; background: var(--accent); border: none; cursor: pointer; transition: background 0.15s; }
.nav-btn:hover { background: var(--accent-hover); }

/* ── CARDS ────────────────────────────────────────────────────────────────── */
.card         { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.card-title   { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.side-card    { border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.side-card-title { font-size: 13.9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 10px; }

/* ── PROPERTY LIST ────────────────────────────────────────────────────────── */
.prop-list    { display: flex; flex-direction: column; gap: 6px; }
.prop-item    { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: all 0.15s; background: var(--surface); }
.prop-item:hover { border-color: var(--accent); background: #fff5f6; box-shadow: 0 2px 8px rgba(232,41,76,0.08); }
.prop-item.active { border-color: var(--accent); background: #fff0f2; box-shadow: 0 0 0 2px rgba(232,41,76,0.12); }
.prop-item-addr { font-weight: 600; font-size: 16.4px; }
.prop-item-meta { font-size: 13.9px; color: var(--muted); margin-top: 2px; }
.prop-item-score { font-family: var(--mono); font-size: 12px; font-weight: 700; margin-top: 4px; }

/* ── PERSONA TABS ─────────────────────────────────────────────────────────── */
.persona-tabs { display: flex; gap: 6px; }
.persona-tab  { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: transparent; cursor: pointer; font-size: 15.2px; font-weight: 600; color: var(--muted); transition: all 0.15s; text-align: center; }
.persona-tab:hover { border-color: var(--accent); color: var(--accent); }
.persona-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── SCORE PANEL ──────────────────────────────────────────────────────────── */
.score-panel  { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

/* Score tabs */
.score-tabs   { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.score-tab    { flex: 1; padding: 8px 12px; border: none; background: transparent; cursor: pointer; font-size: 15.2px; font-weight: 700; letter-spacing: 0.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.score-tab:hover { color: var(--accent); }
.score-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.score-tab.greyed { color: var(--dim); cursor: not-allowed; opacity: 0.5; }
.score-tab-content { display: none; }
.score-tab-content.active { display: block; }

/* Big score */
.score-display { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.score-number  { font-family: var(--mono); font-size: 65.8px; font-weight: 800; line-height: 1; }
.score-badge   { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 13.9px; font-weight: 700; letter-spacing: 0.5px; }
.score-action  { font-size: 15.2px; color: var(--muted); margin-bottom: 14px; min-height: 16px; }

/* Score bar */
.score-bar-wrap { position: relative; height: 5px; background: var(--border); border-radius: 3px; margin-bottom: 8px; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s, background 0.3s; }
.score-bar-markers { display: flex; justify-content: space-between; font-size: 11.4px; color: var(--dim); font-family: var(--mono); margin-bottom: 14px; }

/* Signals */
.signals-title { font-size: 12.6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--dim); margin-bottom: 8px; }
.signal-rows   { display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; }
.signal-row    { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: #F0F0F0; cursor: pointer; border: 1px solid transparent; transition: all 0.12s; width: 100%; min-width: 0; box-sizing: border-box; }
.signal-row-header { display: flex; align-items: center; gap: 8px; width: 100%; }
.signal-row:hover { border-color: var(--border); background: #ebe7e1; }
.signal-dot    { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.signal-name   { font-size: 15.2px; font-weight: 600; flex: 1; }
.signal-val    { font-family: var(--mono); font-size: 13.9px; font-weight: 700; }
.signal-score  { font-family: var(--mono); font-size: 13.9px; color: var(--muted); width: 28px; text-align: right; }
.signal-detail {
  display: none;
  width: 100%;
  box-sizing: border-box;
  margin: 2px 0 4px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}
.sg-desc {
  font-size: 13.8px;
  color: #5a5550;
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}
.sg-title {
  font-size: 10.3px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sg-rows { display: flex; flex-direction: column; gap: 3px; }
.sg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.sg-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sg-label { flex: 1; font-size: 13.2px; color: #5a5550; font-weight: 500; }
.sg-score { font-family: var(--mono); font-size: 13.2px; font-weight: 700; color: var(--accent); min-width: 32px; text-align: right; }
.signal-reason { font-size: 12.6px; color: var(--muted); margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.signal-reason-data { font-family: var(--mono); font-weight: 600; color: var(--text); }
.signal-reason-band { color: var(--dim); }
.signal-contrib-bar { height: 3px; border-radius: 2px; margin-top: 3px; transition: width 0.3s; }
.signal-contrib-pts { font-family: var(--mono); font-size: 12.6px; color: var(--dim); white-space: nowrap; }

/* Seller narrative */
.narrative-block { background: #fff5f6; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 10px 14px; margin-top: 12px; font-size: 15.2px; line-height: 1.6; color: #5a5550; }
.narrative-label { font-size: 12.6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent); margin-bottom: 4px; }

/* ── WHAT-IF SLIDER ───────────────────────────────────────────────────────── */
.whatif-box   { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 4px; }
.whatif-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 10px; }


/* Investment Score in tab */
.inv-score-display { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.inv-score-number  { font-family: var(--mono); font-size: 60.7px; font-weight: 800; line-height: 1; }
.inv-score-badge   { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 13.9px; font-weight: 700; letter-spacing: 0.5px; }
.inv-score-action  { font-size: 15.2px; color: var(--muted); margin-bottom: 12px; min-height: 16px; }

/* ── THRESHOLDS ───────────────────────────────────────────────────────────── */
.threshold-row   { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.threshold-row:last-child { border-bottom: none; }
.threshold-label { font-size: 13.9px; font-weight: 700; width: 60px; }
.threshold-price { font-family: var(--mono); font-size: 15.2px; flex: 1; }
.threshold-signal { font-size: 12.6px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* ── CF GRID ──────────────────────────────────────────────────────────────── */
.cf-grid   { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.cf-row    { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 11px; }
.cf-label  { color: var(--muted); }
.cf-value  { font-family: var(--mono); font-weight: 600; }
.cf-value.positive { color: var(--push); }
.cf-value.negative { color: var(--danger); }
.cf-value.warning  { color: var(--warn); }
.cf-total  { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 3px; border-top: 1px solid var(--border); font-size: 16.4px; font-weight: 700; margin-top: 4px; }

/* ── INVESTMENT ANALYSIS ──────────────────────────────────────────────────── */
.inv-section-divider { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 10px 0 5px; padding-top: 8px; border-top: 1px solid var(--border); }
.inv-metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.inv-metric       { background: #F0F0F0; border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border); }
.inv-metric-label { font-size: 12.6px; color: var(--muted); margin-bottom: 2px; }
.inv-metric-value { font-family: var(--mono); font-size: 16.4px; font-weight: 700; }
.inv-metric-calc  { font-size: 10px; color: var(--muted); font-family: var(--mono); border-top: 1px solid var(--border); padding-top: 5px; margin-top: 5px; line-height: 1.6; }
.inv-metric-calc-nums { color: var(--text); }
.inv-verdict      { border-radius: 8px; padding: 8px 12px; font-size: 13.9px; line-height: 1.5; }
.inv-verdict.pass { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.inv-verdict.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.inv-verdict.fail { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* 1% rule badge */

/* ── COMPARISON TABLE: Option B (card-per-property) ─────────────────────── */
.ct-wrap         { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ct-b-wrap       { display: grid; gap: 8px; align-items: start; min-width: 0; }

/* Label column */
.ct-b-labels     { display: flex; flex-direction: column; padding-top: 42px; }
.ct-b-label      { height: 52px; display: flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--muted); padding-right: 8px; }
.ct-b-divider    { height: 32px; display: flex; align-items: center; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--dim); border-top: 1px solid var(--border); }
.ct-b-divider:first-child { border-top: none; }

/* Property cards */
.ct-b-card       { border-radius: 10px; border: 1px solid var(--border); overflow: hidden; background: var(--surface); cursor: pointer; transition: border-color 0.15s; }
.ct-b-card:hover { border-color: var(--accent); }
.ct-b-card.ct-b-active { border: 2px solid var(--accent); }
.ct-b-head       { padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--border); }
.ct-b-card.ct-b-active .ct-b-head { background: var(--accent); color: #fff; border-bottom: none; font-weight: 800; }
.ct-b-cell       { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); padding: 4px 6px; text-align: center; }
.ct-b-cell:last-child { border-bottom: none; }
.ct-b-card-divider { height: 32px; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Shared type styles */
.ct-score-num    { font-family: var(--mono); font-size: 17px; font-weight: 800; line-height: 1.1; }
.ct-score-label  { font-size: 11px; font-weight: 700; line-height: 1.2; }
.ct-rank-num     { font-family: var(--mono); font-size: 14px; font-weight: 800; line-height: 1.1; }
.ct-rank-label   { font-size: 11px; font-weight: 600; }
.ct-metric-val   { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.ct-sub          { font-size: 10px; color: var(--muted); font-family: var(--sans); font-weight: 400; }
.winner-badge    { font-size: 9px; color: var(--push); font-weight: 700; font-family: var(--sans); }

@media (max-width: 640px) {
  .ct-b-labels   { padding-top: 38px; }
  .ct-b-label    { font-size: 10px; height: 48px; }
  .ct-b-cell     { height: 48px; font-size: 11px; }
  .ct-score-num  { font-size: 14px; }
  .ct-metric-val { font-size: 11px; }
}

#compTable span{font-weight: bold;}

/* ── ASSUMPTIONS PANEL ───────────────────────────────────────────────────── */
.assumptions-header { display: none; }
.assumptions-grid   { display: none; }

/* ── INLINE-EDIT PANEL ─────────────────────────────────────────────────────── */
.ip-section { border-top: 1px solid var(--border); padding: 6px 0 2px; margin-top: 0; }
.ip-section:first-of-type { border-top: none; }
.ip-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ip-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ip-reset { font-size: 10px; color: #3B82F6; cursor: pointer; font-weight: 500; background: none; border: none; padding: 0; }
.ip-reset:hover { text-decoration: underline; }
.ip-row { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; border-bottom: 0.5px solid var(--border); min-height: 26px; }
.ip-row:last-child { border-bottom: none; }
.ip-label { font-size: 11px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 5px; flex: 1; }
.ip-rhs { display: flex; align-items: center; gap: 3px; }
.ip-prefix { font-size: 11px; color: var(--muted); }
.ip-unit { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ip-input {
  width: 56px; padding: 2px 5px;
  border: 1px solid transparent; border-radius: 5px;
  font-size: 11px !important; font-family: var(--mono); font-weight: 700; text-align: right;
  background: transparent; color: var(--text);
  -moz-appearance: textfield; transition: border-color 0.12s, background 0.12s;
  line-height: 1.4;
}
.ip-input::-webkit-outer-spin-button,
.ip-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ip-input:hover { border-color: var(--border); background: var(--bg); }
.ip-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 2px rgba(232,41,76,0.12); }
.ip-zip-badge { font-size: 9px; color: #3B82F6; background: #e6f1fb; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.ip-src-badge { font-size: 9px; font-weight: 700; }

/* ── TOOLTIP ──────────────────────────────────────────────────────────────── */
.tip { position: relative; display: inline-flex; align-items: center; }
.tip-icon { width: 14px; height: 14px; border-radius: 50%; background: var(--border); color: var(--muted); font-size: 11.4px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; cursor: help; margin-left: 4px; flex-shrink: 0; transition: background 0.15s; line-height: 1; }
.tip-icon:hover { background: var(--accent); color: #fff; }
.tip-box { visibility: hidden; opacity: 0; position: fixed; background: #1a1714; color: #f0ede8; font-size: 11px; line-height: 1.5; padding: 8px 11px; border-radius: 7px; width: 240px; pointer-events: auto; transition: opacity 0.15s; z-index: 99999; box-shadow: 0 4px 16px rgba(0,0,0,0.2); font-weight: 400; white-space: normal; }
.tip-box::after { content: ''; position: absolute; top: 100%; left: var(--caret-left, 50%); transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1a1714; }
.tip:hover .tip-box, .tip-box:hover { visibility: visible; opacity: 1; }
.tip-box.tip-left { }
.tip-box.tip-left::after { }

/* ── ADDRESS INPUTS ──────────────────────────────────────────────────────── */
.address-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 16.4px; font-family: var(--sans); color: var(--text); background: var(--bg); outline: none; transition: border-color 0.15s; }
.address-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 2px rgba(232,41,76,0.1); }
.address-input.valid    { border-color: var(--push); background: #f0fdf4; }
.address-input.invalid  { border-color: var(--danger); background: #fff1f2; }
.address-input.matched  { border-color: var(--push); background: #f0fdf4; }
.address-input.google-validated { border-color: var(--push); }
.address-input.unmatched { border-color: var(--warn); }
.address-input.validating { border-color: var(--dim); }
.match-hint { font-size: 13.9px; margin-top: 3px; min-height: 16px; }
.match-hint.ok, .match-hint.google-ok, .match-hint.matched { color: var(--push); }
.match-hint.warn, .match-hint.unmatched { color: var(--warn); }
.match-hint.error, .match-hint.invalid { color: var(--danger); }
.match-hint.validating { color: var(--dim); }

/* ── PROP INPUT ROWS ──────────────────────────────────────────────────────── */
.add-prop-panel { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 4px; }
.add-prop-title { font-size: 13.9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.prop-input-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.prop-num { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12.6px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 9px; }
.prop-input-wrap { flex: 1; }
.remove-prop-btn { padding: 6px 10px; border: 1px solid #fecdd3; border-radius: 6px; background: #fff1f2; color: var(--danger); font-size: 13.9px; font-weight: 700; cursor: pointer; white-space: nowrap; margin-top: 6px; }
.remove-prop-btn:hover { background: #ffe4e6; }
.add-prop-btn { width: 100%; padding: 8px; border: 1px dashed var(--border); border-radius: 7px; background: transparent; color: var(--muted); font-size: 15.2px; font-weight: 600; cursor: pointer; margin-top: 6px; transition: all 0.15s; }
.add-prop-btn:hover { border-color: var(--accent); color: var(--accent); background: #fff5f6; }
.add-prop-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.prop-count-note { font-size: 12.6px; color: var(--dim); text-align: right; margin-top: 4px; }

/* ── GOOGLE AUTOCOMPLETE ──────────────────────────────────────────────────── */
.pac-container { font-family: var(--sans); font-size: 16.4px; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.10); margin-top: 4px; overflow: hidden; z-index: 99999; }
.pac-item { padding: 9px 14px; cursor: pointer; color: var(--text); border-top: 1px solid var(--border); line-height: 1.4; }
.pac-item:hover, .pac-item-selected { background: #fff5f6; }
.pac-item-query { font-size: 16.4px; color: var(--text); font-weight: 600; }
.pac-matched { color: var(--accent); font-weight: 700; }
.pac-icon { display: none; }

/* ── TAGS & MISC ──────────────────────────────────────────────────────────── */
.tag { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 12.6px; font-weight: 600; }
.tag-warn { background: #fffbeb; color: #92400e; }
.tag-ok   { background: #f0fdf4; color: #166534; }
.tag-bad  { background: #fff1f2; color: #9f1239; }
.section-label { font-size: 12.6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 8px; }
.greyed-overlay { position: relative; }
.greyed-overlay::after { content: attr(data-msg); position: absolute; inset: 0; background: rgba(255,255,255,0.92); display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13.9px; color: var(--muted); text-align: center; padding: 12px; }

/* ── ENTRY PAGE ───────────────────────────────────────────────────────────── */
.entry-shell { min-height: calc(100vh - 57px); display: flex; align-items: center; justify-content: center; padding: 48px 32px; gap: 64px; }
.entry-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 500px; overflow: hidden; box-shadow: 0 8px 40px rgba(79,70,229,0.08), 0 2px 8px rgba(0,0,0,0.04); animation: fadeUp 0.45s 0.1s ease both; }
.entry-headline { font-size: 30.4px; font-weight: 800; color: var(--text); letter-spacing: -0.6px; margin-bottom: 6px; }
.entry-sub { font-size: 16.4px; color: var(--muted); margin-bottom: 32px; line-height: 1.6; }
.entry-step { margin-bottom: 28px; }
.entry-step-label { font-size: 12.6px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.9px; color: var(--muted); margin-bottom: 10px; }
.entry-persona-tabs { display: flex; gap: 10px; }
.entry-persona-btn { flex: 1; padding: 14px 12px; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 16.4px; font-weight: 600; color: var(--muted); transition: all 0.15s; text-align: center; }
.entry-persona-btn:hover { border-color: var(--accent); color: var(--accent); background: #fff5f6; }
.entry-persona-btn.active { border-color: var(--accent); background: #fff0f2; color: var(--accent); }
.persona-label { font-size: 20.2px; font-weight: 800; display: block; margin-bottom: 3px; }
.persona-desc  { font-size: 13.9px; color: var(--muted); }
.entry-persona-btn.active .persona-desc { color: #c8203e; }
.entry-props { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.entry-prop-row { display: flex; align-items: flex-start; gap: 8px; }
.entry-prop-num { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12.6px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 9px; }
.entry-prop-wrap { flex: 1; }
.entry-add-btn { width: 100%; padding: 9px; border: 1px dashed var(--border); border-radius: 8px; background: transparent; color: var(--muted); font-size: 15.2px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.entry-add-btn:hover { border-color: var(--accent); color: var(--accent); background: #fff5f6; }
.entry-add-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.entry-analyze-btn { width: 100%; padding: 15px; background: var(--accent); color: #fff; border: none; border-radius: 10px; font-size: 19px; font-weight: 800; cursor: pointer; margin-top: 8px; transition: background 0.15s; letter-spacing: -0.2px; }
.entry-analyze-btn:hover { background: #c8203e; }
.entry-analyze-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--accent); }

/* ── SUMMARY BAR ──────────────────────────────────────────────────────────── */
.summary-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 20px; display: flex; align-items: center; gap: 16px; font-size: 15.2px; }
.summary-persona-chip { padding: 3px 10px; border-radius: 20px; font-size: 13.9px; font-weight: 700; background: #fff0f2; color: var(--accent); }
.summary-props { display: flex; gap: 6px; flex-wrap: wrap; }
.summary-prop-tag { padding: 3px 9px; border-radius: 5px; background: var(--bg); border: 1px solid var(--border); font-size: 13.9px; color: var(--muted); font-weight: 500; cursor: pointer; transition: all 0.15s; }
.summary-prop-tag:hover { border-color: var(--accent); color: var(--accent); background: #fff5f6; }
.summary-prop-tag.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.summary-edit-btn { margin-left: auto; padding: 5px 14px; border: 1px solid var(--border); border-radius: 6px; background: transparent; font-size: 15.2px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.15s; }
.summary-edit-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── SCREEN SWITCHING ─────────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; }

/* ── INDEX PAGE ───────────────────────────────────────────────────────────── */

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* Pitch panel */
.entry-pitch { max-width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 22px; animation: fadeUp 0.45s ease both; }
.pitch-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.6px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); background: var(--accent-light); border: 1px solid var(--accent-mid); padding: 4px 11px; border-radius: 20px; width: fit-content; }
.pitch-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
.pitch-headline { font-size: 43.7px; font-weight: 800; line-height: 1.1; letter-spacing: -1.2px; color: var(--text); }
.pitch-headline em { font-style: normal; color: var(--accent); }
.pitch-sub { font-size: 17.2px; color: var(--muted); line-height: 1.65; }
.pitch-stats { display: flex; gap: 24px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pitch-stat-val { font-family: var(--mono); font-size: 25.3px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; display: block; }
.pitch-stat-val span { color: #0dad78; display: block; }
.pitch-stat-label { font-size: 12.6px; color: var(--muted); margin-top: 2px; display: block; }
.pitch-signals { display: flex; flex-direction: column; gap: 10px; }
.pitch-signal { display: flex; align-items: center; gap: 11px; font-size: 14.9px; color: var(--muted); font-weight: 500; }
.signal-num { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; flex-shrink: 0; }

/* Hero card */
.hero-img-wrap { position: relative; height: 260px; background: linear-gradient(135deg, #e8e4df 0%, #d4d0cb 100%); overflow: hidden; }
.hero-img-wrap.hero-img-fallback::after { content: '🏡'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; opacity: 0.2; }
.hero-img-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(26,23,20,0.72) 0%, rgba(26,23,20,0.1) 55%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 20px 22px; }
.hero-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.hero-caption { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.35; letter-spacing: -0.3px; }
.hero-body { padding: 22px 24px 26px; }
.hero-stats { display: flex; align-items: center; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.hero-stat { flex: 1; text-align: center; }
.hero-stat-val { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--accent); display: block; margin-bottom: 2px; }
.hero-stat-lbl { font-size: 11px; color: var(--muted); font-weight: 500; }
.hero-stat-div { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }
.hero-search-btn { width: 100%; padding: 15px; background: var(--accent); color: #fff; border: none; border-radius: 10px; font-size: 17px; font-weight: 800; cursor: pointer; transition: all 0.15s; letter-spacing: -0.3px; font-family: var(--sans); position: relative; overflow: hidden; }
.hero-search-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%); pointer-events: none; }
.hero-search-btn:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(232,41,76,0.3); }
.hero-sub { text-align: center; font-size: 12px; color: var(--dim); margin-top: 10px; font-weight: 500; }

/* AVM confidence badge inline in price strip */
.avm-conf-inline { margin-left:4px !important; padding:1px 5px !important; font-size:9px !important; vertical-align:middle; }

/* ── REALTOR PANEL ─────────────────────────────────────────────────────────── */
.rtab-btn { flex:1; padding:6px 4px; font-size:11px; font-weight:600; border:none; background:transparent; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; transition:all 0.15s; }
.rtab-btn:hover { color:var(--text); }
.rtab-active { color:var(--accent) !important; border-bottom-color:var(--accent) !important; }
.rtab-section { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:var(--muted); margin:10px 0 6px; }
.rtab-note-block { background:#f9f8f6; border-radius:7px; padding:8px 10px; margin-bottom:6px; }
.rtab-note-cat { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:var(--muted); margin-bottom:3px; }
.rtab-note-text { font-size:11px; color:var(--text); line-height:1.5; }
.rtab-hl-row { display:flex; gap:7px; align-items:flex-start; padding:5px 0; border-bottom:0.5px solid var(--border); font-size:11px; }
.rtab-hl-row:last-child { border-bottom:none; }
.rtab-hl-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:2px; }
.rtab-correct-row { display:flex; align-items:center; justify-content:space-between; padding:6px 0; border-bottom:0.5px solid var(--border); font-size:11px; }
.rtab-correct-row:last-child { border-bottom:none; }
.rtab-verify-btn { font-size:10px; font-weight:600; color:#0c447c; background:#e6f1fb; padding:2px 8px; border-radius:99px; border:none; cursor:pointer; white-space:nowrap; }
.rtab-verified-chip { font-size:10px; font-weight:600; color:#27500a; background:#eaf3de; padding:2px 8px; border-radius:99px; }
.rtab-verify-box { background:#e6f1fb; border:0.5px solid #85b7eb; border-radius:7px; padding:9px 11px; margin-top:8px; font-size:11px; color:#042c53; }
.rtab-confirm-btn { flex:1; padding:5px; background:var(--accent); color:#fff; border:none; border-radius:5px; font-size:11px; font-weight:700; cursor:pointer; }
.rtab-edit-btn { flex:1; padding:5px; background:none; border:1px solid var(--border); border-radius:5px; font-size:11px; cursor:pointer; color:var(--muted); }
.rtab-outcome-row { display:flex; align-items:center; justify-content:space-between; padding:6px 0; border-bottom:0.5px solid var(--border); font-size:11px; }
.rtab-outcome-row:last-child { border-bottom:none; }
.rtab-outcome-input { width:80px; padding:3px 6px; border:1px solid var(--border); border-radius:5px; font-size:11px; font-family:var(--mono); font-weight:700; text-align:right; background:#fafafa; color:var(--text); }
.verified-chip-wrap:hover .verified-chip-tip { visibility:visible !important; opacity:1 !important; }

/* ── INVESTMENT METRIC CARDS ─────────────────────────────────────────────── */
.mc-grid        { border:0.5px solid #d6d5d3;border-radius:10px;overflow:hidden;margin-bottom:4px; }
.mc-row         { display:grid;grid-template-columns:1fr 1fr; }
.mc-cell        { padding:14px 16px;display:flex;align-items:flex-start;gap:20px;background:#f0ede8;border-right:0.5px solid #d6d5d3;border-bottom:0.5px solid #d6d5d3; }
.mc-cell-last-r { border-right:none; }
.mc-cell-last-b { border-bottom:none; }
.mc-left        { min-width:64px;flex-shrink:0; }
.mc-big         { font-size:30px;font-weight:700;line-height:1;margin-bottom:4px; }
.mc-lbl         { font-size:11px;font-weight:600;color:var(--text); }
.mc-right       { border-left:0.5px solid #d6d5d3;padding-left:16px;flex:1; }
.mc-target      { font-size:10px;font-weight:500;border-radius:4px;padding:2px 7px;display:inline-block;margin-bottom:7px; }
.mc-target.pass { background:#eaf3de;color:#27500a; }
.mc-target.fail { background:#fcebeb;color:#a32d2d; }
.mc-target.watch{ background:#faeeda;color:#854f0b; }
.mc-desc        { font-size:11px;color:var(--muted);margin-bottom:4px; }
.mc-formula     { font-size:11px;color:var(--muted);font-family:var(--mono); }
.mc-verdict     { padding:14px 16px;display:flex;align-items:center;background:#f0ede8;border-right:0.5px solid #d6d5d3;border-bottom:0.5px solid #d6d5d3; }
.mc-verdict-lbl { font-size:30px;font-weight:700;line-height:1;margin-bottom:4px; }
.mc-verdict-score { font-size:10px;color:var(--muted);margin-bottom:2px; }
.mc-verdict-count { font-size:10px;color:var(--muted); }


/* ── ANALYSIS PAGE — RIGHT PANEL & LONG-TERM HOLD ───────────────────────── */
.rp-sec-head {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); padding: 9px 14px 5px;
}
.rp-sliders { padding: 0 14px 10px; }
.rp-sl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rp-sl-row:last-child { margin-bottom: 0; }
.rp-sl-label { font-size: 11px; color: var(--muted); width: 100px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-sl-val { font-size: 11px; font-weight: 700; font-family: var(--mono, monospace); color: var(--text); width: 42px; text-align: right; flex-shrink: 0; }
.rp-pos { color: #2ECC71; }
.rp-sl-sep { height: 0.5px; background: var(--border); margin: 4px 0 8px; }
/* Prevent right panel from collapsing during re-render */
#personaCardBody { min-height: 320px; contain: layout style; }
.right-panel { overflow-anchor: none; }
.rp-details-btn {
  font-size: 10px; color: #e8294c; font-weight: 600; background: none;
  border: none; cursor: pointer; padding: 0; text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
}
.rp-details-btn:hover { text-decoration: underline; }
/* Slider track — thin, light pink */
#ipWrapper input[type=range] {
  flex: 1; cursor: pointer; -webkit-appearance: none; appearance: none;
  height: 3px; background: #fad0d8; border-radius: 2px; outline: none;
}
#ipWrapper input[type=range]::-webkit-slider-runnable-track {
  height: 3px; background: #fad0d8; border-radius: 2px;
}
#ipWrapper input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: #e8294c; cursor: pointer; margin-top: -5px;
}
#ipWrapper input[type=range]::-moz-range-track {
  height: 3px; background: #fad0d8; border-radius: 2px;
}
#ipWrapper input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #e8294c; cursor: pointer; border: none;
}
/* Strip override badge + detail link from personaCardBody rent row */
#personaCardBody .rent-detail-btn,
#personaCardBody [data-rent-detail],
#personaCardBody .cf-rent-detail { display: none !important; }

/* ── LONG-TERM HOLD CALLOUT ──────────────────────────────────────────────── */
.lt-hold-wrap {
  margin-top: 10px;
  border: 0.5px solid #f5a0ae;
  border-left: 3px solid #e8294c;
  border-radius: 0 8px 8px 0;
  background: #fff8f9;
  overflow: hidden;
}
.lt-hold-trigger {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; cursor: pointer;
}
.lt-hold-pill {
  font-size: 10px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; background: #e8294c; color: #fff;
  white-space: nowrap; flex-shrink: 0; margin-top: 1px;
  letter-spacing: 0.02em;
}
.lt-hold-text {
  font-size: 13px; color: #444; line-height: 1.45; flex: 1;
}

.lt-hold-body {
  display: none; padding: 0 12px 12px;
  border-top: 0.5px solid rgba(232,41,76,0.15);
}
.lt-hold-body.open { display: block; }
.lt-hold-appr-row {
  display: flex; align-items: center; gap: 8px; margin: 10px 0 2px;
}
.lt-hold-appr-row label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lt-hold-appr-val {
  font-size: 13px; font-weight: 700; font-family: var(--mono, monospace);
  min-width: 40px; text-align: right; color: var(--text);
}
.lt-hold-appr-row input[type=range] {
  flex: 1; cursor: pointer; -webkit-appearance: none; appearance: none;
  height: 3px; background: #fad0d8; border-radius: 2px; outline: none;
}
.lt-hold-appr-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px;
  border-radius: 50%; background: #e8294c; cursor: pointer; margin-top: -5px;
}
.lt-hold-appr-row input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #e8294c; cursor: pointer; border: none;
}
.lt-hold-note { font-size: 11px; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }
.lt-hold-nums {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 8px 0;
}
.lt-hold-num {
  background: var(--surface); border-radius: 7px; padding: 7px 9px;
  border: 0.5px solid var(--border);
}
.lt-hold-num-label { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.lt-hold-num-value { font-size: 15px; font-weight: 700; color: var(--text); }
.lt-hold-num-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.lt-hold-legend { display: flex; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.lt-hold-leg { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.lt-hold-leg-dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.lt-hold-chart-wrap { position: relative; height: 150px; margin: 8px 0 6px; }
.lt-fmla-toggle {
  font-size: 11px; color: #e8294c; cursor: pointer;
  margin: 6px 0 2px; display: inline-block; font-weight: 600;
}
.lt-fmla-box {
  display: none; background: var(--bg); border-radius: 7px;
  padding: 10px 12px; margin: 4px 0 8px;
  font-size: 12px; color: var(--muted); line-height: 1.8;
}
.lt-fmla-box.open { display: block; }
.lt-fmla-row { display: flex; justify-content: space-between; padding: 1px 0; }
.lt-fmla-divider { display: flex; justify-content: space-between; padding: 5px 0 1px; border-top: 0.5px solid var(--border); font-weight: 700; color: var(--text); }
.lt-hold-action {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 7px; padding: 10px 12px;
  font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 10px;
}
.lt-hold-action strong { color: var(--text); font-weight: 700; }