:root {
  --bg: #fbf7f0; --surface: #ffffff; --surface-2: #f4ede2; --ink: #1f1a17; --ink-2: #5a5048; --line: #e4d9c8;
  --accent: #9b2c1f; --accent-ink: #ffffff; --accent-soft: #f6e3de; --gold: #8a6420; --gold-soft: #f5ead3;
  --good: #2f6b3a; --good-soft: #e3f0e4; --warn: #8a5a00; --warn-soft: #fbeed3; --bad: #9b2c1f; --bad-soft: #f8e1dc;
  --neutral-soft: #ece7e0; --focus: #1a5fb4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px; --measure: 44rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15110e; --surface: #1d1814; --surface-2: #26201a; --ink: #eee6db; --ink-2: #b7aa9b; --line: #3a3129;
    --accent: #e0735f; --accent-ink: #1a0f0b; --accent-soft: #3a1f19; --gold: #d9ad5b; --gold-soft: #33291a;
    --good: #7cc48a; --good-soft: #1c2e20; --warn: #e3b35c; --warn-soft: #33291a; --bad: #ec8b78; --bad-soft: #3a1f19;
    --neutral-soft: #2a241e; --focus: #8ab4f8;
  }
}
:root[data-theme="dark"] {
  --bg: #15110e; --surface: #1d1814; --surface-2: #26201a; --ink: #eee6db; --ink-2: #b7aa9b; --line: #3a3129;
  --accent: #e0735f; --accent-ink: #1a0f0b; --accent-soft: #3a1f19; --gold: #d9ad5b; --gold-soft: #33291a;
  --good: #7cc48a; --good-soft: #1c2e20; --warn: #e3b35c; --warn-soft: #33291a; --bad: #ec8b78; --bad-soft: #3a1f19;
  --neutral-soft: #2a241e; --focus: #8ab4f8;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); overflow-x: hidden; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.15rem; }
.brand b { color: var(--accent); }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 1.05rem; font-weight: 600; }
.nav-desktop ul, .menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.nav-desktop a, .menu a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.nav-desktop a:hover, .menu a:hover { background: var(--surface-2); color: var(--ink); }
.nav-desktop a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; z-index: 5; width: min(80vw, 260px); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.menu ul { flex-direction: column; }
@media (max-width: 900px) { .nav-desktop { display: none; } .menu { display: block; } }

/* page */
main { padding-bottom: 48px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 18px 0 0; font-size: .85rem; color: var(--ink-2); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-2); }
.page { max-width: var(--measure); margin: 0 auto; }
.page-head { padding: 26px 0 8px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin: 0 0 12px; }
h2 { font-size: 1.55rem; margin: 2.2em 0 .6em; padding-top: .4em; border-top: 1px solid var(--line); }
h3 { font-size: 1.2rem; margin: 1.6em 0 .4em; }
.dek { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 12px; }
.byline { font-size: .86rem; color: var(--ink-2); margin: 0; }
.byline a { color: var(--ink-2); }
.content p, .content li { max-width: var(--measure); }
.content img, .content svg { max-width: 100%; height: auto; }
.lede { font-size: 1.12rem; }

