:root {
  --ink: #13241c;
  --muted: #5a6b62;
  --paper: #f7f8f6;
  --surface: #ffffff;
  --forest: #1a3d31;
  --forest-mid: #245544;
  --asset: #1b4d3e;
  --liability: #722536;
  --line: #d5ddd7;
  --tbc-bg: #fff6ec;
  --tbc-ink: #9a4e16;
  --tbc-line: #e8b07a;
  --focus: #c6a15b;
  --gilt: #c6a15b;
  --gilt-line: rgba(198, 161, 91, 0.85);
  --shadow: 0 10px 28px rgba(26, 61, 49, 0.08);
  --display: "Source Serif 4", "Noto Serif SC", Georgia, serif;
  --body: "Source Sans 3", "Noto Sans SC", sans-serif;
  --data: "IBM Plex Mono", ui-monospace, monospace;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, var(--forest) 0 7px, var(--gilt) 7px 10px);
  z-index: 5;
}

.lucide {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.lucide.lg { width: 36px; height: 36px; }
.lucide.sm { width: 16px; height: 16px; }
.lucide.invert { filter: brightness(0) invert(1); }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--forest);
  color: #fff;
  padding: 8px 12px;
}
.skip:focus-visible { left: 8px; z-index: 20; }

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gilt);
  margin: 0 0 6px;
}

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.02em;
  margin: 0;
}

.asof {
  text-align: right;
  color: var(--muted);
  font-size: 14px;
}
.asof strong { display: block; color: var(--ink); font-size: 15px; }
.asof span { display: block; margin-top: 4px; }

.pool.is-soon {
  cursor: pointer;
}

.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
  gap: 14px;
  margin-bottom: 28px;
}

.pool {
  background: var(--surface);
  border: 1px solid #cfe0d4;
  border-radius: 4px;
  padding: 16px 14px 14px 16px;
  text-align: left;
  cursor: pointer;
  min-height: 124px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: none;
  font: inherit;
  color: inherit;
}
.pool:hover, .pool:focus-visible {
  border-color: var(--gilt);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.pool-primary:hover, .pool-primary:focus-visible {
  border-color: var(--gilt);
}
.pool-primary {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--gilt);
}
.pool h2 {
  margin: 0 0 4px;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
}
.pool .zh { font-size: 13px; color: var(--ink); font-weight: 600; text-transform: none; letter-spacing: 0; }
.pool p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.pool.pool-primary h2,
.pool.pool-primary .zh,
.pool.pool-primary p,
.pool.pool-primary .bi .zh,
.pool.pool-primary .bi .en {
  color: #f4efe4;
}
.pool.pool-primary .bi .en {
  color: #e8dcc0;
  opacity: 1;
}
.pool .go { margin-left: auto; align-self: center; opacity: .55; }

.mark {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
}
.pool-primary .mark {
  background: #fff;
}

.table-wrap { overflow-x: auto; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
}

.panel-h {
  background: var(--forest);
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  box-shadow: inset 0 -2px 0 var(--gilt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

table.data {
  border-collapse: collapse;
  font-size: 14px;
}
table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
table.data th, table.data td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
}
table.data th, table.data td,
table.mini th, table.mini td {
  text-align: left;
  vertical-align: top;
}
table.data,
table.mini {
  table-layout: fixed;
  width: 100%;
}
table.data th.num, table.data td.num,
table.mini th.num, table.mini td.num {
  text-align: right;
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
}
.bi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.3;
}
.bi .en {
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  opacity: 0.78;
}
th .bi .en,
.panel-h .bi .en,
.col-h .bi .en,
.col-total .bi .en,
.total-row .bi .en {
  opacity: 0.88;
}
.num .bi,
.eq .bi {
  align-items: flex-end;
  text-align: right;
}
.badge .bi {
  align-items: flex-end;
}
.admin-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--forest-mid);
  font-size: 13px;
}
.asof .admin-link .bi { align-items: flex-end; }
.asof .bi { align-items: flex-end; text-align: right; }
.asof .bi .en { color: var(--muted); opacity: 1; }
.admin-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--forest-mid);
  font-size: 13px;
}
.stmt-head h1 .bi { align-items: center; text-align: center; }
.stmt-head h1 .bi .en { font-size: 18px; opacity: 0.8; }
.switch button .bi { align-items: center; text-align: center; }
.switch button .bi .en { font-size: 11px; }
.crumb-path { flex-wrap: wrap; }
.col-h .bi,
.col-total .bi,
.panel-h .bi,
.total-row .bi {
  color: #fff;
}
.col-h .bi .en,
.col-total .bi .en,
.panel-h .bi .en,
.total-row .bi .en {
  color: rgba(255, 255, 255, .9);
  opacity: 1;
}
.eyebrow .bi .en { color: var(--gilt); opacity: 0.85; }
h1 .bi .en { font-size: 18px; font-family: var(--body); font-weight: 600; }
table.data thead th { background: #fff; }
table.data tbody tr[data-href] { cursor: pointer; }
table.data tbody tr[data-href]:hover { background: #f0f5f2; }
table.data tbody tr { position: relative; }
.row-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
}
.row-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.row-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.holder {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}
.holder .bi { flex: 1; }

.total-row td {
  background: var(--forest);
  color: #fff;
  font-weight: 650;
  border: 0;
  box-shadow: inset 0 2px 0 var(--gilt);
}

.badge {
  display: inline-block;
  border: 1px solid var(--tbc-line);
  background: var(--tbc-bg);
  color: var(--tbc-ink);
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.crumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  font-size: 14px;
}
.crumb-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.crumb a, .linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--forest-mid);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.crumb a:focus-visible, .linkish:focus-visible, .ghost:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.member {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px 18px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 168px;
}
.member:hover, .member:focus-visible {
  border-color: var(--forest);
  box-shadow: var(--shadow);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 12px;
}
.member h2 { margin: 0 0 4px; font-size: 18px; font-family: var(--display); }
.member .meta { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.member .net { font-family: var(--data); font-size: 15px; }

.stmt-head { text-align: center; margin: 8px 0 22px; position: relative; }
.stmt-head h1 { font-size: 28px; }
.stmt-head h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin: 12px auto 0;
  background: var(--gilt);
}
.stmt-head p { margin: 8px 0 0; color: var(--muted); }

