/**
 * Portfolio Analysis.
 *
 * The visual argument is the product's: conclusion, then evidence, then the
 * arithmetic — never the reverse. Three devices carry it:
 *
 *   a violet rule marks VestMind's own reading,
 *   a traffic light marks how much something matters, and
 *   a dotted rule marks anything the analysis could not measure.
 *
 * The last one is doing real work. A portfolio product that renders a gap in
 * its data as a confident zero has told the investor something false, so
 * unmeasured things here look unmeasured.
 *
 * The palette, the paper and the display face are Stock Intel's, which are the
 * landing page's, so an investor arriving from the first journey card lands
 * somewhere recognisably the same product.
 */

/*
 * The palette lives on `:root`, not on `.pa`.
 *
 * The import modal is a `<dialog>`, and a dialog in the top layer is a sibling
 * of the page container rather than a descendant of it. Tokens defined on `.pa`
 * therefore do not reach it: `background: var(--pa-card)` resolves to nothing,
 * the modal renders transparent over the page behind it, and every colour falls
 * back to the browser default. Scoping the palette to the container that
 * happened to need it first is what caused that, so it is scoped to the
 * document instead.
 */
:root {
  --pa-paper: #faf8f5;
  --pa-ink: #080b1a;
  --pa-muted: #5c5a6b;
  --pa-dim: #85838f;
  --pa-line: #e6e1da;
  --pa-line-soft: #f0ece6;
  --pa-card: #fff;
  --pa-violet: #342cff;
  --pa-violet-soft: #f1efff;
  --pa-gold: #b9832b;
  --pa-gold-soft: #fdf5e8;
  --pa-green: #0a7a3d;
  --pa-green-soft: #eef8f1;
  --pa-amber: #a95700;
  --pa-amber-soft: #fdf3e8;
  --pa-red: #c1201c;
  --pa-red-soft: #fdefee;
  --pa-shadow: 0 6px 26px rgba(52, 36, 12, .045);
  --pa-menu-height: 88px;
}

.pa {
  background: var(--pa-paper);
  color: var(--pa-ink);
  min-height: 100vh;
}

.pa main { margin: 0 auto; max-width: 1180px; padding: 0 clamp(16px, 4vw, 44px) 90px; }
.pa-dim { color: var(--pa-dim); }
.pa [hidden] { display: none !important; }

/* ── PHASE 1 — the connect screen ───────────────────────────────────────── */

/* The opening is the shared product banner (styles/product-banner.css), the
   landing page's frame restated for VestFolio. What is left here is only what
   the connect screen adds around it. */
.pa-connect { padding: 0 0 30px; }
.pa-connect-head { text-align: left; }

/* Six ways in, as one list rather than a hierarchy: an investor who has a CAS
   and no broker should not feel they are taking the lesser path. */
.pa-sources {
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  margin: 36px auto 0; max-width: 860px;
  /* The banner's call to action scrolls here; clear the sticky menu. */
  scroll-margin-top: calc(var(--pa-menu-height) + 16px);
}

