:root {
  color-scheme: dark;
  --bg: #0a1f3f;
  --surface: #133052;
  --text: #e8eef6;
  --muted: #b0c8e0;
  --accent: #f5c400;
  --link: #7dc8ff;
  --line: #345174;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.7; }
header, main, footer { max-width: 880px; margin-inline: auto; padding: 1.5rem; }
header { padding-bottom: .5rem; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.2; margin-block: 1rem; }
h2 { font-size: clamp(1.35rem, 4vw, 1.7rem); line-height: 1.35; color: var(--accent); }
h3 { font-size: 1.05rem; margin-top: 1.5rem; }
p, li { overflow-wrap: anywhere; }
p { margin-block: .8rem; }
a { color: var(--link); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.lang-toggle { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.lang-toggle button { min-height: 44px; padding: .4rem .75rem; font: inherit; color: var(--text); border: 1px solid var(--line); border-radius: .4rem; background: transparent; cursor: pointer; }
.lang-toggle button.active { background: var(--surface); border-color: var(--accent); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.back, .to-top { display: inline-block; padding-block: .4rem; }
.contents { background: var(--surface); padding: 1rem 1.5rem; border-radius: .75rem; }
.contents h2 { margin-top: .25rem; }
.contents ol { padding-left: 1.3rem; }
.contents a { display: inline-block; padding-block: .3rem; }
section { scroll-margin-top: 1rem; padding-block: 1.5rem; border-bottom: 1px solid var(--line); }
section:target { border-top: 3px solid var(--accent); }
li { padding-left: .15rem; margin-block: .45rem; }
ul, ol { padding-left: 1.5rem; }
.note { border-left: 3px solid var(--accent); background: var(--surface); padding: .9rem 1rem; }
.to-top, .back { color: var(--muted); }
footer { display: flex; flex-wrap: wrap; gap: 1rem; padding-top: .5rem; padding-bottom: 2rem; }
@media (max-width: 480px) {
  header, main, footer { padding-inline: 1rem; }
  .contents { padding-inline: 1rem; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --text: #111; --accent: #111; --muted: #333; --link: #111; --surface: #f3f3f3; --line: #aaa; }
  .lang-toggle, .to-top, footer { display: none; }
  header, main { max-width: none; padding: 0; }
  h2, h3 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
}
