:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f7faf9;
  --hero-from: #edf7f4;
  --hero-glow: #d5f4ea;
  --ink: #152b37;
  --body: #344a54;
  --muted: #50616a;
  --line: #dce5e6;
  --line-strong: #b8c8c9;
  --accent: #126f60;
  --accent-soft: #e9f5f1;
  --button: #102732;
  --button-ink: #ffffff;
  --button-hover: #255366;
  --band: #102732;
  --band-ink: #ffffff;
  --band-muted: #c3d6db;
  --band-card: #23414b;
  --band-card-hover: #34545d;
  --band-line: #45616a;
  --mint: #61d2b2;
  --code-bg: #122a35;
  --code-ink: #ddf7ef;
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d171c;
    --surface: #13222a;
    --hero-from: #12252c;
    --hero-glow: #17453c;
    --ink: #e6f1f0;
    --body: #cbdadc;
    --muted: #9fb4ba;
    --line: #263b44;
    --line-strong: #44616b;
    --accent: #73dcc0;
    --accent-soft: #17352f;
    --button: #61d2b2;
    --button-ink: #08201a;
    --button-hover: #8ce5cb;
    --band: #091215;
    --band-card: #14262e;
    --band-card-hover: #1d3640;
    --band-line: #2e4852;
    --code-bg: #071115;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); overflow-wrap: break-word; }
a { color: inherit; }
a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.band a:focus-visible { outline-color: var(--mint); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; }
:target { scroll-margin-top: 20px; }

.wrap { width: min(1160px, calc(100% - 40px)); margin: auto; }
.skip { position: absolute; top: -80px; left: 20px; background: var(--bg); padding: 12px; z-index: 4; }
.skip:focus { top: 12px; }
.prose { max-width: 62ch; color: var(--muted); }
.text-link { font-weight: 750; color: var(--accent); }

