:root {
  --bg: #0b0e13;
  --panel: #161b22;
  --panel-2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2f81f7;
  --accent-hover: #4493f8;
  --error: #f85149;
  --ok: #3fb950;
  /* Champagne gold — the portal's premium accent (already used by the
     role picker). Reserved for brand + selected/affirmative states. */
  --gold: #e7c66b;
  --gold-soft: rgba(231, 198, 107, 0.10);
  --radius: 14px;
  --radius-sm: 8px;
  /* Layered elevation for the auth card — soft ambient + tight contact. */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset,
                 0 18px 50px -12px rgba(0,0,0,0.65),
                 0 2px 8px rgba(0,0,0,0.4);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  /* Atmosphere: a faint warm glow up top + cool depth below — keeps the
     dark surface from reading as a flat slab. */
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(231, 198, 107, 0.05), transparent 60%),
    radial-gradient(900px 600px at 88% 110%, rgba(47, 129, 247, 0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.brand { font-weight: 700; letter-spacing: 0.4px; font-size: 18px; }
#nav-status { font-size: 13px; color: var(--muted); }

main { max-width: 720px; margin: 0 auto; padding: 32px 24px 80px; }
h1 { margin: 0 0 16px; font-size: 26px; font-weight: 600; }
.enroll-card h2,
.upload-card h2,
h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }

.view { display: none; }
.view.active { display: block; }

.muted { color: var(--muted); margin: 8px 0; }
.muted.small { font-size: 12px; }
.error { color: var(--error); margin: 12px 0; min-height: 1em; }
.ok { color: var(--ok); margin: 12px 0; min-height: 1em; }

form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select {
  padding: 11px 13px; font-size: 16px; /* 16px: stops iOS zoom-on-focus */
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder { color: #6b7280; }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.18);
  background: #1b222c;
}
button {
  padding: 10px 14px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: white;
  border: 0; border-radius: 6px; cursor: pointer;
  transition: background 0.12s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.linklike {
  background: none; color: var(--accent); padding: 0;
  font-weight: 400; font-size: inherit; text-decoration: underline;
}

.enroll-card, .upload-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px; margin: 16px 0;
}

.holding-card {
  background: var(--panel-2); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 16px 20px; margin: 16px 0;
}
.holding-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.holding-card p  { margin: 0; }

.enroll-panel, #factor-totp, #factor-sms, #reset-confirm-pane, #settings-phone-panel {
  display: none; margin-top: 12px;
  padding: 12px; background: var(--panel-2); border-radius: 6px;
}
.enroll-panel.show, #factor-totp.show, #factor-sms.show,
#reset-confirm-pane.show, #settings-phone-panel.show { display: block; }
#reset-request-pane.hide { display: none; }
#redeem-pwd-pane.hide, #redeem-sms-pane.hide,
#redeem-sms-code-pane.hide { display: none; }

#totp-qr { display: block; margin: 12px 0; max-width: 200px; }

.factor-buttons {
  display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0;
}

.doc-list { list-style: none; padding: 0; margin: 16px 0; }
.doc-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 8px;
}
.doc-list .doc-meta { font-size: 13px; color: var(--muted); }
.doc-list .actions { display: flex; gap: 8px; }
.doc-list .actions button { padding: 6px 10px; font-size: 13px; }
.doc-list .sensitivity {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  margin-right: 8px;
}
.doc-list .sensitivity.INTERNAL { background: #1f3a4d; color: #79c0ff; }
.doc-list .sensitivity.CONFIDENTIAL { background: #4d3a1f; color: #f1c757; }
.doc-list .sensitivity.RESTRICTED { background: #4d1f1f; color: #ff7b72; }

#passkey-list { list-style: none; padding: 0; margin: 8px 0; }
#passkey-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--panel-2); border-radius: 6px;
  margin-bottom: 6px; font-size: 13px;
}

.footer-links { margin-top: 32px; color: var(--muted); }
.enroll-done { margin-top: 24px; }

/* Backup-codes lists — monospace + comfortable line-height. Class
   form (was inline `style=""` in index.html) so the strict portal-ui
   CSP can drop `style-src 'unsafe-inline'`. */
.code-list       { font-family: monospace; font-size: 16px; line-height: 1.6; padding-left: 24px; }

/* Role-picker fieldset on signup — buyer/seller selector. Two stacked
   options with a leading radio dot; the picked option gets a tinted
   background + 3px gold left rule so the choice is unmistakable. */
.role-picker {
  border: 1px solid var(--panel-2);
  border-radius: 8px;
  padding: 12px 14px 14px;
  margin: 0 0 16px;
}
.role-picker > legend { padding: 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.role-picker .small { margin: 4px 0 10px; font-size: 12px; }
.role-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid var(--panel-2);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.role-option:last-of-type { margin-bottom: 0; }
.role-option:hover { border-color: #f1c757; }
.role-option input[type="radio"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #f1c757;
  align-self: start;
  grid-row: span 2;
}
.role-option .role-title {
  font-size: 14px; font-weight: 600; color: inherit; line-height: 1.3;
}
.role-option .role-sub {
  font-size: 12px; color: var(--muted); line-height: 1.45; grid-column: 2;
}
.role-option:has(input[type="radio"]:checked) {
  border-color: #f1c757;
  background: rgba(241, 199, 87, 0.06);
  box-shadow: inset 3px 0 0 #f1c757;
}
.code-list-tight { font-family: monospace; }

.portal-translate-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 32px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Skip-to-content link: hidden until focused via keyboard. */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem;
  width: auto; height: auto; padding: .65rem 1rem;
  background: var(--panel); border: 2px solid var(--accent);
  border-radius: 6px; color: var(--text); z-index: 1000;
  font-weight: 600;
}

/* Password strength meter + per-rule checklist (signup form). */
/* The meter + checklist live inside a collapsible region so the empty form
   keeps the Password and Confirm-password fields together. portal.js adds
   .is-open on focus / when the field has content; it stays open while the
   user can still reference the rules. Reduced-motion users skip the slide. */
.pw-help {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin: 0;
  transition: max-height .25s ease, opacity .2s ease, margin .25s ease;
}
.pw-help.is-open {
  /* Headroom well above the ~140px content so a longer translated requirement
     string or large browser text-zoom never clips behind overflow:hidden.
     Only the transition target is affected, not the laid-out height. */
  max-height: 360px;
  opacity: 1;
  margin: 6px 0 4px;
}
@media (prefers-reduced-motion: reduce) {
  .pw-help { transition: none; }
}
.pw-meter {
  height: 6px; border-radius: 3px; background: var(--panel-2, #0d1117);
  border: 1px solid var(--border); overflow: hidden; margin: 2px 0 6px;
}
.pw-meter-bar {
  height: 100%; width: 0; border-radius: 3px;
  transition: width .2s ease, background-color .2s ease; background: transparent;
}
.pw-meter-bar.weak   { background: var(--error); }
.pw-meter-bar.medium { background: #d29922; }
.pw-meter-bar.strong { background: var(--ok); }
.pw-rules {
  list-style: none; padding: 0; margin: 0 0 10px;
  font-size: 12px; color: var(--muted);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px;
}
.pw-rules li { position: relative; padding-left: 1.2em; }
.pw-rules li::before { content: "○"; position: absolute; left: 0; color: var(--muted); }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { content: "✓"; color: var(--ok); }
.pw-rules li.bad { color: var(--error); }
.pw-rules li.bad::before { content: "✕"; color: var(--error); }
.pw-match { font-size: 12px; margin: -4px 0 8px; min-height: 1em; }
.pw-match.ok { color: var(--ok); }
.pw-match.bad { color: var(--error); }

/* ══════════════════════════════════════════════════════════════════════════
   AUTH SURFACE — centered, elevated card for the anonymous views
   (login / signup / verify / factor / redeem / password-reset).
   Scoped by ID so the wider dashboard / settings / vault layouts are
   untouched. The .view show/hide system still controls display.
   ════════════════════════════════════════════════════════════════════════ */
#view-login, #view-signup, #view-verify,
#view-factor, #view-redeem, #view-password-reset {
  max-width: 432px;
  margin: clamp(12px, 4.5vh, 56px) auto 24px;
  padding: 38px 34px 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.016), transparent 140px),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
/* Hairline champagne accent across the top edge of the card. */
#view-login::before, #view-signup::before, #view-verify::before,
#view-factor::before, #view-redeem::before, #view-password-reset::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}

/* Tasteful staggered reveal on each auth view as it becomes active. */
@keyframes authIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
#view-login.active, #view-signup.active, #view-verify.active,
#view-factor.active, #view-redeem.active, #view-password-reset.active {
  animation: authIn .42s cubic-bezier(.2,.7,.2,1) both;
}
#view-signup.active > * { animation: authIn .5s cubic-bezier(.2,.7,.2,1) both; }
#view-signup.active > .auth-brand { animation-delay: .03s; }
#view-signup.active > h1          { animation-delay: .07s; }
#view-signup.active > .auth-sub   { animation-delay: .10s; }
#view-signup.active > form        { animation-delay: .13s; }

/* Brand lockup inside the card. */
.auth-brand { display: flex; flex-direction: column; gap: 3px; margin: 0 0 22px; }
.auth-mark {
  font-family: var(--serif); font-size: 25px; line-height: 1;
  letter-spacing: .3px; color: var(--text);
}
.auth-kicker {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}

/* Auth headings + subhead. */
#view-login > h1, #view-signup > h1, #view-verify > h1,
#view-factor > h1, #view-redeem > h1, #view-password-reset > h1 {
  font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 6px;
}
.auth-sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 22px; }