/* components */
.answer { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin: 20px 0; font-size: 1.05rem; }
.answer p { margin: .3em 0; }
.callout { border-radius: var(--radius); padding: 14px 18px; margin: 22px 0; background: var(--surface-2); border: 1px solid var(--line); }
.callout-title { font-weight: 700; margin: 0 0 4px; }
.callout-warn { background: var(--warn-soft); border-color: transparent; }
.callout-gold { background: var(--gold-soft); border-color: transparent; }
.callout p:last-child { margin-bottom: 0; }
.disclosure { font-size: .9rem; background: var(--gold-soft); border-radius: 8px; padding: 10px 14px; margin: 14px 0 6px; }
.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 22px 0; }
.status div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.status .k { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.status .v { display: block; font-family: var(--serif); font-size: 1.35rem; margin-top: 2px; }
.status .s { display: block; font-size: .82rem; color: var(--ink-2); }
.grid-signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.grid-signs a { display: block; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.grid-signs a:hover { border-color: var(--accent); }
.grid-signs .zh { font-size: 1.4rem; color: var(--accent); font-family: var(--serif); }
.grid-signs .nm { display: block; font-weight: 650; }
.grid-signs .rl { display: block; font-size: .82rem; color: var(--ink-2); }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.tag-supportive { background: var(--good-soft); color: var(--good); }
.tag-challenging { background: var(--bad-soft); color: var(--bad); }
.tag-mixed, .tag-intense { background: var(--warn-soft); color: var(--warn); }
.tag-neutral { background: var(--neutral-soft); color: var(--ink-2); }
.tag-past { background: var(--neutral-soft); color: var(--ink-2); }
.tag-current { background: var(--accent); color: var(--accent-ink); }
.tag-upcoming { background: var(--gold-soft); color: var(--gold); }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 8px; text-decoration: none; font-weight: 650; }
.btn:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.verdict { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin: 18px 0; }
.verdict > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.verdict h3 { margin-top: 0; font-size: 1.05rem; }
@media (max-width: 640px) { .verdict { grid-template-columns: 1fr; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.card p { margin: .3em 0; font-size: .95rem; }

/* tables */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
caption { text-align: left; padding: 10px 12px 0; font-size: .85rem; color: var(--ink-2); }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.is-current td { background: var(--accent-soft); }
tr.is-past td { color: var(--ink-2); }
.zh { font-family: var(--serif); }

/* faq + sources */
.faq details { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; background: var(--surface); }
.faq summary { cursor: pointer; padding: 12px 14px; font-weight: 600; }
.faq details > div { padding: 0 14px 12px; }
.sources ol { font-size: .88rem; color: var(--ink-2); padding-left: 1.2em; }
.sources li { margin: 4px 0; word-break: break-word; }

/* svg */
.wheel { display: block; margin: 20px auto; width: min(100%, 420px); }
.w-cell { font-size: 11px; fill: var(--ink-2); font-family: var(--serif); }
.w-horse { font-size: 12px; fill: var(--gold); font-weight: 700; font-family: var(--serif); }
.w-hi { font-size: 15px; fill: var(--accent); font-weight: 800; font-family: var(--serif); }
.w-ring { fill: var(--surface-2); stroke: var(--line); }
.w-center-big { font-size: 44px; fill: var(--accent); font-family: var(--serif); }
.w-center { font-size: 15px; fill: var(--ink); font-weight: 600; }
.w-center-small { font-size: 12px; fill: var(--ink-2); }
.timeline { display: block; width: 100%; margin: 18px 0; }
.tl-line { stroke: var(--line); stroke-width: 3; }
.tl-dot { fill: var(--gold); }
.tl-dot-em { fill: var(--accent); }
.tl-lab { font-size: 14px; font-weight: 700; fill: var(--ink); }
.tl-sub { font-size: 12px; fill: var(--ink-2); }
figure { margin: 22px 0; }
figcaption { font-size: .85rem; color: var(--ink-2); text-align: center; }

/* calculator */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 20px 0; }
.calc label { display: block; font-weight: 600; margin-bottom: 6px; }
.calc input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.calc button { font: inherit; margin-left: 6px; padding: 9px 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 650; cursor: pointer; }
.calc-out { margin-top: 14px; }
.calc-out .big { font-family: var(--serif); font-size: 1.7rem; margin: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0; font-size: .9rem; color: var(--ink-2); }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--ink-2); }
.foot-note { max-width: 44rem; }
.copy { font-size: .8rem; }
@media (max-width: 520px) { body { font-size: 16px; } h2 { font-size: 1.35rem; } th, td { padding: 8px 9px; } }

/* ---------- responsive tables ----------
   Wide screens: normal table. Phones and small tablets: each row becomes a card,
   each cell shows its column name (data-label) on the left. */