.topbar { border-bottom: 1px solid var(--line); }
.bar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-size: 1.2rem; font-weight: 800; letter-spacing: -.04em; }
.brand small { font-size: .67rem; letter-spacing: .04em; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 30px; padding: 1px 7px; }
.mark { width: 30px; height: 30px; background: url("favicon.png") center / contain no-repeat; }
.bar nav { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.bar nav a { text-decoration: none; font-weight: 600; font-size: .92rem; padding: 4px 0; border-bottom: 2px solid transparent; }
.bar nav a:hover { color: var(--accent); }
.bar nav a[aria-current] { border-bottom-color: var(--accent); }
.bar nav .language { border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 10px; }

.hero { background: radial-gradient(circle at 80% 10%, var(--hero-glow) 0, transparent 33%), linear-gradient(140deg, var(--hero-from), var(--bg) 65%); padding: 72px 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 54px; align-items: center; }
.eyebrow { font-size: .74rem; letter-spacing: .16em; font-weight: 800; color: var(--accent); margin: 0 0 15px; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); letter-spacing: -.045em; line-height: 1.16; margin: 0 0 24px; word-break: auto-phrase; text-wrap: balance; }
/* Japanese headlines need smaller type to break between phrases in three lines or fewer. */
:lang(ja) .hero h1 { font-size: clamp(2rem, 3.2vw, 2.65rem); letter-spacing: -.02em; line-height: 1.35; }
.lead { font-size: 1.13rem; line-height: 1.8; max-width: 52ch; color: var(--body); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.button { display: inline-block; text-decoration: none; padding: 12px 19px; border-radius: 8px; font-weight: 750; border: 1px solid transparent; }
.primary { background: var(--button); color: var(--button-ink); }
.primary:hover { background: var(--button-hover); }
.secondary { background: var(--bg); border-color: var(--line-strong); }
.secondary:hover { background: var(--accent-soft); }
.note { font-size: .86rem; color: var(--muted); }
.hero-image { margin: 0; }
.hero-image img { display: block; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 24px 55px #0004; }
figcaption { font-size: .82rem; color: var(--muted); margin-top: 9px; }

.section { padding: 72px 0; }
.section + .section { padding-top: 0; }
.section h2, .band h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -.035em; margin: 0 0 28px; }
.cards, .steps, .chapter-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.cards h3 { font-size: 1.1rem; margin: 0 0 8px; }
.cards p { color: var(--muted); margin: 0; }
.band { background: var(--band); color: var(--band-ink); padding: 68px 0; }
.steps { grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: step; }
.steps li { counter-increment: step; background: var(--band-card); border: 1px solid var(--band-line); border-radius: 10px; padding: 22px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: #08201a; font-weight: 800; }
.steps h3 { font-size: 1.1rem; margin: 14px 0 6px; }
.steps p { margin: 0; color: var(--band-muted); }
.chapter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chapter-grid a { display: block; height: 100%; padding: 17px 18px; background: var(--band-card); border: 1px solid var(--band-line); border-radius: 8px; text-decoration: none; }
.chapter-grid a:hover { background: var(--band-card-hover); }
.chapter-grid strong { display: block; margin-bottom: 6px; }
.chapter-grid span { display: block; font-size: .85rem; line-height: 1.6; color: var(--band-muted); }

.limit-list { max-width: 70ch; margin: 0 0 22px; padding-left: 22px; line-height: 1.85; color: var(--body); }

.manual-index { padding-top: 48px; padding-bottom: 80px; }
.manual-index h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin: 0 0 16px; }
.manual-index h2 { margin-top: 48px; }
.chapter-grid.light { margin-top: 28px; }
.chapter-grid.light a { background: var(--surface); border-color: var(--line); }
.chapter-grid.light a:hover { background: var(--accent-soft); }
.chapter-grid.light span { color: var(--muted); }
.task-list { padding-left: 20px; display: grid; gap: 8px; }
.task-list a { color: var(--accent); font-weight: 600; }

.docs { display: grid; grid-template-columns: 240px minmax(0, 780px); gap: 60px; padding-top: 46px; padding-bottom: 80px; align-items: start; }
.sidebar { position: sticky; top: 20px; }
.sidebar ol, .chapter-menu ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.sidebar a, .chapter-menu a { display: block; text-decoration: none; padding: 9px 12px; color: var(--muted); font-size: .91rem; border-radius: 6px; }
.sidebar a:hover, .sidebar a[aria-current], .chapter-menu a:hover, .chapter-menu a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.chapter-menu { display: none; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 26px; }
.chapter-menu summary { cursor: pointer; padding: 11px 14px; font-weight: 700; }
.chapter-menu nav { padding: 0 6px 8px; }
.article { min-width: 0; }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.035em; margin: 0 0 14px; }
.summary { color: var(--muted); font-size: 1.05rem; margin: 0 0 26px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 20px; margin-bottom: 30px; }
.toc p { margin: 0 0 6px; font-weight: 750; font-size: .85rem; }
.toc ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 32px; }
.toc a { color: var(--accent); }
.article section { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.article h2 { font-size: 1.45rem; letter-spacing: -.02em; margin: 8px 0 14px; }
.article h3 { font-size: 1.08rem; margin: 24px 0 8px; }
.article p, .article li { line-height: 1.85; color: var(--body); }
.article li + li { margin-top: 4px; }
.article a { color: var(--accent); }
.article .anchor { margin-left: 8px; text-decoration: none; color: var(--muted); opacity: .45; font-weight: 400; }
.article h2:hover .anchor, .article .anchor:focus-visible { opacity: 1; }
.article figure { margin: 24px 0; }
.article figure img { display: block; border: 1px solid var(--line); border-radius: 8px; }
.article pre { overflow: auto; background: var(--code-bg); color: var(--code-ink); border-radius: 8px; padding: 17px; font: 14px/1.65 ui-monospace, SFMono-Regular, monospace; }
code { font: .87em/1.5 ui-monospace, SFMono-Regular, monospace; background: var(--accent-soft); padding: 2px 4px; border-radius: 3px; }
pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
kbd { font: .82em/1.3 ui-monospace, SFMono-Regular, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); padding: 2px 5px; white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: .92rem; }
table.narrow { min-width: 0; }
th, td { text-align: left; vertical-align: top; padding: 10px 13px; border-bottom: 1px solid var(--line); line-height: 1.65; }
thead th { background: var(--surface); font-size: .82rem; }
tbody tr:last-child > * { border-bottom: 0; }
td code, th code { overflow-wrap: anywhere; }
.report { font-size: .85rem; text-align: right; }
.next-prev { display: flex; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.next-prev a { font-weight: 700; }

footer { border-top: 1px solid var(--line); }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px 0; color: var(--muted); font-size: .85rem; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .cards, .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .docs { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .sidebar { display: none; }
  .chapter-menu { display: block; }
  .footer { flex-direction: column; }
}

@media (max-width: 560px) {
  .wrap { width: min(100% - 32px, 1160px); }
  .bar { align-items: flex-start; flex-direction: column; padding: 14px 0; gap: 10px; }
  .bar nav { gap: 16px; }
  .hero { padding: 44px 0; }
  .cards, .chapter-grid { grid-template-columns: minmax(0, 1fr); }
  .section, .band { padding: 52px 0; }
  .toc ul { columns: 1; }
  table.narrow th:first-child, table.narrow td:first-child { width: 42%; }
  table.narrow th, table.narrow td { padding: 9px 10px; }
}
