/* ============================================================================
 * tradeStack — Pages (home, login, placeholder)
 * ========================================================================= */

/* ── home hero ────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.hero__title {
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hero__subtitle {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-md);
}
.hero__timestamp {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}
.hero__greeting { color: var(--accent); }

/* ── home: six headline metric widgets ─────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .metric-grid { grid-template-columns: 1fr; } }

.metric-widget {
  position: relative;
  padding: 16px 18px 14px;
  overflow: hidden;
}
.metric-widget::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-default);
}
.metric-widget--up::before     { background: var(--up); }
.metric-widget--warn::before   { background: var(--warning); }
.metric-widget--down::before   { background: var(--down); }
.metric-widget--neutral::before { background: var(--accent); }

.metric-widget__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.metric-widget__label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.metric-widget__icon { color: var(--text-muted); display: grid; place-items: center; }
.metric-widget__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.1;
}
.metric-widget__sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.metric-widget__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--border-subtle);
}
.metric-widget__split-col { display: flex; flex-direction: column; gap: 2px; }
.metric-widget__split-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}
.metric-widget__split-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── home: Ask Argus call-to-action card ───────────────────────────────── */
.askargus-cta {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(96, 165, 250, 0.04));
  border-color: rgba(96, 165, 250, 0.25);
}
.askargus-cta:hover { border-color: var(--accent); }
.askargus-cta__mark {
  flex: 0 0 46px;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--accent-secondary);
  background: var(--accent-soft);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 50%;
}
.askargus-cta__title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
.askargus-cta__sub { font-size: 13px; color: var(--text-tertiary); line-height: 1.55; margin: 0 0 10px; }
.askargus-cta__link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--accent-secondary);
}
.askargus-cta:hover .askargus-cta__link { color: #fff; }

/* ── recent trades (home page) ─────────────────────────────────────────── */

.recent-trades {
  max-height: 440px;
  overflow-y: auto;
}

.trade-row-symbol {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 450;
}
.trade-row-symbol__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.05);
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}
.trade-row-dir {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}
.trade-row-dir--long  { background: var(--up-soft);   color: var(--up-bright); }
.trade-row-dir--short { background: var(--down-soft); color: var(--down-bright); }

/* ── backup widget ────────────────────────────────────────────────────── */

.backup-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.backup-widget__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}
.backup-widget__label { color: var(--text-secondary); }
.backup-widget__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* ── empty state ──────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  text-align: center;
}
.empty-state__icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-surface-raised);
  display: grid; place-items: center;
  color: var(--text-tertiary);
  font-size: 20px;
}
.empty-state__title {
  font-size: var(--text-md);
  font-weight: 450;
  color: var(--text-primary);
}
.empty-state__subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  max-width: 320px;
}

/* ── login ─────────────────────────────────────────────────────────────── */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 20%, rgba(37, 99, 235, 0.15), transparent 60%),
    radial-gradient(ellipse 500px 300px at 80% 80%, rgba(38, 166, 154, 0.08), transparent 60%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.login-card__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.login-card__logo {
  height: 34px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(37, 99, 235, 0.35));
}

.login-card h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-1);
}
.login-card__sub {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}
.login-form { display: flex; flex-direction: column; gap: var(--space-4); }
.login-card__error {
  background: var(--down-soft);
  border: 1px solid rgba(239, 83, 80, 0.25);
  color: var(--down-bright);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.login-card__footer {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-faint);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
}
.login-card__footer a { color: var(--accent-secondary); text-decoration: none; }
.login-card__footer a:hover { text-decoration: underline; }