.switch {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin: 14px 0 22px;
  border-bottom: 1px solid var(--line);
}
.switch button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 10px 16px;
  min-height: 44px;
  font: inherit;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: -1px;
}
.switch button[aria-selected="true"] {
  color: var(--forest);
  font-weight: 650;
  border-bottom-color: var(--gilt);
}

.ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.ledger > section {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 100%;
}
.ledger .stack { flex: 1; }

.col-h,
.col-total {
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.trend-hint {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0;
}
.trend-hint.dark { color: var(--forest); opacity: 1; }
.col-h.asset { background: var(--asset); box-shadow: inset 0 -2px 0 var(--gilt); }
.col-h.liab { background: var(--liability); }

.sec { padding: 12px 12px 4px; }
.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.ico.g { background: var(--asset); }
.ico.r { background: var(--liability); }
.sec-n {
  color: var(--muted);
  font-family: var(--data);
  font-size: 12px;
  font-weight: 600;
}

.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mini th, .mini td {
  border-bottom: 1px solid var(--line);
  padding: 6px 6px;
}
.mini th { color: var(--muted); font-size: 11px; font-weight: 600; }
.mini .num { text-align: right; font-family: var(--data); }
.mini-wrap { overflow-x: auto; }
.mini.equity { min-width: 640px; }
.sub td { background: #eef3f0; font-weight: 650; }
.liab .sub td { background: #f6ecee; }
.nil {
  color: var(--muted);
  padding: 8px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: auto;
}
.col-total .amt {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #fff;
}
.col-total.asset { background: var(--asset); box-shadow: inset 0 2px 0 var(--gilt); }
.col-total.liab { background: var(--liability); }

.netbar {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--gilt);
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 44px;
  border-radius: 8px;
}
.netbar .mark { background: var(--forest); flex: 0 0 auto; }
.netbar .eq {
  font-family: var(--data);
  font-size: 15px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.netbar .eq .bi { align-items: flex-end; }
.net-sum { font-variant-numeric: tabular-nums; }
.note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.audbar {
  margin-top: 16px;
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  box-shadow: inset 0 2px 0 var(--gilt);
}

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--forest);
  cursor: pointer;
  font: inherit;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--forest-mid);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
}
.pdf-btn .lucide { width: 16px; height: 16px; }
.pdf-btn .bi { align-items: flex-start; text-align: left; }
.pdf-btn .en { font-size: 10px; color: var(--muted); font-weight: 500; }
.pdf-btn:hover { background: #f4f7f5; border-color: var(--gilt); color: var(--forest); }
.pdf-btn:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 2px;
}
.panel-h .pdf-btn.on-forest {
  background: #fff;
  color: var(--forest);
  flex: 0 0 auto;
}
.panel-h .pdf-btn.on-forest .bi { color: inherit; }
.panel-h .pdf-btn.on-forest .en { color: var(--forest-mid); }
.print-asof { display: none; }

.soon {
  background: var(--surface);
  border: 1px dashed var(--line);
  padding: 48px 24px;
  text-align: center;
}
.soon .mark {
  margin: 0 auto 16px;
}
.soon h2 { font-family: var(--display); margin: 0 0 8px; }

