/* ============================================================
   styles.css — Deal Calculator
   Themes set via [data-theme] on <html>. Accent via --accent vars.
   ============================================================ */

:root {
  --maxw: 1180px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --fs-num: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --fs-ui: 'Inter Tight', system-ui, -apple-system, sans-serif;

  /* tone defaults — overridden per theme */
  --bg: #F9FAFB;
  --panel: #FFFFFF;
  --panel-2: #F3F4F6;
  --ink: #1F2937;
  --ink-2: #6B7280;
  --ink-3: #9CA3AF;
  --line: #EDEFF2;
  --line-2: #F3F4F6;
  --field: #FFFFFF;
  --field-line: #E5E7EB;
  --accent: #10B981;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECFDF5;
  --good: #10B981;
  --good-soft: #ECFDF5;
  --warn: #D97706;
  --warn-soft: #FEF3C7;
  --bad: #DC2626;
  --bad-soft: #FEE2E2;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.10);
  --highlight-band: #ECFDF5;
}

/* ---------- THEME: clean-light (warm-neutral white) ---------- */
[data-theme="clean"] {
  --bg: #F9FAFB;
  --panel: #FFFFFF;
  --panel-2: #F3F4F6;
  --ink: #1F2937;
  --ink-2: #6B7280;
  --ink-3: #9CA3AF;
  --line: #EDEFF2;
  --line-2: #F3F4F6;
  --field: #FFFFFF;
  --field-line: #E5E7EB;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-y: none;
}
body {
  font-family: var(--fs-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
}
input, button, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-family: var(--fs-num); font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; }

/* ---------------- Layout shell ---------------- */
.app { min-height: 100vh; width: 100%; max-width: 100%; overflow-x: clip; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(249,250,251,0.97);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.brand-name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--ink-3); margin-top: -2px; }
.topbar-spacer { flex: 1; }
.tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.tab {
  border: none; background: transparent; color: var(--ink-2);
  padding: 7px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 7px;
}
.tab[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.tab .pill { font-size: 11px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 7px; font-family: var(--fs-num); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 26px 20px 160px; width: 100%; box-sizing: border-box; }

/* main two-column on desktop */
.grid {
  display: grid; gap: 22px;
  grid-template-columns: 1fr;
  min-width: 0;
}
.grid > * { min-width: 0; }
@media (min-width: 940px) {
  .grid { grid-template-columns: minmax(0,1fr) 360px; align-items: start; }
  .rail { position: sticky; top: 86px; }
}

/* ---------------- Cards / sections ---------------- */
.card {
  background: var(--panel);
  border: none;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 22px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 17px 20px; border-bottom: 1px solid var(--line-2);
}
.step-no {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  font-family: var(--fs-num);
}
[data-theme="dark"] .step-no { color: var(--accent); }
.card-title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-kicker { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.card-head-aside { margin-left: auto; }
.card-body { padding: 20px; }

/* ---------------- Inputs ---------------- */
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; white-space: nowrap; }
.field-hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; white-space: nowrap; margin-left: 4px; }

.bigfield { position: relative; }
.bigfield .prefix {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--fs-num); font-size: 22px; color: var(--ink-3); pointer-events: none;
}
.bigfield input {
  width: 100%; border: 1.5px solid var(--field-line); background: var(--field);
  border-radius: var(--r-md); padding: 14px 16px 14px 34px;
  font-family: var(--fs-num); font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.bigfield input::placeholder { color: var(--ink-3); opacity: .55; font-weight: 500; }
.bigfield input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.bigfield.compact input { font-size: 18px; padding: 11px 14px 11px 30px; }
.bigfield.compact .prefix { font-size: 17px; left: 13px; }

.tinp {
  width: 100%; border: 1.5px solid var(--field-line); background: var(--field);
  border-radius: var(--r-sm); padding: 9px 12px; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tinp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tinp.num { font-family: var(--fs-num); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .three { grid-template-columns: 1fr 1fr; } }
.fstack { display: flex; flex-direction: column; gap: 7px; }

/* segmented control */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: none; background: transparent; color: var(--ink-2);
  padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  font-family: var(--fs-num); transition: all .12s;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }

/* toggle */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--field-line); position: relative; transition: background .18s; flex: none; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input { display: none; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .knob { transform: translateX(18px); }

/* ---------------- Offer range — sideways picker wheel ---------------- */
.owheel { padding: 2px 0; }
.owheel.empty { opacity: .5; }
.ow-readout { text-align: center; margin-bottom: 4px; }
.ow-price { display: block; font-family: var(--fs-num); font-size: 26px; font-weight: 700;
  letter-spacing: -.02em; line-height: 1.05; color: var(--ink); }
.ow-sub { display: block; font-family: var(--fs-ui); font-size: 11px; font-weight: 600;
  letter-spacing: .01em; color: var(--ink-3); margin-top: 4px; }
.owheel[data-tone="good"] .ow-price,
.owheel[data-tone="good"] .ow-sub { color: var(--good); }
.owheel[data-tone="warn"] .ow-price,
.owheel[data-tone="warn"] .ow-sub { color: var(--warn); }
.owheel[data-tone="bad"] .ow-price,
.owheel[data-tone="bad"] .ow-sub { color: var(--bad); }

.ow-stage { position: relative; height: 84px; overflow: hidden; cursor: grab;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.owheel.dragging .ow-stage { cursor: grabbing; }
.ow-stage::before, .ow-stage::after { content: ''; position: absolute; top: 0; bottom: 0; width: 52px; z-index: 2; pointer-events: none; }
.ow-stage::before { left: 0; background: linear-gradient(90deg, var(--panel), color-mix(in oklab, var(--panel) 0%, transparent)); }
.ow-stage::after { right: 0; background: linear-gradient(270deg, var(--panel), color-mix(in oklab, var(--panel) 0%, transparent)); }
.ow-window { position: absolute; top: 11px; bottom: 11px; left: 50%; width: 54px; transform: translateX(-50%);
  border-radius: 13px; pointer-events: none; z-index: 0;
  background: transparent;
  border: 1.5px solid var(--field-line); transition: border-color .14s, background .14s; }
.owheel[data-tone="warn"] .ow-window { border-color: color-mix(in oklab, var(--warn) 55%, transparent); background: color-mix(in oklab, var(--warn) 8%, transparent); }
.owheel[data-tone="bad"] .ow-window { border-color: color-mix(in oklab, var(--bad) 55%, transparent); background: color-mix(in oklab, var(--bad) 8%, transparent); }

.ow-track { position: absolute; left: 50%; top: 0; height: 100%; z-index: 1; display: flex; align-items: center;
  transition: transform .26s cubic-bezier(.22,.61,.36,1); will-change: transform; }
.owheel.dragging .ow-track { transition: none; }

.ow-item { flex: 0 0 56px; height: 60px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; cursor: pointer; font-family: var(--fs-num);
  position: relative; z-index: 1; will-change: transform, opacity; }
.ow-pct { font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--ink-2);
  display: inline-flex; align-items: baseline; transition: color .14s; }
.ow-pctsign { font-size: 11px; font-weight: 600; opacity: .5; margin-left: 1px; }
.ow-legend { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.ow-legend-swatch { width: 16px; height: 9px; border-radius: 3px;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent); }
.ow-item.sel .ow-pct { color: var(--accent); }
.owheel[data-tone="good"] .ow-item.sel .ow-pct { color: var(--good); }

/* ---------------- The Numbers breakdown ---------------- */
.bd { display: flex; flex-direction: column; }
.bd-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 14px; }
.bd-row:last-child { border-bottom: none; }
.bd-row .lbl { color: var(--ink-2); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.bd-row .val { font-family: var(--fs-num); font-weight: 600; white-space: nowrap; padding-left: 12px; }
.bd-row.neg .val { color: var(--bad); }
.bd-row.total { margin-top: 4px; padding-top: 14px; border-top: 2px solid var(--line); }
.bd-row.total .lbl { font-weight: 700; color: var(--ink); font-size: 15px; }
.bd-row.total .val { font-size: 20px; }

/* ---------------- Stat tiles ---------------- */
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; }
.stat .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.stat .v { font-family: var(--fs-num); font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin-top: 3px; }
.stat .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.stat.good .v { color: var(--good); }
.stat.warn .v { color: var(--warn); }
.stat.bad .v { color: var(--bad); }

