/* ════════════════════════════════════════════════════════════
   Third Rock Wealth · Client Report Card (CRC) styles · v2
   Used by crc-renderer.js: client-report-card.html, dashboard.html.
   Editorial financial-report design, v8 tokens. Print-friendly.
   ────────────────────────────────────────────────────────────
   v2 redesign:
     • Scoped reset — neutralises leaked global element styles
       (main.css `section { padding: var(--space-section) }` was
       adding ~160px of dead space to every CRC section).
     • Body / narrative prose moved to the sans (Inter Tight) at a
       readable size + full-contrast ink. Fraunces kept for the
       client name, fund names and headline figures only.
     • Summary strip + bucket boxes merged into one "Plan at a
       glance" block (removes the duplicated Liquidity reserve).
   ════════════════════════════════════════════════════════════ */

/* ── Scoped reset ──────────────────────────────────────────────
   :where() keeps specificity at zero so every .crc-* class below
   still wins by source order. This is what kills the dead space. */
.crc-doc :where(h1, h2, h3, h4, p, ul, ol, li, section, article, figure, blockquote) {
  margin: 0;
  padding: 0;
}
.crc-doc :where(ul, ol) { list-style: none; }

/* ── Document shell ────────────────────────────────────────── */
.crc-doc {
  max-width: 900px;
  margin: 0 auto;
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--ink);
  border-radius: 2px;
  padding: 44px 48px 38px;
  color: var(--ink);
}

/* ── Header ────────────────────────────────────────────────── */
.crc-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 26px;
  border-bottom: 2px solid var(--ink);
}
.crc-eyebrow {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--neutral-grey); font-weight: 500; margin-bottom: 9px;
}
.crc-title {
  font-family: var(--serif); font-size: clamp(28px, 3.4vw, 38px); font-weight: 400;
  line-height: 1.06; letter-spacing: -0.02em; color: var(--ink);
  font-variation-settings: "SOFT" 50, "opsz" 144;
}
.crc-profile-line {
  font-family: var(--sans); font-size: 13px; color: var(--ink-soft); margin-top: 9px;
}
.crc-head-meta { display: flex; flex-direction: column; gap: 5px; text-align: right; }
.crc-head-meta > div { display: flex; gap: 10px; justify-content: flex-end; align-items: baseline; }
.crc-meta-k {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--neutral-grey);
}
.crc-meta-v { font-family: var(--mono); font-size: 11px; color: var(--ink); font-weight: 600; }

/* ── Selection intro ───────────────────────────────────────── */
.crc-selection-intro {
  font-family: var(--sans); font-size: 14.5px; line-height: 1.65;
  color: var(--ink-soft); max-width: 72ch; margin-bottom: 28px;
}

/* ── Fund selection summary (merged summary + buckets) ─────── */
.crc-plan {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.crc-plan-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px 32px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--rule-strong);
}
.crc-plan-corpus-label,
.crc-plan-input-k,
.crc-plan-alloc-title {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--neutral-grey);
}
.crc-plan-corpus-label { margin-bottom: 5px; }
.crc-plan-corpus-value {
  font-family: var(--serif); font-size: clamp(27px, 3vw, 34px); font-weight: 400;
  line-height: 1; color: var(--ink); font-variation-settings: "SOFT" 40, "opsz" 120;
}
.crc-plan-inputs { display: flex; gap: 30px; }
.crc-plan-input-k { margin-bottom: 4px; }
.crc-plan-input-v {
  font-family: var(--serif); font-size: 19px; font-weight: 400; color: var(--ink);
  line-height: 1; font-variation-settings: "SOFT" 40, "opsz" 50;
}
.crc-plan-alloc-title { margin-bottom: 10px; }
.crc-alloc-bar {
  display: flex; height: 12px; border-radius: 2px; overflow: hidden;
  background: var(--rule); margin-bottom: 14px;
}
.crc-alloc-seg { min-width: 3px; }
.crc-alloc-rows { display: grid; gap: 9px; }
.crc-alloc-row { display: flex; align-items: baseline; gap: 11px; }
.crc-alloc-sw {
  width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; transform: translateY(1px);
}
.crc-alloc-row-main { flex: 1; display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.crc-alloc-row-label { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.crc-alloc-row-note { font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); }
.crc-alloc-row-amt {
  font-family: var(--serif); font-size: 17px; font-weight: 400; color: var(--ink);
  white-space: nowrap; font-variation-settings: "SOFT" 40, "opsz" 40;
}
.crc-alloc--liquidity { background: var(--neutral-grey); }
.crc-alloc--equity    { background: #2f5d3a; }
.crc-alloc--nonequity { background: var(--oxford); }
.crc-alloc--other     { background: var(--rule-strong); }

/* ── Summary note (italic intro) ───────────────────────────── */
.crc-summary-note {
  font-family: var(--serif); font-size: 14.5px; font-style: italic; line-height: 1.6;
  color: var(--ink-soft); font-variation-settings: "SOFT" 50;
  padding-left: 16px; border-left: 3px solid var(--ink);
  margin-bottom: 32px;
}

/* ── Section frame ─────────────────────────────────────────── */
.crc-section { margin-bottom: 34px; }
.crc-section-title {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink);
  border-bottom: 1.5px solid var(--ink); padding-bottom: 7px; margin-bottom: 16px;
}
.crc-section-note {
  font-family: var(--sans); font-size: 13px; line-height: 1.55;
  color: var(--ink-soft); margin-bottom: 16px;
}

/* ── Fund cards ────────────────────────────────────────────── */
.crc-fund-list { display: grid; gap: 14px; }
.crc-fund {
  border: 1px solid var(--rule); border-left: 3px solid var(--ink);
  border-radius: 2px; padding: 20px 22px; background: var(--paper-card);
}
.crc-fund-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.crc-fund-name {
  font-family: var(--serif); font-size: 19px; font-weight: 400; color: var(--ink);
  line-height: 1.18; font-variation-settings: "SOFT" 40, "opsz" 60;
}
.crc-fund-sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--neutral-grey); margin-top: 6px;
}
.crc-fund-alloctag { text-align: right; white-space: nowrap; }
.crc-fund-pct {
  font-family: var(--serif); font-size: 27px; font-weight: 400; color: var(--ink);
  line-height: 1; font-variation-settings: "SOFT" 30, "opsz" 80;
}
.crc-fund-pctnote {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--neutral-grey); margin-top: 5px;
}
.crc-fund-strip {
  display: flex; flex-wrap: wrap; gap: 13px 24px;
  margin: 15px 0; padding: 13px 16px;
  background: var(--paper); border-radius: 2px;
}
.crc-fund-stat { display: flex; flex-direction: column; gap: 3px; }
.crc-fund-stat-k {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--neutral-grey);
}
.crc-fund-stat-v { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 600; }
.crc-fund-summary {
  font-family: var(--sans); font-size: 14.5px; line-height: 1.6; color: var(--ink);
  margin-bottom: 13px;
}
.crc-fund-block { margin-top: 11px; }
.crc-fund-block-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neutral-grey); font-weight: 600; margin-bottom: 4px;
}
.crc-fund-block-body {
  font-family: var(--sans); font-size: 13.5px; line-height: 1.58; color: var(--ink-soft);
}
.crc-fund-link {
  display: inline-block; margin-top: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--ink); text-decoration: underline; text-underline-offset: 2px;
}

