:root {
  color-scheme: light;
  --bg: #faf9f6;
  --surface: #fff;
  --ink: #20201e;
  --muted: #686762;
  --line: #deddd7;
  --soft: #f0efe9;
  --button: #22221f;
  --button-text: #fff;
  --width: 1160px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181817;
  --surface: #222220;
  --ink: #f2f1eb;
  --muted: #b0afa8;
  --line: #3d3d38;
  --soft: #2b2b27;
  --button: #f2f1eb;
  --button-text: #20201e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 Arial, Helvetica, sans-serif; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
button { font: inherit; }
[hidden] { display: none !important; }
header, main, footer, .notice { width: min(var(--width), calc(100% - 64px)); margin-inline: auto; }
header { min-height: 92px; display: flex; align-items: center; gap: 36px; border-bottom: 1px solid var(--line); }
.brand { font-size: 23px; font-weight: 700; letter-spacing: -.8px; text-decoration: none; white-space: nowrap; }
header .brand { margin-right: auto; }
nav { display: flex; flex-wrap: wrap; gap: 12px 26px; }
nav a { font-size: 15px; text-decoration: none; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); cursor: pointer; font-size: 13px; white-space: nowrap; }
.theme-toggle:hover { background: var(--soft); }
.theme-icon { font-size: 21px; line-height: 1; }
.notice { font-size: 12px; color: var(--muted); padding-top: 16px; }
.sheet { padding: 64px 0; }
h1, h2, h3 { margin: 0 0 22px; font-weight: 600; line-height: 1.1; letter-spacing: -.045em; overflow-wrap: break-word; }
h1 { font-size: clamp(38px, 4.6vw, 64px); }
h2 { font-size: clamp(28px, 3vw, 42px); }
p { margin: 0 0 22px; max-width: 65ch; }
.lead { font-size: 19px; line-height: 1.65; color: var(--muted); }
.meta { font-size: 13px; color: var(--muted); margin: 20px 0 0; }
.hero { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 64px; padding-top: 48px; padding-bottom: 76px; }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 45ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 22px; margin-top: 28px; font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 13px 22px; min-height: 48px; background: var(--button); color: var(--button-text); border: 1px solid var(--button); border-radius: 5px; text-decoration: none; font-size: 15px; font-weight: 600; }
.button:hover { opacity: .84; text-decoration: none; }
.worksheet { background: var(--surface); padding: 32px; border: 1px solid var(--line); border-radius: 6px; }
.worksheet h2 { font-size: 30px; letter-spacing: -.035em; }
.worksheet p, .worksheet a { font-size: 15px; }
table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 14px; }
caption { text-align: left; font-size: 12px; color: var(--muted); padding-bottom: 12px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
th:last-child, td:last-child { text-align: right; }
thead { color: var(--muted); font-size: 12px; }
tfoot { background: var(--soft); font-weight: 700; }
.catalog { border-top: 1px solid var(--line); }
.section-label { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.section-label span { font-variant-numeric: tabular-nums; }
.section-head { max-width: 720px; }
.section-head p { color: var(--muted); }
.topics { margin: 28px 0 16px; gap: 10px; }
.topics a { background: var(--soft); border: 1px solid var(--line); padding: 7px 13px; border-radius: 4px; font-size: 13px; }
.rows { counter-reset: guides; }
.row { counter-increment: guides; display: grid; grid-template-columns: 32px 1fr 28px; gap: 20px; align-items: baseline; border-bottom: 1px solid var(--line); padding: 24px 0; }
.row::before { content: counter(guides, decimal-leading-zero); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row h2 { font-size: clamp(22px, 2.3vw, 29px); margin: 6px 0 10px; letter-spacing: -.025em; line-height: 1.2; }
.row h2 a { text-decoration: none; }
.row h2 a:hover { text-decoration: underline; }
.row p { margin-bottom: 0; font-size: 15px; color: var(--muted); }
.row .meta { margin: 0; font-size: 12px; }
.row > span { font-size: 23px; }
.download { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; background: var(--soft); padding: 40px; margin: 20px 0 72px; border-radius: 6px; }
.download .lead { color: var(--ink); }
.download p { font-size: 16px; }
.prose { max-width: 780px; margin-inline: auto; }
.prose h1 { margin-top: 30px; }
.prose h2 { margin-top: 40px; font-size: 30px; }
.prose > a:first-child { color: var(--muted); font-size: 14px; }
footer { border-top: 1px solid var(--line); padding: 32px 0 28px; color: var(--muted); }
.footer-intro { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 20px; font-size: 14px; }
footer .brand { font-size: 17px; color: var(--ink); letter-spacing: -.4px; }
footer nav { gap: 10px 0; }
footer nav a { font-size: 13px; }
footer nav a + a::before { content: '·'; display: inline-block; margin: 0 12px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.footer-bottom p { font-size: 12px; margin: 0; }
.skip { position: absolute; top: -100px; left: 20px; padding: 12px; z-index: 10; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }
@media (max-width: 900px) {
  header { gap: 20px; flex-wrap: wrap; padding: 20px 0; }
  .hero { gap: 32px; grid-template-columns: 1.2fr 1fr; }
  .worksheet { padding: 24px; }
  .theme-toggle [data-theme-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme-toggle { width: 44px; }
}
@media (max-width: 640px) {
  header, main, footer, .notice { width: calc(100% - 40px); }
  header { gap: 16px; }
  header nav { order: 3; flex-basis: 100%; gap: 24px; }
  header nav a { min-height: 32px; display: inline-flex; align-items: center; }
  .hero { grid-template-columns: 1fr; padding: 36px 0 44px; gap: 32px; }
  .hero h1 { font-size: clamp(36px, 9vw, 54px); max-width: 17ch; }
  .lead { font-size: 17px; }
  .sheet { padding-block: 40px; }
  .worksheet h2 { font-size: 28px; }
  .row { grid-template-columns: 23px 1fr 16px; gap: 10px; }
  .row > span { font-size: 20px; }
  .download { grid-template-columns: 1fr; padding: 26px 22px; gap: 8px; margin-bottom: 44px; }
  .topics a { font-size: 12px; }
  .footer-intro { display: block; }
  .footer-intro span { display: block; margin-top: 10px; }
  .footer-bottom { display: block; }
  .footer-bottom p + p { margin-top: 8px; }
  .prose h1 { font-size: 38px; }
}
