/* Buyer Advisor platform demo: "Console" design system.
   Warm-white ground, soft pill navigation, serif display voice for greetings
   and hero numbers, one accent per agency used as punctuation, hairline
   borders instead of heavy shadows.
   Layout: the page never scrolls. Desktop is icon rail + sidebar + stage;
   mobile is fixed header + stage + bottom tabs. The stage is the only
   scrolling pane on every breakpoint. */

:root {
  /* --- ground --- */
  --canvas: #FFFFFF;
  --canvas-deep: #FAFAF8;
  --surface: #FFFFFF;
  --pill: #F4F4F0;

  /* --- ink scale (warm black, not pure) --- */
  --ink: #1F1F1C;
  --ink-2: #3E3E38;
  --ink-body: #55554F;
  --ink-muted: #8F8F88;
  --ink-faint: #A6A69E;

  --hairline: #ECECE7;
  --hairline-strong: #E2E2DC;

  /* --- accent: replaced per agency by applyAccent() --- */
  --accent: #6D6AF8;
  --accent-deep: #5754E8;
  --accent-wash: #EDEDFE;

  --green: #3F7D55;
  --green-soft: #E4F0E5;
  --wa: #3F7D55;

  --ring: inset 0 0 0 1px var(--hairline-strong);
  --shadow-2: 0 1px 2px rgba(31, 31, 25, 0.04);
  --shadow-3: 0 2px 10px rgba(31, 31, 25, 0.06);
  --shadow-pop: 0 10px 28px rgba(31, 31, 25, 0.10);

  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --pad-x: clamp(0.9rem, 3.4vw, 1.6rem);
  --nav-h: 58px;
  --demo-h: 40px;
  --header-h: 52px;
  --rail-w: 84px;
  --side-w: 272px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font-body);
  background: var(--canvas);
  color: var(--ink-body);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* Console signature: quiet sans micro-label, no shouting caps */
.screen-kicker, .card-kicker, .pipe-title, .advisor-card-label, .ho-label,
.inv-label, .ad-field-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}