/* ---------------- Rail summary (bento tiles) ---------------- */
.summary { background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.summary-top { display: flex; flex-direction: column; gap: 12px; }
.summary-addr { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.verdict { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-sm); }
.verdict.good { background: var(--good-soft); }
.verdict.warn { background: var(--warn-soft); }
.verdict.bad  { background: var(--bad-soft); }
.verdict.neutral { background: var(--panel-2); }
.verdict-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px color-mix(in oklab, currentColor 22%, transparent); }
.verdict.good .verdict-dot { color: var(--good); background: var(--good); }
.verdict.warn .verdict-dot { color: var(--warn); background: var(--warn); }
.verdict.bad .verdict-dot { color: var(--bad); background: var(--bad); }
.verdict.neutral .verdict-dot { color: var(--ink-3); background: var(--ink-3); }
.verdict-label { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.verdict.good .verdict-label { color: var(--good); }
.verdict.warn .verdict-label { color: var(--warn); }
.verdict.bad .verdict-label { color: var(--bad); }
.verdict-note { font-size: 12px; color: var(--ink-2); margin-top: 1px; line-height: 1.3; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.summary-cell { background: none; box-shadow: none; border-radius: 0; padding: 0; }
.summary-cell .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.summary-cell .v { font-family: var(--fs-num); font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; }
.summary-cell .v.good { color: var(--good); }
.summary-cell .v.bad { color: var(--bad); }
.summary-cell.wide { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.summary-cell.wide .v { font-size: 27px; }
.summary-actions { padding: 2px 0 0; display: flex; gap: 10px; }
.summary-editing { padding: 2px 4px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.summary-editing svg { color: var(--accent); flex: 0 0 auto; }
.linklike { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; }
.linklike:hover { filter: brightness(1.08); }

/* ---------------- Buttons ---------------- */
.btn {
  border: 1px solid var(--field-line); background: var(--field); color: var(--ink);
  padding: 11px 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .14s; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); padding: 8px 10px; }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; }

/* ---------------- Collapsible ---------------- */
.collapse-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; text-align: left; background: transparent; border: none; padding: 0; cursor: pointer; }
.chev { transition: transform .25s ease; color: var(--ink-3); }
.chev.open { transform: rotate(90deg); }

/* Smooth open/close — JS-measured height animation (see <Collapse>).
   Robust across engines; content-derived height, no snap/jump. */
.card-collapse { overflow: hidden; transition: height .32s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) { .card-collapse { transition: none; } }

/* ---------------- Rehab estimator ---------------- */
.rehab-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 680px) { .rehab-list { grid-template-columns: 1fr; } }
.rehab-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--panel-2);
  transition: all .14s;
}
.rehab-item.on { border-color: var(--accent); background: var(--accent-soft); }
.rehab-check {
  width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--field-line);
  background: var(--field); display: grid; place-items: center; transition: all .14s;
}
.rehab-item.on .rehab-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rehab-main { flex: 1; min-width: 0; }
.rehab-name { font-size: 13.5px; font-weight: 600; }
.rehab-meta { font-size: 11.5px; color: var(--ink-3); font-family: var(--fs-num); margin-top: 1px; }
.rehab-cost { font-family: var(--fs-num); font-size: 15px; font-weight: 700; }
.rehab-item.on .rehab-cost { color: var(--accent); }
[data-theme="dark"] .rehab-item.on .rehab-cost { color: var(--accent); }
.qty-step { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--field-line); border-radius: 7px; overflow: hidden; background: var(--field); }
.qty-step button { width: 24px; height: 24px; border: none; background: transparent; font-size: 15px; font-weight: 700; color: var(--ink-2); display: grid; place-items: center; }
.qty-step button:hover { background: var(--panel-2); }
.qty-step .qv { min-width: 26px; text-align: center; font-family: var(--fs-num); font-size: 13px; font-weight: 600; }
.cost-edit { width: 78px; border: 1px solid var(--field-line); background: var(--field); border-radius: 6px; padding: 4px 7px; font-family: var(--fs-num); font-size: 13px; text-align: right; outline: none; }
.cost-edit:focus { border-color: var(--accent); }
.rate-edit { display: inline-flex; align-items: center; gap: 1px; border: 1px solid var(--field-line); border-radius: 7px; background: var(--field); padding: 3px 7px; }
.rate-edit:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rate-edit .rate-dollar { font-family: var(--fs-num); font-size: 12px; color: var(--ink-3); }
.rate-edit input { width: 34px; border: none; background: transparent; outline: none; font-family: var(--fs-num); font-size: 13px; font-weight: 600; text-align: center; color: var(--ink); padding: 0; }
.rate-edit .rate-unit { font-family: var(--fs-num); font-size: 10.5px; color: var(--ink-3); }