.pa-source {
  align-items: center; background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px;
  box-shadow: var(--pa-shadow); display: flex; gap: 14px; padding: 16px 18px; text-align: left;
  transition: border-color .18s, box-shadow .18s, transform .18s; width: 100%;
}
.pa-source:not(.is-unavailable):hover { border-color: #c9c2ff; box-shadow: 0 10px 30px rgba(52, 36, 140, .08); transform: translateY(-1px); }
.pa-source-mark {
  align-items: center; background: var(--pa-violet-soft); border-radius: 10px; color: var(--pa-violet);
  display: flex; flex: 0 0 40px; font-size: 15px; font-weight: 700; height: 40px; justify-content: center;
}
.pa-source-mark .pa-provider-logo { background: transparent; height: 34px; width: 34px; }
.pa-source-mark .pa-provider-logo svg { height: 32px; width: 32px; }
.pa-source.is-file .pa-source-mark { background: var(--pa-gold-soft); color: var(--pa-gold); }
.pa-source-body { flex: 1; min-width: 0; }
.pa-source-body b { display: block; font-size: 14px; }
.pa-source-body span { color: var(--pa-dim); display: block; font-size: 11.5px; line-height: 1.5; margin-top: 2px; }
.pa-source-action {
  align-items: center; background: #080b18; border: 1px solid #c7973b; border-radius: 10px; box-shadow: 0 8px 18px rgba(8,25,51,.12);
  color: #fff; cursor: pointer; display: inline-flex; flex: 0 0 auto; font: 500 12px var(--font-body);
  gap: 11px; justify-content: center; min-height: 42px; padding: 0 17px; transition: box-shadow .25s ease, transform .25s ease; white-space: nowrap;
}
.pa-source-action i { color: #d2a03d; font-size: 17px; font-style: normal; line-height: 1; }
.pa-source-action:hover { background: #080b18; box-shadow: 0 10px 22px rgba(8,25,51,.18); transform: translateY(-1px); }
.pa-source-action:active { box-shadow: 0 5px 12px rgba(8,25,51,.14); transform: translateY(1px); }
/* The source tiles while the list is still being fetched: the real tile with
   nothing in it, so the row holds its height instead of collapsing and then
   pushing the rest of the screen down when the answer arrives. */
.pa-source.is-placeholder { box-shadow: none; pointer-events: none; }
.pa-source.is-placeholder .pa-source-mark { background: var(--pa-line-soft); }
.pa-source.is-placeholder b,
.pa-source.is-placeholder span {
  background: var(--pa-line-soft); border-radius: 5px; display: block; height: 11px;
}
.pa-source.is-placeholder b { width: 45%; }
.pa-source.is-placeholder span { height: 9px; margin-top: 9px; width: 72%; }

/* Every source is actionable, so there is no disabled styling. What differs is
   the badge, which says up front whether an account is needed. */
.pa-source-badge {
  background: var(--pa-line-soft); border-radius: 999px; color: var(--pa-muted); font-size: 9px;
  font-style: normal; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; text-transform: uppercase;
}
.pa-source-badge.is-open { background: var(--pa-green-soft); color: var(--pa-green); }
/* A broker VestMind cannot reach today still shows its fallback, because the
   analysis behind an upload is identical to the analysis behind a connection. */
.pa-source-fallback {
  background: none; border: 0; color: var(--pa-violet); cursor: pointer; font-size: 11.5px;
  font-weight: 700; padding: 4px 0 0; text-align: left;
}
.pa-source-fallback:hover { text-decoration: underline; }

.pa-reassurance {
  align-items: flex-start; background: var(--pa-green-soft); border: 1px solid #cbe7d5; border-radius: 14px;
  display: flex; gap: 14px; margin: 26px auto 0; max-width: 860px; padding: 18px 20px;
}
.pa-reassurance svg { color: var(--pa-green); fill: none; flex: 0 0 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; width: 22px; }
.pa-reassurance strong { display: block; font-size: 14px; }
.pa-reassurance span { color: #326a49; display: block; font-size: 12px; line-height: 1.55; margin-top: 3px; }
.pa-reassurance-second:not(:empty) { border-top: 1px solid #cbe7d5; margin-top: 8px; padding-top: 8px; }

.pa-preview {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  margin: 40px auto 0; max-width: 1000px;
}
.pa-preview article { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; box-shadow: var(--pa-shadow); padding: 18px 20px; }
.pa-preview b { display: block; font-size: 13px; margin-bottom: 5px; }
.pa-preview span { color: var(--pa-muted); font-size: 11.5px; line-height: 1.6; }

.pa-note { color: var(--pa-dim); font-size: 12px; margin: 20px auto 0; max-width: 860px; text-align: center; }
.pa-note.is-error { color: var(--pa-red); }

/* ── states ─────────────────────────────────────────────────────────────── */

.pa-state { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 16px; margin: 40px 0; padding: 54px 26px; text-align: center; }
.pa-state h2 { font: 400 26px var(--font-display); margin: 0 0 8px; }
.pa-state p { color: var(--pa-muted); font-size: 13px; line-height: 1.6; margin: 0 auto; max-width: 60ch; }
.pa-state .pa-gate-actions { justify-content: center; margin-top: 18px; }

/* ── PHASE 8 — reconciliation ───────────────────────────────────────────── */

.pa-reconcile {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-left: 3px solid var(--pa-violet);
  border-radius: 14px; box-shadow: var(--pa-shadow); margin: 28px 0 0; padding: 24px 26px;
}
.pa-reconcile h2 { font: 400 15px var(--font-display); margin: 0 0 4px; }
.pa-reconcile .pa-found { font: 400 clamp(30px, 3.6vw, 42px)/1 var(--font-display); letter-spacing: -.03em; margin: 6px 0 4px; }
.pa-reconcile .pa-counts { color: var(--pa-muted); font-size: 13px; }
.pa-reconcile-sources { border-top: 1px solid var(--pa-line-soft); display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); margin-top: 18px; padding-top: 16px; }
.pa-reconcile-sources div { display: flex; font-size: 13px; gap: 8px; }
.pa-reconcile-sources b { margin-left: auto; }
.pa-duplicates { border-top: 1px solid var(--pa-line-soft); margin-top: 16px; padding-top: 14px; }
.pa-duplicate { align-items: flex-start; display: flex; font-size: 12.5px; gap: 10px; line-height: 1.55; padding: 6px 0; }
.pa-duplicate i { color: var(--pa-amber); font-style: normal; }
.pa-reconcile-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ── PHASE 31 — connection strip ────────────────────────────────────────── */

.pa-connections { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
.pa-connection {
  align-items: center; background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 999px;
  display: flex; font-size: 11.5px; gap: 7px; padding: 7px 14px;
}
.pa-connection b { font-weight: 700; }
.pa-connection span { color: var(--pa-dim); }
.pa-connection.is-stale { background: var(--pa-amber-soft); border-color: #f0d3ac; }
.pa-connection.is-stale span { color: var(--pa-amber); }
.pa-connection button { background: none; border: 0; color: var(--pa-violet); cursor: pointer; font-size: 11.5px; font-weight: 700; padding: 0; }
.pa-connection-add { border-style: dashed; color: var(--pa-violet); cursor: pointer; }

/* ── cards, the common furniture ────────────────────────────────────────── */

.pa-card {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 16px;
  box-shadow: var(--pa-shadow); margin-bottom: 14px; padding: 22px clamp(18px, 2.5vw, 26px);
}
.pa-card > header { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 16px; }
.pa-card h2 { font: 400 18px var(--font-display); margin: 0; }
.pa-card h3 { font: 400 15px var(--font-display); margin: 0 0 10px; }
.pa-card > header p { color: var(--pa-muted); font-size: 12px; margin: 0; }
.pa-card-note { color: var(--pa-dim); font-size: 11px; line-height: 1.55; margin: 14px 0 0; }
.pa-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

/* Anything the analysis could not measure is drawn as unmeasured. */
.pa-unmeasured { border: 1px dashed var(--pa-line); border-radius: 10px; color: var(--pa-dim); font-size: 12px; line-height: 1.55; padding: 14px 16px; }

/* ── allocation bars and drill-down ─────────────────────────────────────── */

.pa-bar { background: var(--pa-line-soft); border-radius: 6px; display: flex; height: 26px; margin: 4px 0 14px; overflow: hidden; }
.pa-bar span { align-items: center; color: #fff; display: flex; font-size: 10.5px; font-weight: 700; justify-content: center; min-width: 0; overflow: hidden; }
.pa-bar span:nth-child(1) { background: #342cff; }
.pa-bar span:nth-child(2) { background: #6b63ff; }
.pa-bar span:nth-child(3) { background: #b9832b; }
.pa-bar span:nth-child(4) { background: #0a7a3d; }
.pa-bar span:nth-child(5) { background: #85838f; }
.pa-bar span.is-unseen { background: repeating-linear-gradient(45deg, #d6d1c9, #d6d1c9 5px, #e6e1da 5px, #e6e1da 10px); color: var(--pa-muted); }

.pa-tree { display: grid; gap: 2px; }
.pa-node { border-radius: 8px; }
.pa-node > button {
  align-items: center; background: none; border: 0; cursor: pointer; display: flex; gap: 10px;
  padding: 9px 10px; text-align: left; width: 100%;
}
.pa-node > button:hover { background: var(--pa-line-soft); }
.pa-node > button b { flex: 1; font-size: 13px; font-weight: 600; }
.pa-node > button em { color: var(--pa-dim); font-size: 11px; font-style: normal; }
.pa-node > button i { color: var(--pa-dim); font-size: 10px; font-style: normal; transition: transform .15s; }
.pa-node.is-open > button i { transform: rotate(90deg); }
.pa-node-children { display: none; margin-left: 14px; padding-left: 12px; border-left: 1px solid var(--pa-line-soft); }
.pa-node.is-open > .pa-node-children { display: block; }
.pa-leaf { align-items: center; display: flex; font-size: 12px; gap: 10px; padding: 6px 10px; }
.pa-leaf span { flex: 1; }
.pa-leaf em { color: var(--pa-dim); font-size: 11px; font-style: normal; }

/* ── tables ─────────────────────────────────────────────────────────────── */

.pa-table-wrap { overflow-x: auto; }
.pa-table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; width: 100%; }
.pa-table th {
  border-bottom: 1px solid var(--pa-line); color: var(--pa-dim); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; padding: 8px 10px; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.pa-table td { border-bottom: 1px solid var(--pa-line-soft); padding: 9px 10px; vertical-align: top; }
.pa-table td.pa-number, .pa-table th.pa-number { text-align: right; white-space: nowrap; }
.pa-table tr:last-child td { border-bottom: 0; }
.pa-table .is-up { color: var(--pa-green); }
.pa-table .is-down { color: var(--pa-red); }

/* PHASE 15 — the overlap matrix. */
.pa-matrix { border-collapse: collapse; font-size: 11.5px; }
.pa-matrix th, .pa-matrix td { border: 1px solid var(--pa-line-soft); padding: 7px 9px; text-align: center; }
.pa-matrix th { background: var(--pa-paper); font-size: 10px; max-width: 110px; text-align: left; }
.pa-matrix td.is-self { background: var(--pa-line-soft); color: var(--pa-dim); }
.pa-matrix td.is-high { background: var(--pa-red-soft); color: var(--pa-red); font-weight: 700; }
.pa-matrix td.is-medium { background: var(--pa-amber-soft); color: var(--pa-amber); }
.pa-matrix td.is-unmeasured { color: var(--pa-dim); font-size: 10px; }

/* ── PHASE 17 — plain-language risk, with the mathematics underneath ────── */

.pa-translation { border-bottom: 1px solid var(--pa-line-soft); padding: 13px 0; }
.pa-translation:last-child { border-bottom: 0; }
.pa-translation p { font-size: 13.5px; line-height: 1.6; margin: 0; }
.pa-translation small { color: var(--pa-dim); display: block; font-size: 10.5px; margin-top: 5px; }

/* PHASE 18 — money share against risk share, as two bars that can be compared. */
.pa-contribution { border-bottom: 1px solid var(--pa-line-soft); padding: 12px 0; }
.pa-contribution:last-child { border-bottom: 0; }
.pa-contribution-head { display: flex; font-size: 12.5px; gap: 10px; margin-bottom: 8px; }
.pa-contribution-head b { flex: 1; font-weight: 600; }
.pa-contribution-row { align-items: center; display: flex; font-size: 10.5px; gap: 8px; margin-top: 4px; }
.pa-contribution-row small { color: var(--pa-dim); flex: 0 0 56px; }
.pa-contribution-track { background: var(--pa-line-soft); border-radius: 999px; flex: 1; height: 8px; overflow: hidden; }
.pa-contribution-track i { display: block; height: 100%; }
.pa-contribution-row.is-money i { background: #b7b3c6; }
.pa-contribution-row.is-risk i { background: var(--pa-violet); }
.pa-contribution-row em { flex: 0 0 44px; font-style: normal; text-align: right; }

/* ── PHASE 19 — stress scenarios ────────────────────────────────────────── */

.pa-scenario { border-bottom: 1px solid var(--pa-line-soft); display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 0; }
.pa-scenario:last-child { border-bottom: 0; }
.pa-scenario b { flex: 1 1 200px; font-size: 13px; font-weight: 600; }
.pa-scenario span { font-size: 12.5px; white-space: nowrap; }
.pa-scenario .pa-scenario-change { color: var(--pa-red); font-weight: 700; }
.pa-scenario .pa-scenario-change.is-up { color: var(--pa-green); }
.pa-scenario small { color: var(--pa-dim); flex: 1 1 100%; font-size: 10.5px; }

/* ── PHASE 22 — portfolio versus you ────────────────────────────────────── */

.pa-fit { align-items: center; display: flex; flex-wrap: wrap; gap: 20px 40px; }
.pa-fit-sides { display: flex; flex: 1 1 300px; gap: 24px; }
.pa-fit-side small { color: var(--pa-dim); display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.pa-fit-side strong { display: block; font: 400 20px var(--font-display); margin-top: 6px; }
.pa-fit-score { text-align: center; }
.pa-fit-score strong { display: block; font: 400 44px/1 var(--font-display); letter-spacing: -.03em; }
.pa-fit-score small { color: var(--pa-dim); font-size: 11px; }

/* ── PHASE 23 — goals ───────────────────────────────────────────────────── */

.pa-goal { border-bottom: 1px solid var(--pa-line-soft); padding: 16px 0; }
.pa-goal:last-child { border-bottom: 0; }
.pa-goal-head { align-items: baseline; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pa-goal-head b { flex: 1 1 160px; font-size: 14px; }
.pa-goal-head span { font-size: 13px; }
.pa-goal-status { border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 3px 10px; }
.pa-goal-status.is-on_track { background: var(--pa-green-soft); color: var(--pa-green); }
.pa-goal-status.is-needs_attention { background: var(--pa-amber-soft); color: var(--pa-amber); }
.pa-goal-status.is-off_track { background: var(--pa-red-soft); color: var(--pa-red); }
.pa-goal-track { background: var(--pa-line-soft); border-radius: 999px; height: 6px; margin: 10px 0 8px; overflow: hidden; }
.pa-goal-track i { background: var(--pa-violet); display: block; height: 100%; }
.pa-goal-lever { background: var(--pa-violet-soft); border-radius: 9px; color: #2b23c9; font-size: 12px; line-height: 1.55; margin-top: 8px; padding: 10px 12px; }

/* ── PHASE 21 — behaviour ───────────────────────────────────────────────── */

.pa-behaviour { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
.pa-behaviour-score { border: 1px solid var(--pa-line); border-radius: 11px; padding: 14px 16px; }
.pa-behaviour-score small { color: var(--pa-dim); display: block; font-size: 11px; }
.pa-behaviour-score strong { display: block; font: 400 26px/1 var(--font-display); margin-top: 5px; }

/* ── buttons and dialog ─────────────────────────────────────────────────── */

.pa-primary { background: var(--pa-ink); border: 0; border-radius: 9px; color: #fff; cursor: pointer; font-size: 13px; font-weight: 700; min-height: 40px; padding: 0 20px; }
.pa-primary:hover { background: var(--pa-violet); }
.pa-ghost { background: none; border: 1px solid var(--pa-line); border-radius: 9px; color: var(--pa-ink); cursor: pointer; font-size: 13px; font-weight: 700; min-height: 40px; padding: 0 18px; }
.pa-ghost:hover { border-color: #c9c2ff; color: var(--pa-violet); }

/* ── the modal ──────────────────────────────────────────────────────────── */

/* Every property here is stated rather than inherited. A dialog sits in the
   browser's top layer, outside the page's own stacking and cascade, so
   anything it is assumed to pick up from an ancestor it will not have. */
.pa-dialog {
  background: var(--pa-card);
  border: 1px solid var(--pa-line);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(20, 14, 6, .28);
  color: var(--pa-ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  margin: auto;
  max-height: min(88vh, 900px);
  max-width: min(720px, 94vw);
  overflow: hidden;
  padding: 0;
  width: 100%;
}
/* A dialog opened with `showModal()` is centred by the browser; one that falls
   back to `open` is not, so it is centred here too and the page behind it is
   dimmed either way. */
.pa-dialog[open] { display: flex; }
.pa-dialog::backdrop { background: rgba(8, 11, 26, .55); }

.pa-dialog > form { display: flex; flex-direction: column; max-height: inherit; min-height: 0; width: 100%; }
.pa-dialog header {
  align-items: center; background: var(--pa-card); border-bottom: 1px solid var(--pa-line);
  display: flex; flex: 0 0 auto; gap: 12px; padding: 20px 26px;
}
.pa-dialog header h3 { flex: 1; font: 400 20px/1.25 var(--font-display); letter-spacing: -.02em; margin: 0; }
.pa-dialog header button {
  background: var(--pa-line-soft); border: 0; border-radius: 8px; color: var(--pa-muted); cursor: pointer;
  font-size: 20px; height: 32px; line-height: 1; padding: 0; width: 32px;
}
.pa-dialog header button:hover { background: var(--pa-line); color: var(--pa-ink); }
/* The scrolling region, and the only one. */
.pa-dialog > form > div { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 26px; }
.pa-dialog footer {
  background: var(--pa-card); border-top: 1px solid var(--pa-line); display: flex; flex: 0 0 auto;
  gap: 10px; justify-content: flex-end; padding: 18px 26px;
}
.pa-dialog p { color: var(--pa-muted); font-size: 13px; line-height: 1.65; margin: 0 0 16px; }
.pa-dialog h4 { font: 400 15px var(--font-display); margin: 22px 0 10px; }
.pa-dialog h4:first-child { margin-top: 0; }
.pa-field { display: grid; gap: 4px; margin-bottom: 12px; }
.pa-field label { color: var(--pa-dim); font-size: 11px; }
.pa-field input, .pa-field select { background: var(--pa-paper); border: 1px solid var(--pa-line); border-radius: 8px; font: 13px var(--font-body); outline: 0; padding: 10px 12px; }
.pa-field input:focus, .pa-field select:focus { border-color: #9d8ae5; }
/* ── the import modal ───────────────────────────────────────────────────── */

/* The one requirement is the group, not any single slot: an investor whose
   wealth is a deposit, a PPF balance and some gold has a real portfolio and no
   statement to export. */
.pa-dialog-requirement {
  background: var(--pa-violet-soft); border: 1px solid #ddd7ff; border-radius: 12px;
  margin-bottom: 20px; padding: 14px 16px;
}
.pa-dialog-requirement b { color: #2b23c9; display: block; font-size: 13.5px; }
.pa-dialog-requirement span { color: #4a4370; display: block; font-size: 12.5px; line-height: 1.6; margin-top: 4px; }
.pa-dialog-requirement.is-error { background: var(--pa-red-soft); border-color: #f3c9c7; }
.pa-dialog-requirement.is-error b { color: var(--pa-red); }
.pa-dialog-requirement.is-error span { color: #8a3532; }

/* Slots, visibly unequal. The portfolio is the requirement and everything else
   is an upgrade, and the styling says so before the labels do. */
.pa-upload-slot {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px;
  margin-bottom: 14px; padding: 18px 20px;
}
.pa-upload-slot[data-slot="portfolio"] { border-color: #d8d2ca; box-shadow: var(--pa-shadow); }
.pa-upload-slot[data-slot="transactions"] { background: var(--pa-violet-soft); border-color: #ddd7ff; }
.pa-upload-head b { align-items: center; display: flex; flex-wrap: wrap; font-size: 15px; font-weight: 700; gap: 9px; }
.pa-upload-head span { color: var(--pa-muted); display: block; font-size: 12.5px; line-height: 1.6; margin: 5px 0 12px; }
.pa-required, .pa-optional {
  border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 700;
  letter-spacing: .1em; padding: 4px 9px; text-transform: uppercase; white-space: nowrap;
}
.pa-required { background: var(--pa-red-soft); color: var(--pa-red); }
.pa-optional { background: var(--pa-card); border: 1px solid #c9c2ff; color: var(--pa-violet); }

/* A styled file control. The native one renders as an unlabelled grey button
   whose text the page cannot size or colour, which is most of what made the
   modal unreadable. */
.pa-file {
  align-items: center; background: var(--pa-paper); border: 1px dashed #cfc8bf; border-radius: 10px;
  color: var(--pa-muted); cursor: pointer; display: flex; font-size: 13px; gap: 10px; padding: 12px 14px;
  transition: border-color .15s, background .15s;
}
.pa-file:hover { background: var(--pa-card); border-color: var(--pa-violet); color: var(--pa-ink); }
.pa-file input[type="file"] {
  height: 100%; left: 0; opacity: 0; position: absolute; top: 0; width: 100%; cursor: pointer;
}
.pa-file-wrap { position: relative; }
.pa-file b { color: var(--pa-ink); font-size: 13px; font-weight: 700; }
.pa-file svg { color: var(--pa-violet); fill: none; flex: 0 0 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; width: 18px; }
.pa-upload-chosen { color: var(--pa-green); font-size: 12.5px; font-weight: 600; margin-top: 10px; word-break: break-word; }
.pa-required-error { color: var(--pa-red); font-weight: 600; }
.pa-upload-unlocks { color: #3c357a; font-size: 12.5px; line-height: 1.7; margin: 14px 0 0; padding-left: 20px; }

/* ── other investments ──────────────────────────────────────────────────── */

/* The things no statement carries. An Indian investor's real portfolio includes
   a PPF balance, an EPF balance, a deposit and some gold, and a portfolio
   analysis that silently omits them is analysing a fraction of their money. */
.pa-other-row {
  align-items: start; display: grid; gap: 10px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  margin-bottom: 10px;
}
.pa-other-row select, .pa-other-row input {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 9px; color: var(--pa-ink);
  font: 13.5px var(--font-body); outline: 0; padding: 11px 12px; width: 100%;
}
.pa-other-row select:focus, .pa-other-row input:focus { border-color: #9d8ae5; box-shadow: 0 0 0 3px rgba(99, 56, 238, .09); }
.pa-other-row input::placeholder { color: #9b98a6; }
.pa-other-remove {
  background: none; border: 1px solid var(--pa-line); border-radius: 9px; color: var(--pa-dim);
  cursor: pointer; font-size: 16px; height: 42px; line-height: 1; width: 42px;
}
.pa-other-remove:hover { border-color: var(--pa-red); color: var(--pa-red); }
.pa-other-total {
  border-top: 1px solid var(--pa-line-soft); color: var(--pa-muted); display: flex; font-size: 13px;
  justify-content: space-between; margin-top: 12px; padding-top: 12px;
}
.pa-other-total b { color: var(--pa-ink); }

@media (max-width: 560px) {
  .pa-other-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pa-other-row select { grid-column: 1 / -1; }
}
.pa-dialog-notice { background: var(--pa-amber-soft); border-radius: 10px; color: var(--pa-amber); font-size: 13px; line-height: 1.6; margin-bottom: 16px; padding: 12px 14px; }
.pa-dialog-fineprint { border-top: 1px solid var(--pa-line-soft); color: var(--pa-dim); font-size: 12px; line-height: 1.6; margin: 18px 0 0; padding-top: 14px; }
.pa-dialog .pa-ghost, .pa-dialog .pa-primary { min-height: 44px; }

/* Guided statement import — composed to match the focused, three-step handoff. */
.pa-dialog.is-statement-import { max-height: min(96vh, 984px); max-width: min(620px, 94vw); }
.pa-dialog.is-statement-guide { max-height: min(92vh, 914px); max-width: min(614px, 94vw); }
.pa-dialog.is-statement-import, .pa-dialog.is-statement-guide { font-family: var(--font-body); letter-spacing: 0; }
.pa-dialog.is-statement-import header, .pa-dialog.is-statement-guide header { border: 0; padding: 16px 20px 0; position: absolute; right: 0; z-index: 2; }
.pa-dialog.is-statement-import header h3, .pa-dialog.is-statement-guide header h3 { display: none; }
.pa-dialog.is-statement-import > form > div { padding: 27px 40px 8px; }
.pa-dialog.is-statement-guide > form > div { padding: 24px 30px 10px; }
.pa-dialog.is-statement-import footer, .pa-dialog.is-statement-guide footer { padding: 17px 32px 20px; }
.pa-dialog.is-statement-import footer .pa-ghost, .pa-dialog.is-statement-guide footer .pa-ghost { display: none; }
.pa-dialog.is-statement-import footer::before { color: #68738b; content: '🛡  Your files are processed securely and used only to analyse your portfolio.'; font-size: 9px; margin-right: auto; max-width: 350px; }
.pa-dialog.is-statement-import footer .pa-primary, .pa-dialog.is-statement-guide footer .pa-primary {
  background: #080b18; border: 1px solid #c7973b; border-radius: 10px; box-shadow: 0 8px 18px rgba(8,25,51,.15);
  color: #fff; font: 500 13px var(--font-body); letter-spacing: 0; min-height: 52px; padding: 0 26px;
  transition: box-shadow .25s ease, transform .25s ease;
}
.pa-dialog.is-statement-import footer .pa-primary { min-width: 136px; }
.pa-dialog.is-statement-guide footer .pa-primary { width: 100%; }
.pa-dialog.is-statement-import footer .pa-primary::after { color: #d2a03d; content: '⟶'; font-size: 19px; margin-left: 13px; vertical-align: -1px; }
.pa-dialog.is-statement-guide footer .pa-primary::after { color: #d2a03d; content: '↗'; font-size: 17px; margin-left: 13px; }
.pa-dialog.is-statement-import footer .pa-primary:hover, .pa-dialog.is-statement-guide footer .pa-primary:hover { background: #080b18; box-shadow: 0 10px 22px rgba(8,25,51,.2); transform: translateY(-1px); }
.pa-dialog.is-statement-import footer .pa-primary:active, .pa-dialog.is-statement-guide footer .pa-primary:active { box-shadow: 0 5px 12px rgba(8,25,51,.14); transform: translateY(1px); }
.pa-import-intro h3 { color: #07152f; font: 600 35px/1 var(--font-display); letter-spacing: -.04em; margin: 8px 0 10px; }
.pa-import-intro h3 > span { display: block; }
.pa-import-intro h3 .pa-import-title-second-line { margin-top: 8px; }
.pa-import-intro h3 b { color: #080b18; font-weight: inherit; }
.pa-import-intro h3 em { color: #e48a13; font-style: normal; }
.pa-import-intro p, .pa-import-section > p { color: #63708a; font: 400 13px/1.52 var(--font-body); margin: 0; }
.pa-import-eyebrow { color: #e48a13; font-size: 8px; font-weight: 800; letter-spacing: .2em; }
.pa-import-section { border-bottom: 1px solid #e5e8ee; padding: 14px 0; }
.pa-import-section h4 { color: #07152f; font: 700 15px/1.3 var(--font-body); letter-spacing: -.01em; margin: 0 0 5px; }
.pa-import-section h4 > span { color: #ed8b00; }
.pa-provider-grid { display: grid; gap: 10px; grid-template-columns: repeat(4,1fr); margin: 10px 0; }
.pa-provider-card { align-items: center; background: #fff; border: 1px solid #dfe3ea; border-radius: 8px; color: #07152f; cursor: pointer; display: flex; flex-direction: column; min-height: 127px; padding: 14px 8px 9px; position: relative; }
.pa-provider-card.is-selected { background: #fffaf1; border-color: #ed920c; }
.pa-provider-card b { font: 700 12px/1.25 var(--font-body); margin-top: 7px; }
.pa-provider-card small { font: 500 9px/1.25 var(--font-body); }
.pa-provider-logo { align-items: center; background: #f5f7fa; border-radius: 6px; display: inline-flex; height: 39px; justify-content: center; overflow: hidden; width: 39px; }
.pa-provider-logo svg { display: block; height: 34px; width: 34px; }
.pa-provider-logo.is-zerodha .kite-tile { fill: #f7faff; stroke: #dfe8f3; }
.pa-provider-logo.is-zerodha .kite-face { fill: #0877ef; }
.pa-provider-logo.is-zerodha .kite-fold { fill: #73b7ff; }
.pa-provider-logo.is-groww { background: #fff; border-radius: 50%; }
.pa-provider-logo.is-groww .groww-base { fill: #fff; }
.pa-provider-logo.is-groww .groww-blue { fill: #5367e8; }
.pa-provider-logo.is-groww .groww-green { fill: #21c7a8; }
.pa-provider-logo.is-angelone { background: #fff; }
.pa-provider-logo.is-angelone .angel-green { fill: #079b61; }
.pa-provider-logo.is-angelone .angel-orange, .pa-provider-logo.is-angelone circle { fill: #ff7a21; }
.pa-provider-logo.is-cas { color: #697386; }
.pa-provider-logo.is-cas svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.pa-provider-card .pa-guide-info { bottom: 10px; position: absolute; }
.pa-guide-info { align-items: center; background: #fff; border: 1px solid #697386; border-radius: 50%; color: #697386; cursor: pointer; display: inline-flex; font: 700 10px/1 var(--font-body); height: 19px; justify-content: center; padding: 0; width: 19px; }
.pa-integration-notice { align-items: center; background: #fff8ed; border-radius: 8px; color: #596780; display: flex; gap: 13px; padding: 12px 14px; }
.pa-integration-notice > i { align-items: center; background: #e9941b; border-radius: 50%; color: #fff; display: flex; flex: 0 0 26px; font-style: normal; height: 26px; justify-content: center; }
.pa-integration-notice span, .pa-integration-notice b { display: block; font-size: 11px; }
.pa-integration-notice b { color: #07152f; margin-bottom: 1px; }
.pa-provider-download { align-items: center; background: #fffaf1; border: 1px solid #f0dfc6; border-radius: 7px; color: #07152f; display: flex; gap: 14px; margin-top: 10px; min-height: 51px; padding: 8px 14px; text-decoration: none; }
.pa-provider-download .pa-provider-logo { height: 27px; width: 27px; }
.pa-provider-download b { font-size: 12px; }
.pa-provider-download > span:last-child { font-size: 24px; margin-left: auto; }
.pa-compact-upload-grid { display: grid; gap: 10px; grid-template-columns: repeat(3,1fr); margin-top: 10px; }
.pa-compact-upload { border: 1px solid #dfe3ea; border-radius: 8px; display: grid; gap: 5px; grid-template-columns: 28px 1fr auto; min-height: 130px; padding: 10px; position: relative; }
.pa-compact-upload input { inset: 55px 9px 9px; opacity: 0; position: absolute; width: calc(100% - 18px); }
.pa-upload-type-icon { color: #f29400; }
.pa-upload-type-icon svg { fill: none; height: 25px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 25px; }
.pa-upload-type-icon svg path:first-child { fill: rgba(242,148,0,.05); }
.pa-compact-upload-copy b, .pa-compact-upload-copy small { display: block; }
.pa-compact-upload-copy b { color: #07152f; font-size: 10px; line-height: 1.25; }
.pa-compact-upload-copy small { color: #697386; font-size: 8px; }
.pa-upload-file-button {
  align-items: center; align-self: center; background: #080b18; border: 1px solid #c7973b; border-radius: 8px;
  box-shadow: 0 8px 18px rgba(8,25,51,.15); color: #fff; cursor: pointer; display: flex;
  font: 500 11px var(--font-body); gap: 7px; grid-column: 1 / -1; justify-content: center; min-height: 40px; width: 100%;
  transition: box-shadow .25s ease, transform .25s ease;
}
.pa-upload-file-button svg { fill: none; height: 15px; stroke: #d2a03d; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 15px; }
.pa-compact-upload:hover .pa-upload-file-button { box-shadow: 0 10px 22px rgba(8,25,51,.2); transform: translateY(-1px); }
.pa-compact-upload:active .pa-upload-file-button { box-shadow: 0 5px 12px rgba(8,25,51,.14); transform: translateY(1px); }
.pa-upload-chosen { font-size: 8px; grid-column: 1 / -1; margin: 0; }
.pa-other-toggle { align-items: center; color: #263550; display: flex; font-size: 11px; gap: 6px; margin-top: 10px; }
.pa-other-toggle input { accent-color: #ed920c; }
.pa-other-toggle i { border: 1px solid #78849a; border-radius: 50%; font-size: 8px; font-style: normal; text-align: center; width: 14px; }
.pa-other-box { background: #f5f7fa; border: 1px solid #e2e5eb; border-radius: 7px; margin-top: 7px; padding: 10px 12px; }
.pa-other-box .pa-other-row { grid-template-columns: 175px minmax(0,1fr) 28px; margin-bottom: 7px; }
.pa-other-box .pa-other-row select, .pa-other-box .pa-other-row input { background: #fff; font-size: 10px; height: 30px; padding: 5px 9px; }
.pa-other-amount { align-items: center; display: grid; grid-template-columns: 34px 1fr; }
.pa-other-amount i { align-items: center; background: #fff; border: 1px solid var(--pa-line); border-radius: 7px 0 0 7px; color: #65718a; display: flex; font-size: 10px; font-style: normal; height: 30px; justify-content: center; }
.pa-other-amount input { border-radius: 0 7px 7px 0 !important; border-left: 0 !important; }
.pa-other-box .pa-other-remove { border: 0; height: 30px; width: 28px; }
.pa-other-add-link { background: none; border: 0; color: #263550; cursor: pointer; font-size: 9px; }
.pa-secure-note { display: none; }
.pa-guide-top { height: 32px; }
.pa-guide-back { background: none; border: 0; color: #07152f; cursor: pointer; font: 700 12px var(--font-body); padding: 0; }
.pa-guide-heading { align-items: start; display: flex; gap: 18px; margin: 8px 0 28px; }
.pa-guide-heading h3 { color: #07152f; font: 700 20px/1.25 var(--font-display); letter-spacing: -.025em; margin: 0 0 6px; }
.pa-guide-heading p { color: #68758e; font: 400 12px/1.55 var(--font-body); margin: 0; }
.pa-guide-tabs { background: #f7f8fa; border: 1px solid #e7e9ed; border-radius: 8px; display: grid; grid-template-columns: repeat(3,1fr); margin-bottom: 26px; overflow: hidden; }
.pa-guide-tabs button { background: none; border: 0; color: #526079; cursor: pointer; font: 600 11px var(--font-body); padding: 15px 8px; }
.pa-guide-tabs button.is-active { background: #fff8ed; border-bottom: 2px solid #ed920c; color: #07152f; }
.pa-guide-steps { counter-reset: guide; display: grid; gap: 14px; list-style: none; margin: 0; padding: 0 0 0 14px; }
.pa-guide-steps li { align-items: center; counter-increment: guide; display: grid; gap: 18px; grid-template-columns: 48px minmax(0,1fr) 190px; min-height: 82px; }
.pa-guide-steps li::before { align-items: center; background: #fff4e2; border-radius: 50%; color: #ed920c; content: '0' counter(guide); display: flex; font-size: 14px; font-weight: 700; height: 48px; justify-content: center; width: 48px; }
.pa-guide-steps li span b, .pa-guide-steps li span small { display: block; }
.pa-guide-steps li span b { color: #07152f; font-size: 13px; }
.pa-guide-steps li span small { color: #6b7790; font-size: 12px; line-height: 1.45; margin-top: 4px; }
.pa-guide-steps li:last-child > span { grid-column: 2 / -1; max-width: 270px; }
.pa-step-preview { align-items: center; background: #fbfcfd; border: 1px solid #e1e5eb; border-radius: 8px; color: #0877ef; display: flex; flex-direction: column; font-size: 10px; font-style: normal; gap: 7px; justify-content: center; min-height: 84px; overflow: hidden; padding: 8px 12px; }
.pa-platform-wordmark { align-items: center; display: flex; gap: 5px; }
.pa-platform-wordmark .pa-provider-logo { background: transparent; height: 17px; width: 17px; }
.pa-platform-wordmark .pa-provider-logo svg { height: 17px; width: 17px; }
.pa-platform-wordmark b { color: #0877ef; font-size: 13px; }
.pa-platform-wordmark.is-groww b { color: #5367e8; }
.pa-platform-wordmark.is-angelone b { color: #15213a; }
.pa-platform-wordmark.is-cas b { color: #177a6b; }
.pa-step-preview > button { background: #0877ef; border: 0; border-radius: 3px; color: #fff; font: 500 9px var(--font-body); min-width: 88px; padding: 6px 12px; }
.pa-step-preview.is-groww > button { background: #00b386; }
.pa-step-preview.is-angelone > button { background: #ee5a24; }
.pa-step-preview.is-cas > button { background: #177a6b; }
.pa-preview-menu { align-self: stretch; display: grid; margin: -8px -12px; text-align: left; }
.pa-preview-menu b, .pa-preview-menu em { color: #263550; font-size: 8px; font-style: normal; font-weight: 500; padding: 4px 18px; }
.pa-preview-menu em.is-active { background: #e4f2ff; color: #0877ef; }
.pa-step-preview.is-groww .pa-preview-menu em.is-active { background: #e6faf5; color: #008f6c; }
.pa-step-preview.is-angelone .pa-preview-menu em.is-active { background: #fff0e9; color: #d84d17; }
.pa-step-preview.is-cas .pa-preview-menu em.is-active { background: #e8f5f2; color: #177a6b; }
.pa-preview-date { align-self: stretch; color: #526079; display: grid; gap: 5px; text-align: left; }
.pa-preview-date small, .pa-preview-download small { font-size: 8px; }
.pa-preview-date b { align-items: center; border: 1px solid #dfe3ea; border-radius: 4px; color: #07152f; display: flex; font-size: 9px; justify-content: space-between; padding: 6px 8px; }
.pa-preview-date svg { fill: none; height: 12px; stroke: #07152f; stroke-width: 1.5; width: 12px; }
.pa-preview-download { align-self: stretch; color: #526079; display: grid; gap: 7px; text-align: left; }
.pa-preview-download > span { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.pa-preview-download b, .pa-preview-download em { border: 1px solid #dfe3ea; border-radius: 4px; color: #07152f; font-size: 9px; font-style: normal; font-weight: 600; padding: 7px; text-align: center; }
.pa-preview-download b { background: #0877ef; border-color: #0877ef; color: #fff; }
.pa-step-preview.is-groww .pa-preview-download b { background: #00b386; border-color: #00b386; }
.pa-step-preview.is-angelone .pa-preview-download b { background: #ee5a24; border-color: #ee5a24; }
.pa-step-preview.is-cas .pa-preview-download b { background: #177a6b; border-color: #177a6b; }

@media (max-width: 600px) {
  .pa-dialog.is-statement-import > form > div, .pa-dialog.is-statement-guide > form > div { padding-left: 18px; padding-right: 18px; }
  .pa-provider-grid { grid-template-columns: repeat(2,1fr); }
  .pa-compact-upload-grid { grid-template-columns: 1fr; }
  .pa-guide-steps { padding-left: 0; }
  .pa-guide-steps li { grid-template-columns: 42px 1fr; }
  .pa-guide-steps li > i { display: none; }
  .pa-dialog.is-statement-import footer::before { display: none; }
}

/* ── sign-in gates ──────────────────────────────────────────────────────── */

/* A gate states what is on the other side. One that only says "sign in" is a
   wall; one that names what it unlocks is an offer. */
.pa-gate { border-left: 3px solid var(--pa-violet); }
.pa-gate-promise { color: var(--pa-muted); font-size: 13.5px; line-height: 1.65; margin: 0 0 12px; }
.pa-gate-points { color: var(--pa-muted); font-size: 12.5px; line-height: 1.7; margin: 0 0 18px; padding-left: 20px; }
.pa-gate-points li { margin-bottom: 4px; }
.pa-gate-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.pa-gate-actions a.pa-primary, .pa-gate-actions a.pa-ghost { align-items: center; display: inline-flex; text-decoration: none; }

@media (max-width: 720px) {
  .pa-header-figures { gap: 16px 28px; }
  .pa-fit-sides { flex-direction: column; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .pa-source, .pa-node > button i { transition: none; }
}

/* ══ VestFolio — the five layers ══════════════════════════════════════════

   A briefing, not a brokerage dashboard. Three devices carry it:

     materiality is a quiet mark, never a red alert — ink for high, gold for
     medium, grey for low, green for what is working;
     a dashed outline is anything the analysis could not measure;
     the sheet opens over the page, so depth never costs the investor their
     place. */

.vf { --vf-bar-height: 58px; }
.sr-only { clip: rect(0, 0, 0, 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

/* Figures, shared by Explore and the sheet. */
.pa-header-figures { display: flex; flex-wrap: wrap; gap: 14px clamp(24px, 5vw, 56px); margin-bottom: 12px; }
.pa-figure small { color: var(--pa-dim); display: block; font-size: 10px; letter-spacing: .16em; margin-bottom: 6px; text-transform: uppercase; }
.pa-figure strong { display: block; font: 400 clamp(24px, 3vw, 32px)/1 var(--font-display); letter-spacing: -.03em; }
.pa-figure em { color: var(--pa-dim); display: block; font-size: 11px; font-style: normal; margin-top: 5px; }
.pa-figure.is-up strong { color: var(--pa-green); }
.pa-figure.is-down strong { color: var(--pa-red); }
.pa-score-bar { background: var(--pa-line-soft); border-radius: 999px; height: 4px; margin: 8px 0 6px; overflow: hidden; }
.pa-score-bar i { background: var(--pa-violet); display: block; height: 100%; }
.pa-score-driver { display: flex; font-size: 11.5px; gap: 8px; line-height: 1.5; padding: 3px 0; }
.pa-score-driver span { color: var(--pa-muted); flex: 1; }
.pa-score-driver.is-up span::before { color: var(--pa-green); content: '+ '; font-weight: 700; }
.pa-score-driver.is-down span::before { color: var(--pa-amber); content: '− '; font-weight: 700; }
.pa-observation-detail { color: var(--pa-muted); font-size: 12.5px; line-height: 1.6; margin: 10px 0; }
.pa-observation-impact { color: var(--pa-dim); font-size: 11px; margin-top: 8px; }
.pa-table td small { color: var(--pa-dim); display: block; font-size: 11px; margin-top: 2px; }
.pa-card h3, .vf-more-body h3, .vf-sheet-body h3 { font: 400 15px var(--font-display); margin: 18px 0 8px; }

/* ── the context bar ─────────────────────────────────────────────────────── */

.vf-bar {
  background: rgba(250, 248, 245, .94); border-bottom: 1px solid var(--pa-line);
  margin: 0 calc(clamp(16px, 4vw, 44px) * -1); padding: 0 clamp(16px, 4vw, 44px);
  position: sticky; top: var(--pa-menu-height); z-index: 15;
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
}
.vf-bar-inner { align-items: center; display: flex; gap: 14px; min-height: var(--vf-bar-height); }
.vf-bar-home {
  align-items: baseline; background: none; border: 0; color: var(--pa-ink); cursor: pointer; display: flex;
  flex: 1 1 auto; gap: 12px; min-width: 0; padding: 6px 0; text-align: left;
}
.vf-bar-mark { font: 400 16px var(--font-display); white-space: nowrap; }
.vf-bar-mark b { color: var(--pa-violet); font-weight: 400; }
.vf-bar-context { display: flex; gap: 8px; min-width: 0; overflow: hidden; }
.vf-bar-context b { font-size: 13px; white-space: nowrap; }
.vf-bar-context span { color: var(--pa-dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vf-nav { display: flex; gap: 2px; }
.vf-nav button {
  align-items: center; background: none; border: 0; border-radius: 9px; color: var(--pa-muted); cursor: pointer;
  display: flex; font-size: 13px; font-weight: 700; gap: 7px; min-height: 40px; padding: 0 14px; white-space: nowrap;
}
.vf-nav button svg { fill: none; height: 17px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 17px; }
.vf-nav button:hover { color: var(--pa-ink); }
.vf-nav button.is-active { background: var(--pa-ink); color: #fff; }

.vf-tools { display: flex; gap: 6px; }
.vf-tool {
  align-items: center; background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 999px; color: var(--pa-ink);
  cursor: pointer; display: inline-flex; font-size: 12.5px; font-weight: 700; gap: 7px; justify-content: center; min-height: 38px; min-width: 38px; padding: 0 10px;
}
.vf-tool svg { fill: none; height: 17px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 17px; }
.vf-tool:hover { border-color: #c9c2ff; color: var(--pa-violet); }
.vf-tool.is-ask { background: var(--pa-violet-soft); border-color: #ddd7ff; color: #2b23c9; padding: 0 14px; }

.vf-view { padding: 30px 0 10px; }
.vf-view:focus { outline: 0; }

/* ── LAYER 1 — VestFolio Pulse ───────────────────────────────────────────── */

.vf-kicker { color: var(--pa-dim); font-size: 10.5px; font-weight: 700; letter-spacing: .22em; margin: 0 0 8px; text-transform: uppercase; }
.vf-kicker b { color: var(--pa-violet); }
.vf-pulse-head h1, .vf-view-head h1 { font: 400 clamp(30px, 4.4vw, 46px)/1.05 var(--font-display); letter-spacing: -.035em; margin: 0; }
.vf-pulse-sub, .vf-view-head p { color: var(--pa-muted); font-size: 13px; line-height: 1.6; margin: 10px 0 0; }
.vf-notice { background: var(--pa-gold-soft); border: 1px solid #f0dcb8; border-radius: 12px; color: #6f4a0f; font-size: 12.5px; line-height: 1.6; margin: 12px 0 0; padding: 10px 14px; }
.vf-changes { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 999px; display: inline-block; font-size: 12px; margin: 12px 0 0; padding: 6px 14px; }

.vf-pulse { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); margin-top: 24px; }
.vf-card {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 18px; box-shadow: var(--pa-shadow);
  display: flex; flex-direction: column; padding: 24px clamp(20px, 2.6vw, 28px);
}
.vf-card > small, .vf-next small, .vf-question > small, .vf-related > small, .vf-accounts > small {
  color: var(--pa-dim); display: block; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.vf-big { display: block; font: 400 clamp(34px, 4.6vw, 48px)/1 var(--font-display); letter-spacing: -.04em; margin: 10px 0 6px; }
.vf-big span { color: var(--pa-dim); font-size: .45em; letter-spacing: 0; margin-left: 2px; }
.vf-gain { align-items: baseline; display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 0; }
.vf-gain b { font: 400 22px var(--font-display); }
.vf-gain span { color: var(--pa-dim); font-size: 12px; }
.vf-gain.is-up b { color: var(--pa-green); }
.vf-gain.is-down b { color: var(--pa-red); }
.vf-note { color: var(--pa-muted); font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
.vf-goals-line { align-items: center; border-top: 1px solid var(--pa-line-soft); display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 14px; }
.vf-goals-line { margin-top: 18px; }
.vf-goals-line small { color: var(--pa-dim); font-size: 10px; font-weight: 700; letter-spacing: .16em; margin-right: 4px; text-transform: uppercase; }
.vf-goal-chip { background: var(--pa-paper); border: 1px solid var(--pa-line); border-radius: 999px; color: var(--pa-ink); cursor: pointer; font-size: 11.5px; min-height: 30px; padding: 0 12px; }
.vf-goal-chip.is-on_track { background: var(--pa-green-soft); border-color: #cde9d6; color: var(--pa-green); }
.vf-goal-chip.is-needs_attention, .vf-goal-chip.is-off_track { background: var(--pa-gold-soft); border-color: #f0dcb8; color: #8a5a10; }
.vf-goal-chip.is-unknown { border-style: dashed; color: var(--pa-violet); }

.vf-structure-text { font-size: 14px; line-height: 1.5; margin: 2px 0 10px; }
.vf-drivers { display: grid; gap: 4px; list-style: none; margin: 0 0 10px; padding: 0; }
.vf-drivers li { color: var(--pa-muted); font-size: 12px; line-height: 1.5; padding-left: 16px; position: relative; }
.vf-drivers li::before { font-weight: 700; left: 0; position: absolute; }
.vf-drivers li.is-up::before { color: var(--pa-green); content: '+'; }
.vf-drivers li.is-down::before { color: var(--pa-amber); content: '−'; }
.vf-drivers b { color: var(--pa-ink); font-weight: 600; }
.vf-confidence { border-radius: 12px; display: grid; font-size: 12px; gap: 3px; line-height: 1.55; margin-top: auto; padding: 12px 14px; }
.vf-structure .vf-confidence { margin-top: 14px; }
.vf-confidence b { font-size: 12.5px; }
.vf-confidence span { color: var(--pa-muted); }
.vf-confidence.is-high { background: var(--pa-green-soft); }
.vf-confidence.is-moderate { background: var(--pa-gold-soft); }
.vf-confidence.is-limited { background: var(--pa-paper); border: 1px dashed #cfc8bf; }

.vf-link { background: none; border: 0; color: var(--pa-violet); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 0; text-align: left; }
.vf-link:hover { text-decoration: underline; }
.vf-fine { color: var(--pa-dim); font-size: 11.5px; line-height: 1.55; margin: 10px 0 0; }
.vf-boundary { margin-top: 26px; text-align: center; }

.vf-attention { margin-top: 30px; }
.vf-attention > header { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; margin-bottom: 12px; }
.vf-attention h2, .vf-next h2, .vf-question h2, .vf-answer h2 { font: 400 clamp(20px, 2.4vw, 24px)/1.25 var(--font-display); letter-spacing: -.02em; margin: 0; }
.vf-findings { display: grid; gap: 8px; }

/* A finding is one tappable sentence. Materiality is a mark, not a colour
   wash, because severity should read as a judgement, not as an alarm. */
.vf-finding {
  align-items: center; background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; color: var(--pa-ink);
  cursor: pointer; display: flex; gap: 14px; padding: 16px 18px; text-align: left; width: 100%;
}
.vf-finding:hover { border-color: #c9c2ff; box-shadow: var(--pa-shadow); }
.vf-finding-mark { background: var(--pa-dim); border-radius: 50%; flex: 0 0 10px; height: 10px; }
.vf-finding[data-materiality="High"] .vf-finding-mark { background: var(--pa-ink); }
.vf-finding[data-materiality="Medium"] .vf-finding-mark { background: var(--pa-gold); }
.vf-finding.is-good .vf-finding-mark { background: var(--pa-green); }
.vf-finding-copy { display: grid; flex: 1; gap: 3px; min-width: 0; }
.vf-finding-copy b { font-size: 14.5px; line-height: 1.35; }
.vf-finding-copy span { color: var(--pa-muted); font-size: 12.5px; line-height: 1.55; }
.vf-finding-copy small { color: var(--pa-dim); font-size: 11px; margin-top: 2px; }
.vf-finding > i { color: var(--pa-dim); font-size: 22px; font-style: normal; line-height: 1; }
.vf-finding.is-compact { padding: 12px 14px; }
.vf-finding.is-compact .vf-finding-copy b { font-size: 13.5px; }
.vf-clear { background: var(--pa-green-soft); border-radius: 14px; display: grid; gap: 4px; padding: 18px 20px; }
.vf-clear b { font-size: 14.5px; }
.vf-clear span { color: var(--pa-muted); font-size: 12.5px; line-height: 1.6; }

.vf-question {
  background: var(--pa-violet-soft); border: 1px solid #ddd7ff; border-radius: 18px; margin-top: 18px; padding: 22px clamp(20px, 2.6vw, 28px);
}
.pa-card .vf-question { background: none; border: 0; margin: 0; padding: 0; }
.vf-question > small { color: #4a4370; }
.vf-question h2 { margin-top: 6px; }
.vf-question > p { color: #4a4370; font-size: 12.5px; line-height: 1.6; margin: 8px 0 14px; max-width: 70ch; }
.vf-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.vf-options button {
  background: var(--pa-card); border: 1px solid #c9c2ff; border-radius: 999px; color: #2b23c9; cursor: pointer;
  font-size: 12.5px; font-weight: 700; min-height: 40px; padding: 0 16px;
}
.vf-options button:hover { background: #2b23c9; color: #fff; }
.vf-inline-form, .vf-goal-form { align-items: end; display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
.vf-inline-form label, .vf-goal-form label { display: grid; flex: 1 1 160px; gap: 4px; }
.vf-inline-form span, .vf-goal-form span { color: var(--pa-dim); font-size: 11px; }
.vf-inline-form input, .vf-goal-form input {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 9px; font: 14px var(--font-body); min-height: 42px; outline: 0; padding: 0 12px;
}
.vf-inline-form input:focus, .vf-goal-form input:focus { border-color: #9d8ae5; }

.vf-next {
  align-items: center; background: var(--pa-ink); border-radius: 18px; color: #fff; display: flex; flex-wrap: wrap;
  gap: 16px 24px; justify-content: space-between; margin-top: 18px; padding: 22px clamp(20px, 2.6vw, 28px);
}
.vf-next > div { flex: 1 1 320px; }
.vf-next small { color: rgba(255, 255, 255, .6); }
.vf-next h2 { margin-top: 6px; }
.vf-next p { color: rgba(255, 255, 255, .72); font-size: 12.5px; line-height: 1.6; margin: 6px 0 0; }
.vf-next .pa-primary { background: #fff; color: var(--pa-ink); }
.vf-next .pa-primary:hover { background: var(--pa-violet-soft); }

/* ── the top two cards ─────────────────────────────────────────────────── */

.vf-top { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); margin-bottom: 30px; }
.vf-found { border-left: 3px solid var(--pa-violet); }
.vf-rebalance { border-left: 3px solid #e58408; }
.vf-top .vf-card { padding-bottom: 18px; position: relative; }
.vf-top .vf-big { margin-bottom: 12px; }
/* Four lines, each held to one line; the rest is behind the "…". */
.vf-card-lines { border-top: 1px solid var(--pa-line-soft); display: grid; gap: 7px; list-style: none; margin: 0; padding: 12px 0 0; }
.vf-card-lines li { color: var(--pa-muted); font-size: 13px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-card-lines b { font-weight: 600; }
.vf-card-lines b.is-up { color: var(--pa-green); }
.vf-card-lines b.is-down { color: var(--pa-red); }
.vf-card-lines em { margin-left: 6px; }
.vf-card-lines .vf-move { color: var(--pa-ink); }
.vf-card-lines .vf-move::before { color: #e58408; content: '→'; margin-right: 7px; }
.vf-card-more {
  align-items: center; align-self: flex-start; background: var(--pa-line-soft); border: 1px solid transparent; border-radius: 999px; color: var(--pa-muted);
  cursor: pointer; display: inline-flex; font: 700 18px/1 var(--font-body); height: 30px; justify-content: center; letter-spacing: .08em; margin-top: 12px;
  padding: 0 0 6px; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .3s cubic-bezier(.22, 1, .36, 1); width: 48px;
}
.vf-card-more:hover, .vf-card-more:focus-visible { background: #fff; border-color: var(--pa-line); color: var(--pa-ink); transform: translateX(3px); }
.vf-card-more:focus-visible { outline: 2px solid var(--pa-violet); outline-offset: 2px; }

/* ── the scores, drawn as VestStudio draws its key risk indicators ─────────

   Four rings side by side in one card, each a 158px ring with its number,
   "/ 100", its name in small capitals and one line on what it measures;
   a footer says what the numbers are formed from and when. The palette is
   VestStudio's: violet, amber, green and blue rings on a soft track. */

.vf-indicators {
  background: rgba(255, 255, 255, .92); border: 1px solid #dce7f4; border-radius: 18px; box-shadow: 0 12px 32px rgba(27, 75, 139, .06);
  color: #071a50; margin-top: 24px; padding: 30px clamp(18px, 3vw, 36px) 18px;
}
.vf-indicators > header { align-items: center; display: grid; gap: 22px 28px; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); }
.vf-indicators-kicker { color: #d97800; font-size: 11px; font-weight: 800; letter-spacing: .2em; margin: 0; text-transform: uppercase; }
.vf-indicators > header h3 { color: #071a50; font: 400 clamp(23px, 2.1vw, 32px)/1.15 var(--font-display); letter-spacing: -.02em; margin: 7px 0 0; }
.vf-indicators > header > p { background: #f4f8fe; border-radius: 14px; color: #667da8; font-size: 12.5px; line-height: 1.5; margin: 0; padding: 13px 18px; }
.vf-indicators-grid { border-top: 1px solid #e1e9f3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 26px; padding-top: 26px; }

/* The health score's own row: a larger ring beside the sum that forms it. */
.vf-health-row { align-items: center; display: grid; gap: 28px clamp(24px, 4vw, 56px); grid-template-columns: auto minmax(0, 460px); justify-content: center; margin-top: 26px; }
.vf-indicator.is-lead { gap: 14px; padding: 0; }
.vf-indicator.is-lead .vf-indicator-ring { height: 196px; width: 196px; }
.vf-indicator.is-lead .vf-indicator-ring strong { font-size: 46px; }
.vf-indicator.is-lead .vf-indicator-ring small { font-size: 12px; }
.vf-indicator.is-lead .vf-indicator-ring b { font-size: 10px; }
.vf-indicator.is-lead .vf-indicator-note { max-width: 230px; }
.vf-health-sum { border-collapse: collapse; font-size: 13px; width: 100%; }
.vf-health-sum caption { color: #7184ae; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; padding-bottom: 10px; text-align: left; text-transform: uppercase; }
.vf-health-sum th, .vf-health-sum td { border-bottom: 1px solid #e8eef7; padding: 9px 0; text-align: right; }
.vf-health-sum th:first-child { font-weight: 600; text-align: left; }
.vf-health-sum thead th { color: #8394b5; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.vf-health-sum td { color: #33466f; font-variant-numeric: tabular-nums; }
.vf-health-sum tfoot th, .vf-health-sum tfoot td { border-bottom: 0; color: #071a50; font-weight: 700; padding-top: 12px; }
.vf-health-sum tfoot strong { color: #8064ee; font-size: 16px; }
.vf-indicators.is-optional .vf-indicators-grid { border-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; max-width: 640px; padding-top: 0; }
.vf-indicator {
  --ring: #147ff2; --ring-soft: rgba(20, 127, 242, .11);
  align-content: start; background: none; border: 0; color: inherit; cursor: pointer; display: grid; gap: 12px; justify-items: center;
  padding: 4px 22px 8px; text-align: center;
}
.vf-indicator + .vf-indicator { border-left: 1px solid #e1e9f3; }
.vf-indicator:hover .vf-indicator-ring strong, .vf-indicator:focus-visible .vf-indicator-ring strong { color: var(--ring); }
.vf-indicator.violet { --ring: #8064ee; --ring-soft: rgba(128, 100, 238, .11); }
.vf-indicator.amber { --ring: #e58408; --ring-soft: rgba(229, 132, 8, .12); }
.vf-indicator.green { --ring: #0da887; --ring-soft: rgba(13, 168, 135, .11); }
.vf-indicator.blue { --ring: #4e72ee; --ring-soft: rgba(78, 114, 238, .11); }
.vf-indicator.teal { --ring: #1497b8; --ring-soft: rgba(20, 151, 184, .11); }
.vf-indicator-ring { display: grid; height: 158px; place-items: center; position: relative; width: 158px; }
.vf-indicator-ring svg { height: 100%; inset: 0; position: absolute; width: 100%; }
.vf-ring-track { fill: none; stroke: var(--ring-soft); stroke-width: 11; }
.vf-ring-value { fill: none; stroke: var(--ring); stroke-linecap: round; stroke-width: 11; }
.vf-indicator-ring > span { display: grid; justify-items: center; line-height: 1; position: relative; }
.vf-indicator-ring strong { color: #071a50; font: 400 34px/1 var(--font-display); }
.vf-indicator-ring small { color: #7184ae; font-size: 11px; margin-top: 6px; }
.vf-indicator-ring b { color: #071a50; font-size: 8.5px; letter-spacing: .11em; line-height: 1.35; margin-top: 13px; max-width: 98px; text-transform: uppercase; }
.vf-indicator-note { color: #667da8; font-size: 12px; line-height: 1.45; max-width: 200px; }
.vf-indicators > footer { align-items: center; border-top: 1px solid #e1e9f3; display: grid; gap: 14px; grid-template-columns: 22px minmax(0, 1fr) auto; margin-top: 26px; padding-top: 16px; }
.vf-info-icon { align-items: center; border: 1px solid #b9c7df; border-radius: 50%; color: #6b80a8; display: flex; font-size: 11px; font-weight: 700; height: 20px; justify-content: center; width: 20px; }
.vf-indicators > footer p { color: #6b80a8; font-size: 11px; line-height: 1.5; margin: 0; }
.vf-indicators > footer time { color: #8394b5; font-size: 11px; white-space: nowrap; }
.vf-optional-invite { color: var(--pa-muted); font-size: 12.5px; line-height: 1.6; margin: 12px 0 0; }
.vf-optional-invite .vf-link { font-size: 12.5px; }

@media (max-width: 900px) {
  .vf-indicators > header { grid-template-columns: 1fr; }
  .vf-health-row { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .vf-health-sum { max-width: 460px; }
  .vf-indicators-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 26px; }
  .vf-indicator:nth-child(3) { border-left: 0; }
  .vf-indicators > footer { grid-template-columns: 22px minmax(0, 1fr); }
  .vf-indicators > footer time { grid-column: 2; }
}
@media (max-width: 520px) {
  .vf-indicator-ring { height: 132px; width: 132px; }
  .vf-indicator-ring strong { font-size: 28px; }
  .vf-indicator-ring b { hyphens: manual; letter-spacing: .07em; max-width: 78px; }
  .vf-indicator { padding: 4px 8px 8px; }
  .vf-indicator.is-lead .vf-indicator-ring { height: 172px; width: 172px; }
  .vf-indicator.is-lead .vf-indicator-ring strong { font-size: 40px; }
  .vf-health-sum { font-size: 12px; }
}

.vf-structure { margin-top: 18px; }
.vf-composition-toggle { margin: 10px 0 12px; }
.vf-composition-bar { background: var(--pa-line-soft); border-radius: 6px; display: flex; gap: 2px; height: 12px; overflow: hidden; }
.vf-composition-bar span:nth-child(6n+1), .vf-composition li:nth-child(6n+1) i { background: #342cff; }
.vf-composition-bar span:nth-child(6n+2), .vf-composition li:nth-child(6n+2) i { background: #8a84ff; }
.vf-composition-bar span:nth-child(6n+3), .vf-composition li:nth-child(6n+3) i { background: #b9832b; }
.vf-composition-bar span:nth-child(6n+4), .vf-composition li:nth-child(6n+4) i { background: #0a7a3d; }
.vf-composition-bar span:nth-child(6n+5), .vf-composition li:nth-child(6n+5) i { background: #5c5a6b; }
.vf-composition-bar span:nth-child(6n), .vf-composition li:nth-child(6n) i { background: #d6c9a8; }
.vf-composition { display: grid; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.vf-composition li { align-items: center; display: flex; font-size: 12.5px; gap: 8px; }
.vf-composition i { border-radius: 3px; flex: 0 0 10px; height: 10px; }
.vf-composition span { flex: 1; }
.vf-composition b { color: var(--pa-muted); font-weight: 600; white-space: nowrap; }

.vf-insights { display: grid; gap: 8px; margin: 14px 0; }
.vf-insight { background: var(--pa-card); border: 1px solid var(--pa-line); border-left: 3px solid var(--pa-violet); border-radius: 12px; padding: 12px 14px; }
.vf-insight.is-working { border-left-color: var(--pa-green); }
.vf-insight.is-attention { border-left-color: var(--pa-gold); }
.vf-insight b { font-size: 13px; }
.vf-insight p { color: var(--pa-muted); font-size: 12.5px; line-height: 1.6; margin: 4px 0 0; }

.vf-health-compare { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; display: grid; gap: 4px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 4px; padding: 12px; }
.vf-health-compare div { display: grid; gap: 2px; text-align: center; }
.vf-health-compare small { color: var(--pa-dim); font-size: 10px; line-height: 1.3; }
.vf-health-compare b { font: 400 20px/1.1 var(--font-display); }
.vf-health-compare em { font-size: 11px; font-style: normal; font-weight: 700; }
.vf-health-compare em.is-up { color: var(--pa-green); }
.vf-health-compare em.is-down { color: var(--pa-amber); }

@media (max-width: 900px) {
  .vf-health-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .vf-health-overall { align-items: flex-start; flex-direction: column; gap: 14px; }
  .vf-health-score { flex-direction: column; text-align: center; }
  .vf-health-score > span:last-child { justify-items: center; }
  .vf-health-compare { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── LAYER 2 — Explore ───────────────────────────────────────────────────── */

.vf-questions { display: flex; gap: 8px; margin-top: 20px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.vf-questions::-webkit-scrollbar { display: none; }
.vf-questions button {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 999px; color: var(--pa-muted); cursor: pointer;
  flex: 0 0 auto; font-size: 13px; font-weight: 700; min-height: 42px; padding: 0 18px;
}
.vf-questions button:hover { color: var(--pa-ink); }
.vf-questions button.is-active { background: var(--pa-ink); border-color: var(--pa-ink); color: #fff; }
.vf-adapt { margin-top: 8px; }

.vf-answer {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 18px; box-shadow: var(--pa-shadow);
  margin: 16px 0 14px; padding: 24px clamp(20px, 2.6vw, 28px);
}
.vf-answer-head { align-items: center; display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: space-between; }
.vf-conclusion { font: 400 clamp(19px, 2.2vw, 23px)/1.4 var(--font-display); letter-spacing: -.015em; margin: 12px 0 6px; max-width: 46ch; }
.vf-points { color: var(--pa-muted); display: grid; font-size: 13px; gap: 6px; line-height: 1.6; margin: 10px 0 0; padding-left: 18px; }
.vf-risk-drivers { counter-reset: driver; display: grid; gap: 10px; list-style: none; margin: 16px 0 4px; padding: 0; }
.vf-risk-drivers li { background: var(--pa-paper); border-radius: 12px; counter-increment: driver; display: grid; gap: 3px; padding: 12px 14px 12px 46px; position: relative; }
.vf-risk-drivers li::before {
  align-items: center; background: var(--pa-ink); border-radius: 50%; color: #fff; content: counter(driver); display: flex;
  font-size: 11px; font-weight: 700; height: 22px; justify-content: center; left: 14px; position: absolute; top: 12px; width: 22px;
}
.vf-risk-drivers b { font-size: 13.5px; }
.vf-risk-drivers span { color: var(--pa-muted); font-size: 12.5px; line-height: 1.55; }

.vf-status { border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; white-space: nowrap; }
.vf-status.is-ready, .vf-status.is-complete { background: var(--pa-green-soft); color: var(--pa-green); }
.vf-status.is-partial, .vf-status.is-modelled { background: var(--pa-gold-soft); color: #8a5a10; }
.vf-status.is-needs_data { background: var(--pa-paper); border: 1px dashed #cfc8bf; color: var(--pa-muted); }
.vf-status.is-not_applicable { background: var(--pa-line-soft); color: var(--pa-dim); }

.vf-related { display: grid; gap: 8px; margin-top: 18px; }
.vf-whatifs { display: flex; flex-wrap: wrap; gap: 8px; }
.vf-whatifs button {
  background: var(--pa-violet-soft); border: 1px solid #ddd7ff; border-radius: 999px; color: #2b23c9; cursor: pointer;
  font-size: 12.5px; font-weight: 700; min-height: 38px; padding: 0 16px; text-align: left;
}
.vf-whatifs button:hover { background: #e6e2ff; }

/* Every deeper level is a disclosure: the browser's own, so it works with a
   keyboard and a screen reader, and costs no request. */
.vf-more { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; margin-bottom: 10px; }
.vf-more > summary {
  align-items: center; cursor: pointer; display: flex; font-size: 14px; font-weight: 700; gap: 10px; list-style: none;
  min-height: 52px; padding: 0 20px;
}
.vf-more > summary::-webkit-details-marker { display: none; }
.vf-more > summary::after { color: var(--pa-dim); content: '+'; font-size: 20px; font-weight: 400; margin-left: auto; }
.vf-more[open] > summary::after { content: '−'; }
.vf-more > summary:hover { color: var(--pa-violet); }
.vf-more-body { border-top: 1px solid var(--pa-line-soft); padding: 16px 20px 20px; }
.vf-more-body > :first-child { margin-top: 0; }
.vf-alloc { margin-top: 0; }

/* ── My Investments ─────────────────────────────────────────────────────── */

.vf-accounts { margin: 18px 0 0; }
.vf-accounts .pa-connections { margin-top: 8px; }
.vf-inv-tools { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 12px; }
.vf-search { display: block; flex: 1 1 260px; }
.vf-search input {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 999px; font: 14px var(--font-body);
  min-height: 44px; outline: 0; padding: 0 18px; width: 100%;
}
.vf-search input:focus { border-color: #9d8ae5; box-shadow: 0 0 0 3px var(--pa-violet-soft); }
.vf-segment { background: var(--pa-line-soft); border-radius: 999px; display: inline-flex; gap: 2px; padding: 3px; }
.vf-segment button {
  background: none; border: 0; border-radius: 999px; color: var(--pa-muted); cursor: pointer; font-size: 12.5px; font-weight: 700; min-height: 36px; padding: 0 14px;
}
.vf-segment button.is-active { background: var(--pa-card); box-shadow: 0 1px 3px rgba(8, 11, 26, .12); color: var(--pa-ink); }
.vf-inventory { display: grid; gap: 14px; }
.vf-inv-group { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 16px; overflow: hidden; }
.vf-inv-group > header { align-items: baseline; background: var(--pa-paper); border-bottom: 1px solid var(--pa-line-soft); display: flex; gap: 10px; justify-content: space-between; padding: 12px 18px; }
.vf-inv-group > header b { font-size: 12.5px; letter-spacing: .04em; }
.vf-inv-group > header span { color: var(--pa-dim); font-size: 12px; }
.vf-holding {
  align-items: center; background: none; border: 0; border-bottom: 1px solid var(--pa-line-soft); color: var(--pa-ink); cursor: pointer;
  display: flex; gap: 14px; justify-content: space-between; min-height: 60px; padding: 12px 18px; text-align: left; width: 100%;
}
.vf-holding:last-child { border-bottom: 0; }
.vf-holding:hover { background: var(--pa-violet-soft); }
.vf-holding-name { display: grid; gap: 2px; min-width: 0; }
.vf-holding-name b { font-size: 13.5px; font-weight: 600; }
.vf-holding-name small, .vf-holding-figures small { color: var(--pa-dim); font-size: 11.5px; }
.vf-holding-figures { display: grid; gap: 2px; text-align: right; white-space: nowrap; }
.vf-holding-figures b { font-size: 13.5px; }
.vf-holding-figures small.is-up { color: var(--pa-green); }
.vf-holding-figures small.is-down { color: var(--pa-red); }
.vf-related .vf-holding { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 12px; }
.vf-inv-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ── the sheet ──────────────────────────────────────────────────────────── */

/* Stated in full, like the import modal: a dialog in the top layer inherits
   nothing from the page.

   A side panel on a wide screen, in the landing banner's sky-aqua — pale at
   the top, deepening towards the foot — with the reading surface a frosted
   white card set into it, so long tables and paragraphs stay as legible as
   they are on the page. It slides in from the right on a long, settling
   curve while the page behind dims and softens; it slides back out the same
   way. Each new page of the sheet rises into place. */
.vf-sheet {
  --sheet-aqua-top: #d3f0fd;
  --sheet-aqua-mid: #a9e0f8;
  --sheet-aqua-foot: #6cc7f0;
  --sheet-ease: cubic-bezier(.22, 1, .36, 1);
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(255, 255, 255, .55), transparent 60%),
    linear-gradient(168deg, var(--sheet-aqua-top) 0%, var(--sheet-aqua-mid) 46%, var(--sheet-aqua-foot) 100%);
  border: 0; border-left: 1px solid rgba(255, 255, 255, .7);
  box-shadow: -30px 0 80px rgba(9, 52, 92, .28), -1px 0 0 rgba(255, 255, 255, .4);
  color: #071a50;
  font-family: var(--font-body); font-size: 14px; height: 100%; inset: 0 0 0 auto; line-height: 1.6;
  margin: 0; max-height: 100%; max-width: 100%; overflow: hidden; padding: 0; position: fixed; width: min(620px, 100%);
}
.vf-sheet[open] { animation: vf-sheet-in .62s var(--sheet-ease) both; display: flex; }
.vf-sheet.is-leaving { animation: vf-sheet-out .34s cubic-bezier(.55, 0, .75, .3) both; }
.vf-sheet::backdrop { background: rgba(7, 26, 58, .34); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.vf-sheet[open]::backdrop { animation: vf-backdrop-in .5s ease both; }
.vf-sheet.is-leaving::backdrop { animation: vf-backdrop-out .34s ease both; }
@keyframes vf-sheet-in { from { opacity: .4; transform: translateX(104%); } to { opacity: 1; transform: none; } }
@keyframes vf-sheet-out { from { opacity: 1; transform: none; } to { opacity: .3; transform: translateX(104%); } }
@keyframes vf-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes vf-backdrop-out { from { opacity: 1; } to { opacity: 0; } }

.vf-sheet-panel { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.vf-sheet-head {
  align-items: flex-start; background: transparent; display: flex; flex: 0 0 auto; gap: 12px; padding: 26px 26px 20px;
}
.vf-sheet[open] .vf-sheet-head { animation: vf-sheet-rise .7s .12s var(--sheet-ease) both; }
.vf-sheet-titles { flex: 1; min-width: 0; }
.vf-sheet-kicker { color: #c46d00; font-size: 10.5px; font-weight: 800; letter-spacing: .18em; margin: 0 0 6px; text-transform: uppercase; }
.vf-sheet-head h2 { color: #071a50; font: 400 24px/1.25 var(--font-display); letter-spacing: -.025em; margin: 0; }
.vf-sheet-back, .vf-sheet-close {
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .85); border-radius: 50%;
  box-shadow: 0 4px 14px rgba(9, 52, 92, .1); color: #173b78; cursor: pointer; flex: 0 0 auto;
  font-size: 19px; height: 40px; line-height: 1; padding: 0; transition: background .2s ease, transform .3s var(--sheet-ease), box-shadow .2s ease; width: 40px;
}
.vf-sheet-back:hover, .vf-sheet-close:hover { background: #fff; box-shadow: 0 6px 18px rgba(9, 52, 92, .16); color: #071a50; }
.vf-sheet-close:hover { transform: rotate(90deg); }
.vf-sheet-back:hover { transform: translateX(-2px); }
.vf-sheet-back:focus-visible, .vf-sheet-close:focus-visible { outline: 2px solid #1466e8; outline-offset: 2px; }

/* The reading surface: frosted white, set into the aqua. */
.vf-sheet-body {
  -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1);
  background: rgba(255, 255, 255, .9); border: 1px solid rgba(255, 255, 255, .95); border-bottom: 0; border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 34px rgba(9, 52, 92, .1); color: var(--pa-ink);
  flex: 1 1 auto; margin: 0 14px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 24px 44px;
  scrollbar-color: rgba(23, 59, 120, .25) transparent; scrollbar-width: thin;
}
.vf-sheet[open] .vf-sheet-body { animation: vf-sheet-rise .74s .16s var(--sheet-ease) both; }
.vf-sheet-body.is-entering > * { animation: vf-sheet-settle .5s var(--sheet-ease) both; }
.vf-sheet-body.is-entering > :nth-child(2) { animation-delay: .04s; }
.vf-sheet-body.is-entering > :nth-child(3) { animation-delay: .08s; }
.vf-sheet-body.is-entering > :nth-child(n+4) { animation-delay: .12s; }
@keyframes vf-sheet-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes vf-sheet-settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vf-sheet-body > p, .vf-more-body p { font-size: 13px; line-height: 1.65; }
.vf-sheet-body .pa-table-wrap, .vf-more-body .pa-table-wrap { margin: 0 -4px; }

@media (prefers-reduced-motion: reduce) {
  .vf-sheet[open], .vf-sheet.is-leaving, .vf-sheet[open]::backdrop, .vf-sheet.is-leaving::backdrop,
  .vf-sheet[open] .vf-sheet-head, .vf-sheet[open] .vf-sheet-body, .vf-sheet-body.is-entering > * { animation: none; }
}

.vf-lead { font: 400 18px/1.45 var(--font-display); letter-spacing: -.01em; margin: 0 0 10px; }
.vf-meta { color: var(--pa-dim); font-size: 11.5px; line-height: 1.6; margin: 10px 0 0; }
.vf-impact { background: var(--pa-gold-soft); border-radius: 10px; color: #6f4a0f; font-size: 12.5px; padding: 9px 12px; }
.vf-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.vf-actions a, .vf-boundary-box a { align-items: center; display: inline-flex; text-decoration: none; }

.vf-level { margin-bottom: 10px; }
.vf-level.is-a { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; padding: 18px 20px; }
.vf-level.is-a p { color: var(--pa-muted); font-size: 13px; line-height: 1.65; margin: 0 0 8px; }
.vf-level.is-a .vf-lead { color: var(--pa-ink); }
.vf-level-tag { color: var(--pa-violet) !important; font-size: 10px !important; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
details.vf-level { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; }
details.vf-level > summary { align-items: center; cursor: pointer; display: flex; font-size: 14px; font-weight: 700; list-style: none; min-height: 52px; padding: 0 20px; }
details.vf-level > summary::-webkit-details-marker { display: none; }
details.vf-level > summary::after { color: var(--pa-dim); content: '+'; font-size: 20px; font-weight: 400; margin-left: auto; }
details.vf-level[open] > summary::after { content: '−'; }
details.vf-level.is-b > summary::before { color: var(--pa-violet); content: 'Explanation · '; font-size: 10px; letter-spacing: .14em; margin-right: 8px; text-transform: uppercase; }
details.vf-level.is-c > summary::before { color: var(--pa-violet); content: 'Full evidence · '; font-size: 10px; letter-spacing: .14em; margin-right: 8px; text-transform: uppercase; }
.vf-explain td:first-child { width: 62%; }

.vf-alternatives { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0; }
.vf-alternative {
  background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; color: var(--pa-ink); cursor: pointer;
  display: grid; gap: 4px; padding: 14px; text-align: left;
}
.vf-alternative small { color: var(--pa-dim); font-size: 11px; font-weight: 700; }
.vf-alternative strong { font: 400 24px/1 var(--font-display); letter-spacing: -.02em; }
.vf-alternative span { color: var(--pa-muted); font-size: 11.5px; }
.vf-alternative.is-active { border-color: var(--pa-violet); box-shadow: 0 0 0 2px var(--pa-violet-soft); }
.vf-compare { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 14px; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.vf-compare div { display: grid; gap: 4px; padding: 14px 16px; }
.vf-compare div + div { border-left: 1px solid var(--pa-line-soft); }
.vf-compare small { color: var(--pa-dim); font-size: 11px; }
.vf-compare b { font: 400 26px/1 var(--font-display); }
.vf-tradeoffs { display: grid; gap: 10px; }
.vf-tradeoff { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 12px; padding: 14px 16px; }
.vf-tradeoff b { display: block; font-size: 12.5px; margin-bottom: 6px; }
.vf-tradeoff ul { color: var(--pa-muted); display: grid; font-size: 12.5px; gap: 4px; line-height: 1.55; margin: 0; padding-left: 18px; }
.vf-boundary-box { background: var(--pa-violet-soft); border-radius: 14px; display: grid; gap: 8px; justify-items: start; margin-top: 14px; padding: 16px 18px; }
.vf-boundary-box p { color: #4a4370; font-size: 12.5px; line-height: 1.6; margin: 0; }
.vf-boundary-box p em { color: var(--pa-ink); font-style: normal; font-weight: 700; }

.vf-holding-top { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }
.vf-holding-top small { color: var(--pa-dim); display: block; font-size: 10.5px; }
.vf-holding-top b { display: block; font: 400 19px/1.2 var(--font-display); }
.vf-holding-top b.is-up { color: var(--pa-green); }
.vf-holding-top b.is-down { color: var(--pa-red); }
.vf-holding-top em { font-size: 12px; font-style: normal; }

.vf-component { border-bottom: 1px solid var(--pa-line-soft); padding: 12px 0; }
.vf-component.is-unmeasured { color: var(--pa-dim); }
.vf-component-head { align-items: baseline; display: flex; font-size: 13px; gap: 10px; justify-content: space-between; }
.vf-component-head span { color: var(--pa-dim); font-size: 11.5px; }
.vf-checks { display: grid; gap: 8px; list-style: none; margin: 0 0 14px; padding: 0; }
.vf-checks li { font-size: 13px; line-height: 1.55; padding-left: 24px; position: relative; }
.vf-checks li::before { font-weight: 700; left: 0; position: absolute; }
.vf-checks li.is-ok::before { color: var(--pa-green); content: '✓'; }
.vf-checks li.is-gap::before { color: var(--pa-amber); content: '○'; }
.vf-gap { background: var(--pa-card); border: 1px dashed #cfc8bf; border-radius: 12px; display: grid; gap: 4px; justify-items: start; padding: 12px 14px; }
.vf-gap b { font-size: 13px; }
.vf-gap span { color: var(--pa-muted); font-size: 12.5px; }
.vf-status-table td { vertical-align: middle; }
.vf-dismissed { align-items: center; display: flex; font-size: 12.5px; gap: 10px; justify-content: space-between; padding: 6px 0; }
.vf-dismissed span { color: var(--pa-dim); }

.vf-ask-form { margin-bottom: 14px; }
.vf-qas { display: grid; gap: 8px; }
.vf-qa { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 12px; overflow: hidden; }
.vf-qa > button { background: none; border: 0; color: var(--pa-ink); cursor: pointer; font-size: 13.5px; font-weight: 600; min-height: 48px; padding: 10px 16px; text-align: left; width: 100%; }
.vf-qa > button:hover, .vf-qa.is-open > button { color: #2b23c9; }
.vf-qa-answer { border-top: 1px solid var(--pa-line-soft); padding: 12px 16px 14px; }
.vf-qa-answer p { font-size: 13px; line-height: 1.65; margin: 0 0 6px; }

/* The report exists only on paper. */
.vf-report { display: none; }

/* ── a phone ─────────────────────────────────────────────────────────────── */

/* Three destinations become a bottom tab bar, the sheet becomes a bottom
   sheet, and everything a thumb taps is at least 44px. */
@media (max-width: 760px) {
  .vf { --vf-bar-height: 52px; padding-bottom: 76px; }
  /* A backdrop filter makes the bar the containing block of anything fixed
     inside it, which would pin the tab bar to the bar instead of the screen. */
  .vf-bar { background: var(--pa-paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .vf-bar-inner { gap: 8px; }
  .vf-bar-context span { display: none; }
  .vf-nav {
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--pa-line); bottom: 0; display: grid;
    grid-template-columns: repeat(3, 1fr); left: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); position: fixed; right: 0; z-index: 30;
  }
  .vf-nav button { border-radius: 12px; flex-direction: column; font-size: 11px; gap: 3px; justify-content: center; min-height: 52px; padding: 4px; }
  .vf-nav button.is-active { background: var(--pa-violet-soft); color: #2b23c9; }
  .vf-tool.is-ask span { display: none; }
  .vf-tool.is-ask { padding: 0 10px; }
  /* On a phone the same sheet rises from the foot of the screen. */
  .vf-sheet {
    border-left: 0; border-radius: 24px 24px 0 0; border-top: 1px solid rgba(255, 255, 255, .7);
    box-shadow: 0 -24px 60px rgba(9, 52, 92, .28); height: min(92vh, 100%); inset: auto 0 0 0; top: auto; width: 100%;
  }
  .vf-sheet[open] { animation-name: vf-sheet-up; }
  .vf-sheet.is-leaving { animation-name: vf-sheet-down; }
  @keyframes vf-sheet-up { from { opacity: .4; transform: translateY(100%); } to { opacity: 1; transform: none; } }
  @keyframes vf-sheet-down { from { opacity: 1; transform: none; } to { opacity: .3; transform: translateY(100%); } }
  .vf-sheet-head { padding: 22px 18px 14px; position: relative; }
  .vf-sheet-head::before { background: rgba(255, 255, 255, .85); border-radius: 999px; content: ''; height: 4px; left: 50%; position: absolute; top: 8px; transform: translateX(-50%); width: 42px; }
  .vf-sheet-head h2 { font-size: 21px; }
  .vf-sheet-body { border-radius: 20px 20px 0 0; margin: 0 8px; padding: 18px 16px 40px; }
  .vf-alternatives { grid-template-columns: 1fr; }
  .vf-alternative { align-items: baseline; grid-template-columns: 1fr auto; }
  .vf-alternative span { grid-column: 1 / -1; }
  .vf-holding-top { grid-template-columns: 1fr 1fr; }
  .vf-next .pa-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .vf-finding, .vf-more > summary::after { transition: none; }
}

@media print {
  primary-menu, site-footer, plan-cta, .vx, .vf-bar, .vf-view, .vf-sheet, .pa-reconcile, .pa-connect { display: none !important; }
  .pa, .pa main { background: #fff; padding: 0; }
  .vf { padding: 0; }
  .vf-report { color: #000; display: block; font-size: 11pt; }
  .vf-report h1 { font: 400 22pt var(--font-display); margin: 0 0 6pt; }
  .vf-report h2 { border-bottom: 1px solid #ccc; font: 400 15pt var(--font-display); margin: 18pt 0 8pt; }
  .vf-report h3 { font-size: 12pt; margin: 12pt 0 4pt; }
  .vf-report section { break-inside: avoid; }
}
