:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --soft-bg: #f6f8fa;
  --surface: #ffffff;
  --surface-rgb: 255, 255, 255;
  --text: #17202a;
  --muted: #5f6f7a;
  --body-copy: #33424d;
  --line: #dfe5ea;
  --line-dark: #c7d0d8;
  --primary: #174ea6;
  --primary-dark: #123c80;
  --max: 920px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418;
    --soft-bg: #161d24;
    --surface: #151b22;
    --surface-rgb: 21, 27, 34;
    --text: #edf2f7;
    --muted: #a8b3bd;
    --body-copy: #d4dbe3;
    --line: #2a3440;
    --line-dark: #3a4654;
    --primary: #7fb3ff;
    --primary-dark: #a7caff;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body::before { display: none; }
a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 750;
}
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid rgba(23, 78, 166, .35); outline-offset: 3px; }

.wrap {
  width: min(var(--max), calc(100% - 40px));
  max-width: none;
  margin-inline: auto;
  padding: 0;
}

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--surface-rgb), .94);
  backdrop-filter: blur(12px);
}
.nav-inner {
  width: min(1120px, calc(100% - 40px));
  max-width: none;
  min-height: 68px;
  margin: auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: 0;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: none;
}
.brand span {
  color: var(--text);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 16px;
}
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  font: 700 14px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}
.nav-links a:hover { color: var(--text); }

header.wrap {
  position: static;
  padding: 72px 0 32px;
}
header.wrap::after { display: none; }
.badge {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--primary);
  font: 800 13px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
h1 {
  max-width: 820px;
  margin: 12px 0 14px;
  color: var(--text);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}
.lead {
  max-width: 780px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}
.muted {
  color: var(--muted);
}
header .muted {
  margin-top: 14px;
  color: var(--muted);
  font: 650 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

main.wrap {
  padding: 30px 0 86px;
}
.doc {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.doc > h2,
h2 {
  margin: 46px 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}
.doc > h2:first-of-type,
h2:first-child {
  margin-top: 0;
}
.doc h3,
h3 {
  margin: 28px 0 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}
.doc p,
p {
  max-width: 800px;
  margin: 0 0 15px;
  color: var(--body-copy);
}
.doc ul,
.doc ol,
ul,
ol {
  max-width: 800px;
  margin: 0 0 22px;
  padding-left: 24px;
  color: var(--muted);
}
.doc li,
li {
  margin: 8px 0;
  padding-left: 3px;
}
.doc li::marker,
li::marker {
  color: var(--primary);
}
.notice {
  margin: 0 0 34px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--soft-bg);
  color: var(--body-copy);
}
.highlight {
  border-color: var(--line);
  border-left-color: var(--primary);
  background: var(--soft-bg);
}
table {
  width: 100%;
  margin: 22px 0 8px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
}
th,
td {
  padding: 13px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--text);
  background: var(--soft-bg);
  font-weight: 800;
}
td {
  color: var(--muted);
}

footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: 650 13px/1.6 Inter, ui-sans-serif, system-ui, sans-serif;
}
footer .wrap {
  width: min(1120px, calc(100% - 40px));
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.legal-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
}
.legal-footer-links a:hover { color: var(--text); }

@media (max-width: 720px) {
  .wrap,
  .nav-inner,
  footer .wrap {
    width: min(100% - 28px, var(--max));
  }
  .nav-inner {
    min-height: 64px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }
  .nav-links {
    gap: 14px;
    font-size: 13px;
  }
  header.wrap {
    padding: 56px 0 24px;
  }
  h1 {
    font-size: 38px;
  }
  .lead {
    font-size: 17px;
  }
  main.wrap {
    padding-top: 24px;
    padding-bottom: 64px;
  }
  .doc > h2,
  h2 {
    margin-top: 40px;
    font-size: 25px;
  }
  .notice {
    padding: 16px;
  }
  table {
    display: block;
    overflow-x: auto;
  }
  footer .wrap {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 470px) {
  .brand span { display: none; }
  .nav-links { gap: 10px; }
  h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
