/* ---------------------------------------------------------------------------
 * report.css — the 2027 reading
 * Scoped entirely under .rep so it can sit inside the site or stand alone.
 * ------------------------------------------------------------------------- */

body.rep-doc {
  margin: 0;
  background: #F7F5F0;
  color: #1C1B19;
  font-family: "Source Serif 4", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

.rep {
  --rep-ink: var(--color-text, #1C1B19);
  --rep-muted: var(--color-muted, #6E6A62);
  --rep-line: var(--color-line, #DCD7CC);
  --rep-accent: var(--color-accent, #A8402F);
  --rep-paper: var(--color-surface, #FDFCFA);
  --rep-alt: var(--color-surface-alt, #F2EFE8);
  --rep-serif: var(--font-body, "Source Serif 4", Georgia, serif);
  --rep-display: var(--font-display, "Cormorant Garamond", Georgia, serif);
  --rep-sans: var(--font-sans, "Source Sans 3", system-ui, sans-serif);

  max-width: 800px;
  margin: 0 auto;
  padding: 0 0 48px;
  color: var(--rep-ink);
  font-family: var(--rep-serif);
  font-size: 17px;
  line-height: 1.7;
}

.rep * { box-sizing: border-box; }

/* ---------- cover ---------- */
.rep-cover {
  padding: 8px 0 34px;
  border-bottom: 1px solid var(--rep-line);
  margin-bottom: 38px;
}
.rep-kicker {
  margin: 0 0 14px;
  font-family: var(--rep-sans);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rep-muted);
}
.rep-title {
  margin: 0;
  font-family: var(--rep-display);
  font-weight: 300;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.rep-sub {
  margin: 10px 0 30px;
  font-family: var(--rep-display);
  font-size: clamp(20px, 2.6vw, 26px);
  font-style: italic;
  color: var(--rep-accent);
}
.rep-meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2px 28px;
  font-size: 14px;
}
.rep-meta__row {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--rep-line);
}
.rep-meta__row dt {
  min-width: 108px;
  font-family: var(--rep-sans);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rep-muted);
  line-height: 2.1;
}
.rep-meta__row dd { margin: 0; }

/* ---------- sections ---------- */
.rep-sec { margin: 0 0 46px; }
.rep-sec--last { margin-bottom: 0; }
.rep-h2 {
  margin: 0 0 18px;
  font-family: var(--rep-display);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.rep-h2__n {
  flex: 0 0 auto;
  font-family: var(--rep-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--rep-accent);
  border: 1px solid var(--rep-accent);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  transform: translateY(-3px);
}
.rep-h3 {
  margin: 34px 0 12px;
  font-family: var(--rep-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rep-muted);
}
.rep-p { margin: 0 0 16px; }
.rep-lead {
  margin: 0 0 20px;
  font-size: 21px;
  line-height: 1.5;
}
.rep-zh {
  font-size: .92em;
  color: var(--rep-muted);
}
.rep-dim { color: var(--rep-muted); font-size: .9em; }
.rep strong { font-weight: 600; }

.rep-note {
  margin: 20px 0 0;
  padding: 16px 18px;
  border-left: 2px solid var(--rep-line);
  font-size: 15px;
  line-height: 1.62;
  color: var(--rep-muted);
}
.rep-note--tint {
  margin: 26px 0 0;
  background: var(--rep-alt);
  border-left: 2px solid var(--rep-accent);
}

/* ---------- pillar cards ---------- */
.rep-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rep-line);
  border: 1px solid var(--rep-line);
  margin: 24px 0 22px;
}
.rep-pillar {
  background: var(--rep-paper);
  padding: 16px 14px 18px;
  text-align: center;
}
.rep-pillar--day { background: var(--rep-alt); }
.rep-pillar__role {
  margin: 0;
  font-family: var(--rep-sans);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rep-muted);
}
.rep-pillar__gz {
  margin: 10px 0 2px;
  font-family: var(--rep-display);
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.05;
  letter-spacing: .04em;
}
.rep-pillar__py {
  margin: 0 0 12px;
  font-family: var(--rep-sans);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--rep-muted);
}
.rep-pillar__rows {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--rep-line);
  text-align: left;
}
.rep-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 0;
}
.rep-row dt {
  font-family: var(--rep-sans);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rep-muted);
}
.rep-row dd { margin: 0; font-size: 13px; line-height: 1.45; }