/* Auth form rhythm + micro-cap labels. */
#form-signup, #form-login { max-width: 100%; gap: 14px; }
#form-signup > label, #form-login > label,
#view-password-reset label, #view-redeem label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); gap: 7px;
}

/* Full-width, lifted primary buttons on the auth forms. */
#form-signup > button[type="submit"], #form-login button[type="submit"],
#view-password-reset form button[type="submit"],
#view-redeem form button[type="submit"] {
  width: 100%; margin-top: 6px; padding: 12px 16px; font-size: 15px;
  letter-spacing: .01em; border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10),
              0 8px 22px -8px rgba(47,129,247,0.55);
}
#form-signup > button[type="submit"]:hover, #form-login button[type="submit"]:hover {
  transform: translateY(-1px);
}
#form-signup > button[type="submit"]:active, #form-login button[type="submit"]:active {
  transform: translateY(0);
}

/* Card footer links — centered, quiet. */
#view-login > .muted, #view-signup > .muted {
  text-align: center; font-size: 13px; margin: 18px 0 0;
}
#view-signup > .muted a, #view-login > .muted a { font-weight: 600; }

/* Compact the password requirement list a touch inside the tighter card. */
.pw-rules { font-size: 11.5px; gap: 3px 16px; margin: 0 0 12px; }
.pw-meter { height: 5px; margin: 4px 0 8px; }
.pw-match { font-weight: 600; }