/* ── two-factor (TOTP) enrolment + verify ─────────────────────────────── */
.login-card--wide { max-width: 460px; }
.twofa-setup { margin-bottom: var(--space-5); }
.twofa-steps {
  margin: 0 0 var(--space-5);
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.twofa-steps li { margin-bottom: 5px; }
.twofa-steps strong { color: var(--text-primary); font-weight: 500; }
/* QR needs a light background — the generated paths are dark. */
.twofa-qr {
  width: 188px;
  height: 188px;
  margin: 0 auto var(--space-4);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.twofa-qr svg { width: 100%; height: 100%; display: block; }
.twofa-manual { font-size: 12px; }
.twofa-manual summary {
  cursor: pointer;
  color: var(--text-tertiary);
  text-align: center;
  list-style: none;
}
.twofa-manual summary:hover { color: var(--text-secondary); }
.twofa-secret {
  display: block;
  margin: 8px auto 0;
  padding: 8px 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--accent-secondary);
  word-break: break-all;
  user-select: all;
}
.twofa-code {
  font-family: var(--font-mono);
  font-size: 22px !important;
  letter-spacing: 0.4em;
  text-align: center;
}
.twofa-code::placeholder { letter-spacing: 0.4em; color: var(--text-muted); }

/* ── per-section methodology dropdown ─────────────────────────────────
   Full-width button bar at the BOTTOM of the parent card. Click → drops
   the methodology body down inside the card. Two contexts:
   - <details class="methodology"> nested INSIDE a .card  → just a top divider
   - <details class="methodology"> as a STANDALONE element → its own border/bg
*/
.methodology {
  /* Standalone (default) — sits as its own bordered block below a grid row */
  margin-bottom: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
/* Inside a card — strip the outer styling so it visually IS the card footer */
.card > .methodology {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  margin: 0;
}

.methodology > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 18px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;     /* button-bar feel — centred label */
  gap: 8px;
  transition: color 120ms, background 120ms;
  user-select: none;
}
.methodology > summary::-webkit-details-marker { display: none; }
.methodology > summary::after {
  content: '▾';
  font-size: 10px;
  letter-spacing: 0;
  color: var(--text-tertiary);
  transition: transform 200ms var(--ease-out);
  display: inline-block;
}
.methodology[open] > summary::after { transform: rotate(180deg); }
.methodology > summary:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}
.methodology[open] > summary {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}
.methodology__body {
  padding: 16px 22px 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  animation: methodology-slide-down 220ms var(--ease-out);
}
@keyframes methodology-slide-down {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.methodology__body p              { margin: 0 0 8px; }
.methodology__body p:last-child   { margin-bottom: 0; }
.methodology__body strong         { color: var(--text-primary); }
.methodology__body ul             { padding-left: 18px; margin: 6px 0 10px; }
.methodology__body li             { margin-bottom: 5px; }
.methodology__body .mono          { font-family: var(--font-mono); font-size: 11.5px; }

/* ── period snapshot KPI cards ────────────────────────────────────────── */
.snapshot-kpi {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}
.snapshot-kpi__delta {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.snapshot-kpi__delta-pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 500;
}
.snapshot-kpi__delta-abs {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.snapshot-kpi__delta-prev {
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}
.snapshot-kpi__delta.up   .snapshot-kpi__delta-pct { color: var(--up-bright); }
.snapshot-kpi__delta.down .snapshot-kpi__delta-pct { color: var(--down-bright); }

/* Tone variants — used on the Arrears page KPIs which don't have a
   period-comparison delta (only 3 days of snapshot history yet) and
   instead carry a severity hue on the left border. */
.snapshot-kpi--ok     { box-shadow: inset 3px 0 0 var(--up); }
.snapshot-kpi--warn   { box-shadow: inset 3px 0 0 var(--warning); }
.snapshot-kpi--danger { box-shadow: inset 3px 0 0 var(--down); }
.snapshot-kpi--dim    { box-shadow: inset 3px 0 0 var(--border-subtle); }

/* ── brand-tag (used in worst-loans table) ───────────────────────────── */
.brand-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.brand-tag--ufa { color: #60a5fa; border-color: rgba(96,165,250,0.35); }
.brand-tag--blc { color: #facc15; border-color: rgba(250,204,21,0.35); }
.brand-tag--rse { color: #34d399; border-color: rgba(52,211,153,0.35); }

/* ── data-table compact variant (used on Arrears tables) ─────────────── */
.data-table--compact thead th { padding: 8px 10px; font-size: 10.5px; }
.data-table--compact tbody td { padding: 7px 10px; font-size: 12px; }
.data-table--compact tbody td.num { font-size: 12px; }

/* ── Cohort-quality section (Arrears page) ───────────────────────────── */
.callout {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.callout p           { margin: 0 0 8px 0; }
.callout p:last-child { margin-bottom: 0; }
.callout__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px !important;
}
.callout__punchline {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--text-primary);
}
.callout__delta {
  display: inline-block;
  margin-left: 4px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
}
.callout__delta--up   { color: var(--up-bright);   background: rgba(38, 166, 154, 0.12); }
.callout__delta--down { color: var(--down-bright); background: rgba(239, 83, 80, 0.12); }

.callout__list {
  margin: 6px 0 8px 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.55;
}
.callout__list li { margin-bottom: 5px; }

.cohort-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.cohort-grid__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 0 0 6px 0;
  font-weight: 500;
}
/* Only stack on narrow screens — desktop dashboards should always be
   side-by-side because the comparison is the point of the section. */
@media (max-width: 760px) {
  .cohort-grid { grid-template-columns: 1fr; }
}

/* ── Risk concentration page ────────────────────────────────────────── */
.conc-table-card { padding: 0; }
.conc-table-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.conc-table-card__title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--text-primary);
}
.conc-table-card__meta {
  font-size: 11px;
  font-family: var(--font-mono);
}
.data-coverage {
  color: var(--warning);
  font-weight: 500;
}
.conc-table tbody td { vertical-align: middle; }
.conc-row--unknown td { color: var(--text-tertiary); font-style: italic; }

/* Whole-row tint for the single worst + single best segment per table.
   Need !important to win against any zebra/hover styles that .data-table
   may pick up — these are intentional callouts. */
.conc-table tbody tr.conc-row--worst td { background: rgba(239, 83, 80, 0.22) !important; }
.conc-table tbody tr.conc-row--best  td { background: rgba(38, 166, 154, 0.20) !important; }
.conc-table tbody tr.conc-row--worst:hover td { background: rgba(239, 83, 80, 0.30) !important; }
.conc-table tbody tr.conc-row--best:hover  td { background: rgba(38, 166, 154, 0.28) !important; }

/* Pair the two share-of-X columns visually with a subtle border between
   them and a soft inset background, so they read as a comparison unit. */
.conc-table th.conc-pair-l,
.conc-table td.conc-pair-l {
  background: rgba(255,255,255,0.02);
  border-left: 1px solid rgba(255,255,255,0.06);
}
.conc-table th.conc-pair-r,
.conc-table td.conc-pair-r {
  background: rgba(255,255,255,0.02);
  border-right: 1px solid rgba(255,255,255,0.06);
}

/* Filter bar — the toolbar row that sits below the hero, holding the
   metric + range toggles. Matches the styling weight of section-header. */
.filter-bar {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px 18px;
  margin-bottom: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.filter-bar__group { display: flex; flex-direction: column; gap: 8px; }
.filter-bar__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ── Reusable info-card widget (How to read sections) ────────────────── */
.info-card {
  background: linear-gradient(180deg,
              rgba(96, 165, 250, 0.06),
              rgba(96, 165, 250, 0.03));
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  overflow: hidden;
}
/* Memo column on the monthly-breakdown table — visually fenced off from the
   Opening→Closing reconciliation flow (it doesn't move the book balance). */
.data-table th.memo-col,
.data-table td.memo-col {
  border-left: 2px solid var(--border-default);
  background: rgba(255, 255, 255, 0.015);
}

/* Snug variant — sits directly under a section-header, above its chart/table. */
.info-card--tight { margin-top: -4px; margin-bottom: var(--space-3); }
.info-card--tight .info-card__head { padding: 9px 14px; }
.info-card--tight .info-card__title { font-size: 12.5px; color: var(--text-secondary); }
.info-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.info-card__head::-webkit-details-marker { display: none; }
.info-card__icon {
  width: 22px; height: 22px;
  flex: 0 0 22px;
  display: grid; place-items: center;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.14);
  border-radius: 50%;
}
.info-card__icon svg,
.info-card__chevron svg { display: block; max-width: 100%; max-height: 100%; }
.info-card__icon svg { width: 14px; height: 14px; }
.info-card__title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.info-card__chevron {
  color: var(--text-tertiary);
  transition: transform 0.18s ease;
  display: grid; place-items: center;
}
.info-card__chevron svg { width: 16px; height: 16px; }
.info-card[open] .info-card__chevron { transform: rotate(180deg); }
.info-card__body {
  padding: 4px 18px 16px 50px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  border-top: 1px solid rgba(96, 165, 250, 0.14);
  background: rgba(0, 0, 0, 0.10);
}
.info-card__body p { margin: 10px 0; }
.info-card__body p:first-child { margin-top: 14px; }
.info-card__list {
  margin: 8px 0 10px 0;
  padding-left: 18px;
}
.info-card__list li { margin-bottom: 6px; }
.info-card__body strong { color: var(--text-primary); font-weight: 500; }
.info-card__body em { color: var(--text-primary); font-style: normal; font-weight: 500; }
.info-card__punchline {
  margin-top: 12px !important;
  padding-top: 12px;
  border-top: 1px dashed rgba(96, 165, 250, 0.20);
  color: var(--text-primary);
}
.info-card__tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 3px;
}
.info-card__tag--up   { color: var(--up-bright);   background: rgba(38, 166, 154, 0.16); }
.info-card__tag--down { color: var(--down-bright); background: rgba(239, 83, 80, 0.16); }

