/**
 * Public Treasury Statement — editorial layout.
 *
 * All rules scoped under `.pd-v2` so the dashboard's editorial palette
 * (ink/cream/gold, PP Eiko + Host Grotesk + Fragment Mono) doesn't bleed
 * into the rest of the Portfolio Terminal.
 *
 * Direct port of public/treasury-statement-v2.html — same tokens, same
 * responsive breakpoints, same visual fingerprint.
 */

@font-face {
  font-family: "PP Eiko";
  src: url("/fonts/pp-eiko.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.pd-v2 {
  --pd-ink: rgb(20, 20, 20);
  --pd-ink-2: rgb(15, 15, 15);
  --pd-cream: rgb(237, 235, 231);
  --pd-muted: rgba(237, 235, 231, 0.5);
  --pd-faint: rgba(237, 235, 231, 0.34);
  --pd-line: rgba(237, 235, 231, 0.12);
  --pd-line-soft: rgba(237, 235, 231, 0.07);
  --pd-gold: rgb(197, 162, 112);
  --pd-gold-line: rgba(197, 162, 112, 0.45);
  --pd-font-display: "PP Eiko", "Times New Roman", Georgia, serif;
  --pd-font-ui: "Host Grotesk", ui-sans-serif, system-ui, sans-serif;
  --pd-font-mono: "Fragment Mono", ui-monospace, monospace;

  background: var(--pd-ink);
  color: var(--pd-cream);
  font-family: var(--pd-font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  display: flex;
  justify-content: center;
}

.pd-v2 * { box-sizing: border-box; }

.pd-v2 .statement {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--pd-line);
  border-right: 1px solid var(--pd-line);
  min-height: 100%;
}

/* ── Toolbar (above the editorial canvas; React-only addition) ── */
.pd-v2 .toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 48px;
  border-bottom: 1px solid var(--pd-line);
  background: var(--pd-ink-2);
  font-family: var(--pd-font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.pd-v2 .toolbar-left,
.pd-v2 .toolbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pd-v2 .toggle {
  display: inline-flex; gap: 0; border: 1px solid var(--pd-line);
}
.pd-v2 .toggle button {
  padding: 7px 14px; background: transparent; border: 0; color: var(--pd-muted);
  font-family: var(--pd-font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; cursor: pointer; transition: color 120ms, background 120ms;
}
.pd-v2 .toggle button + button { border-left: 1px solid var(--pd-line); }
.pd-v2 .toggle button:hover { color: var(--pd-cream); }
.pd-v2 .toggle button.active {
  background: var(--pd-gold); color: var(--pd-ink); font-weight: 600;
}
.pd-v2 .tb-btn {
  padding: 7px 14px; background: transparent; border: 1px solid var(--pd-line);
  color: var(--pd-muted); font-family: var(--pd-font-mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.pd-v2 .tb-btn:hover:not(:disabled) { color: var(--pd-cream); border-color: var(--pd-gold-line); }
.pd-v2 .tb-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pd-v2 .tb-btn.primary {
  border-color: var(--pd-gold); color: var(--pd-gold);
}
.pd-v2 .tb-btn.primary:hover:not(:disabled) {
  background: var(--pd-gold); color: var(--pd-ink);
}
.pd-v2 .tb-status { color: var(--pd-faint); }
.pd-v2 .tb-status .ok { color: var(--pd-gold); }
.pd-v2 .tb-status .stale { color: rgba(231, 144, 144, 0.8); }

/* ── shared bits ── */
.pd-v2 .eyebrow {
  font-family: var(--pd-font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--pd-muted); margin: 0;
  display: inline-flex; align-items: center; gap: 9px;
}
.pd-v2 .eyebrow::before { content: ""; width: 5px; height: 5px; background: var(--pd-gold); flex: none; }
.pd-v2 .chip {
  font-family: var(--pd-font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(237, 235, 231, 0.78);
  display: inline-flex; align-items: center; gap: 9px;
}
.pd-v2 .chip::before { content: ""; width: 5px; height: 5px; border: 1px solid var(--pd-gold); flex: none; }
.pd-v2 .num {
  font-family: var(--pd-font-display); font-weight: 400; letter-spacing: -0.025em;
  line-height: 0.92; font-feature-settings: "tnum" 1; margin: 0; color: var(--pd-cream);
}

/* ── banner ticker ── */
.pd-v2 .top {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 26px 48px; border-bottom: 1px solid var(--pd-line);
}
.pd-v2 .wordmark { font-family: var(--pd-font-display); font-size: 26px; letter-spacing: 0.06em; line-height: 1; text-transform: uppercase; }
.pd-v2 .chips { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pd-v2 .quote { display: inline-flex; align-items: center; gap: 9px; font-family: var(--pd-font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.pd-v2 .quote::before { content: ""; width: 5px; height: 5px; background: var(--pd-gold); flex: none; }
.pd-v2 .quote .qsym { color: var(--pd-muted); }
.pd-v2 .quote .qval { color: var(--pd-cream); font-size: 12px; letter-spacing: 0.03em; }

/* ── HERO ── */
.pd-v2 .hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--pd-line); padding: 46px 48px 40px; }
.pd-v2 .hero .lion { position: absolute; right: -40px; bottom: -50px; width: 300px; opacity: 0.06; filter: invert(1); pointer-events: none; }
.pd-v2 .hero .lion svg { width: 100%; height: auto; display: block; }
/* .trio carries four KPIs since 2026-08-26 (mNAV promoted into the hero);
   the class name is kept so this file stays diffable against the original
   static mockup at public/treasury-statement-v2.html. */
.pd-v2 .trio { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; z-index: 1; }
/* Centered in-column: the four values differ wildly in width (a 10-digit
   holdings figure beside "0.46"), so left-aligning in equal 1fr columns
   stranded the short ones against a wide gap. Padding stays symmetric on the
   first column too — an unbalanced gutter there would throw off its centre. */
.pd-v2 .kpi { padding: 0 18px; border-left: 1px solid var(--pd-line); min-width: 0; text-align: center; }
.pd-v2 .kpi:first-child { border-left: 0; }
.pd-v2 .kpi .klabel { font-family: var(--pd-font-mono); font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--pd-muted); margin: 0 0 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pd-v2 .kpi .klabel::before { content: ""; width: 5px; height: 5px; background: var(--pd-gold); flex: none;
  align-self: flex-start; margin-top: 5px; }
.pd-v2 .kpi .kval { display: flex; align-items: baseline; justify-content: center; gap: 9px; }
/* Fluid so four KPIs never collide; caps at the original 52px on wide screens. */
.pd-v2 .kpi .num { font-size: clamp(30px, 3.2vw, 52px); }
.pd-v2 .kpi .unit { font-family: var(--pd-font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--pd-faint); }
.pd-v2 .kpi.thesis .num { color: var(--pd-gold); }
.pd-v2 .kpi .ksub { font-family: var(--pd-font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pd-faint); margin: 16px 0 0; }

/* ── DETAIL ── */
.pd-v2 .detail { display: grid; grid-template-columns: repeat(3, 1fr); }
.pd-v2 .group { padding: 30px 32px 34px; border-left: 1px solid var(--pd-line-soft); }
.pd-v2 .group:first-child { border-left: 0; }
.pd-v2 .group-head { font-family: var(--pd-font-mono); font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--pd-cream); margin: 0 0 6px; display: flex; align-items: center; gap: 9px; }
.pd-v2 .group-head::before { content: ""; width: 5px; height: 5px; background: var(--pd-gold); flex: none; }
.pd-v2 .metric { padding: 17px 0; border-bottom: 1px solid var(--pd-line-soft); }
.pd-v2 .metric:last-child { border-bottom: 0; }
.pd-v2 .mlabel { font-family: var(--pd-font-ui); font-weight: 600; font-size: 12.5px; letter-spacing: 0.01em; color: rgba(237, 235, 231, 0.82); display: block; margin-bottom: 11px; }
.pd-v2 .mrow { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.pd-v2 .mval { font-family: var(--pd-font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 0.95; font-feature-settings: "tnum" 1; font-size: 30px; color: var(--pd-cream); }
.pd-v2 .munit { font-family: var(--pd-font-mono); font-size: 11.5px; letter-spacing: 0.03em; color: var(--pd-faint); }
.pd-v2 .metric.pnl .mval { color: var(--pd-gold); }
.pd-v2 .metric.pnl .mlabel { color: var(--pd-gold); }
.pd-v2 .fn { font-family: var(--pd-font-mono); font-size: 0.5em; font-weight: 400; color: var(--pd-gold); vertical-align: super; margin-left: 3px; line-height: 0; }

/* ── methodology + footer ── */
.pd-v2 .method {
  border-top: 1px solid var(--pd-line); padding: 24px 48px 26px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.pd-v2 .method .mh { font-family: var(--pd-font-mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--pd-gold); margin: 0 0 8px; }
.pd-v2 .method p { font-family: var(--pd-font-mono); font-size: 10.5px; line-height: 1.55; letter-spacing: 0.02em; color: var(--pd-faint); margin: 0; }
.pd-v2 .foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 48px; border-top: 1px solid var(--pd-line);
  font-family: var(--pd-font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pd-faint);
}
.pd-v2 .foot .brand { font-family: var(--pd-font-display); text-transform: none; letter-spacing: -0.01em; font-size: 14px; color: var(--pd-muted); }

/* ── approval history modal ── */
.pd-v2 .modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.pd-v2 .modal {
  background: var(--pd-ink-2); border: 1px solid var(--pd-line);
  max-width: 900px; width: 100%; max-height: 80vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.pd-v2 .modal-head {
  padding: 18px 24px; border-bottom: 1px solid var(--pd-line);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--pd-font-mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--pd-cream);
}
.pd-v2 .modal-close {
  background: transparent; border: 0; color: var(--pd-muted); cursor: pointer;
  font-size: 18px; padding: 0 8px;
}
.pd-v2 .modal-body { overflow: auto; padding: 16px 24px; }
.pd-v2 .approval-row {
  padding: 14px 0; border-bottom: 1px solid var(--pd-line-soft);
  font-family: var(--pd-font-mono); font-size: 11px; color: var(--pd-cream);
}
.pd-v2 .approval-row:last-child { border-bottom: 0; }
.pd-v2 .approval-row .hdr { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.pd-v2 .approval-row .badge {
  font-size: 10px; letter-spacing: 0.1em; padding: 2px 8px; border: 1px solid;
}
.pd-v2 .approval-row .badge.active { color: var(--pd-gold); border-color: var(--pd-gold); }
.pd-v2 .approval-row .badge.superseded { color: var(--pd-faint); border-color: var(--pd-line); }
.pd-v2 .approval-row .badge.pushed { color: rgb(144, 200, 144); border-color: rgba(144, 200, 144, 0.5); }
.pd-v2 .approval-row dl { display: grid; grid-template-columns: 1fr 2fr; gap: 6px 16px; margin: 0; color: var(--pd-muted); }
.pd-v2 .approval-row dt { color: var(--pd-faint); }
.pd-v2 .approval-row dd { margin: 0; color: var(--pd-cream); word-break: break-all; }

/* ── states ── */
.pd-v2 .loading-state, .pd-v2 .error-state {
  padding: 80px 48px; text-align: center;
  font-family: var(--pd-font-mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--pd-muted);
}
.pd-v2 .error-state { color: rgba(231, 144, 144, 0.9); }

/* ── responsive ── */
/* Four across needs room; drop to 2×2 before collapsing to a single column. */
@media (max-width: 1240px) {
  .pd-v2 .trio { grid-template-columns: repeat(2, 1fr); row-gap: 34px; }
  .pd-v2 .kpi:nth-child(odd) { border-left: 0; }
  .pd-v2 .kpi:nth-child(n+3) { padding-top: 30px; border-top: 1px solid var(--pd-line-soft); }
  .pd-v2 .kpi .num { font-size: clamp(34px, 5vw, 52px); }
}
@media (max-width: 980px) {
  .pd-v2 .trio { grid-template-columns: 1fr; gap: 28px; row-gap: 28px; }
  .pd-v2 .kpi { padding: 0; border-left: 0; border-top: 1px solid var(--pd-line-soft); padding-top: 24px; }
  .pd-v2 .kpi:first-child { border-top: 0; padding-top: 0; }
  .pd-v2 .kpi:nth-child(n+3) { padding-top: 24px; }
  .pd-v2 .kpi .num { font-size: 56px; }
}
@media (max-width: 1040px) {
  .pd-v2 .detail { grid-template-columns: repeat(2, 1fr); }
  .pd-v2 .group { border-left: 0; border-top: 1px solid var(--pd-line-soft); }
  .pd-v2 .group:nth-child(-n+2) { border-top: 0; }
  .pd-v2 .group:nth-child(odd) { border-right: 1px solid var(--pd-line-soft); }
  .pd-v2 .method { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .pd-v2 .top, .pd-v2 .hero, .pd-v2 .method, .pd-v2 .foot, .pd-v2 .toolbar { padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 600px) {
  .pd-v2 .detail { grid-template-columns: 1fr; }
  .pd-v2 .group { border-right: 0 !important; }
  .pd-v2 .group:nth-child(n+2) { border-top: 1px solid var(--pd-line-soft); }
  .pd-v2 .method { grid-template-columns: 1fr; }
}

/* ── Disclosures + per-metric computation (added 2026-08) ─────────────── */
.pd-v2 .filing-banner {
  margin: 0; padding: 12px 48px;
  background: rgba(197, 162, 112, 0.10);
  border-bottom: 1px solid var(--pd-gold-line);
  border-top: 1px solid var(--pd-gold-line);
  font-family: var(--pd-font-mono); font-size: 11px; line-height: 1.55;
  letter-spacing: 0.02em; color: var(--pd-cream);
}
.pd-v2 .filing-banner strong { color: var(--pd-gold); font-weight: 600; }

/* One note per line. The hanging indent (padding-left + negative text-indent)
   pulls the ¹ ² markers into the left margin so wrapped lines align under the
   text, and max-width keeps the measure readable on wide monitors. */
.pd-v2 .fn-legend {
  padding: 18px 48px 4px; margin: 0;
  font-family: var(--pd-font-mono); font-size: 10px; line-height: 1.65;
  letter-spacing: 0.02em; color: var(--pd-faint);
}
.pd-v2 .fn-item {
  margin: 0 0 7px; max-width: 900px;
  display: grid; grid-template-columns: 14px 1fr; align-items: start;
}
.pd-v2 .fn-item:last-child { margin-bottom: 0; }
/* Marker sits in its own column, so every wrapped line aligns to the text.
   Overrides the inline-superscript treatment .fn uses beside metric labels. */
.pd-v2 .fn-legend .fn {
  color: var(--pd-gold); margin-left: 0;
  font-size: 9px; line-height: 1.45; vertical-align: baseline;
}

.pd-v2 .section-head {
  font-family: var(--pd-font-mono); font-size: 11px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--pd-cream); margin: 0 0 16px;
  display: flex; align-items: center; gap: 9px;
}
.pd-v2 .section-head::before { content: ""; width: 5px; height: 5px; background: var(--pd-gold); flex: none; }

.pd-v2 .method-full { border-top: 1px solid var(--pd-line); padding: 26px 48px 28px; }
/* CSS columns, not grid: grid ties every cell in a row to the tallest one, so a
   one-line formula beside a five-line one left large empty gaps. Columns let
   entries flow with an even vertical rhythm and read top-to-bottom per column. */
.pd-v2 .calc-grid { column-count: 2; column-gap: 56px; }
.pd-v2 .calc { break-inside: avoid; page-break-inside: avoid; margin: 0 0 18px; }
.pd-v2 .calc-label {
  font-family: var(--pd-font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--pd-gold); margin: 0 0 4px;
}
.pd-v2 .calc-formula {
  font-family: var(--pd-font-mono); font-size: 10.5px; line-height: 1.55;
  letter-spacing: 0.02em; color: var(--pd-faint); margin: 0;
}

.pd-v2 .disclosures { border-top: 1px solid var(--pd-line); padding: 24px 48px 26px; }
.pd-v2 .disc { margin: 0 0 14px; max-width: 900px; }
.pd-v2 .disc-title {
  font-family: var(--pd-font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--pd-muted); margin: 0 0 3px;
}
.pd-v2 .disc-body {
  font-family: var(--pd-font-mono); font-size: 10.5px; line-height: 1.6;
  letter-spacing: 0.02em; color: var(--pd-faint); margin: 0;
}
.pd-v2 .disc-generated {
  margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--pd-line-soft);
  font-family: var(--pd-font-mono); font-size: 10px; line-height: 1.5;
  letter-spacing: 0.02em; color: var(--pd-faint); font-style: italic;
}

@media (max-width: 720px) {
  .pd-v2 .filing-banner, .pd-v2 .fn-legend,
  .pd-v2 .method-full, .pd-v2 .disclosures { padding-left: 20px; padding-right: 20px; }
  .pd-v2 .calc-grid { column-count: 1; }
}