/* Role picker — lift the resting state and strengthen the selected look. */
.role-picker { border-color: var(--border); padding: 14px 14px 12px; }
.role-option { border-color: var(--border); background: rgba(255,255,255,0.012); }
.role-option:hover { border-color: var(--gold); background: var(--gold-soft); }
.role-option:has(input[type="radio"]:checked) {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 3px 0 0 var(--gold), 0 0 0 1px rgba(231,198,107,0.25);
}

/* ── Responsive: phones ──────────────────────────────────────────────────*/
@media (max-width: 520px) {
  header { padding: 14px 18px; }
  main { padding: 14px 14px 56px; }
  #view-login, #view-signup, #view-verify,
  #view-factor, #view-redeem, #view-password-reset {
    max-width: 100%; padding: 26px 20px 24px;
    border-radius: 12px; margin-top: 8px;
  }
  .auth-mark { font-size: 23px; }
  .pw-rules { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #view-login.active, #view-signup.active, #view-verify.active,
  #view-factor.active, #view-redeem.active, #view-password-reset.active,
  #view-signup.active > * { animation: none; }
}

/* Auth card small-print footer — firm + broker attribution. */
.auth-footer {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
  letter-spacing: .02em;
}
.auth-footer .auth-firm {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--gold);
  letter-spacing: .02em;
  margin-bottom: 2px;
}

/* Enrollment requirement checklist (view-enroll). */
.enroll-reqs {
  list-style: none; padding: 14px 16px; margin: 0 0 20px;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
  background: var(--panel-2); display: grid; gap: 9px;
}
.enroll-reqs li { font-size: 14px; color: var(--muted); display: flex; gap: 9px; align-items: baseline; }
.enroll-reqs li.done { color: var(--ok); }
.enroll-reqs .req-mark { font-weight: 700; width: 1em; display: inline-block; }
.enroll-reqs li.done .req-mark { color: var(--ok); }