/* Tiny inline tags next to the segment name on the extremes */
.conc-tag {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
}
.conc-tag--worst { background: rgba(239, 83, 80, 0.22); color: #ffb4b1; }
.conc-tag--best  { background: rgba(38, 166, 154, 0.22); color: #7fd8c9; }

/* In-cell mini bar — fill behind the right-aligned number so the cell
   reads as both a value and a magnitude. */
.conc-cell-bar {
  position: relative;
  display: inline-block;
  min-width: 110px;
  height: 18px;
  text-align: right;
  vertical-align: middle;
}
.conc-cell-bar__fill {
  position: absolute;
  top: 4px; bottom: 4px;
  left: 0;
  border-radius: 2px;
  z-index: 0;
}
.conc-cell-bar__fill--metric   { background: rgba(247, 185, 85, 0.30); }
/* Severity fills tinted by whether the segment is worse / better /
   on-par with the book-wide rate. Red = over-represented in arrears
   (bad), green = under-represented (good), grey = within ±10% of
   book-wide. */
.conc-cell-bar__fill--severity-worse   { background: rgba(239, 83, 80, 0.38); }
.conc-cell-bar__fill--severity-better  { background: rgba(38, 166, 154, 0.35); }
.conc-cell-bar__fill--severity-neutral { background: rgba(255, 255, 255, 0.10); }
.conc-rate--worse  .conc-cell-bar__label { color: #ffb4b1; font-weight: 500; }
.conc-rate--better .conc-cell-bar__label { color: #7fd8c9; font-weight: 500; }
.conc-cell-bar__label {
  position: relative;
  z-index: 1;
  padding-right: 6px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Empty-state additions for the arrears trajectory placeholder */
.empty-state__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.5;
}
.empty-state__hint {
  font-size: 11px;
  margin-top: var(--space-2);
}

/* ── data-inventory diagram ──────────────────────────────────────────── */
.data-diagram {
  width: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.06), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(38, 166, 154, 0.04), transparent 50%);
  padding: 12px 18px 18px;
}
.data-diagram svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 640px;
}
.data-diagram__node { transition: opacity 160ms var(--ease-out); }
.data-diagram__node:hover { opacity: 0.92; }

/* HTML rendered inside <foreignObject> needs explicit styling */
.data-diagram foreignObject { overflow: visible; }

.diagram-card {
  font-family: Inter, sans-serif;
  color: rgba(255,255,255,0.85);
  padding: 2px 4px;
}
.diagram-card__title {
  font-family: 'Plus Jakarta Sans', Inter, sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 4px;
}
.diagram-card__sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 14px;
  line-height: 1.35;
}
.diagram-card__body {
  font-size: 12.5px;
  color: rgba(255,255,255,0.78);
  line-height: 1.45;
  margin-bottom: 10px;
}
.diagram-card__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}
.diagram-card__schedule {
  font-size: 10.5px;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
}