.rehab-total-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 15px 18px; background: var(--accent-soft); border-radius: var(--r-md); }
.rehab-total-bar .k { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rehab-total-bar .v { font-family: var(--fs-num); font-size: 22px; font-weight: 800; color: var(--accent); }
[data-theme="dark"] .rehab-total-bar .v { color: var(--accent); }

/* ---------------- Sticky mobile bar ---------------- */
.mobilebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,0.97);
  background: color-mix(in oklab, var(--panel) 94%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; align-items: center;
  box-shadow: 0 -10px 30px -20px rgba(0,0,0,.4);
}
@media (min-width: 940px) { .mobilebar { display: none; } }
.mobilebar .mb { min-width: 0; }
.mobilebar .mb .k { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.mobilebar .mb .v { font-family: var(--fs-num); font-size: 16px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.mobilebar .mb .v.good { color: var(--good); }
.mobilebar .mb .v.bad { color: var(--bad); }

/* ---------------- Saved deals ---------------- */
.deals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.deal-card { background: var(--panel); border: none; border-radius: var(--r-md); box-shadow: var(--shadow); padding: 18px; cursor: pointer; transition: transform .14s, box-shadow .14s, border-color .14s; position: relative; }
.deal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.deal-card .dc-addr { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-card .dc-date { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; }
.deal-card .dc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.deal-card .dc-stats .k { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.deal-card .dc-stats .v { font-family: var(--fs-num); font-size: 18px; font-weight: 700; margin-top: 2px; }
.deal-card .dc-stats .v.good { color: var(--good); }
.deal-card .dc-stats .v.bad { color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .01em; white-space: nowrap; flex-shrink: 0; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.neutral { background: var(--panel-2); color: var(--ink-3); }
.dc-del { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 8px; border: none; background: transparent; color: var(--ink-3); display: grid; place-items: center; opacity: 0; transition: opacity .14s, background .14s; }
.deal-card:hover .dc-del { opacity: 1; }
.dc-del:hover { background: var(--bad-soft); color: var(--bad); }

.empty { text-align: center; padding: 80px 20px; color: var(--ink-3); }
.empty .e-mark { width: 64px; height: 64px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 18px; }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 18px; }

/* reference fields */
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .ref-grid { grid-template-columns: 1fr; } }

.sectionwrap { margin-bottom: 22px; }
.divider-note { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; margin: 2px 0 16px; }
.dot { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); display: inline-block; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; display: flex; align-items: center; gap: 9px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 940px) { .toast { bottom: 30px; } }

/* ---------------- Save conflict modal ---------------- */
.modal-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: rgba(31,41,55,0.5);
  background: color-mix(in oklab, var(--ink) 42%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: modal-fade .16s ease; }
.modal { width: 100%; max-width: 408px; background: var(--panel); border: none;
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 26px 26px 22px;
  animation: modal-pop .2s cubic-bezier(.22,.61,.36,1); }
.modal-warn { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px;
  background: color-mix(in oklab, var(--warn) 16%, transparent); color: var(--warn); }
.modal h3 { margin: 0 0 10px; font-size: 19px; color: var(--ink); letter-spacing: -.01em; }
.modal p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.modal p b { color: var(--ink); font-weight: 700; }
.modal .modal-sub { color: var(--ink-3); font-size: 13px; }
.modal-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* changed-fields chips inside the confirm modal */
.modal-changes { margin: 14px 0 4px; }
.modal-changes-lbl { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.change-chip { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }

/* close button + large detail modal */
.modal-x { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; background: transparent; border: none; color: var(--ink-3); cursor: pointer; transition: all .14s; }
.modal-x:hover { background: var(--panel-2); color: var(--ink); }
.modal.modal-lg { max-width: 480px; max-height: calc(100vh - 48px); overflow-y: auto; padding-top: 22px; position: relative; }

.dd-head { padding-right: 40px; margin-bottom: 18px; }
.dd-addr { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.dd-addr svg { color: var(--accent); flex: 0 0 auto; }
.dd-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 20px; }
.dd-stat { background: var(--panel-2); border-radius: var(--r-sm); padding: 13px 15px; }
.dd-stat-k { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.dd-stat-v { font-family: var(--fs-num); font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin-top: 3px; color: var(--ink); }
.dd-stat-v.good { color: var(--good); }
.dd-stat-v.bad { color: var(--bad); }

.dd-section { margin-bottom: 18px; }
.dd-section-h { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
  padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.dd-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 6px 0; min-width: 0; }
.dd-row .dd-k { font-size: 13.5px; color: var(--ink-2); flex-shrink: 0; }
.dd-row .dd-v { font-family: var(--fs-num); font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; word-break: break-all; min-width: 0; text-align: right; }
.dd-row .dd-v.good { color: var(--good); }
.dd-row .dd-v.bad { color: var(--bad); }
.dd-row.strong .dd-k { font-weight: 600; color: var(--ink); }
.dd-row.strong .dd-v { font-size: 16px; font-weight: 700; }
.dd-notes { font-size: 13px; line-height: 1.55; color: var(--ink-2); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; margin-top: 8px; white-space: pre-wrap; }

/* URL rows in deal detail */
.dd-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.dd-link:hover { text-decoration: underline; }

/* URL input + open button in RefCard */
.ref-input-row { display: flex; align-items: center; gap: 6px; }
.ref-input-row .tinp { flex: 1; min-width: 0; }
.ref-open { padding: 0 10px; height: 38px; flex-shrink: 0; }

/* deal-card View/Edit footer */
.dc-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------------- Splash ---------------- */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); }
.splash-mark { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-md); }
.splash-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.splash-dots { display: flex; gap: 6px; }
.splash-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .35; animation: splash-bounce 1.1s ease-in-out infinite; }
.splash-dots span:nth-child(2) { animation-delay: .15s; }
.splash-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes splash-bounce { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .splash-dots span { animation: none; } }

