:root {
  --bg: #fbfaf9;
  --surface: #ffffff;
  --ink: #32292f;
  --muted: #776d73;
  --line: #ebe7e9;
  --soft: #f3f0f1;
  --accent: #99e1d9;
  --accent-ink: #1f4a45;
  --link: #1f6f66;
  --shadow: 0 1px 2px rgba(50, 41, 47, .05), 0 8px 24px rgba(50, 41, 47, .06);
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #241e22; --surface: #32292f; --ink: #e8ede8; --muted: #a99ea5; --line: #43393f; --soft: #3a3036;
    --accent: #86cfc7; --accent-ink: #12302c; --link: #8fd8cf;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #241e22; --surface: #32292f; --ink: #e8ede8; --muted: #a99ea5; --line: #43393f; --soft: #3a3036;
  --accent: #86cfc7; --accent-ink: #12302c; --link: #8fd8cf;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(30px, 5.2vw, 46px); letter-spacing: -.03em; }
h2 { font-size: 24px; margin-top: 2.2em; }
h3 { font-size: 18px; margin-top: 1.6em; }
p { margin: 0 0 1em; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }

header.top { border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo i { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: block; position: relative; }
.logo i::after { content: ""; position: absolute; left: 7px; top: 7px; width: 12px; height: 12px; border: 2px solid var(--accent-ink); border-radius: 50%; }
nav.main { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 15px; }
nav.main a { color: var(--muted); text-decoration: none; }
nav.main a:hover { color: var(--ink); }
.theme { background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: inherit; font-size: 13.5px; padding: 4px 12px; cursor: pointer; }
.theme:hover { color: var(--ink); }

.btn { display: inline-block; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; font-size: 16px; padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer; }
.btn:hover { opacity: .9; }
:root[data-theme="dark"] .btn { background: var(--accent); color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { background: var(--accent); color: var(--accent-ink); } }
.btn.ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 22px 0 6px; }

.hero { padding: 64px 0 28px; }
.hero p.lead { font-size: 20px; color: var(--muted); max-width: 640px; }
.crumbs { font-size: 14px; color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.page-head { padding: 12px 0 8px; }
.page-head p.lead { font-size: 19px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.tool { margin: 18px 0 10px; }
.tool .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.tool label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.tool .col { flex: 1 1 150px; min-width: 130px; }
.tool .col.sm { flex: 0 1 130px; }
input, select { font: inherit; font-size: 16px; width: 100%; padding: 9px 10px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.swap { flex: 0 0 auto; background: var(--soft); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 9px 12px; font: inherit; cursor: pointer; }
.result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.result .big { font-size: clamp(30px, 6vw, 44px); font-weight: 650; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result .big .tag { font-size: .42em; font-weight: 600; letter-spacing: 0; color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.result .sub { color: var(--muted); font-size: 15px; margin-top: 6px; }
.fmt { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.fmt button { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

table { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
th, td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 13.5px; font-weight: 600; color: var(--muted); background: var(--soft); }
tr:last-child td { border-bottom: 0; }
td.day { color: var(--muted); font-size: 13.5px; }
.tablewrap { overflow-x: auto; }

.cta { margin: 48px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.cta h2 { margin: 0 0 6px; font-size: 22px; }
.cta p { margin: 0; color: var(--muted); }
.cta > div { flex: 1 1 320px; }
.cta .btn { border-top: 3px solid var(--accent); }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 18px 0; }
.grid3 .card { padding: 20px; box-shadow: none; }
.grid3 h3 { margin-top: 0; }
.ex { font-size: 15px; color: var(--muted); }
.ex b { color: var(--ink); font-weight: 600; }

.demo p { margin: 0 0 .8em; font-size: 18px; }
.chip { display: inline-block; margin-left: 4px; padding: 0 7px; font-size: .78em; line-height: 1.55; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: .08em; }
.demo-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.demo-bar select { width: auto; font-size: 14px; padding: 5px 8px; }
.demo-bar .on { margin-left: auto; display: flex; gap: 6px; align-items: center; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "\2212"; }
details p { margin: 10px 0 0; color: var(--muted); }

.links { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 12px 0; padding: 0; list-style: none; }
.links a { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; text-decoration: none; color: var(--ink); background: var(--surface); }
.links a:hover { border-color: var(--accent); background: var(--soft); }

footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 30px 0 50px; font-size: 14.5px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; }
footer a { color: var(--muted); }
footer .grow { flex: 1 1 280px; }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .hero { padding-top: 40px; }
  nav.main a.hide-sm { display: none; }
  th, td { padding: 8px 10px; }
}
