/* zdf0221.com — paper theme, shared by home / daily / cta / trades */
:root {
  --bg: #f7f7f8;
  --ink: #1c1c1c;
  --muted: #5c5c5c;
  --rule: #d8d8d8;
  --accent: #1f5f8a;
  --up: #1f7a4c;
  --down: #b42318;
  --chart-1: #1f5f8a;
  --chart-2: #c45c26;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg) !important;
  color: var(--ink) !important;
}
body {
  font-family: ui-sans-serif, system-ui, "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
main.page a { color: var(--accent); }
main.page .kicker a { color: var(--ink); }
a:hover { color: var(--muted); }
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.kicker {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
}
h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}
main.page h2 { color: var(--accent); }
h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 650;
}
.lede { margin: 0.85rem 0 0; }
.sub, .muted, .notes, .fine { color: var(--muted); }
.sub { font-size: 0.88rem; margin: 0.45rem 0 0; }
.notes { font-size: 0.88rem; }

main.home {
  width: min(38rem, calc(100% - 3rem));
  margin: 0;
  padding: 12vh 1.5rem 4rem;
}
main.page {
  width: min(52rem, calc(100% - 3rem));
  margin: 0 auto;
  padding: 2.2rem 1.5rem 4rem;
}
main.page.wide {
  width: min(60rem, calc(100% - 3rem));
}

.section {
  border-top: 1px solid var(--rule);
  margin-top: 1.6rem;
  padding-top: 1.15rem;
}
.home h2 {
  margin: 2.2rem 0 0;
}

ul { margin: 0.75rem 0 0; padding-left: 1.15rem; }
li { margin: 0.28rem 0; }
li::marker { color: var(--muted); }

.fine {
  margin-top: 2.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  line-height: 1.5;
}
.fine p { margin: 0.3rem 0 0; }
.fine p:first-child { margin-top: 0; }

nav.home-nav { margin: 2.2rem 0 0; }
nav.home-nav a { display: block; width: fit-content; }
nav.home-nav a + a { margin-top: 0.35rem; }

.up { color: var(--up); }
.down { color: var(--down); }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.86rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
td.num, th.num { text-align: right; }
.table-wrap { overflow: auto; }

.vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: start;
  margin: 0.35rem 0 0.5rem;
}
.vs-mid {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  padding-top: 0.15rem;
}
.vs-strong { color: var(--up); font-weight: 650; }
.vs-weak { color: var(--down); font-weight: 650; }
.dir-up { color: var(--up); }
.dir-down { color: var(--down); }
.tension + .tension {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.tension-title { font-weight: 650; margin-bottom: 0.2rem; }
.tension-read { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.92rem; }

.heat-list { margin: 0; padding: 0; list-style: none; }
.heat-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--rule);
}
.heat-list li:last-child { border-bottom: none; }
.heat-bar {
  display: block;
  height: 4px;
  margin-top: 0.28rem;
  background: #e6e6e8;
}
.heat-bar i {
  display: block;
  height: 100%;
  background: var(--muted);
}
.heat-bar.up i { background: var(--up); }
.heat-bar.down i { background: var(--down); }

/* heatmap tiles, ordered strong → weak, left → right, top → bottom */
.heat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.45rem;
  margin: 0.6rem 0 0;
}
.heat-cell {
  min-width: 0;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #ececef;
}
.heat-cell.up {
  background: color-mix(in srgb, var(--up) calc(9% + var(--h, 0.5) * 30%), var(--bg));
  border-color: color-mix(in srgb, var(--up) 30%, var(--rule));
}
.heat-cell.down {
  background: color-mix(in srgb, var(--down) calc(9% + var(--h, 0.5) * 30%), var(--bg));
  border-color: color-mix(in srgb, var(--down) 30%, var(--rule));
}
.heat-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: break-word;
}
.heat-val {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.88rem;
  line-height: 1.3;
}
.heat-cell.up .heat-val { color: var(--up); }
.heat-cell.down .heat-val { color: var(--down); }
.heat-tag {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.2rem 1.2rem;
  margin: 0.7rem 0 0.4rem;
}
.kpis div { padding: 0.35rem 0; border-top: 1px solid var(--rule); }
.kpis span { display: block; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.06em; }
.kpis b { font-weight: 650; font-variant-numeric: tabular-nums; }

.pivots, .scens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem 1.2rem;
  margin: 0.4rem 0 0.8rem;
}
.pivot, .scen { padding: 0.2rem 0; }
.idx { border-top: 1px solid var(--rule); margin-top: 1.4rem; padding-top: 1.1rem; }
.idx:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.idx header { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }

@media (max-width: 40rem) {
  main.home { padding-top: 3rem; }
  .vs, .pivots, .scens { grid-template-columns: 1fr; }
}

/* —— legacy dark daily markup, restyled in place —— */
.card {
  background: transparent;
  border: none;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  padding: 1.15rem 0 0.2rem;
  margin: 1.6rem 0 0;
  backdrop-filter: none;
  box-shadow: none;
}
main > .card:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.badge, .tag, .chip {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}
.tags { display: none; }
.banner { display: none; }
.vs-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  align-items: start;
}
.vs-side {
  background: none !important;
  border: none !important;
  padding: 0;
  min-height: 0;
}
.vs-tag { display: none; }
.vs-body { font-weight: 650; }
.vs-side.green .vs-body { color: var(--up); }
.vs-side.red .vs-body { color: var(--down); }
.vs-badge {
  width: auto;
  height: auto;
  background: none;
  border: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.bar-track {
  display: block;
  height: 4px;
  background: #e6e6e8;
  margin-top: 0.2rem;
}
.bar-fill { display: block; height: 100%; background: var(--muted); }
.heat-row.up .bar-fill { background: var(--up); }
.heat-row.down .bar-fill { background: var(--down); }
.heat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--rule);
  background: none;
}
.hl { background: none; color: inherit; font-weight: 650; }
.focus-grid { display: grid; gap: 1.1rem; }
.focus { border: none; background: none; padding: 0; }
.focus.bull, .focus.split, .focus.bear { background: none; }
.chip.up, .heat-row.up .heat-label { color: var(--up); }
.chip.down, .heat-row.down .heat-label { color: var(--down); }
.dir { color: var(--muted); font-size: 0.85rem; }