/* ---------- Demo bar (vendor chrome) ---------- */
.demo-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  /* Constant, never var(--demo-h): the ResizeObserver writes this bar's own
     height into --demo-h, so reading it back here would ratchet upward forever */
  min-height: 46px;
  display: flex; align-items: center; justify-content: center; gap: 8px 16px;
  flex-wrap: wrap; padding: 7px var(--pad-x);
  padding-top: calc(7px + env(safe-area-inset-top));
  background: var(--ink); color: #D5D5CE;
  font-size: 12px; letter-spacing: 0;
}
.demo-bar strong { color: #fff; font-weight: 600; }
.demo-dot { display: inline-block; margin: 0 7px; color: #86867E; }
.demo-bar-cta {
  color: var(--ink); background: #fff; text-decoration: none; white-space: nowrap;
  font-weight: 600; font-size: 12px; padding: 6px 15px; border-radius: 999px;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.demo-bar-cta:hover { opacity: 0.88; transform: translateY(-1px); }
.role-switch {
  display: inline-flex; gap: 3px; background: rgba(255, 255, 255, 0.14);
  border-radius: 999px; padding: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.role-btn {
  font-size: 12px; font-weight: 600; color: #CBCBC4;
  padding: 5px 14px; border-radius: 999px; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.role-btn:hover { color: #fff; }
.role-btn.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }

/* Below the three-zone breakpoint, keep the bar to two rows: the label and
   the CTA share the first line, the role switcher gets its own centred row.
   Left to plain wrapping it becomes three rows and eats a fifth of a phone. */
@media (max-width: 859px) {
  .demo-bar { justify-content: space-between; row-gap: 6px; }
  /* flex-basis 0, not auto: with auto the label claims its full content width
     and pushes the CTA onto a third row */
  .demo-bar-text { flex: 1 1 0; min-width: 0; }
  .demo-bar-cta { flex: none; }
  .demo-bar-mid { flex: 1 0 100%; order: 2; }
  /* A phone previewing phone frames is pointless: it is already the phone.
     Scoped to .demo-bar so it outranks the later .view-switch declaration. */
  .demo-bar .view-switch { display: none; }
}

/* Three zones once there is room: text left, switcher centre, CTA right */
@media (min-width: 860px) {
  .demo-bar {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; column-gap: 16px;
  }
  .demo-bar-text { justify-self: start; }
  .demo-bar-mid { justify-self: center; }
  .demo-bar-cta { justify-self: end; }
}

/* ---------- Fixed app header (phone/tablet) ---------- */
.app-header {
  position: fixed; top: var(--demo-h); left: 0; right: 0; z-index: 55;
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--pad-x);
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.app-header .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
.app-header .brand-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--ink); color: #fff;
  font-weight: 600; font-size: 12px; letter-spacing: 0.02em;
}
.brand-name {
  font-weight: 600; color: var(--ink); letter-spacing: -0.015em;
  font-size: 15px; line-height: 1.2;
}

/* ---------- Icon rail: role switcher (desktop only) ---------- */
.rail { display: none; }

/* Preview-mode switch, next to the role switch in the demo bar */
.demo-bar-mid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.view-switch {
  display: inline-flex; gap: 3px; border-radius: 999px; padding: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.view-btn {
  font-size: 11.5px; font-weight: 500; color: #B9B9B2;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.view-btn:hover { color: #fff; }
.view-btn.is-on { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ---------- Mobile-app preview: real phones, not mockups ---------- */
.phones {
  position: fixed;
  top: calc(var(--demo-h) + var(--header-h));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0; right: 0;
  overflow-y: auto; background: var(--canvas-deep);
  padding: 20px var(--pad-x) 28px;
}
.phones-note { font-size: 12.5px; color: var(--ink-muted); text-align: center; margin-bottom: 18px; }
.phone-row {
  display: flex; gap: 22px; justify-content: center; align-items: flex-start;
  flex-wrap: wrap;
}
.phone { flex: 0 0 auto; width: 300px; }
.phone-cap { text-align: center; margin-bottom: 10px; }
.phone-cap strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.phone-cap span { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
.phone-shell {
  position: relative; border-radius: 38px; padding: 26px 9px 9px;
  background: linear-gradient(160deg, #2A2A26, #121210);
  box-shadow: var(--shadow-pop);
  transition: box-shadow 0.25s, transform 0.25s var(--ease);
}
.phone.is-on .phone-shell { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(31, 31, 25, 0.22); }
.phone.is-on .phone-cap strong { color: var(--accent-deep); }
.phone-island {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 62px; height: 9px; border-radius: 999px; background: #060605; z-index: 2;
}
/* The iframe is a REAL 390px phone viewport scaled down to fit the frame.
   Rendering it at the frame's own width would preview a layout no handset
   actually has, which is worse than useless for judging the mobile design. */
.phone-view {
  width: 282px; height: 610px; overflow: hidden;
  border-radius: 30px; background: var(--canvas);
}
.phone-screen {
  display: block; width: 390px; height: 844px; border: 0;
  transform: scale(0.7231); transform-origin: top left;
}

/* Inside a phone frame the vendor chrome belongs to the parent page */
body.is-framed .demo-bar { display: none; }

/* ---------- App shell ---------- */
.app { height: 100dvh; }
.stage {
  position: fixed;
  top: calc(var(--demo-h) + var(--header-h));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0; right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px var(--pad-x) 30px;
}

.screen { display: none; animation: rise 0.35s var(--ease); }
.screen.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.screen-head { margin-bottom: 18px; }
.screen-kicker { color: var(--accent-deep); margin-bottom: 4px; font-weight: 500; }
.screen-title {
  font-family: var(--font-serif); font-weight: 500; color: var(--ink);
  font-size: clamp(1.7rem, 1.35rem + 1.7vw, 2.5rem); line-height: 1.12;
  letter-spacing: -0.015em;
}
.screen-sub { margin-top: 7px; max-width: 60ch; font-size: 13.5px; color: var(--ink-muted); }

.tag {
  display: inline-block; vertical-align: 2px;
  font-size: 11px; font-weight: 500; color: var(--ink-muted); background: var(--pill);
  border-radius: 999px; padding: 2px 9px; letter-spacing: 0;
}
.caveat { font-size: 12px; color: var(--ink-faint); margin: 10px 0 20px; max-width: 66ch; }
.row-title {
  font-family: var(--font-serif); font-weight: 500; color: var(--ink);
  letter-spacing: -0.01em; font-size: 1.35rem; margin: 30px 0 12px;
  display: flex; align-items: center; gap: 10px;
}

/* ---------- Nav: bottom tabs (mobile) ---------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-brand, .nav-foot, .nav-label { display: none; }
.nav-list { list-style: none; display: flex; height: var(--nav-h); }
.nav-list li { flex: 1; }
.nav-item {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 500; color: var(--ink-faint);
  transition: color 0.2s;
}
.nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: var(--ink); }
.nav-item.is-active svg { color: var(--accent-deep); }
.nav-item:hover { color: var(--ink); }
.nav-item .nav-badge { display: none; }

/* ---------- Buyer home ---------- */
.advisor-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--hairline-strong); padding: 15px 16px;
}
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pill); color: var(--ink-2);
  font-weight: 600; font-size: 13px; letter-spacing: 0.01em;
}
.advisor-card-body { flex: 1; min-width: 0; }
.advisor-card-label { margin-bottom: 1px; }
.advisor-card-name { font-weight: 600; color: var(--ink); margin: 0 0 2px; font-size: 15px; letter-spacing: -0.01em; }
.advisor-card-meta { font-size: 12.5px; color: var(--ink-muted); }
.btn-wa {
  flex: none; background: var(--wa); color: #fff; font-weight: 500; font-size: 13px;
  padding: 9px 16px; border-radius: 999px; transition: transform 0.2s var(--ease), opacity 0.2s;
}
.btn-wa:hover { transform: translateY(-1px); opacity: 0.92; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.quick {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  padding: 13px 14px; font-weight: 500; font-size: 13.5px; color: var(--ink);
  text-align: left; transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.quick:hover { transform: translateY(-1px); background: var(--canvas-deep); }
.quick-emoji { color: var(--accent-deep); font-size: 14px; }

.tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong); padding: 15px 16px;
}
.tile-yield {
  font-family: var(--font-serif); font-weight: 500; color: var(--ink);
  font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem); line-height: 1.05; letter-spacing: -0.015em;
}
.tile-com { font-weight: 500; color: var(--ink); font-size: 13px; margin-top: 7px; }
.tile-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }

.launch-row { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.launch {
  background: var(--surface);
  border-radius: var(--radius-sm); border: 1px solid var(--hairline-strong);
  padding: 15px 16px; position: relative; overflow: hidden;
}
.launch::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.launch-name { font-weight: 600; color: var(--ink); font-size: 13.5px; line-height: 1.25; letter-spacing: -0.01em; }
.launch-meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 5px; }
.launch-from { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--accent-deep); margin-top: 8px; }

/* ---------- Chat ---------- */
#screen-buyer-advisor.is-active { display: flex; flex-direction: column; height: 100%; }
/* Chat is a screen-fit surface: the trailing footer would make the stage scroll */
#screen-buyer-advisor.is-active ~ .foot { display: none; }
.chat-head { padding-bottom: 10px; }
.chat-title { font-family: var(--font-serif); font-weight: 500; color: var(--ink); font-size: 1.55rem; letter-spacing: -0.015em; }
.chat-banner {
  margin-top: 8px; font-size: 11.5px; color: var(--ink-muted);
  background: var(--canvas-deep); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: 8px 12px;
}
.chat-scroll { flex: 1; overflow-y: auto; padding: 12px 2px; display: flex; flex-direction: column; gap: 9px; }
.msg { max-width: 86%; font-size: 13.5px; }
.msg-user { align-self: flex-end; background: var(--ink); color: #F5F5F0; border-radius: 16px 16px 5px 16px; padding: 9px 14px; }
.msg-ai { align-self: flex-start; background: var(--canvas-deep); border: 1px solid var(--hairline); border-radius: 16px 16px 16px 5px; padding: 9px 14px; color: var(--ink-2); }
.msg-note {
  align-self: flex-start; max-width: 86%;
  background: var(--accent-wash); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 9px 13px; font-size: 12.5px; color: var(--ink-2);
}
.msg-note strong { color: var(--accent-deep); }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 11px 14px; background: var(--canvas-deep); border: 1px solid var(--hairline); border-radius: 16px 16px 16px 5px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

.card {
  align-self: flex-start; width: min(100%, 340px);
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--hairline-strong); box-shadow: var(--shadow-3); padding: 15px 16px;
}
.card-kicker { color: var(--accent-deep); font-size: 12px; }
.card-yield { font-family: var(--font-serif); font-weight: 500; color: var(--ink); font-size: 2.4rem; line-height: 1.05; letter-spacing: -0.02em; margin: 4px 0 2px; }
.card-seg { font-weight: 500; color: var(--ink); font-size: 13.5px; }
.card-src { font-size: 11px; color: var(--ink-faint); margin-top: 10px; border-top: 1px solid var(--hairline); padding-top: 9px; }

.confirm-facts { list-style: none; margin: 6px 0 12px; }
.confirm-facts li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.confirm-facts li:last-child { border-bottom: 0; }
.confirm-facts .k { color: var(--ink-muted); }
.confirm-facts .v { font-weight: 500; color: var(--ink); }
.confirm-row { display: flex; gap: 8px; }
.btn-confirm { flex: 1; background: var(--ink); color: #fff; font-weight: 500; font-size: 13px; padding: 10px 0; border-radius: 999px; transition: transform 0.2s var(--ease), opacity 0.2s; }
.btn-confirm:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-edit { flex: 0 0 auto; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--hairline-strong); font-size: 13px; font-weight: 500; color: var(--ink-body); }
.btn-edit:hover { background: var(--canvas-deep); }
.card.confirmed .confirm-row { display: none; }
.card .confirmed-line { display: none; font-size: 12.5px; font-weight: 500; color: var(--green); }
.card.confirmed .confirmed-line { display: block; }

/* Handoff card: WhatsApp, callback scheduler, voice, call-now */
.ho-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ho-actions .btn-confirm { grid-column: 1 / -1; }
.ho-opt {
  border: 1px solid var(--hairline-strong); border-radius: 999px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding: 8px 12px;
  transition: border-color 0.2s, background 0.2s;
}
.ho-opt:hover { border-color: var(--ink); background: var(--canvas-deep); }
.ho-sched { margin-top: 13px; border-top: 1px solid var(--hairline); padding-top: 12px; }
.ho-label { margin-bottom: 7px; }
.ho-chips { margin-bottom: 11px; }
.ho-request { width: 100%; }
.ho-request:disabled { opacity: 0.4; cursor: default; }
.ho-request:disabled:hover { transform: none; }
.ho-done { margin-top: 11px; font-size: 12.5px; font-weight: 500; color: var(--green); }

.chat-listing { display: flex; gap: 11px; align-items: center; }
.chat-listing + .chat-listing { margin-top: 9px; border-top: 1px solid var(--hairline); padding-top: 9px; }
.chat-chips { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--ink-muted); background: var(--canvas-deep); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.chat-inputbar { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.chat-inputbar input {
  flex: 1; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: 999px; padding: 11px 18px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-inputbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; transition: transform 0.2s var(--ease); }
.chat-send:hover { transform: translateY(-1px); }

/* ---------- Explore ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.listing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.listing {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--hairline-strong); overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
}
.listing:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.listing-art {
  height: 96px; display: flex; align-items: center; justify-content: center;
  background: var(--canvas-deep); border-bottom: 1px solid var(--hairline);
  color: var(--ink-faint); font-family: var(--font-serif); font-size: 1.9rem;
}
.listing-body { padding: 12px 14px 13px; }
.listing-price { font-family: var(--font-mono); font-weight: 700; color: var(--ink); font-size: 13.5px; letter-spacing: -0.02em; }
.listing-title { font-size: 12.5px; color: var(--ink-body); margin: 3px 0 3px; }
.listing-meta { font-size: 11px; color: var(--ink-muted); }
.listing-permit { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-faint); margin-top: 8px; border-top: 1px solid var(--hairline); padding-top: 7px; letter-spacing: 0.02em; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-muted); padding: 28px 0; font-size: 13px; }

/* ---------- Explore: investor view ---------- */
.inv-card { width: 100%; margin: 4px 0 14px; }
.inv-form { display: grid; gap: 14px; margin: 12px 0 4px; }
.inv-field { display: block; }
.inv-label { display: block; margin-bottom: 6px; }
#inv-budget {
  width: 100%; max-width: 230px; font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--ink); background: var(--canvas-deep); border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm); padding: 10px 13px; outline: none; letter-spacing: -0.02em;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#inv-budget:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); background: var(--surface); }
