/* Advisor Desk. Direction: a private-bank advisor's desk. Ivory paper app, deep ink stage for the
   advisor, one marigold accent. Fraunces for headings (warmth, trust), Manrope for UI. */
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20B9, U+2122, U+2190-21FF; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --ink: #13233f; --ink-2: #1c3157; --ink-3: #2a4372;
  --paper: #f6f1e7; --paper-2: #fbf8f2; --card: #ffffff;
  --line: #e4dccb; --line-2: #d4c9b2;
  --text: #1d2433; --muted: #5d6474; --faint: #8a8f9b;
  --gold: #e9a83a; --gold-2: #c98a1f; --gold-soft: #fbedd2;
  --ok: #2f7d5b; --ok-soft: #e3f1ea; --warn: #a2560f; --warn-soft: #fbe9d6; --bad: #a33a2c;
  --r: 14px; --r-sm: 9px;
  --shadow: 0 1px 2px rgba(19,35,63,.06), 0 6px 24px rgba(19,35,63,.06);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", "Noto Sans Devanagari", "Nirmala UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--text); background: var(--paper); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink-3); }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card); padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s, border-color .15s, transform .1s; text-decoration: none; color: var(--text); }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2a1a00; }
.btn.gold:hover { background: #f0b552; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #f1cfa8; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe0cf; }
.badge.gold { background: var(--gold-soft); color: #7a4f06; border-color: #f2d49b; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; z-index: 50; box-shadow: var(--shadow); max-width: 90vw; }

/* ---------- sign-in ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--ink); color: #f6f1e7; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { color: #fff; font-size: clamp(34px, 4vw, 54px); line-height: 1.05; font-weight: 500; max-width: 12ch; }
.login-art h1 em { color: var(--gold); font-style: italic; }
.login-art p { color: #c7cfdf; max-width: 42ch; }
.login-art .rings { position: absolute; right: -120px; bottom: -120px; width: 460px; height: 460px; border-radius: 50%; border: 1px solid rgba(233,168,58,.35); box-shadow: 0 0 0 40px rgba(233,168,58,.06), 0 0 0 90px rgba(233,168,58,.04); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand .mark { width: 30px; height: 30px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form form { width: min(380px, 100%); display: grid; gap: 14px; }
.login-form h2 { font-size: 28px; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); background: var(--card); border-radius: var(--r-sm); padding: 10px 12px; font-size: 15px; color: var(--text); }
.input:focus { outline: none; border-color: var(--ink-3); box-shadow: 0 0 0 3px rgba(42,67,114,.12); }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; }

/* ---------- top bar ---------- */
.top { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--paper-2); position: sticky; top: 0; z-index: 10; }
.top .brand { color: var(--ink); }
.top nav { display: flex; gap: 6px; align-items: center; }
.seg-switch { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-switch a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg-switch a.on { background: var(--ink); color: #fff; }

/* ---------- home ---------- */
.home { max-width: 1120px; margin: 0 auto; padding: 56px 24px 80px; }
.home .eyebrow { color: var(--gold-2); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.home h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; margin: 10px 0 12px; max-width: 18ch; font-weight: 500; }
.home .lede { color: var(--muted); max-width: 60ch; margin: 0 0 36px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.choice { position: relative; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 28px; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; display: grid; gap: 14px; overflow: hidden; min-height: 280px; }
.choice:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 2px 4px rgba(19,35,63,.06), 0 16px 40px rgba(19,35,63,.1); }
.choice h2 { font-size: 28px; }
.choice p { margin: 0; color: var(--muted); }
.choice .glyph { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--ink); }
.choice .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.choice .go { position: absolute; right: 24px; top: 28px; font-family: var(--serif); font-size: 26px; color: var(--gold-2); transition: transform .2s; }
.choice:hover .go { transform: translateX(4px); }
.mode-row { display: flex; gap: 10px; align-items: center; margin: 26px 0 0; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.note { font-size: 13px; color: var(--muted); }
.notice { border: 1px solid #f1cfa8; background: var(--warn-soft); color: #5e3608; border-radius: var(--r); padding: 12px 16px; font-size: 14px; margin: 0 0 22px; }

/* ---------- advisor desk ---------- */
.desk { display: grid; grid-template-columns: 290px minmax(0, 1fr) 400px; height: calc(100vh - 60px); }
.col { min-height: 0; overflow: auto; }
.col-left { border-right: 1px solid var(--line); background: var(--paper-2); display: flex; flex-direction: column; }
.col-right { border-left: 1px solid var(--line); background: var(--paper-2); display: flex; flex-direction: column; }
.col-mid { display: flex; flex-direction: column; min-width: 0; }

.list-head { padding: 16px 16px 10px; position: sticky; top: 0; background: var(--paper-2); z-index: 2; border-bottom: 1px solid var(--line); }
.list-head h3 { font-size: 17px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.list-head h3 span { font-family: var(--sans); font-size: 12px; color: var(--faint); font-weight: 600; }
.plist { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.pitem { border: 1px solid transparent; border-radius: 11px; padding: 10px 12px; cursor: pointer; display: grid; gap: 3px; background: transparent; text-align: left; width: 100%; transition: background .15s, border-color .15s; }
.pitem:hover { background: var(--card); border-color: var(--line); }
.pitem.on { background: var(--card); border-color: var(--ink-3); box-shadow: inset 3px 0 0 var(--ink-3); }
.pitem.suggested { background: var(--gold-soft); border-color: #f2d49b; }
.pitem .n { font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--ink); }
.pitem .p { font-size: 12px; color: var(--muted); }
.pitem .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.group-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 10px 12px 4px; }

.stage { position: relative; background: radial-gradient(120% 90% at 50% 0%, #22385f 0%, var(--ink) 55%, #0c172b 100%); margin: 16px 16px 0; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; max-height: 52vh; display: grid; place-items: center; color: #dbe2ef; }
.stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage .idle { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 24px; }
.stage .portrait { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #2c4775, #182a4a); border: 2px solid rgba(233,168,58,.55); font-family: var(--serif); font-size: 52px; color: var(--gold); position: relative; }
.stage .portrait.talking::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(233,168,58,.5); animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
.stage .who { font-family: var(--serif); font-size: 22px; color: #fff; }
.stage .role { font-size: 13px; color: #aab6cc; }
.stage .status { position: absolute; left: 16px; top: 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.35); color: #e8edf6; display: flex; gap: 6px; align-items: center; }
.stage .status .dot { width: 8px; height: 8px; border-radius: 50%; background: #6ad19b; }
.stage .status.busy .dot { background: var(--gold); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.stage .caption { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(88%, 760px); background: rgba(8,15,30,.72); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15.5px; line-height: 1.45; backdrop-filter: blur(6px); text-align: center; }
.stage .caption:empty { display: none; }
.stage-tools { position: absolute; right: 14px; top: 12px; display: flex; gap: 6px; }
.stage-tools .btn { background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.18); color: #fff; }

.talk { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 14px; gap: 10px; }
.log { flex: 1; min-height: 80px; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; }
.msg.advisor { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg .src { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.msg .src a { font-size: 11.5px; font-weight: 700; text-decoration: none; background: var(--paper); border: 1px solid var(--line); color: var(--ink-3); padding: 2px 8px; border-radius: 999px; }
.msg.handoff { border-color: #f1cfa8; background: var(--warn-soft); }
.msg.thinking { color: var(--muted); font-style: italic; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--card); padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--ink-2); font-weight: 600; transition: background .15s, border-color .15s; }
.chip:hover { border-color: var(--ink-3); background: var(--paper-2); }
.ask { display: flex; gap: 8px; }
.ask .input { border-radius: 999px; padding: 11px 16px; }
.mic { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; display: grid; place-items: center; flex: none; }
.mic.on { background: var(--bad); border-color: var(--bad); color: #fff; }

.tabs { display: flex; gap: 2px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper-2); z-index: 2; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 9px 9px; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--gold); }
.tab .dotn { display: inline-block; min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold); color: #2a1a00; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }
.panel { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.col-right { overflow-x: hidden; }
.panel h3 { font-size: 20px; }
.empty { color: var(--muted); font-size: 14px; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 16px; text-align: center; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 12px; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.checklist .v { font-weight: 700; color: var(--ink); }

.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.pcard .hd { padding: 16px; background: var(--ink); color: #fff; display: grid; gap: 4px; }
.pcard .hd h3 { color: #fff; font-size: 20px; }
.pcard .hd .p { color: #b9c4d9; font-size: 13px; }
.pcard .hd .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.why { padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--gold-soft); }
.why h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #7a4f06; }
.why ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.fact { background: var(--card); padding: 11px 13px; display: grid; gap: 3px; align-content: start; }
.fact .l { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); display: flex; gap: 6px; align-items: center; }
.fact .v { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.fact a.pg { font-size: 11px; font-weight: 700; color: var(--ink-3); text-decoration: none; }
.fact.hl { background: #fffaf0; box-shadow: inset 3px 0 0 var(--gold); }
.docs { display: grid; gap: 6px; padding: 14px 16px; }
.doc-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; background: var(--paper-2); }
.doc-link:hover { border-color: var(--ink-3); }
.doc-link small { color: var(--muted); font-weight: 600; }
.caution { font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; margin: 12px 16px 0; }

.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.compare th, .compare td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: var(--ink); color: #fff; font-family: var(--serif); font-weight: 500; font-size: 14px; }
.compare tbody th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); width: 30%; }
.compare td a { font-size: 11px; text-decoration: none; }

.calc { display: grid; gap: 10px; }
.calc .members { display: grid; gap: 6px; }
.calc .mrow { display: grid; grid-template-columns: 1fr 80px 32px; gap: 6px; }
.steps { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.steps td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.steps { table-layout: fixed; }
.steps td { overflow-wrap: anywhere; }
.steps td:last-child:not([colspan]) { width: 34%; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.steps tr.total td { background: var(--ink); color: #fff; font-size: 15px; }
.steps a { font-size: 11px; font-weight: 700; text-decoration: none; margin-left: 4px; }
.calc-notes { font-size: 12.5px; color: var(--muted); margin: 0; padding-left: 18px; display: grid; gap: 3px; }

.viewer { height: 62vh; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.viewer iframe { width: 100%; height: 100%; border: 0; }

.modal-back { position: fixed; inset: 0; background: rgba(12,23,43,.5); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--paper-2); border-radius: 18px; width: min(460px, 100%); padding: 24px; display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { font-size: 22px; }
.contact-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.contact-card .av { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--gold); display: grid; place-items: center; font-family: var(--serif); font-size: 20px; flex: none; }

@media (max-width: 1180px) {
  .desk { grid-template-columns: 250px minmax(0, 1fr) 360px; }
}
.browse-btn { display: none; }
@media (max-width: 960px) {
  .browse-btn { display: inline-flex; }
  .col-left { display: none; }
  .col-left.open { display: flex; position: fixed; inset: 60px 0 0 0; z-index: 30; }
  .stage.compact { aspect-ratio: auto; min-height: 0; padding: 12px 14px; place-items: stretch; }
  .stage.compact .idle { grid-template-columns: 52px 1fr; justify-items: start; text-align: left; gap: 2px 12px; padding: 34px 0 0; align-items: center; }
  .stage.compact .portrait { width: 52px; height: 52px; font-size: 24px; grid-row: span 2; }
  .stage.compact .who { font-size: 18px; } .stage.compact .caption { display: none; }
  .stage.compact #startBtn { grid-column: 1 / -1; justify-self: stretch; justify-content: center; margin-top: 10px; }
  .stage-tools .btn { padding: 5px 10px; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; min-height: 260px; }
  .choices { grid-template-columns: 1fr; }
  .desk { display: flex; flex-direction: column; height: auto; }
  .col-left { order: 3; border-right: 0; border-top: 1px solid var(--line); max-height: none; }
  .col-mid { order: 1; }
  .col-right { order: 2; border-left: 0; border-top: 1px solid var(--line); }
  .stage { margin: 10px 10px 0; max-height: none; }
  .log { max-height: 40vh; }
  .top { padding: 0 12px; }
  .top .hide-sm { display: none; }
  .facts { grid-template-columns: 1fr; }
}