/* ── Exposure map ──────────────────────────────────────────── */
.crc-exp-block { margin-bottom: 20px; }
.crc-exp-block:last-child { margin-bottom: 0; }
.crc-exp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.crc-exp-name {
  font-family: var(--serif); font-size: 16px; color: var(--ink);
  font-variation-settings: "SOFT" 40, "opsz" 50;
}
.crc-exp-pct { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.crc-bar {
  display: flex; height: 22px; border-radius: 2px; overflow: hidden; background: var(--rule);
}
.crc-seg { min-width: 2px; }
.crc-seg--equity  { background: #2f5d3a; }
.crc-seg--hybrid  { background: #6f8f74; }
.crc-seg--small   { background: var(--mauve-deep); }
.crc-seg--debt    { background: var(--oxford); }
.crc-seg--debtaa  { background: #5a7d96; }
.crc-seg--gold    { background: #b58b3a; }
.crc-seg--other   { background: var(--neutral-grey); }
.crc-legend { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 9px; }
.crc-legend-item {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.crc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

/* ── Household table ───────────────────────────────────────── */
.crc-hh-table { border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.crc-hh-row {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 0.9fr;
  border-bottom: 1px solid var(--rule);
}
.crc-hh-row:last-child { border-bottom: none; }
.crc-hh-cell {
  padding: 11px 14px; font-family: var(--mono); font-size: 12px; color: var(--ink);
  text-align: right;
}
.crc-hh-cell:first-child {
  text-align: left; font-family: var(--sans); font-size: 13.5px; font-weight: 500;
}
.crc-hh-row--head .crc-hh-cell {
  font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--neutral-grey); background: var(--paper);
}
.crc-hh-row--total { border-top: 2px solid var(--ink); }
.crc-hh-row--total .crc-hh-cell { font-weight: 700; }

/* ── Execution list ────────────────────────────────────────── */
.crc-exec-list { display: grid; gap: 9px; }
.crc-exec-list li {
  font-family: var(--sans); font-size: 14px; line-height: 1.55; color: var(--ink);
  padding-left: 18px; position: relative;
}
.crc-exec-list li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 9px; height: 1.5px; background: var(--ink);
}

/* ── Disclosures + footer ──────────────────────────────────── */
.crc-disclosures { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.crc-disc-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink); font-weight: 600; margin-bottom: 10px;
}
.crc-disc-line {
  font-family: var(--sans); font-size: 11px; line-height: 1.6;
  color: var(--neutral-grey); margin-bottom: 7px;
}
.crc-doc-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; color: var(--neutral-grey);
}

/* ── Empty state ───────────────────────────────────────────── */
.crc-empty {
  max-width: 560px; margin: 0 auto; text-align: center; padding: 56px 32px;
  background: var(--paper-card); border: 1px solid var(--rule); border-radius: 2px;
}
.crc-empty-mark { font-size: 30px; color: var(--rule-strong); margin-bottom: 14px; }
.crc-empty-title {
  font-family: var(--serif); font-size: 21px; font-weight: 400; color: var(--ink);
  margin-bottom: 10px; font-variation-settings: "SOFT" 60, "opsz" 80;
}
.crc-empty-body {
  font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--ink-soft);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 680px) {
  .crc-doc { padding: 26px 20px 28px; }
  .crc-head-meta { text-align: left; align-items: flex-start; }
  .crc-head-meta > div { justify-content: flex-start; }
  .crc-plan-head { align-items: flex-start; }
  .crc-plan-inputs { gap: 24px; }
  .crc-hh-cell { padding: 9px 8px; font-size: 10.5px; }
  .crc-hh-cell:first-child { font-size: 12px; }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .crc-doc { border: none; padding: 0; max-width: none; background: none; }
  .crc-plan, .crc-fund, .crc-section, .crc-exp-block { break-inside: avoid; }
}