.inv-chips { margin-bottom: 0; }
.inv-out {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 14px 0 2px; padding: 14px 0 0; border-top: 1px solid var(--hairline);
}
.inv-o-num { font-family: var(--font-serif); font-weight: 500; color: var(--ink); font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); letter-spacing: -0.015em; line-height: 1.1; }
.inv-o-rent { color: var(--green); }
.inv-o-label { font-size: 11.5px; color: var(--ink-muted); margin-top: 4px; }
.inv-portfolio { font-size: 12px; color: var(--ink-body); margin-top: 11px; border-top: 1px solid var(--hairline); padding-top: 11px; }
.inv-line { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--green); margin: 3px 0 3px; letter-spacing: -0.01em; }

@media (min-width: 640px) {
  .inv-form { grid-template-columns: auto 1fr 1fr; gap: 18px; align-items: start; }
}
@media (max-width: 520px) {
  .inv-out { grid-template-columns: 1fr; gap: 12px; }
  .inv-o { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .inv-o-label { margin-top: 0; }
}

/* ---------- Vault ---------- */
.vault-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--hairline-strong); padding: 18px; }
.vault-prop { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.vault-prop-art {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff;
  font-family: var(--font-serif); font-size: 1.3rem;
}
.vault-prop-name { font-weight: 600; color: var(--ink); font-size: 14px; letter-spacing: -0.01em; }
.vault-prop-meta { font-size: 12px; color: var(--ink-muted); }
.vault-steps { list-style: none; margin: 6px 0 14px; }
.vault-steps li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 13.5px; color: var(--ink); }
.vault-steps li:last-child { border-bottom: 0; }
.step-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.step-done .step-dot { background: var(--green); color: #fff; }
.step-progress .step-dot { background: var(--accent-wash); color: var(--accent-deep); }
.step-pending { color: var(--ink-muted); }
.step-pending .step-dot { border: 1.5px dashed var(--hairline-strong); }
.step-note { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--accent-deep); font-weight: 700; }
.vault-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 4px; }
.btn-primary { background: var(--ink); color: #fff; font-weight: 500; font-size: 13px; padding: 10px 18px; border-radius: 999px; transition: transform 0.2s var(--ease), opacity 0.2s; }
.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }
.share-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-body); cursor: pointer; }
.share-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Buyer: investments portfolio ---------- */
.pf-strip { margin-bottom: 14px; }
.pf-strip .tile-yield { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }
.pf-strip-up { color: var(--green); }
.pf-card + .pf-card { margin-top: 14px; }

