:root {
  --ink: #1d211f;
  --muted: #6c706b;
  --paper: #f1eee7;
  --paper-2: #e9e4da;
  --card: #faf8f3;
  --line: #d7d1c4;
  --green: #1f614e;
  --green-deep: #143f35;
  --red: #a43d32;
  --gold: #b89255;
  --shadow: 0 18px 55px rgba(30, 38, 34, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(42, 51, 47, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 34px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  font-variant-numeric: tabular-nums lining-nums;
}

button, summary { font: inherit; }

.masthead {
  color: #f8f4e9;
  background: var(--green-deep);
  border-bottom: 5px solid var(--gold);
}

.masthead__inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 148px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
}

.masthead__inner > *, .metric { min-width: 0; }

.brand-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  font-size: 30px;
}

.eyebrow, .section-kicker {
  margin: 0 0 8px;
  letter-spacing: .18em;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: .06em;
}

.as-of {
  padding-left: 24px;
  border-left: 1px solid rgba(255,255,255,.28);
  font-family: ui-sans-serif, system-ui, sans-serif;
  text-align: right;
}

.as-of span, .as-of strong { display: block; }
.as-of span { opacity: .65; font-size: 12px; margin-bottom: 5px; }
.as-of strong { font-size: 16px; letter-spacing: .08em; }

main, footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.hero { padding: 62px 0 42px; }

.hero__intro {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 35px;
  align-items: end;
  margin-bottom: 26px;
}

.section-kicker { color: var(--green); }

.hero h2, .section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 500;
}

.hero__intro > p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.metric {
  grid-column: span 2;
  min-height: 150px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metric:nth-child(3), .metric:nth-child(5) { border-right: 0; }
.metric:nth-child(n+4) { border-bottom: 0; }
.metric:nth-child(4), .metric:nth-child(5) { grid-column: span 3; }

.metric > span {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

.metric strong {
  margin: auto 0 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(27px, 3vw, 39px);
  font-weight: 650;
  letter-spacing: -.04em;
  white-space: nowrap;
}

.metric strong small {
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.metric em { color: var(--muted); font-size: 12px; font-style: normal; }
.metric--primary { color: white; background: var(--green); }
.metric--primary > span, .metric--primary em, .metric--primary strong small { color: rgba(255,255,255,.72); }
.metric--loss strong { color: var(--red); }

.formula-note {
  padding: 15px 18px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-top: 0;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
}

.formula-note span {
  margin-right: 10px;
  color: white;
  background: var(--green-deep);
  padding: 3px 7px;
  border-radius: 2px;
}

.ledger-section, .rules {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.section-heading h2 { font-size: 32px; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 35px rgba(30,38,34,.05);
}

table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

th, td { padding: 17px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
thead th { color: #f5f1e7; background: var(--green-deep); font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
tbody tr:hover { background: #f3f0e8; }
.numeric { text-align: right; white-space: nowrap; }
.strong { font-weight: 700; }
tfoot th, tfoot td { color: white; background: var(--green); border-bottom: 0; font-weight: 700; }
tfoot sup { margin-left: 3px; font-size: 8px; opacity: .7; }

.estimate {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  padding: 0 3px;
  color: #6c512d;
  background: #eadabd;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 800;
}

.row-note { display: block; max-width: 180px; margin-bottom: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.proof-group { display: flex; flex-wrap: wrap; gap: 6px; }
.proof-button {
  padding: 7px 10px;
  color: var(--green);
  background: transparent;
  border: 1px solid #8ca69c;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.proof-button:hover { color: white; background: var(--green); border-color: var(--green); }
.proof-missing { color: #8e8170; font-size: 11px; border-bottom: 1px dashed #a99b88; }
.table-footnote { margin: 10px 0 0; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 11px; line-height: 1.7; }

.fee-details {
  margin-top: 14px;
  padding: 0 18px;
  background: rgba(250,248,243,.72);
  border: 1px solid var(--line);
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.fee-details summary { padding: 15px 0; color: var(--green); cursor: pointer; font-weight: 700; }
.fee-details dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 0 18px; background: var(--line); border: 1px solid var(--line); }
.fee-details dl div { display: flex; justify-content: space-between; gap: 18px; padding: 12px; background: var(--card); }
.fee-details dt { color: var(--muted); }
.fee-details dd { margin: 0; font-weight: 700; }
.fee-details .fee-total { color: white; background: var(--green); }
.fee-details .fee-total dt { color: rgba(255,255,255,.7); }

.rules-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.rules-grid article {
  position: relative;
  grid-column: span 2;
  min-height: 210px;
  padding: 25px;
  background: var(--card);
  border: 1px solid var(--line);
}
.rules-grid article:nth-child(4), .rules-grid article:nth-child(5) { grid-column: span 3; }
.rules-grid article > span { color: var(--gold); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; font-weight: 800; }
.rules-grid h3 { margin: 33px 0 12px; font-size: 21px; font-weight: 500; }
.rules-grid p { margin: 0; color: var(--muted); line-height: 1.8; }
.rules-disclaimer { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

footer {
  padding: 24px 0 46px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: .06em;
}

.proof-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: 90vh;
  padding: 0;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 28px 90px rgba(0,0,0,.35);
}
.proof-dialog::backdrop { background: rgba(12,20,17,.75); backdrop-filter: blur(4px); }
.dialog-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px 18px; color: white; background: var(--green-deep); }
.dialog-bar h2 { margin: 0; font-size: 16px; font-weight: 500; }
.dialog-close { padding: 7px 11px; color: white; background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: 3px; cursor: pointer; }
.proof-stage { position: relative; min-height: 220px; display: grid; place-items: center; padding: 12px; }
.proof-stage img { display: none; width: 100%; height: auto; }
.proof-stage img.is-loaded { display: block; }
.loading { color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 13px; }

@media (max-width: 760px) {
  .masthead__inner, main, footer { width: calc(100% - 24px); }
  .masthead__inner { min-height: 118px; grid-template-columns: auto 1fr; gap: 14px; }
  .brand-mark { width: 48px; height: 48px; font-size: 22px; }
  .as-of { grid-column: 1 / -1; padding: 10px 0 0; display: flex; justify-content: space-between; border: 0; border-top: 1px solid rgba(255,255,255,.22); text-align: left; }
  .hero { padding-top: 38px; }
  .hero__intro { grid-template-columns: 1fr; gap: 15px; }
  .metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .metric, .metric:nth-child(3), .metric:nth-child(4), .metric:nth-child(5) { grid-column: span 1; min-height: 135px; padding: 18px; overflow: hidden; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .metric strong { font-size: clamp(23px, 7.2vw, 30px); }
  .metric--loss strong { font-size: clamp(21px, 6.7vw, 28px); }
  .metric strong small { display: block; margin: 4px 0 0; }
  .metric:nth-child(even) { border-right: 0; }
  .metric:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 10px; }
  .rules-grid { grid-template-columns: 1fr; }
  .rules-grid article, .rules-grid article:nth-child(4), .rules-grid article:nth-child(5) { grid-column: 1; min-height: auto; }
  .fee-details dl { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .metrics { grid-template-columns: 1fr; }
  .metric, .metric:nth-child(3), .metric:nth-child(4), .metric:nth-child(5), .metric:last-child {
    grid-column: 1;
    min-height: 122px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .metric:last-child { border-bottom: 0; }
  .metric strong, .metric--loss strong { font-size: 30px; }
  .metric strong small { display: inline; margin-left: 6px; }
  .formula-note { line-height: 1.65; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