.table-wrap { -webkit-overflow-scrolling: touch; }
td small { color: var(--ink-2); }
@media (max-width: 760px) {
  .rt-wrap { overflow: visible; border: 0; background: transparent; border-radius: 0; }
  .rt caption { padding: 0 0 8px; }
  .rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
  .rt tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 10px; padding: 10px 14px; }
  .rt tr.is-current { background: var(--accent-soft); border-color: var(--accent); }
  .rt tr.is-past { opacity: .8; }
  .rt tr.is-current td, .rt tr.is-past td { background: transparent; }
  .rt td { border: 0; padding: 5px 0; display: grid; grid-template-columns: minmax(84px, 36%) 1fr; gap: 10px; align-items: baseline; overflow-wrap: anywhere; }
  .rt td::before { content: attr(data-label); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
  .rt td:first-child { display: block; font-size: 1.02rem; padding: 0 0 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .rt td:first-child::before { content: none; }
  .rt td[data-label=""] { display: block; }
  .rt td[data-label=""]::before { content: none; }
  .rt td:empty { display: none; }
  .rt-compact th, .rt-compact td { padding: 8px 10px; }
}
/* 5+ column tables become cards on tablets too */
@media (min-width: 761px) and (max-width: 900px) {
  .table-wrap:has(> .rt-wide) { overflow: visible; border: 0; background: transparent; border-radius: 0; }
  .rt-wide caption { padding: 0 0 8px; }
  .rt-wide thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rt-wide, .rt-wide tbody, .rt-wide tr, .rt-wide td { display: block; width: 100%; }
  .rt-wide tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 10px; padding: 10px 14px; }
  .rt-wide tr.is-current { background: var(--accent-soft); border-color: var(--accent); }
  .rt-wide tr.is-past { opacity: .8; }
  .rt-wide tr.is-current td, .rt-wide tr.is-past td { background: transparent; }
  .rt-wide td { border: 0; padding: 5px 0; display: grid; grid-template-columns: minmax(84px, 36%) 1fr; gap: 10px; align-items: baseline; overflow-wrap: anywhere; }
  .rt-wide td::before { content: attr(data-label); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
  .rt-wide td:first-child { display: block; font-size: 1.02rem; padding: 0 0 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .rt-wide td:first-child::before { content: none; }
  .rt-wide td[data-label=""] { display: block; }
  .rt-wide td[data-label=""]::before { content: none; }
  .rt-wide td:empty { display: none; }
  
}
.rt td > .tag { justify-self: start; }
@media (max-width: 360px) {
  .rt td { grid-template-columns: 1fr; gap: 2px; }
  .rt-compact { font-size: .86rem; }
  .rt-compact th, .rt-compact td { padding: 7px 8px; }
}

/* compact tables: let headers wrap, tighten on small phones */
.rt-compact thead th { white-space: normal; }
@media (max-width: 420px) {
  .rt-compact { font-size: .84rem; }
  .rt-compact th, .rt-compact td { padding: 7px 6px; }
  .rt-compact thead th { font-size: .68rem; letter-spacing: .02em; }
}
/* desktop: wide tables break out of the 44rem text column instead of scrolling */
@media (min-width: 901px) {
  .table-wrap:has(> .rt-wide) { width: min(calc(100vw - 32px), 62rem); position: relative; left: 50%; transform: translateX(-50%); }
  .rt-wide thead th { white-space: normal; }
}

/* ---------- conversion components ---------- */
.cta { margin: 26px 0; padding: 18px 20px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft), var(--gold-soft)); border: 1px solid var(--line); }
.cta-soft { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--gold); }
.cta-kicker { margin: 0; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.cta-title { margin: 4px 0 6px; font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; }
.cta-body { margin: 0 0 12px; color: var(--ink); }
.cta-actions { margin: 0; }
.cta .btn { font-size: 1.02rem; padding: 12px 20px; box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.cta-note { margin: 10px 0 0; font-size: .8rem; color: var(--ink-2); }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,.12); }
.sticky-cta[hidden] { display: none; }
.sticky-text { flex: 1; font-weight: 650; font-size: .92rem; line-height: 1.25; }
.sticky-cta .btn { padding: 9px 16px; white-space: nowrap; }
.sticky-x { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--ink-2); cursor: pointer; padding: 4px 6px; }
@media (min-width: 901px) { .sticky-cta { left: auto; right: 20px; bottom: 20px; max-width: 420px; border: 1px solid var(--line); border-radius: 14px; } }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