/* ---------------- Auth screen ---------------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 392px; background: var(--panel); border: none;
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 30px 28px 24px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 12px;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-md); }
.auth-brand-name { font-size: 21px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.auth-brand-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 20px; }
.auth-tab { background: transparent; border: none; border-radius: calc(var(--r-md) - 4px); padding: 9px 0;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: all .14s; }
.auth-tab[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.auth-field .tinp { width: 100%; }
.auth-error { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--bad);
  background: color-mix(in oklab, var(--bad) 10%, transparent); border: 1px solid color-mix(in oklab, var(--bad) 28%, transparent);
  border-radius: var(--r-md); padding: 9px 12px; margin-bottom: 14px; }
.auth-submit { margin-top: 4px; }
.auth-submit:disabled { opacity: .6; cursor: default; }

/* Keep me logged in */
.auth-remember { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 2px 0 16px; user-select: none; }
.auth-remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-remember-box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid var(--line);
  background: var(--panel-2); display: grid; place-items: center; color: transparent; transition: all .14s; }
.auth-remember input:checked + .auth-remember-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.auth-remember input:focus-visible + .auth-remember-box { box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-remember-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.auth-remember-hint { font-weight: 400; color: var(--ink-3); }
.auth-foot { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 16px; }

/* ---------------- Account menu + local chip (top bar) ---------------- */
.acct { position: relative; margin-left: 4px; }
.acct-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--accent); color: var(--accent-ink);
  font-family: var(--fs-ui); font-weight: 700; font-size: 14px; cursor: pointer; display: grid; place-items: center; }
.acct-backdrop { position: fixed; inset: 0; z-index: 40; }
.acct-menu { position: absolute; top: 42px; right: 0; z-index: 41; width: 210px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 13px 14px; }
.acct-email { font-size: 13.5px; font-weight: 600; color: var(--ink); word-break: break-all; }
.acct-plan { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; margin-top: 2px; }
.local-chip { margin-left: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }

/* ---------------- Deal search ---------------- */
.deal-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; min-width: 0; }
.deal-search > svg { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.deal-search-input { width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 40px 12px 42px; transition: border-color .14s, box-shadow .14s; }
.deal-search-input::placeholder { color: var(--ink-3); }
.deal-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.deal-search-input::-webkit-search-cancel-button { display: none; }
.deal-search-clear { position: absolute; right: 8px; width: 28px; height: 28px; border-radius: 7px; border: none; background: transparent;
  color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.deal-search-clear:hover { background: var(--panel-2); color: var(--ink); }
.deal-noresults { text-align: center; color: var(--ink-3); font-size: 14px; padding: 40px 0; }

/* ---------------- Brand wordmark + lock flourish ---------------- */
.brand-wordmark { font-weight: 700; letter-spacing: -.02em; }
.brand-wordmark .tld { color: var(--accent); }
.lock-shut { flex: 0 0 auto; }
.lock-shut .ls-shackle { transform-box: fill-box; transform-origin: center bottom; animation: ls-drop .42s cubic-bezier(.34,1.56,.64,1) both; }
.lock-shut .ls-body { transform-box: fill-box; transform-origin: center; animation: ls-pulse .42s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes ls-drop { 0% { transform: translateY(-3.5px); } 55% { transform: translateY(1px); } 100% { transform: translateY(0); } }
@keyframes ls-pulse { 0% { transform: scale(.88); } 50% { transform: scale(1.07); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .lock-shut .ls-shackle, .lock-shut .ls-body { animation: none; } }

/* ============================================================
   RESPONSIVE POLISH  —  premium feel on phones (≤600px)
   ============================================================ */
@media (max-width: 600px) {
  /* top bar: brand + actions on row 1, tabs full-width on row 2 */
  .topbar-inner { flex-wrap: wrap; padding: 10px 14px; gap: 10px 8px; }
  .topbar-spacer { display: none; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-sub { display: none; }
  .brand-name { font-size: 16px; }
  .tabs { order: 5; flex: 1 1 100%; justify-content: center; }
  .tab { flex: 1; justify-content: center; padding: 13px 12px; min-height: 44px; }   /* ≥44px tap target */

  /* iOS Safari auto-zooms when a focused input is <16px — force 16px on
     all form controls at phone width so tapping a field never zooms the page */
  input, select, textarea, .tinp, .deal-search-input, .bench-input input, .misc-name-input { font-size: 16px; }

  .wrap { padding: 20px 16px 150px; }

  /* stack paired number fields so each stays big & readable */
  .two { grid-template-columns: 1fr; gap: 16px; }

  /* roomier headline rhythm */
  .card-head { padding: 16px 16px; }
}

/* tablet: keep paired fields side-by-side but a touch tighter */
@media (min-width: 601px) and (max-width: 939px) {
  .wrap { padding: 24px 22px 150px; }
}

/* ============================================================
   HOME / DASHBOARD  —  returning-user landing surface
   Three layouts (bento / focus / command) share these modules.
   ============================================================ */
.home-wrap { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px 120px; }

/* base module card */
.home-mod {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
}

.home-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 14px;
}
.home-eyebrow svg { color: var(--accent); }

/* ---------- hero ---------- */
.home-hero { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.home-hero h1 { margin: 0; font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
.home-hero h1 .accentword { color: var(--accent); }
.home-hero p { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 46ch; }
.home-hero.plain { background: transparent; box-shadow: none; padding: 8px 2px; }
.home-hero.center { text-align: center; align-items: center; }
.home-sample-chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 6px; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.home-hero.center .home-sample-chip { align-self: center; }

/* ---------- action card ---------- */
.home-action {
  display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  border: none; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow);
  padding: 20px 22px; cursor: pointer; color: inherit; font: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.home-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.home-action .ha-ic {
  width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.home-action .ha-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-action .ha-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.home-action .ha-desc { font-size: 13px; color: var(--ink-3); }
.home-action .ha-arrow { color: var(--ink-3); transition: transform .15s ease, color .15s ease; }
.home-action:hover .ha-arrow { transform: translateX(3px); color: var(--accent); }
.home-action.primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 16px color-mix(in oklab, var(--accent) 30%, transparent);
}
.home-action.primary:hover { box-shadow: 0 9px 22px color-mix(in oklab, var(--accent) 36%, transparent); }
.home-action.primary .ha-ic { background: color-mix(in oklab, #fff 22%, transparent); color: var(--accent-ink); }
.home-action.primary .ha-desc { color: color-mix(in oklab, var(--accent-ink) 80%, transparent); }
.home-action.primary .ha-arrow { color: var(--accent-ink); }

/* ---------- stat tile ---------- */
.home-stat .home-eyebrow { margin-bottom: 12px; }
.home-stat .hs-v { font-family: var(--fs-num); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.home-stat .hs-v.good { color: var(--good); }
.home-stat .hs-v.bad { color: var(--bad); }
.home-stat .hs-sub { font-size: 13px; color: var(--ink-3); margin-top: 7px; }

/* ---------- verdict breakdown ---------- */
.vbreak h2, .home-recent h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.recent-row .chip { white-space: nowrap; }
.vbreak-bar {
  display: flex; height: 12px; border-radius: 999px; overflow: hidden;
  background: var(--panel-2); margin: 6px 0 18px;
}
.vbreak-seg { height: 100%; transition: width .3s ease; }
.vbreak-seg.good { background: var(--good); }
.vbreak-seg.warn { background: var(--warn); }
.vbreak-seg.bad  { background: var(--bad); }
.vbreak-legend { display: flex; flex-direction: column; gap: 11px; }
.vbreak-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.vbreak-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.vbreak-dot.good { background: var(--good); }
.vbreak-dot.warn { background: var(--warn); }
.vbreak-dot.bad  { background: var(--bad); }
.vbreak-row .vb-label { color: var(--ink-2); white-space: nowrap; }
.vbreak-row .vb-count { margin-left: auto; font-family: var(--fs-num); font-weight: 700; color: var(--ink); }

/* ---------- recent deals ---------- */
.home-recent .recent-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.recent-list { display: flex; flex-direction: column; }
.recent-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 8px;
  border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 9px;
  transition: background .12s ease;
}
.recent-row:last-child { border-bottom: none; }
.recent-row:hover { background: var(--panel-2); }
.recent-main { min-width: 0; flex: 1; }
.recent-addr { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-date { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.recent-num { font-family: var(--fs-num); font-weight: 600; font-size: 14px; white-space: nowrap; text-align: right; color: var(--ink); }
.recent-num .k { display: block; font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; margin-bottom: 1px; }
.recent-profit { font-family: var(--fs-num); font-weight: 700; font-size: 15px; white-space: nowrap; min-width: 56px; text-align: right; }
.recent-profit.good { color: var(--good); }
.recent-profit.bad { color: var(--bad); }
.chipdot { width: 7px; height: 7px; border-radius: 9px; background: currentColor; display: inline-block; flex: none; }
.recent-row.dense { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto auto; gap: 16px; }
@media (max-width: 620px) { .recent-row.dense { display: flex; } .recent-row.dense .recent-num { display: none; } }

/* ---------- resume draft ---------- */
.home-resume { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.resume-card { display: flex; align-items: center; gap: 13px; }
.resume-thumb { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.resume-info { min-width: 0; }
.resume-addr { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }

/* ---------- coaching tip ---------- */
.home-tip {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--accent-soft); box-shadow: none;
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
}
.home-tip .tip-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--panel); color: var(--accent); box-shadow: var(--shadow-sm); }
.home-tip .tip-body h3 { margin: 0 0 3px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.home-tip .tip-body p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }

/* ---------- empty (first-run) ---------- */
.home-empty { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.home-empty .empty-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.empty-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.estep { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.estep-no { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--fs-num); font-weight: 700; font-size: 13px; flex: none; }
.estep-t { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.estep-d { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
@media (max-width: 560px) { .home-empty .empty-actions, .empty-steps { grid-template-columns: 1fr; } }

/* ============================================================
   HOME LAYOUTS
   ============================================================ */

/* ---------- Bento: asymmetric modular grid ---------- */
.home-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.home-bento .span-2 { grid-column: span 2; }
.home-bento .span-3 { grid-column: span 3; }
.home-bento .span-2 > .home-mod, .home-bento .span-3 > .home-mod { height: 100%; }
@media (max-width: 900px) {
  .home-bento { grid-template-columns: repeat(2, 1fr); }
  .home-bento .span-2, .home-bento .span-3 { grid-column: span 2; }
}
@media (max-width: 600px) {
  .home-bento { grid-template-columns: 1fr; }
  .home-bento .span-2, .home-bento .span-3 { grid-column: span 1; }
}

/* ---------- Focus: calm centered column ---------- */
.home-focus { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.home-focus .home-hero { padding: 22px 0 8px; }
.home-focus .home-hero h1 { font-size: 40px; }
.home-focus .focus-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.home-focus .focus-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 560px) {
  .home-focus .home-hero h1 { font-size: 31px; }
  .home-focus .focus-actions, .home-focus .focus-stats { grid-template-columns: 1fr; }
}

/* ---------- Command: dense two-column dashboard ---------- */
.home-command { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.home-command .cmd-rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.home-command .cmd-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.home-command .cmd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.home-command .cmd-rail .home-hero h1 { font-size: 23px; }
.home-command .cmd-rail .home-hero p { font-size: 13px; }
.home-command .cmd-rail .home-hero { padding: 20px; }
@media (max-width: 900px) {
  .home-command { grid-template-columns: 1fr; }
  .home-command .cmd-rail { position: static; }
  .home-command .cmd-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) { .home-command .cmd-stats { grid-template-columns: 1fr; } }

/* ============================================================
   DEAL PIVOT ENGINE  —  property card, lens tabs, wholesale,
   your-offer summary, vault sort, share. (added)
   ============================================================ */

/* ---------- shared field hardening ---------- */
.fstack { min-width: 0; }
.tselect {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

/* close-date input — keep it from blowing out on iOS Safari */
.tinp[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; min-height: 42px; }
.tinp[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.tinp[type="date"]::-webkit-calendar-picker-indicator { margin-left: auto; }

/* ---------- Property card ---------- */
.prop-addr { font-size: 16px; font-weight: 600; padding: 12px 14px; }
.prop-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr 1fr; gap: 12px; }
@media (max-width: 760px) { .prop-grid { grid-template-columns: 1fr 1fr; } .prop-grid .pg-type { grid-column: 1 / -1; } }

/* ---------- Lens tabs (Fix & Flip / Wholesale) ---------- */
.lens-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0 22px; }
.lens-tab {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 12px; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--panel); color: var(--ink-2); font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow-sm); transition: all .14s;
}
.lens-tab svg { color: var(--ink-3); transition: color .14s; }
.lens-tab:hover { border-color: var(--ink-3); }
.lens-tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.lens-tab[aria-selected="true"] svg { color: var(--accent); }

/* ---------- Wholesale MAO hero ---------- */
.mao-hero { border-radius: var(--r-md); padding: 18px 20px; text-align: center;
  background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent); }
.mao-hero .mao-k { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.mao-hero .mao-v { font-family: var(--fs-num); font-size: 38px; font-weight: 800; letter-spacing: -.03em; margin: 5px 0 7px; color: var(--ink); }
.mao-hero .mao-sub { font-size: 12px; color: var(--ink-3); max-width: 44ch; margin: 0 auto; line-height: 1.5; }
.mao-hero[data-tone="good"] .mao-v { color: var(--good); }
.mao-hero[data-tone="warn"] { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 26%, transparent); }
.mao-hero[data-tone="warn"] .mao-v { color: var(--warn); }
.mao-hero[data-tone="bad"] { background: var(--bad-soft); border-color: color-mix(in oklab, var(--bad) 26%, transparent); }
.mao-hero[data-tone="bad"] .mao-v { color: var(--bad); }

/* ---------- Deal Grade chip ---------- */
.grade-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  border: 1px solid transparent; }
.grade-chip .gc-dot { width: 7px; height: 7px; border-radius: 9px; background: currentColor; }
.grade-chip.big { font-size: 13px; padding: 5px 13px; }
.grade-chip.good { color: var(--good); background: color-mix(in oklab, var(--good) 13%, transparent); border-color: color-mix(in oklab, var(--good) 30%, transparent); }
.grade-chip.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 14%, transparent); border-color: color-mix(in oklab, var(--warn) 32%, transparent); }
.grade-chip.bad  { color: var(--bad);  background: color-mix(in oklab, var(--bad) 12%, transparent);  border-color: color-mix(in oklab, var(--bad) 30%, transparent); }
.grade-chip.neutral { color: var(--ink-3); background: var(--panel-2); border-color: var(--line); }

/* ---------- Net profit hero ---------- */
.profit-hero { padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.profit-hero .ph-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profit-hero .ph-k { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.profit-hero .ph-v { font-family: var(--fs-num); font-size: 38px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.profit-hero .ph-v.good { color: var(--ink); }
.profit-hero .ph-v.bad { color: var(--bad); }
.profit-hero .ph-note { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

/* 70% rule reference anchor under net profit */
.ph-anchor { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 12px; color: var(--ink-3); }
.ph-anchor svg { color: var(--accent); }
.ph-anchor strong { color: var(--ink-2); font-weight: 700; font-family: var(--fs-num); }
.ph-anchor .pha-delta { font-weight: 600; padding-left: 6px; }
.ph-anchor .pha-delta.good { color: var(--good); }
.ph-anchor .pha-delta.bad { color: var(--bad); }

/* metric label info affordance + focusable tooltip target */
.metric-cell { cursor: help; position: relative; }
.metric-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.metric-cell .mc-label { display: inline-flex; align-items: center; gap: 4px; }
.metric-cell .mc-label svg { color: var(--ink-3); opacity: .6; }

/* ---------- MetricCell styled tooltip ---------- */
.mc-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: var(--panel);
  border-radius: var(--r-md);
  padding: 11px 14px;
  min-width: 230px;
  max-width: 300px;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  animation: mc-tt-in 0.13s ease;
  white-space: normal;
}
.mc-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--ink);
}
/* nudge left-most and right-most cells so arrow stays aligned */
.metric-trio > :first-child .mc-tooltip { left: 0; transform: none; }
.metric-trio > :first-child .mc-tooltip::after { left: 20px; transform: none; }
.metric-trio > :last-child .mc-tooltip { left: auto; right: 0; transform: none; }
.metric-trio > :last-child .mc-tooltip::after { left: auto; right: 20px; transform: none; }
.mc-tt-formula {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
  margin-bottom: 6px;
}
.mc-tt-result {
  font-family: var(--fs-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--panel);
  line-height: 1.4;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
@keyframes mc-tt-in {
  from { opacity: 0; transform: translateX(-50%) translateY(5px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);   }
}
.metric-trio > :first-child .mc-tooltip { animation-name: mc-tt-in-l; }
@keyframes mc-tt-in-l {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.metric-trio > :last-child .mc-tooltip { animation-name: mc-tt-in-r; }
@keyframes mc-tt-in-r {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ---------- Rehab card open pulse (scroll-to feedback) ---------- */
@keyframes card-pulse {
  0%   { box-shadow: var(--shadow), 0 0 0 0   color-mix(in oklab, var(--accent) 38%, transparent); }
  40%  { box-shadow: var(--shadow), 0 0 0 7px color-mix(in oklab, var(--accent) 18%, transparent); }
  100% { box-shadow: var(--shadow), 0 0 0 0   transparent; }
}
.card-pulse { animation: card-pulse 0.85s ease-out; }
.metric-trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; padding: 16px 0; }
.metric-cell { padding: 11px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--panel-2); }
.metric-cell .mc-top { display: flex; flex-direction: column; gap: 1px; }
.metric-cell .mc-label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.metric-cell .mc-val { font-family: var(--fs-num); font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.metric-cell .mc-bench { font-size: 10.5px; color: var(--ink-3); margin-top: 5px; }
.metric-cell.ok { border-color: color-mix(in oklab, var(--good) 34%, transparent); background: color-mix(in oklab, var(--good) 8%, var(--panel)); }
.metric-cell.ok .mc-val { color: var(--good); }
.metric-cell.short .mc-val { color: var(--warn); }

/* ---------- MetricTrio duo layout: CoC + Annualized as the performance twins, Margin as full-width safety cushion ---------- */
.metric-trio.duo-layout { grid-template-columns: 1fr 1fr; }
/* Margin (last child) spans both columns — wider, flatter, reads as a defensive anchor below the duo */
.metric-trio.duo-layout > :last-child { grid-column: 1 / -1; }
.metric-trio.duo-layout > :last-child .mc-top { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 10px; }
.metric-trio.duo-layout > :last-child .mc-val { font-size: 18px; }
.metric-trio.duo-layout > :last-child .mc-bench { display: inline; margin-top: 0; margin-left: 8px; }

/* ph-anchor + grade note after metrics in funnel mode */
.ph-context-block { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Summary mini stats ---------- */
.summary-mini { display: flex; gap: 10px; padding: 14px 0 4px; }
.summary-mini .sm-cell { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.summary-mini .k { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.summary-mini .v { font-family: var(--fs-num); font-size: 15px; font-weight: 700; color: var(--ink); }

/* ---------- Cash invested readout (financing) ---------- */
.cash-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 4px;
  padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-soft); }
.cash-readout .cr-k { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.cash-readout .cr-v { font-family: var(--fs-num); font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--accent); margin-left: auto; }
.cash-readout .cr-sub { flex-basis: 100%; font-size: 11.5px; color: var(--ink-3); }

/* ---------- Benchmarks editor ---------- */
.bench-grid { display: flex; flex-direction: column; gap: 12px; }
.bench-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.bench-label { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 1px; }
.bench-label .bench-hint { font-size: 11px; font-weight: 400; color: var(--ink-3); }
.bench-input { display: flex; align-items: center; gap: 6px; flex: none; }
.bench-input .tinp.num { width: 74px; text-align: right; }
.bench-input .bench-suffix { font-size: 14px; font-weight: 700; color: var(--ink-3); }

/* ---------- Vault card: profit + grade row ---------- */
.dc-profit { display: flex; align-items: baseline; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.dc-profit .dc-profit-v { font-family: var(--fs-num); font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.dc-profit .dc-profit-v.good { color: var(--ink); }
.dc-profit .dc-profit-v.bad { color: var(--bad); }
.dc-profit .dc-profit-k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.dc-profit .grade-chip { margin-left: auto; }

/* ---------- Vault card: funnel layout (anchor → hook → proof → context) ---------- */
/* Tier 1 — anchor: who & what, kept quiet so the number can lead. */
.deal-card.funnel .dc-anchor { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.deal-card.funnel .dca-figs { display: flex; align-items: center; gap: 9px; margin-top: 7px;
  font-family: var(--fs-num); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.deal-card.funnel .dca-k { font-family: var(--fs); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); margin-right: 3px; font-family: var(--fs-ui); }
.deal-card .dca-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); opacity: .6; flex: none; }

/* Tier 2 — hook: the one number they're scanning for, with the verdict. */
.deal-card.funnel .dc-hook { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.deal-card.funnel .dc-hook-num { display: flex; align-items: baseline; gap: 8px; }
.deal-card.funnel .dc-hook-num .dc-profit-v { font-family: var(--fs-num); font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.deal-card.funnel .dc-hook-num .dc-profit-v.good { color: var(--ink); }
.deal-card.funnel .dc-hook-num .dc-profit-v.bad { color: var(--bad); }
.deal-card.funnel .dc-hook-num .dc-profit-k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

/* "Show your work" — the cost stack micro-accordion. */
.dc-stackwrap { margin-top: 10px; }
.cs-toggle { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 11px;
  border: 1px dashed var(--line); border-radius: var(--r-sm); background: transparent;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: border-color .14s, background .14s, color .14s; }
.cs-toggle:hover { border-color: color-mix(in oklab, var(--ink-3) 60%, transparent); color: var(--ink); background: var(--panel-2); }
.cs-toggle svg:first-child { color: var(--ink-3); flex: none; }
.cs-toggle .cs-chev { margin-left: auto; color: var(--ink-3); display: grid; place-items: center; transition: transform .18s ease; }
.dc-stackwrap.open .cs-toggle { border-style: solid; border-color: var(--line); border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--panel-2); }
.dc-stackwrap.open .cs-chev { transform: rotate(180deg); }
.cost-stack { border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--r-sm) var(--r-sm);
  padding: 4px 11px 8px; animation: cs-reveal .18s ease; }
@keyframes cs-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.cs-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12.5px; }
.cs-row .cs-k { color: var(--ink-2); }
.cs-row .cs-k i { font-style: normal; color: var(--ink-3); font-size: 10.5px; display: block; margin-top: 1px; }
.cs-row .cs-v { font-family: var(--fs-num); font-weight: 700; color: var(--ink); white-space: nowrap; }
.cs-row .cs-v.neg { color: var(--ink-2); }
.cs-row.cs-total { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 8px; }
.cs-row.cs-total .cs-k { font-weight: 700; color: var(--ink); }
.cs-row.cs-total .cs-v { font-size: 14px; }
.cs-row.cs-total .cs-v.good { color: var(--good); }
.cs-row.cs-total .cs-v.bad { color: var(--bad); }

/* Tier 3 — proof: the three returns, the hero metrics. */
.deal-card.funnel .dc-stats.trio { grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-top: 16px; }
.deal-card.funnel .dc-stats.trio .v { font-size: 16px; }
.deal-card.funnel .dc-stats.trio .v.warn { color: var(--warn); }

/* Tier 4 — context: time & cash, the least-glanced facts, last. */
.deal-card.funnel .dc-context { display: flex; align-items: center; gap: 9px; margin-top: 13px;
  font-size: 12px; color: var(--ink-3); font-weight: 500; }

.mobilebar .mb-grade { display: flex; align-items: center; justify-content: center; }

@media (max-width: 560px) {
  .metric-trio { grid-template-columns: 1fr; gap: 7px; }
  .metric-trio.duo-layout { grid-template-columns: 1fr; }
  .metric-trio.duo-layout > :last-child { grid-column: auto; }
  .metric-trio.duo-layout > :last-child .mc-top { flex-direction: row; }
  .metric-cell { display: flex; align-items: baseline; justify-content: space-between; }
  .metric-cell .mc-top { flex-direction: row; align-items: baseline; gap: 8px; }
  .metric-cell .mc-bench { margin-top: 0; }
}

/* ---------- Summary: Your offer vs target ---------- */
.summary-lens { font-weight: 700; color: var(--accent); margin-left: 6px; white-space: nowrap; }
.summary-addr { flex-wrap: wrap; }
.summary-offers { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.summary-offers.single { grid-template-columns: 1fr; }

/* ---------- Unified stepper field ---------- */
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--panel-2); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 5px; height: 50px; }
.stepper-btn { width: 40px; height: 38px; flex: none; border-radius: calc(var(--r-md) - 5px);
  border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center;
  color: var(--ink); box-shadow: var(--shadow-sm); transition: all .12s; cursor: pointer; }
.stepper-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.stepper-btn:active:not(:disabled) { transform: translateY(1px); }
.stepper-btn:disabled { opacity: .3; cursor: default; box-shadow: none; }
.stepper-val { flex: 1; text-align: center; font-family: var(--fs-num); font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }

/* ---------- iOS-style dial picker ---------- */
.dial { user-select: none; -webkit-user-select: none; }
.dial-stage { position: relative; height: 50px; overflow: hidden; cursor: grab; touch-action: pan-y;
  background: var(--panel-2); border: 1.5px solid var(--line); border-radius: var(--r-md); }
.dial.dragging .dial-stage { cursor: grabbing; }
.dial-stage::before, .dial-stage::after { content: ''; position: absolute; top: 0; bottom: 0; width: 28px; z-index: 2; pointer-events: none; }
.dial-stage::before { left: 0; background: linear-gradient(90deg, var(--panel-2), transparent); }
.dial-stage::after { right: 0; background: linear-gradient(270deg, var(--panel-2), transparent); }
.dial-window { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 58px; height: 38px;
  border-radius: 9px; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--accent) 38%, transparent); pointer-events: none; }
.dial-track { display: flex; align-items: center; height: 100%; will-change: transform; transition: transform .18s cubic-bezier(.22,.61,.36,1); }
.dial.dragging .dial-track { transition: none; }
.dial-item { flex: none; text-align: center; font-family: var(--fs-num); font-size: 15px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.dial-item.sel { color: var(--accent); font-weight: 800; }
.fin-results .divider-note { margin-bottom: 10px; }

/* ---------- Offer: purchase + LTV + cash, one row ---------- */
.offer-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 12px; align-items: end; margin-bottom: 20px; }
@media (max-width: 580px) { .offer-row { grid-template-columns: 1fr 1fr; } .offer-row > .fstack { grid-column: 1 / -1; } }

/* ---------- Advanced rehab calculator link ---------- */
.adv-rehab { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 14px;
  padding: 12px 14px; border-radius: var(--r-md); cursor: pointer; transition: all .14s;
  background: var(--panel-2); border: 1.5px solid var(--line); }
.adv-rehab:hover { border-color: var(--accent); }
.adv-rehab .ar-ic { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.adv-rehab .ar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.adv-rehab .ar-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.adv-rehab .ar-meta { font-size: 12px; color: var(--ink-3); }
.adv-rehab .ar-chev { color: var(--ink-3); flex: none; }
.adv-rehab:hover .ar-chev { color: var(--accent); }

/* ---------- Purchase & sale assumptions (in Numbers card) ---------- */
.assume-block { margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 14px; }

/* editable misc-fee name */
.misc-label { gap: 4px; overflow: visible; }
.misc-label > svg { color: var(--ink-3); flex: none; opacity: .6; transition: opacity .12s, color .12s; }
.misc-label:hover > svg { opacity: 1; color: var(--accent); }
.misc-name-input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); letter-spacing: .01em; border: none; background: transparent;
  padding: 2px 5px; margin: -2px 0 -2px -5px; border-radius: 5px; cursor: text; transition: background .12s, box-shadow .12s; }
.misc-name-input::placeholder { color: var(--ink-2); opacity: 1; }
.misc-name-input:hover { background: var(--panel-2); }
.misc-name-input:focus { outline: none; color: var(--ink); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--accent); }
.so-cell { background: var(--panel-2); border-radius: var(--r-md); padding: 12px 14px; }
.so-cell.hero { background: var(--accent-soft); }
.so-cell .k { font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.so-cell .v { font-family: var(--fs-num); font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.so-cell.hero .v { font-size: 29px; }
.so-sub { font-size: 11.5px; font-weight: 600; margin-top: 4px; color: var(--ink-3); }
.so-sub.good { color: var(--good); }
.so-sub.bad { color: var(--bad); }

/* ---------- Pivot hint (cross-lens nudge) ---------- */
.pivot-hint { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 13px; border-radius: var(--r-md); cursor: pointer; transition: all .14s;
  background: var(--accent-soft); border: 1px dashed color-mix(in oklab, var(--accent) 42%, transparent); }
.pivot-hint:hover { border-style: solid; }
.pivot-hint .ph-ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--panel); color: var(--accent); box-shadow: var(--shadow-sm); }
.pivot-hint .ph-text { flex: 1; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.pivot-hint .ph-cta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------- Vault: search + sort on one row ---------- */
.vault-bar { display: flex; align-items: center; gap: 14px 20px; margin-bottom: 20px; flex-wrap: wrap; }
.vault-controls { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-bottom: 20px; align-items: center; }
.vault-ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.vc-lbl { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.seg button { white-space: nowrap; }
.seg.sm button { padding: 6px 11px; font-size: 12.5px; }
.sort-seg { flex-wrap: wrap; }
.sort-caret { display: inline-block; width: 0; height: 0; margin-left: 7px; vertical-align: middle;
  border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sort-caret.desc { border-top: 5px solid currentColor; }
.sort-caret.asc { border-bottom: 5px solid currentColor; }
@media (max-width: 620px) { .vault-bar { gap: 12px; } .vault-ctl { width: 100%; align-items: flex-start; flex-direction: column; gap: 7px; } .sort-seg { width: 100%; } }

/* ---------- Vault: dual-strategy card ---------- */
.dc-strats { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.dc-strat { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line); }
.dc-strat.active { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 28%, transparent); }
.dc-strat .ds-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dc-strat .ds-lens { font-size: 12.5px; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dc-strat .ds-active { font-size: 8.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--panel); border-radius: 999px; padding: 2px 6px; }
.dc-strat .ds-head { font-family: var(--fs-num); font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.dc-strat .chip { flex: none; padding: 3px 9px; font-size: 10.5px; white-space: nowrap; }

/* ---------- Deal detail: property facts line ---------- */
.dd-facts { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

/* ---------- Share modal preview ---------- */
.share-preview { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; margin: 8px 0 4px; }
.share-prev-addr { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.share-prev-addr svg { color: var(--accent); }
.share-prev-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); }
.spr-lens { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.spr-num { font-family: var(--fs-num); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.spr-num.good { color: var(--good); }
.spr-num.bad { color: var(--bad); }

/* ---------- Mobile: clearer section separation ---------- */
@media (max-width: 600px) {
  .card { box-shadow: var(--shadow-md); }
  .card + .card { margin-top: 18px; }
  .lens-tabs { margin: 16px 0 18px; }
  .summary-offers { grid-template-columns: 1fr 1fr; }
}

/* ---------- Mobile a11y: force 16px on every input so iOS never zoom-jumps
   on focus. Placed last so source order beats any earlier same-specificity
   font-size (e.g. .misc-name-input). ---------- */
@media (max-width: 600px) {
  input, select, textarea, .misc-name-input { font-size: 16px !important; }
}

/* ---------- Public calculator page ---------- */
.pub-share-banner {
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 500; padding: 10px 20px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 20%, transparent);
}
.pub-share-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px;
}
.pub-cta { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.pub-cta a.btn { text-decoration: none; justify-content: center; }
.pub-cta-note { font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.4; }
