/* Syndication Portal: the only stylesheet (docs/DESIGN.md section 5). The CSP allows no inline styles: every
   colour, size and chart stroke is set here, through classes the templates and app/portal/charts.py write. */

:root {
  --primary: #14381B;
  --primary-dark: #0A1F0E;
  --accent: #D4872C;
  --accent-deep: #B8721F;
  --ink: #17251B;
  --ink-soft: #5F6D62;
  --ink-mute: #8A9388;
  --line: #E5E5DB;
  --line-strong: #D6D6CA;
  --surface: #FFFFFF;
  --surface-head: #F6F6EF;
  --bad: #B3261E;
  --ok: #166534;
  --warn: #8A6100;
  --link: #2F6F47;

  --c1: #2E7D4F;
  --c2: #D4872C;
  --c3: #4A7CB5;
  --c4: #8A6100;
  --st-active: #4A7CB5;
  --st-paid: #2E7D4F;
  --st-defaulted: #B3261E;

  --radius: 14px;
  --radius-btn: 9px;
  --shadow: 0 1px 2px rgba(23, 42, 28, .04), 0 10px 28px -18px rgba(23, 42, 28, .12);
  --focus: 0 0 0 3px rgba(212, 135, 44, .15);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── base ──────────────────────────────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 14px/1.5 var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #F7F7F2 0%, #EFEFE7 100%) fixed;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3 { color: var(--primary-dark); line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -.015em; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.005em; }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 0 0 .75em; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.neg { color: var(--bad); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--accent); color: var(--primary-dark); font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-btn); text-decoration: none;
  transition: top .15s;
}
.skip:focus { top: 10px; }

main:focus { outline: none; }

/* ── header ────────────────────────────────────────────────────────────────────────────────────────────────── */

.topbar {
  background: var(--primary-dark);
  border-bottom: 3px solid var(--accent);
  color: #fff;
}
.topbar-in, .subnav-in, .asof-in, .page, .foot-in {
  max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px;
}
.topbar-in {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-logo { height: 30px; width: auto; display: block; }
.wordmark {
  font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em;
  padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .22); white-space: nowrap;
}
.topbar-user { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.who {
  color: rgba(255, 255, 255, .78); font-size: 13px; margin-right: 8px;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logout { margin: 0; display: inline; }
.toplink {
  font: inherit; font-size: 13px; font-weight: 500; color: #fff; background: transparent;
  border: 1px solid transparent; border-radius: 7px; padding: 5px 10px; cursor: pointer;
  text-decoration: none; line-height: 1.3;
}
.toplink:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .16); color: #fff; }
.toplink:focus-visible { outline-color: var(--accent); }

/* ── sub-navigation and selector ───────────────────────────────────────────────────────────────────────────── */

.subnav { background: var(--surface); border-bottom: 1px solid var(--line); }
.subnav-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: block; padding: 14px 12px 12px; color: var(--ink-soft); font-weight: 550; text-decoration: none;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--primary-dark); border-bottom-color: var(--line-strong); }
.tabs a.on { color: var(--primary-dark); border-bottom-color: var(--accent); font-weight: 650; }

.selector { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 0; }
.selector label { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.selector select { min-width: 200px; max-width: 320px; }
.js .selector button { display: none; }

.asof { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .45); }
.asof-in { padding-top: 6px; padding-bottom: 6px; color: var(--ink-mute); font-size: 12px; }

/* ── page layout ───────────────────────────────────────────────────────────────────────────────────────────── */