.diagram-argus-header {
  text-align: center;
  font-family: Inter, sans-serif;
}
.diagram-argus-header__title {
  font-family: 'Plus Jakarta Sans', Inter, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.diagram-argus-header__sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  line-height: 1.45;
  max-width: 640px;
  margin: 0 auto;
}
.diagram-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 8px #2563eb;
  margin-right: 8px;
  vertical-align: 2px;
}

.diagram-argus-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 8px 0;
  font-family: Inter, sans-serif;
}

.diagram-anon {
  font-family: Inter, sans-serif;
  color: rgba(255,255,255,0.85);
  padding-left: 8px;
}
.diagram-anon__title {
  font-family: 'Plus Jakarta Sans', Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #93c5fd;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.diagram-anon__sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.65);
  line-height: 1.45;
}
.diagram-anon__sub strong {
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}

.diagram-schema-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.diagram-schema-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-left: 3px solid var(--c, #2563eb);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  transition: background 120ms, border-color 120ms;
}
.diagram-schema-chip:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.18);
  border-left-color: var(--c, #2563eb);
}
.diagram-schema-chip__schema {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--c, #fff);
}
.diagram-schema-chip__count {
  font-size: 11.5px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}
.diagram-schema-chip__hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.40);
  line-height: 1.4;
  word-break: break-word;
}

.diagram-joins {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
}
.diagram-joins__title {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
  font-weight: 600;
}
.diagram-joins__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.diagram-joins__list > li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}
.diagram-joins__pair {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}
.diagram-joins__key {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
}
.diagram-joins__key code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  background: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
  padding: 1px 5px;
  border-radius: 3px;
}
.diagram-joins__why {
  font-size: 10.5px;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
  margin-top: 2px;
}

/* ── placeholder page ─────────────────────────────────────────────────── */

.placeholder-hero {
  padding: var(--space-16) var(--space-6);
  text-align: center;
  background:
    radial-gradient(ellipse 600px 300px at 50% 30%, rgba(37, 99, 235, 0.08), transparent 70%);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-default);
}
.placeholder-hero__tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: var(--text-xs);
  font-weight: 450;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.placeholder-hero__title {
  font-size: var(--text-4xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.placeholder-hero__body {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: var(--text-md);
  line-height: var(--leading-snug);
}