/* Buyer document checklist on the dashboard upload card. Reuses .enroll-reqs
   layout; a completed item shows a green check but keeps its text readable
   (overriding the all-green "done" state used on the enrollment screen). */
/* "Required to begin" heading — small authoritative label above the list. */
.checklist-intro {
  margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold);
}
.checklist-foot { margin: 12px 0 0; }
.upload-reqs { margin-bottom: 22px; }
.upload-reqs li.done { color: var(--text); }
.upload-reqs li.done strong { color: var(--ok); }
.accepted-types { margin: 6px 2px 14px; }

/* ── Legal pages (/legal/privacy, /legal/terms) ───────────────────────────
   Server-rendered by portal_legal.py. Scoped under .legal so the long-form
   typography here never leaks into the SPA views. */
main.legal { max-width: 760px; }
.legal h1 { font-size: 28px; line-height: 1.25; }
.legal h2 {
  font-size: 17px; font-weight: 600; margin: 30px 0 8px;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.legal p { line-height: 1.65; margin: 10px 0; color: var(--text); }
.legal ul { line-height: 1.65; margin: 10px 0 10px 4px; padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal .updated {
  color: var(--muted); font-size: 13px; margin-bottom: 8px;
  letter-spacing: .02em;
}
.legal .nav {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px;
}

/* ── Signup legal-consent checkbox ─────────────────────────────────────────
   The generic `label` rule (flex-direction:column, muted, 13px) would stack
   the checkbox above the text and render the required consent copy in muted
   gray — illegible for an informed-consent gate. Override explicitly so the
   checkbox sits inline with full-contrast, normal-size text. */
.consent-row { margin: 1rem 0; }
.consent-label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}
.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--gold);
}
.consent-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.consent-label input[type="checkbox"][aria-invalid="true"] {
  outline: 2px solid var(--error);
}

/* ── Delete-account control ─────────────────────────────────────────────── */
.delete-action-row { display: flex; gap: 0.75rem; margin-top: 1rem; }
#btn-delete-account { background: var(--error); color: #fff; }
#btn-delete-account:hover { background: #ff6b61; }
#btn-delete-account:focus-visible { outline: 2px solid var(--error); outline-offset: 2px; }
#btn-delete-account-confirm { background: var(--error); color: #fff; }
#btn-delete-account-confirm:disabled { opacity: 0.5; cursor: not-allowed; }
#delete-account-panel:not([hidden]) {
  display: block;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

/* Required strong-factor group on the enroll screen. */
.enroll-group-label { font-weight: 600; color: var(--text); margin: 20px 0 10px; }
.enroll-group-label em { color: var(--gold); font-style: normal; font-weight: 700; }
.req-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #0b0e13; background: var(--gold);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 8px;
}

/* ════════════════════════════════════════════════════════════════════════
   Deal Room dashboard — premium navy/champagne working surface. The auth
   views stay in their centered 432px card; the dashboard breaks wider via
   :has() (graceful 720px fallback where :has is unsupported).
   ════════════════════════════════════════════════════════════════════════ */
main:has(#view-dashboard.active) { max-width: 1060px; }

.view-room { color: var(--text); }

/* — Header — */
.room-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
  margin-bottom: 26px;
}
.room-eyebrow {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold);
}
.room-title {
  margin: 0; font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.04;
}
.room-greeting { margin: 12px 0 0; max-width: 56ch; color: var(--muted); font-size: 15px; line-height: 1.6; }

/* — Path-to-close stepper — */
.dealflow-card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 140%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 26px;
}
.room-card-label {
  margin: 0 0 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.dealflow {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
}
.dealflow::-webkit-scrollbar { display: none; }
.dealflow li {
  position: relative; flex: 1 0 auto; min-width: 104px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 6px;
}
/* connector line between dots */
.dealflow li::before {
  content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px;
  background: var(--border);
}
.dealflow li:first-child::before { display: none; }
.dealflow li.done::before, .dealflow li.current::before { background: var(--gold); }
.dealflow .dot {
  position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--border); box-sizing: border-box;
}
.dealflow li.done .dot { background: var(--gold); border-color: var(--gold); }
.dealflow li.current .dot {
  background: var(--gold); border-color: var(--gold);
  box-shadow: 0 0 0 5px var(--gold-soft);
}
.dealflow .label {
  margin-top: 10px; font-size: 12.5px; line-height: 1.35; color: var(--muted);
  max-width: 13ch;
}
.dealflow li.current .label { color: var(--text); font-weight: 600; }
.dealflow li.done .label { color: var(--text); }