.page { flex: 1 0 auto; width: 100%; padding-top: 28px; padding-bottom: 40px; }
.page > * + * { margin-top: 20px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-soft); margin: 4px 0 0; }
.page-actions, .head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.with-pill { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.with-pill .pill { font-size: 12px; }
.back { margin: 0; font-size: 13px; }
.back a { text-decoration: none; font-weight: 550; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.section-card { padding: 20px 22px; }
.card-head { margin-bottom: 14px; }
.card-head p { margin: 3px 0 0; font-size: 13px; }
.card-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.foot { border-top: 1px solid var(--line); background: rgba(255, 255, 255, .5); }
.foot-in { padding-top: 16px; padding-bottom: 20px; color: var(--ink-mute); font-size: 12px; }
.foot a { color: var(--ink-soft); }

/* ── hero and KPI tiles ────────────────────────────────────────────────────────────────────────────────────── */

.overview { display: grid; gap: 16px; }
.hero {
  padding: 24px 28px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-color: var(--primary-dark); color: #fff;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 135, 44, .28) 0%, rgba(212, 135, 44, 0) 70%);
}
.hero-label {
  margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255, 255, 255, .72);
}
.hero-value {
  margin: 6px 0 2px; font-size: 48px; font-weight: 750; line-height: 1.1; letter-spacing: -.025em;
  font-variant-numeric: proportional-nums; color: #fff;
}
.hero-caption { margin: 0; color: rgba(255, 255, 255, .72); font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; position: relative;
}
.kpi dt { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .07em; }
.kpi dd { margin: 0; }
.kpi-value {
  font-size: 26px; font-weight: 700; letter-spacing: -.015em; margin-top: 4px !important; color: var(--primary-dark);
  font-variant-numeric: proportional-nums;
}
.kpi-value.neg { color: var(--bad); }
.kpi-cap { font-size: 12.5px; color: var(--ink-mute); }

/* ── charts ────────────────────────────────────────────────────────────────────────────────────────────────── */

.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { padding: 18px 20px 12px; min-width: 0; display: flex; flex-direction: column; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-body { flex: 1 0 auto; }
.chart-card .card-head { margin-bottom: 8px; }

svg.chart { width: 100%; height: auto; display: block; font-family: inherit; overflow: visible; }

.c1 { --sc: #2E7D4F; }
.c2 { --sc: #D4872C; }
.c3 { --sc: #4A7CB5; }
.c4 { --sc: #8A6100; }
.st-active { --sc: #4A7CB5; }
.st-paid { --sc: #2E7D4F; }
.st-defaulted { --sc: #B3261E; }

path.mark, rect.mark, circle.mark, rect.swatch { fill: var(--sc, var(--c1)); }
polyline.line, line.swatch {
  stroke: var(--sc, var(--c1)); fill: none; stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round;
}
.line.dashed, line.swatch.dashed { stroke-dasharray: 6 4; }
.line.bold { stroke-width: 3px; }
path.area { fill: var(--sc, var(--c1)); opacity: .1; stroke: none; }
circle.ring { stroke: #fff; stroke-width: 2px; }

line.grid { stroke: #ECECE3; stroke-width: 1; }
line.axis { stroke: #B9BCB0; stroke-width: 1; }
.tick, .xlabel, .legend, .hlabel, .value, .empty, .donut-caption { fill: var(--ink-soft); font-size: 11px; }
.legend { font-size: 12px; }
.value { font-size: 12px; font-weight: 600; fill: var(--ink); }
.empty { font-size: 13px; }
.end-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.donut-total { font-size: 22px; font-weight: 800; fill: var(--primary-dark); }

.mark { cursor: default; transition: opacity .12s; }
.mark:hover, .mark:focus { opacity: .85; outline: none; }
.mark:focus-visible { stroke: var(--primary-dark); stroke-width: 2px; }
svg.chart a { cursor: pointer; }
svg.chart a:hover .hlabel { fill: var(--link); text-decoration: underline; }

.tip {
  position: fixed; z-index: 100; pointer-events: none; max-width: 300px;
  background: var(--primary-dark); color: #fff; font-size: 12.5px; line-height: 1.35; font-weight: 500;
  padding: 6px 9px; border-radius: 6px; box-shadow: 0 6px 18px -6px rgba(10, 31, 14, .45);
  font-variant-numeric: tabular-nums;
}
.tip[hidden] { display: none; }

details.figures { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
details.figures > summary, details.glossary > summary {
  cursor: pointer; color: var(--link); font-size: 13px; font-weight: 550; list-style: none; padding: 4px 0;
  display: inline-flex; align-items: center; gap: 6px;
}
details.figures > summary::-webkit-details-marker, details.glossary > summary::-webkit-details-marker { display: none; }
details.figures > summary::before, details.glossary > summary::before {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
details[open].figures > summary::before, details[open].glossary > summary::before { transform: rotate(45deg); }
details.figures[open] .table-scroll { margin-top: 8px; max-height: 360px; overflow-y: auto; }

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

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; padding: 0 2px; }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; vertical-align: middle; }
table.data thead th {
  background: var(--surface-head); color: var(--ink-soft); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-strong);
}
table.data thead th:first-child { border-left: 1px solid var(--line); border-top-left-radius: 9px; }
table.data thead th:last-child { border-right: 1px solid var(--line); border-top-right-radius: 9px; }
table.data tbody td { border-bottom: 1px solid var(--line); }
table.data tbody tr:hover td { background: #FBFBF7; }
table.data tbody tr:last-child td { border-bottom-color: var(--line-strong); }
table.data tfoot th, table.data tfoot td {
  font-weight: 700; color: var(--primary-dark); background: var(--surface-head); border-bottom: 1px solid var(--line);
}
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data thead th.num { text-align: right; }
table.data tr.current td { background: #FFF8EE; }
.compact-table { font-size: 12.5px; }
table.data.compact-table th, table.data.compact-table td { padding: 6px 10px; }

.deal-cell a { font-weight: 600; text-decoration: none; color: var(--primary-dark); }
.deal-cell a:hover { color: var(--link); text-decoration: underline; }
.deal-cell small { display: block; color: var(--ink-mute); font-size: 12px; margin-top: 1px; }
.empty-row { text-align: center !important; color: var(--ink-mute); padding: 26px 12px !important; }
.ua { color: var(--ink-soft); font-size: 12.5px; max-width: 380px; overflow-wrap: anywhere; }

table.sortable thead th { cursor: pointer; user-select: none; position: relative; }
table.sortable thead th:hover { color: var(--primary-dark); }
table.sortable thead th::after {
  content: ""; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid var(--line-strong);
  opacity: 0;
}
.js table.sortable thead th::after { opacity: 1; }
table.sortable thead th[aria-sort="ascending"]::after { border-top: 0; border-bottom: 4px solid var(--accent-deep); }
table.sortable thead th[aria-sort="descending"]::after { border-top-color: var(--accent-deep); }
.no-js-sort table.sortable thead th { cursor: default; }

/* ── pills, meters, tags ───────────────────────────────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.active { color: #2F5F95; background: #EAF1F9; border-color: #D3E1F1; }
.pill.paid { color: var(--ok); background: #E9F5EC; border-color: #CFE7D6; }
.pill.defaulted { color: var(--bad); background: #FBECEA; border-color: #F2D2CE; }
.pill.other { color: var(--ink-soft); background: var(--surface-head); border-color: var(--line); }

.meter-wrap { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
progress.meter {
  -webkit-appearance: none; appearance: none; width: 72px; height: 6px; border: 0; border-radius: 999px;
  background: #ECECE3; color: var(--c1); overflow: hidden; vertical-align: middle;
}
progress.meter::-webkit-progress-bar { background: #ECECE3; border-radius: 999px; }
progress.meter::-webkit-progress-value { background: linear-gradient(90deg, #2E7D4F, #3F9763); border-radius: 999px; }
progress.meter::-moz-progress-bar { background: linear-gradient(90deg, #2E7D4F, #3F9763); border-radius: 999px; }
.meter-num { font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.fact .meter-wrap { justify-content: flex-start; }
.fact progress.meter { width: 120px; }

.tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--accent-deep); background: #FCF1E3; border: 1px solid #F1DBBE;
}

/* ── deals: filters ────────────────────────────────────────────────────────────────────────────────────────── */

.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-head); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.filters a {
  padding: 6px 14px; border-radius: 7px; color: var(--ink-soft); text-decoration: none; font-weight: 550; font-size: 13px;
}
.filters a:hover { color: var(--primary-dark); background: rgba(255, 255, 255, .7); }
.filters a.on { background: var(--surface); color: var(--primary-dark); box-shadow: 0 1px 2px rgba(23, 42, 28, .1); font-weight: 650; }
.count { margin: 0; color: var(--ink-soft); font-size: 13px; }

/* ── deal page ─────────────────────────────────────────────────────────────────────────────────────────────── */

.investor-head { font-size: 18px; margin-bottom: 10px; }
.facts-card { padding: 6px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.fact { padding: 12px 16px; border-radius: 10px; }
.fact dt { font-size: 12px; color: var(--ink-soft); font-weight: 550; }
.fact dd { margin: 3px 0 0; font-size: 15.5px; font-weight: 650; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.fact.strong { background: #FCF4E8; }
.fact.strong dd { font-size: 17px; }
.fee-lines { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.note {
  margin: 12px 0 0; font-size: 13px; color: var(--warn); background: #FBF5E6; border: 1px solid #EEDFB8;
  padding: 9px 12px; border-radius: 9px;
}
.deal-view + .charts, .deal-view + .section-card { margin-top: 20px; }

/* ── activity ──────────────────────────────────────────────────────────────────────────────────────────────── */

.month .card-head h2 { font-size: 16px; }
.month-total { margin: 0; font-size: 16px; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.month-total .muted { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }

/* ── account ───────────────────────────────────────────────────────────────────────────────────────────────── */

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.minor { font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 550; }
.plain-list li:last-child { border-bottom: 0; }

/* ── forms, buttons, callouts ──────────────────────────────────────────────────────────────────────────────── */

.form { display: grid; gap: 14px; margin-top: 4px; }
.field { display: grid; gap: 5px; }
.field label { font-weight: 600; font-size: 13px; color: var(--ink); }
.hint { margin: 0; font-size: 12px; color: var(--ink-mute); }

input[type="email"], input[type="password"], input[type="text"], select {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius-btn); padding: 10px 12px; min-height: 42px;
  transition: border-color .12s, box-shadow .12s;
}
select { width: auto; padding-right: 32px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[readonly] { background: var(--surface-head); color: var(--ink-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: 9px 16px; border-radius: var(--radius-btn); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--primary-dark); box-shadow: 0 1px 1px rgba(23, 42, 28, .04);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-head); border-color: var(--ink-mute); color: var(--primary-dark); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; padding-top: 11px; padding-bottom: 11px; }

.callout {
  border-radius: 10px; padding: 11px 14px; border: 1px solid; font-size: 13.5px; margin: 0 0 14px;
}
.callout.bad { color: var(--bad); background: #FBECEA; border-color: #F2D2CE; }
.callout.ok { color: var(--ok); background: #E9F5EC; border-color: #CFE7D6; }
.callout.info { color: var(--ink-soft); background: rgba(255, 255, 255, .7); border-color: var(--line); }

/* ── empty and error states, glossary ──────────────────────────────────────────────────────────────────────── */

.empty-state { padding: 40px 28px; text-align: center; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { max-width: 520px; margin-left: auto; margin-right: auto; }

.error-card { padding: 40px 28px; }
.error-box { text-align: center; }
.error-box h1 { margin-bottom: 8px; }
.error-code {
  margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--accent-deep);
}

.glossary { padding: 14px 22px; }
.glossary dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 18px; margin: 12px 0 6px; font-size: 13px; }
.glossary dt { font-weight: 650; color: var(--primary-dark); }
.glossary dd { margin: 0; color: var(--ink-soft); }

/* ── signed-out layout ─────────────────────────────────────────────────────────────────────────────────────── */

.auth-wrap {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 16px 32px; width: 100%;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 8px 22px -12px rgba(10, 31, 14, .55); }
.auth-wordmark {
  font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .18em; color: var(--primary);
}
.auth-card { width: 100%; max-width: 420px; padding: 30px 30px 24px; border-top: 3px solid var(--accent); }
.auth-card h1 { font-size: 21px; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 18px; }
.auth-card .form { margin-top: 16px; }
.auth-links { margin: 16px 0 0; text-align: center; font-size: 13px; }
.auth-foot { margin: 22px 0 0; color: var(--ink-mute); font-size: 12px; text-align: center; }
.auth-foot a { color: var(--ink-soft); }
.auth-card .error-box { text-align: left; }

/* ── 0.2.0: statement tables, the deal page's groups, the Activity month, phone variants ─────────────────────────── */

.overview { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: stretch; }
.statement-card { padding: 20px 22px; }
.statement-card h2 { font-size: 16px; margin: 0 0 10px; }
table.statement { width: 100%; border-collapse: collapse; font-size: 14px; }
table.statement th { text-align: left; font-weight: 500; color: var(--ink); padding: 7px 12px 7px 0; }
table.statement td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 7px 0; }
table.statement tr + tr th, table.statement tr + tr td { border-top: 1px solid var(--line); }
table.statement tr.strong th, table.statement tr.strong td { font-weight: 700; color: var(--primary-dark); }
table.statement tr.emph th, table.statement tr.emph td {
  font-weight: 750; color: var(--primary-dark); background: #EAF4EC; font-size: 15px;
}
table.statement tr.emph th { padding-left: 10px; border-radius: 8px 0 0 8px; }
table.statement tr.emph td { padding-right: 10px; border-radius: 0 8px 8px 0; }
table.statement tr.sub th { padding-left: 18px; color: var(--ink-soft); font-size: 13px; }
table.statement tr.sub td { color: var(--ink-soft); font-size: 13px; }
.statement-line { margin: 12px 0 0; font-weight: 600; color: var(--primary-dark); }
.explain { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.more-link { margin: 12px 0 0; font-size: 13.5px; }
table.data.composition tbody th { font-weight: 500; }

.fact-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.facts-head { margin: 10px 16px 2px; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); }
.facts.facts-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fact-note { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.facts-card .explain, .facts-card .note { margin: 4px 16px 12px; }
.fact .meter-wrap { width: 100%; }
.fact progress.meter { flex: 1 1 auto; min-width: 0; max-width: 120px; }
table.data tr.distribution td { background: #F7FAF7; }

.month-table tr.on th, .month-table tr.on td { background: #FFF8EE; }
.month-table tbody th { font-weight: 500; }
.month-pick { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; flex-wrap: wrap; }
.month-pick label { color: var(--ink-soft); font-size: 13px; }

.chart-narrow { display: none; }

/* ── responsive ────────────────────────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .charts { grid-template-columns: minmax(0, 1fr); }
  .overview, .fact-groups { grid-template-columns: minmax(0, 1fr); }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar-in, .subnav-in, .asof-in, .page, .foot-in { padding-left: 14px; padding-right: 14px; }
  .topbar-in { min-height: 52px; gap: 6px 12px; }
  .wordmark { font-size: 11px; letter-spacing: .12em; padding-left: 10px; }
  .brand { gap: 10px; }
  .brand-logo { height: 26px; }
  .who { display: none; }
  .toplink { padding: 5px 8px; }
  .subnav-in { gap: 0; }
  .tabs { width: 100%; }
  .tabs a { padding: 12px 10px 10px; }
  .selector { width: 100%; border-top: 1px solid var(--line); }
  .selector select { flex: 1; min-width: 0; max-width: none; }
  .page { padding-top: 20px; }
  h1 { font-size: 22px; }
  .hero { padding: 20px; }
  .hero-value { font-size: 38px; }
  .kpis { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; }
  .kpi dt { grid-column: 1; }
  .kpi-value { grid-column: 2; grid-row: 1 / span 2; font-size: 22px; text-align: right; margin-top: 0 !important; }
  .kpi-cap { grid-column: 1; }
  .section-card, .chart-card { padding: 16px 14px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { padding: 10px 10px; }
  .glossary dl { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 8px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .auth-card { padding: 24px 20px 20px; }
  /* phones: the less important columns go, so the date, the deal and the investor's own amounts stay in view */
  table.data .opt { display: none; }
  table.data th, table.data td { padding: 8px 6px; }
  table.data { font-size: 12.5px; }
  table.data thead th, table.data thead th.num { white-space: normal; }
  .deal-cell small { display: none; }
  .chart-wide { display: none; }
  .chart-narrow { display: block; }
  .statement-card { padding: 16px 14px; }
  table.statement { font-size: 13.5px; }
}

@media (max-width: 400px) {
  table.data th, table.data td { padding: 7px 3px; }
  table.data { font-size: 12px; }
  table.data .opt2 { display: none; }
}

@media (max-width: 380px) {
  .wordmark { display: none; }
  .facts.facts-list { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .topbar, .subnav, .foot, .btn, .skip, .selector { display: none !important; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; }
  details.figures { display: none; }
}