.chart-hit {
  cursor: pointer;
}
button.col-h, button.col-total, button.sec-title {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
}
button.col-h, button.col-total {
  color: #fff;
}
button.sec-title {
  color: inherit;
  background: transparent;
}
.chart-hit:hover {
  filter: brightness(1.06);
}
button.sec-title.chart-hit:hover {
  background: #f0f5f2;
}
.netbar.chart-hit { cursor: pointer; }
.netbar.chart-hit:hover { background: #f4f7f5; }
.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(19, 36, 28, .46);
  display: grid;
  place-items: center;
  padding: 24px;
  overscroll-behavior: contain;
}
.chart-modal[hidden] { display: none; }
.chart-panel {
  width: min(760px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(19, 36, 28, .22);
  padding: 16px 18px 12px;
  overscroll-behavior: contain;
}
.chart-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.chart-top h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
}
#chartClose,
#printClose {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c4453a;
  color: #fff;
  font: 700 22px/32px Arial, "Source Sans 3", sans-serif;
  cursor: pointer;
  flex: 0 0 auto;
}
#chartClose:hover, #printClose:hover { background: #a83228; }
#chartClose:focus-visible,
#printClose:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 2px;
}
.trend-chart { height: 360px; }
.chart-empty { color: var(--muted); padding: 48px 16px; text-align: center; }

.print-panel { width: min(440px, 100%); }
.print-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.print-lead .en { display: block; font-size: 12px; }
.print-orient {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.print-orient button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9f8;
  color: var(--forest);
  cursor: pointer;
  font: inherit;
}
.print-orient button:hover {
  border-color: var(--gilt);
  background: #fff;
}
.print-orient button:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 2px;
}
.print-orient .paper {
  display: block;
  background: #fff;
  border: 2px solid var(--forest);
  box-shadow: inset 0 2px 0 var(--gilt);
}
.print-orient .paper.portrait { width: 28px; height: 40px; }
.print-orient .paper.landscape { width: 40px; height: 28px; }

@media (max-width: 1100px) {
  .pool-grid, .member-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .pool-grid, .member-grid, .ledger { grid-template-columns: 1fr; }
  .topbar, .asof { text-align: left; display: block; }
  h1 { font-size: 26px; }
}

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

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  html, body {
    background: #fff !important;
  }
  body::before,
  .skip,
  .crumb,
  .switch,
  .trend-hint,
  .pdf-btn,
  .admin-link,
  .pool-grid,
  .chart-modal,
  #printModal {
    display: none !important;
  }
  .print-asof {
    display: inline;
    color: #5a6b62;
  }
  .app {
    max-width: none;
    padding: 0;
  }
  .topbar {
    margin-bottom: 10px;
  }
  .stmt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    text-align: left;
    margin: 0 0 8px;
    break-after: avoid;
    page-break-after: avoid;
  }
  .stmt-head h1 {
    font-size: 15px;
    margin: 0;
  }
  .stmt-head h1::after { display: none; }
  .stmt-head p { margin: 0; }
  .stmt-head h1 .bi { align-items: flex-start; text-align: left; }
  .stmt-head h1 .bi .en { font-size: 12px; }
  .chart-hit { cursor: default; }
  .col-h,
  .col-total,
  .panel-h,
  .total-row td,
  .mark,
  .ico {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ledger {
    display: block !important;
    break-inside: auto;
    page-break-before: avoid;
    break-before: avoid;
  }
  html.print-landscape .ledger {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    align-items: start;
  }
  html.print-portrait .ledger > section + section {
    margin-top: 14px;
  }
  .ledger > section,
  .ledger .stack {
    display: block !important;
    min-height: 0 !important;
    flex: none !important;
    break-inside: auto;
  }
  .col-h,
  .col-total {
    display: table !important;
    width: 100%;
    margin-top: 0 !important;
    position: static;
  }
  .col-h > .bi,
  .col-total > .bi,
  .col-h > .amt,
  .col-total > .amt {
    display: table-cell !important;
    vertical-align: middle;
  }
  .col-h > .amt,
  .col-total > .amt {
    text-align: right;
    white-space: nowrap;
    width: 1%;
  }
  .netbar {
    display: block !important;
    position: static;
    overflow: visible;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 14px;
  }
  .netbar .mark {
    float: left;
    margin: 0 10px 0 0;
  }
  .netbar .eq {
    display: block;
    overflow: hidden;
    text-align: right;
  }
  html.print-portrait .netbar .net-sum {
    display: block;
    margin-top: 4px;
    font-size: 13px;
  }
  .netbar::after {
    content: "";
    display: table;
    clear: both;
  }
  .panel {
    break-inside: avoid;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  .row-link .lucide {
    display: none;
  }
  .mini-wrap { overflow: visible; }
  .mini.equity { min-width: 0; }
}
