:root {
  --bg: #0d1117; --surface: #161c26; --ink: #ece7da; --muted: #a39b88;
  --line: #2b3342; --amber: #d8a45a; --teal: #5ea8be; --radius: 12px;
}
[data-theme="light"] {
  --bg: #f6f1e6; --surface: #fffdf6; --ink: #211c12; --muted: #6f6552;
  --line: #ddd2ba; --amber: #96690f; --teal: #1f6e86;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: Georgia, "Times New Roman", serif; line-height: 1.6; }
body, .topbar, input, button, table { font-family: -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, .deck, main p, main li { font-family: Georgia, "Times New Roman", serif; }
main { max-width: 44rem; margin: 0 auto; padding: 0 1.1rem 4rem; }
section { scroll-margin-top: 4rem; margin: 3rem 0; }
h1 { font-size: 2rem; line-height: 1.15; margin: 0.6rem 0; }
h2 { font-size: 1.5rem; margin: 0 0 0.8rem; }
a { color: var(--amber); }
.kicker { color: var(--amber); font-size: 0.8rem; letter-spacing: 0.12em; margin: 2.2rem 0 0; }
.deck { font-size: 1.15rem; color: var(--muted); }
.byline { color: var(--muted); font-size: 0.85rem; }
.note { color: var(--muted); font-size: 0.92rem; }
.guard { border-left: 3px solid var(--amber); padding: 0.4rem 0.9rem; background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.live { font-weight: 700; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.4rem 0.7rem;
  flex-wrap: wrap; background: var(--bg); border-bottom: 1px solid var(--line); padding: 0.45rem 0.8rem; font-size: 0.82rem; }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; white-space: nowrap; }
.rail { display: flex; gap: 0.7rem; overflow-x: auto; flex: 1; scrollbar-width: none; order: 5; flex-basis: 100%; }
.rail::-webkit-scrollbar { display: none; }
.rail a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.rail a:hover { color: var(--ink); }
@media (min-width: 40rem) { .topbar { flex-wrap: nowrap; } .rail { order: 0; flex-basis: auto; } }
.langs { position: relative; flex: none; }
.langs summary { list-style: none; cursor: pointer; padding: 4px 11px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 0.8rem; }
.langs summary::-webkit-details-marker { display: none; }
.langs > div { position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; z-index: 30; }
.langs > div a { padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 0.88rem; }
.langs > div a:hover { background: var(--bg); }
.themebtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0.2rem; display: flex; }
.themebtn .moon { display: none; }
[data-theme="light"] .themebtn .moon { display: block; }
[data-theme="light"] .themebtn svg:first-child { display: none; }
.split { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .split { grid-template-columns: 1fr 1fr; } }
.pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; }
.pane h3 { margin-top: 0.2rem; }
.pane ul { margin: 0.4rem 0; padding-left: 1.1rem; }
.planctl label { font-size: 1.1rem; font-weight: 700; }
.planctl input[type="range"] { width: 100%; accent-color: var(--amber); min-height: 2.5rem; }
.planout > div { margin: 0.6rem 0; }
.planout span { font-size: 0.85rem; color: var(--muted); }
.bar { height: 0.7rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 0.2rem 0; }
.bar i { display: block; height: 100%; background: var(--amber); border-radius: 999px; width: 0; }
.planout strong { color: var(--amber); }
.tblwrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); }
.q { color: var(--muted); font-size: 0.8rem; }
.profile { margin: 1rem 0; }
.profile svg { width: 100%; height: auto; display: block; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.line-tf { stroke: var(--amber); }
.line-ta { stroke: var(--teal); }
.profile circle { fill: var(--amber); }
.profile .lbl { font-size: 13px; fill: var(--muted); font-family: -apple-system, "Segoe UI", sans-serif; }
details.faq { border-bottom: 1px solid var(--line); padding: 0.6rem 0; }
details.faq summary { cursor: pointer; font-weight: 700; }
.snap { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; margin-top: 1rem; }
.snapcap { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.6rem; }
.snaprow + .snaprow { border-top: 1px solid var(--line); margin-top: 0.8rem; padding-top: 0.8rem; }
.snaprow h4 { margin: 0 0 0.2rem; font-size: 1rem; }
.snapvalid { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.4rem; }
details.snapq summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.snapq blockquote { margin: 0.6rem 0 0.2rem; padding-left: 1rem; border-left: 2px solid var(--line);
  color: var(--muted); font-size: 0.9rem; }
.mine { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; }
.mine h3 { margin-top: 0.2rem; }
.mine ul { margin: 0.4rem 0; padding-left: 1.1rem; }
.badge { font-size: 0.72rem; font-weight: 700; border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 9px; color: var(--muted); white-space: nowrap; }
.mine.closed .badge { color: var(--amber); border-color: var(--amber); }
.mline { color: var(--muted); font-size: 0.88rem; }
.bib { font-size: 0.9rem; color: var(--muted); }
.bib a { color: var(--muted); }
footer { border-top: 1px solid var(--line); padding: 1.2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
footer a { color: var(--muted); margin: 0 0.3rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