/* ---------- tables ---------- */
.rep-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 20px;
  font-size: 14px;
  line-height: 1.5;
}
.rep-table caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 8px;
  font-family: var(--rep-sans);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rep-muted);
}
.rep-table th {
  text-align: left;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--rep-ink);
  font-family: var(--rep-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rep-muted);
}
.rep-table td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--rep-line);
  vertical-align: top;
}
.rep-td-jie { white-space: nowrap; }
.rep-cellnote {
  display: block;
  margin-top: 1px;
  font-family: var(--rep-sans);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--rep-muted);
}
.rep-table tbody tr:last-child td { border-bottom: 0; }
.rep-num { font-variant-numeric: tabular-nums; }
.rep-kua--good td:first-child strong { color: var(--rep-ink); }
.rep-kua--bad { color: var(--rep-muted); }
.rep-star--alert td:nth-child(2) { color: var(--rep-accent); }
.rep-star--wealth td:nth-child(2) { color: var(--rep-accent); font-weight: 600; }
.rep-hl td { background: var(--rep-alt); }

/* ---------- element bars ---------- */
.rep-bars { margin: 20px 0 22px; display: grid; gap: 10px; }
.rep-bar {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 14px;
  align-items: center;
}
.rep-bar__label { margin: 0; font-size: 15px; }
.rep-bar__track {
  height: 10px;
  background: var(--rep-alt);
  position: relative;
  overflow: hidden;
}
.rep-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--rep-accent);
  height: 100%;
}
.rep-bar__fill--hidden { background: rgba(168, 64, 47, 0.22); }
.rep-bar__num {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  min-width: 120px;
  text-align: right;
}

/* ---------- footer line ---------- */
.rep-foot {
  margin: 34px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--rep-line);
  font-family: var(--rep-sans);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rep-muted);
}

/* ---------- narrower screens ---------- */
@media (max-width: 720px) {
  .rep { font-size: 16px; padding: 0 18px 40px; }
  .rep-pillars { grid-template-columns: repeat(2, 1fr); }
  .rep-bar { grid-template-columns: 1fr; gap: 4px; }
  .rep-bar__num { text-align: left; min-width: 0; }
  /* keep long cells inside the column instead of widening the table */
  .rep-table th,
  .rep-table td { padding-right: 6px; overflow-wrap: anywhere; }
  .rep-table { font-size: 13px; }
  .rep-table th, .rep-table td { padding-right: 8px; }
}

/* ---------- print / PDF ---------- */
@media print {
  @page { margin: 16mm 15mm; }
  body.rep-doc { background: #fff; }
  .rep { max-width: none; font-size: 10.5pt; }
  .rep-cover { break-after: page; }
  .rep-sec { break-inside: auto; page-break-inside: auto; }
  .rep-h2 { break-after: avoid; page-break-after: avoid; }
  .rep-table, .rep-pillars, .rep-bars, .rep-note { break-inside: avoid; page-break-inside: avoid; }
  .rep-pillar, .rep-table tr { break-inside: avoid; page-break-inside: avoid; }
  .rep-note--tint { background: #fff; border-left: 2px solid #999; }
  .rep-hl td { background: #F2EFE8; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rep-bar__fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* tables whose first two columns are a name and a compass point: keep them on one line */
.rep-table--dirs td:nth-child(1),
.rep-table--dirs td:nth-child(2) { white-space: nowrap; }