/* — Two-column working area — */
.room-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.room-main { min-width: 0; }
.room-rail { display: flex; flex-direction: column; gap: 18px; }
.room-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
}
.room-card-h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 600; }
.vault-intro { margin: 0 0 18px; font-size: 14px; line-height: 1.6; max-width: 54ch; }
.upload-form { max-width: 100%; gap: 16px; }

/* Custom dropzone — replaces the unstyled native file button. The real
   <input type=file> is stretched transparent over the whole label so a click
   or drag-drop anywhere selects the file. */
.dropzone {
  position: relative; display: block; cursor: pointer;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); padding: 28px 20px; text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #1b222c; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: rgba(63,185,80,.06); }
.dropzone input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 7px; pointer-events: none; }
.dropzone-icon { width: 30px; height: 30px; color: var(--accent); }
.dropzone.has-file .dropzone-icon { color: var(--ok); }
.dropzone-primary { font-size: 14px; color: var(--text); }
.dropzone-primary strong { color: var(--accent); font-weight: 600; }
.dropzone.has-file .dropzone-primary strong { color: var(--ok); }
.dropzone-hint { font-size: 12px; color: var(--muted); }

/* Two-up row for kind + note. */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row .field { gap: 6px; }
.field-opt { color: var(--muted); font-weight: 400; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* Custom select chevron (native arrow removed). */
.select-wrap { position: relative; display: block; }
.select-wrap select { width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; }
.select-wrap::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* Encrypt & Upload — full-width, icon + label, premium weight. */
.btn-upload {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 16px; font-size: 15px; border-radius: var(--radius-sm);
  margin-top: 2px;
}
.btn-lock { width: 16px; height: 16px; flex: 0 0 auto; }

/* NDA stage: numbered steps + a secondary (outline) download button. */
.nda-steps { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.nda-steps li { line-height: 1.5; }
.btn-secondary {
  display: inline-block; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--accent); background: transparent; border: 1px solid var(--accent);
  border-radius: var(--radius-sm); text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.btn-secondary:hover { background: var(--accent); color: #fff; }

/* — Identity verification card (advisory) — */
.idv-card { margin-bottom: 20px; }
.idv-card .idv-intro { margin: 0 0 16px; font-size: 14px; line-height: 1.6; max-width: 54ch; }
.idv-card .btn-upload { width: auto; min-width: 240px; }
.idv-arrow { font-size: 1.05em; line-height: 1; transition: transform .15s ease; }
.idv-card .btn-upload:hover .idv-arrow { transform: translateX(3px); }
.idv-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: rgba(63, 185, 80, .14); color: var(--ok);
  font-size: 13px; font-weight: 700; margin-right: 7px; vertical-align: -4px;
}
#btn-idv-start.loading { opacity: .65; pointer-events: none; }
.idv-error { color: #f0883e; margin: 12px 0 0; }
.idv-error:empty { display: none; }
.idv-pending { margin: 0 0 14px; }

/* — Broker relationship card — */
.broker-card {
  background: linear-gradient(180deg, var(--panel) 0%, #11161d 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center;
}
.broker-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #243247, #0f141b);
  border: 2px solid var(--gold); box-shadow: 0 6px 20px -8px rgba(0,0,0,.7);
}
.broker-avatar { position: relative; }
.broker-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Initials shown behind the photo; visible when no headshot is set or it 404s. */
.broker-monogram {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--gold);
  letter-spacing: .02em;
}
.broker-role {
  margin: 14px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
}
.broker-name { margin: 2px 0 2px; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.broker-creds { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.broker-contact { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.broker-contact li { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.broker-contact .k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.broker-contact a { color: var(--text); text-decoration: none; font-size: 14px; }
.broker-contact a:hover { color: var(--gold); }

/* — Security reassurance — */
.assurance-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.assurance-list li { position: relative; padding-left: 22px; font-size: 13.5px; color: var(--text); }
.assurance-list li::before {
  content: "✓"; position: absolute; left: 0; top: -1px; color: var(--gold); font-weight: 700;
}

/* — 61J2 identity footer — */
.room-footer {
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border);
  text-align: center; color: var(--muted);
}
.room-footer p { margin: 2px 0; font-size: 13px; }
.room-footer .firm { color: var(--text); font-weight: 600; font-size: 14px; }
.room-footer .phone a { color: var(--muted); text-decoration: none; }
.room-footer .phone a:hover { color: var(--gold); }
.room-footer .legal { margin-top: 12px; font-size: 11.5px; line-height: 1.5; }

/* — Holding banner (restyled as a warm status note) — */
.view-room .holding-card {
  background: var(--gold-soft); border: 1px solid rgba(231,198,107,.28);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px;
}
.view-room .holding-card h2 { margin: 0 0 6px; font-size: 1.05rem; color: var(--gold); }
.view-room .holding-card p { margin: 0; font-size: 14px; line-height: 1.55; }

/* — Onboarding tour — */
.tour-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(6,9,14,.72); backdrop-filter: blur(2px); }
.tour-card {
  position: fixed; background: var(--panel); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-card);
  animation: tour-pop .18s ease-out;
}
@keyframes tour-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.tour-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.2rem; }
.tour-card p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.tour-actions { display: flex; align-items: center; gap: 14px; }
.tour-count { font-size: 12px; color: var(--muted); margin-right: auto; }
.tour-skip { color: var(--muted); font-size: 13px; }
.tour-next {
  background: var(--gold); color: #0b0e13; border: none; border-radius: var(--radius-sm);
  padding: 9px 20px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.tour-next:hover { background: #f0d684; }

/* — Responsive — */
@media (max-width: 860px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-rail { flex-direction: column; }
}

.dealflow-caption { margin: -6px 0 16px; font-size: 12.5px; }

.partner-kind-picker { margin-top: 4px; }
.partner-firm-field { display: block; margin-top: 12px; }
.partner-firm-field input { margin-top: 6px; }

/* ── Professional Partner Hub (PH-06) ─────────────────────────────────────── */
.room-card-h3 { margin: 0 0 12px; font-size: 1.02rem; font-weight: 600; }
.partner-referral-form { margin-top: 20px; }
.referral-list { list-style: none; margin: 0 0 4px; padding: 0; }
.referral-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.referral-row:last-child { border-bottom: none; }
.referral-row strong { font-size: 14.5px; }
.referral-meta { color: var(--muted); font-size: 13px; }
.referral-note { margin-top: 4px; font-size: 13px; }
.referral-stage {
  float: right; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted);
}
.referral-stage.stage-engaged, .referral-stage.stage-under_loi { background: var(--gold-soft); color: var(--gold); }
.referral-stage.stage-closed { background: rgba(63,185,80,.12); color: var(--ok); }
.partner-deal-card {
  background: linear-gradient(180deg, var(--panel) 0%, #11161d 100%);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-bottom: 12px;
}
.partner-deal-card .pd-code { margin: 0 0 6px; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.partner-deal-card .pd-meta { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.partner-deal-card .pd-stage { color: var(--gold); text-transform: capitalize; }
.partner-deal-card .pd-role { color: var(--muted); text-transform: capitalize; }
/* Per-deal document upload + list (partner contributes NDA / term sheet / etc). */
.partner-deal-card .pd-docs { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.partner-deal-card .pd-docs-label { margin: 0 0 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.partner-deal-card .pd-doc-list { list-style: none; margin: 0 0 10px; padding: 0; }
.partner-deal-card .pd-doc { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.partner-deal-card .pd-doc:last-child { border-bottom: none; }
.partner-deal-card .pd-doc-label { font-size: 14px; color: var(--text); }
.partner-deal-card .pd-doc-meta { color: var(--muted); }
.partner-deal-card .pd-upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.partner-deal-card .pd-desc { flex: 1 1 220px; min-width: 180px; padding: 7px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; }
.partner-deal-card .pd-upload-status { color: var(--muted); }

/* Partner vetting block + seller industry picker (signup progressive disclosure) */
.partner-vetting { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px solid rgba(0,0,0,0.08); }
.partner-vetting textarea,
.seller-industry-picker input[type="text"] { width: 100%; box-sizing: border-box; resize: vertical; }