.pf-values { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 4px; }
.pf-val-num { font-family: var(--font-serif); font-weight: 500; color: var(--ink); font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem); letter-spacing: -0.015em; }
.pf-val-label { font-size: 11px; color: var(--ink-muted); margin-top: 1px; }
.pf-arrow { color: var(--ink-faint); }
.pf-apprec {
  margin-left: auto; font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 4px 11px;
}

.pf-pay { margin: 12px 0 2px; }
.pf-pay-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.pf-pay-head .ho-label { margin-bottom: 0; }
.pf-pay-pct { font-family: var(--font-mono); font-weight: 700; font-size: 11.5px; color: var(--ink); }
.pf-bar { height: 7px; border-radius: 999px; background: var(--pill); overflow: hidden; }
.pf-fill {
  height: 100%; border-radius: inherit; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--ease);
}
.pf-fill.pf-notrans { transition: none; }
.pf-pay-line { font-size: 12px; color: var(--ink-muted); margin-top: 7px; }
.pf-pay-line strong { color: var(--ink); font-weight: 500; }

.pf-expanders { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.pf-sched { list-style: none; margin: 12px 0 0; border-top: 1px solid var(--hairline); padding-top: 4px; }
.pf-mile { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 12.5px; color: var(--ink-muted); }
.pf-mile:last-child { border-bottom: 0; }
.pf-mile .step-dot { border: 1.5px dashed var(--hairline-strong); }
.pf-mile-paid { color: var(--ink); }
.pf-mile-paid .step-dot { background: var(--green); border: 0; color: #fff; }
.pf-mile-label { flex: 1; }
.pf-mile-when { font-family: var(--font-mono); font-size: 10.5px; }
.pf-docs { margin-top: 12px; border-top: 1px solid var(--hairline); padding-top: 4px; }

.pf-read { margin-top: 14px; background: var(--canvas-deep); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 13px 14px; }
.pf-read-text { font-size: 12.5px; color: var(--ink-2); margin: 3px 0 10px; }
.pf-read-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.pf-read-caveat { margin: 10px 0 0; }

/* ---------- Pipeline (shared by agent deals) ---------- */
.pipeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pipe-col { background: var(--canvas-deep); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px; }
.pipe-title { font-size: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; }
.lead { background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--hairline-strong); padding: 12px 13px; margin-bottom: 8px; }
.lead:last-child { margin-bottom: 0; }
.lead-name { font-weight: 600; color: var(--ink); font-size: 13.5px; letter-spacing: -0.01em; }
.lead-meta { font-size: 12px; color: var(--ink-muted); margin: 3px 0 7px; }
.lead-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.lead-chip { font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; border-radius: 999px; padding: 3px 9px; background: var(--pill); color: var(--ink-muted); }
.lead-chip.confirmed { background: var(--green-soft); color: var(--green); }
.lead-next { font-size: 12px; color: var(--ink-body); }

/* ---------- Footer + tip ---------- */
.foot { padding: 24px 0 8px; text-align: center; font-size: 11px; color: var(--ink-faint); }
.tip {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px); transform: translate(-50%, 12px);
  background: var(--ink); color: #F5F5F0; font-size: 12.5px;
  padding: 10px 16px; border-radius: 14px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease); z-index: 70;
  white-space: normal; max-width: min(92vw, 30rem); text-align: center;
  box-shadow: var(--shadow-pop);
}
.tip.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Welcome guide overlay ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(31, 31, 25, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 1; transition: opacity 0.3s var(--ease);
}
.welcome.is-hidden { opacity: 0; pointer-events: none; }
.welcome-card {
  position: relative; width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 26px 24px calc(22px + env(safe-area-inset-bottom));
  animation: rise 0.4s var(--ease);
}
.welcome-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 50%; color: var(--ink-muted); font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.welcome-close:hover { background: var(--pill); color: var(--ink); }
.welcome-kicker { font-size: 12.5px; font-weight: 500; color: var(--ink-faint); margin-bottom: 10px; }
.welcome-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.welcome-brand .brand-name { font-family: var(--font-serif); font-weight: 500; font-size: 1.65rem; letter-spacing: -0.015em; }
.welcome-text { font-size: 13.5px; color: var(--ink-body); margin-bottom: 16px; }
.welcome-roles { display: grid; gap: 9px; margin-bottom: 16px; }
.welcome-role {
  text-align: left; border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  padding: 13px 15px; transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.welcome-role:hover { background: var(--canvas-deep); transform: translateY(-1px); }
.welcome-role strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.welcome-role span { display: block; font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; }
.welcome-start { width: 100%; padding: 13px 0; font-size: 13.5px; }
.welcome-note { font-size: 11.5px; color: var(--ink-faint); text-align: center; margin-top: 12px; }

@media (min-width: 640px) {
  .welcome { align-items: center; padding: 20px; }
  .welcome-card { border-radius: 22px; }
}

/* Vendor lead flow inside the same overlay pattern */
.gf-title { font-family: var(--font-serif); font-weight: 500; color: var(--ink); font-size: 1.75rem; letter-spacing: -0.015em; margin-bottom: 12px; }
.gf-field { display: block; margin-bottom: 12px; }
.gf-input {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--canvas-deep); border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm); padding: 11px 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.gf-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); background: var(--surface); }
.gf-area { resize: vertical; min-height: 62px; }
.gf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gf-done-line { font-size: 14px; color: var(--ink-2); margin: 8px 0 14px; }
.gf-done-cta { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ---------- Desktop: icon rail + sidebar ---------- */
@media (min-width: 1024px) {
  :root { --header-h: 0px; }
  .app-header { display: none; }

  /* The rail owns role switching on desktop, so the demo bar drops its
     switcher and becomes two zones. Both carry .role-btn, so one handler
     keeps them in sync with no extra JS. */
  .demo-bar .role-switch { display: none; }

  /* Named, not just icons: a prospect must never have to guess which app
     they are looking at, or hover to find out */
  .rail {
    position: fixed; top: var(--demo-h); bottom: 0; left: 0; z-index: 52;
    width: var(--rail-w);
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 14px 6px 16px;
    background: var(--surface); border-right: 1px solid var(--hairline);
  }
  .rail .brand-mark { margin-bottom: 10px; }
  .rail-head { font-size: 11px; color: var(--ink-faint); margin-bottom: 4px; }
  .rail-btn {
    width: 100%; padding: 9px 2px 7px; border-radius: 13px; color: var(--ink-muted);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    transition: background 0.2s, color 0.2s;
  }
  .rail-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .rail-label { font-size: 11.5px; font-weight: 500; letter-spacing: -0.01em; }
  .rail-btn:hover { background: var(--pill); color: var(--ink); }
  .rail-btn.is-on { background: var(--accent-wash); color: var(--accent-deep); font-weight: 600; }
  .rail-spacer { flex: 1; }

  .nav {
    position: fixed; top: var(--demo-h); bottom: 0; left: var(--rail-w); right: auto;
    width: var(--side-w); border-top: 0; border-right: 1px solid var(--hairline);
    background: var(--surface);
    display: flex; flex-direction: column; padding: 18px 14px 14px;
  }
  .nav-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
  .nav-brand .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; display: block; }
  .nav-brand-sub { font-size: 12px; color: var(--ink-muted); margin-top: 1px; }

  .nav-list { flex-direction: column; height: auto; gap: 2px; overflow-y: auto; flex: 1; }
  .nav-list li { flex: none; }
  .nav-label {
    display: block; font-size: 12.5px; color: var(--ink-faint);
    padding: 18px 12px 6px; font-weight: 400;
  }
  .nav-list li:first-child .nav-label { padding-top: 4px; }
  .nav-item {
    /* height:auto is load-bearing: the mobile tab rule sets height:100%, which
       here resolves against the li and swallows the group label above it */
    height: auto;
    flex-direction: row; justify-content: flex-start; gap: 12px;
    font-size: 14px; font-weight: 400; padding: 9px 12px; border-radius: var(--radius-sm);
    border: 1px solid transparent; color: var(--ink-2);
  }
  .nav-item svg { color: var(--ink-muted); }
  .nav-item.is-active {
    background: var(--pill); border-color: var(--hairline-strong); color: var(--ink);
    font-weight: 500; box-shadow: var(--shadow-2);
  }
  .nav-item.is-active svg { color: var(--ink); }
  .nav-item:hover:not(.is-active) { background: var(--canvas-deep); }
  .nav-item .nav-badge {
    display: inline-block; margin-left: auto; font-size: 11px; font-weight: 600;
    background: var(--accent-wash); color: var(--accent-deep);
    border-radius: 999px; padding: 2px 9px;
  }

  .nav-foot { display: block; margin-top: auto; padding-top: 10px; }
  .nav-promo {
    border-radius: var(--radius); padding: 16px 16px 14px; margin: 0 2px 10px;
    background:
      radial-gradient(90% 80% at 15% 10%, rgba(244, 178, 94, 0.75), transparent 55%),
      radial-gradient(80% 80% at 92% 28%, rgba(216, 227, 198, 0.9), transparent 62%),
      radial-gradient(130% 95% at 50% 112%, #8FAE7E 0%, rgba(190, 209, 168, 0.9) 45%, transparent 78%),
      #F2E9DB;
  }
  .nav-promo-title {
    font-family: var(--font-serif); font-weight: 500; font-size: 1.2rem;
    line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 12px;
  }
  .nav-promo-btn {
    display: block; width: 100%; text-align: center; text-decoration: none;
    border-radius: 999px; padding: 9px 14px; background: #fff; color: var(--ink);
    font-size: 13px; font-weight: 500; box-shadow: 0 1px 3px rgba(31, 31, 20, 0.16);
    transition: box-shadow 0.2s, transform 0.2s var(--ease);
  }
  .nav-promo-btn:hover { box-shadow: 0 3px 8px rgba(31, 31, 20, 0.22); transform: translateY(-1px); }
  .nav-account {
    display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px;
    border-top: 1px solid var(--hairline); font-size: 13.5px; font-weight: 500; color: var(--ink);
  }
  .nav-account .avatar { width: 30px; height: 30px; font-size: 11px; }
  .nav-account .nav-account-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-powered { font-size: 11px; color: var(--ink-faint); padding: 6px 8px 0; }

  .stage, .phones {
    top: var(--demo-h); bottom: 0; left: calc(var(--rail-w) + var(--side-w));
    padding: 30px clamp(1.8rem, 4vw, 3.2rem) 44px;
  }
  body[data-view="app"] .nav { display: none; }
  body[data-view="app"] .phones { left: var(--rail-w); padding-left: 1.5rem; padding-right: 1.5rem; }
  .phone { width: 320px; }
  .phone-view { width: 302px; height: 654px; }
  .phone-screen { transform: scale(0.7744); }
  .stage > .screen { max-width: 980px; }
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
  .pipeline { grid-template-columns: repeat(4, 1fr); }
  .tip { bottom: 26px; left: calc(50% + (var(--rail-w) + var(--side-w)) / 2); }
}

@media (max-width: 460px) {
  .tile-row, .launch-row { grid-template-columns: 1fr 1fr; }
  /* Scoped to the buyer home rows only: other surfaces keep all their tiles */
  #market-tiles .tile:last-child, .launch-row .launch:last-child { display: none; }
  .listing-grid { grid-template-columns: 1fr; }
  .demo-bar { gap: 5px 9px; padding: 6px 11px; padding-top: calc(6px + env(safe-area-inset-top)); }
  .demo-bar-text { font-size: 11px; }
  .demo-bar-cta { font-size: 11px; padding: 4px 10px; }
}

@media (max-width: 360px) {
  .nav-item { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
