:root {
  color-scheme: dark;
  --bg: #080b10;
  --surface: #10151c;
  --text: #f5f7fa;
  --body: #c5ccd6;
  --muted: #96a0af;
  --line: rgba(194, 210, 228, .14);
  --accent: #82b5ff;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 110px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, p, li, a { overflow-wrap: anywhere; }
h1, h2 { letter-spacing: 0; text-wrap: balance; }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 30; padding: 10px 16px; background: var(--text); color: var(--bg); border-radius: 6px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); color: var(--bg); }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1280px, calc(100% - 32px));
  min-height: 72px;
  margin: 12px auto 0;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 11, 16, .94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); font-size: 18px; font-weight: 720; text-decoration: none; }
.brand img { flex: 0 0 auto; border-radius: 10px; box-shadow: 0 0 0 1px rgba(190, 241, 255, .7), 0 0 5px 1px rgba(70, 197, 255, .4), 0 0 10px 2px rgba(50, 116, 255, .24); }
.header-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; font-weight: 600; }
.header-nav > a { display: inline-flex; align-items: center; min-height: 44px; color: var(--body); text-decoration: none; }
.header-nav > a:hover { color: white; }
.language-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.language-switch a, .language-switch span { display: grid; place-items: center; min-width: 44px; min-height: 40px; border-radius: 5px; text-decoration: none; color: var(--muted); }
.language-switch [aria-current] { background: #25303d; color: var(--text); }

.document-intro { padding: 68px 0 36px; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font-size: 14px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
h1 { margin: 0; max-width: 850px; font-size: 48px; line-height: 1.12; font-weight: 700; }
.meta { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.summary { max-width: 740px; margin: 22px 0 0; color: var(--body); font-size: 18px; line-height: 1.65; }
.contact-link { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 48px; margin-top: 24px; font-weight: 650; }
.contact-link span:last-child { flex: 0 0 auto; }

.document-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); align-items: start; gap: 64px; padding: 40px 0 72px; }
.document-toc { position: sticky; top: 116px; font-size: 14px; }
.document-toc h2 { margin: 0 0 12px; font-size: 13px; line-height: 1.4; font-weight: 650; color: var(--muted); }
.document-toc ol { margin: 0; padding: 0; list-style: none; }
.document-toc a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; color: var(--body); line-height: 1.4; text-decoration: none; }
.document-toc a:hover { color: var(--accent); }
.document-body { min-width: 0; color: var(--body); }
.document-body h2 { margin: 38px 0 14px; padding-top: 30px; border-top: 1px solid var(--line); color: var(--text); font-size: 24px; line-height: 1.3; font-weight: 620; text-wrap: pretty; }
.document-body > h2:first-child { margin-top: 0; padding-top: 0; border: 0; }
.document-body p { margin: 0 0 16px; }
.document-body ul { margin: 16px 0 0; padding-left: 22px; }
.document-body li { margin: 12px 0; padding-left: 4px; }
.document-body li::marker { color: var(--muted); }
.document-body strong { color: var(--text); font-weight: 620; }
.document-body .notice { margin-top: 32px; padding: 4px 0 4px 22px; border-left: 2px solid var(--accent); }
.document-body .notice h2 { margin: 0 0 12px; padding: 0; border: 0; font-size: 20px; }
.document-body .notice p:last-child { margin-bottom: 0; }

.site-footer { padding: 44px 0 max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; align-items: start; gap: 32px; }
.footer-brand .brand { font-size: 18px; }
.footer-brand > p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.footer-column { display: grid; align-content: start; gap: 4px; font-size: 14px; }
.footer-column strong { margin-bottom: 10px; font-weight: 650; }
.footer-column a, .footer-column > span { display: flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; }
.footer-column a:hover { color: var(--text); }
.footer-store { display: block; margin-top: 12px; max-width: 150px; }
.footer-store img { width: 150px; height: auto; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .document-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 36px; }
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 96px; }
  .shell { width: calc(100% - 48px); }
  .site-header { top: 8px; width: calc(100% - 24px); min-height: 64px; gap: 12px; margin-top: 8px; padding: 8px 12px; }
  .brand { gap: 10px; font-size: 17px; }
  .brand img { width: 32px; height: 32px; border-radius: 9px; }
  .header-nav > a { display: none; }
  .document-intro { padding: 40px 0 28px; }
  .breadcrumb { margin-bottom: 18px; }
  h1 { font-size: 36px; line-height: 1.14; }
  .summary { margin-top: 18px; font-size: 17px; }
  .document-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 24px 0 48px; }
  .document-toc { position: static; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .document-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .document-toc a { font-size: 13px; }
  .document-body h2 { margin-top: 30px; padding-top: 26px; font-size: 22px; }
  .document-body .notice { padding-left: 16px; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-column:last-child { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; }
  .footer-column:last-child > strong, .footer-column:last-child > span, .footer-column:last-child > a:not(.footer-store) { grid-column: 1; }
  .footer-column:last-child > .footer-store { grid-column: 2; grid-row: 1 / 4; align-self: end; justify-self: end; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 360px) {
  .shell { width: calc(100% - 40px); }
  h1 { font-size: 32px; }
  .site-header .brand { font-size: 16px; gap: 8px; }
  .language-switch a, .language-switch span { min-width: 40px; }
}

@media print {
  :root { color-scheme: light; --text: #111; --body: #222; --muted: #444; --bg: white; --line: #ccc; --accent: #222; }
  .site-header, .site-footer, .document-toc, .skip-link, .breadcrumb, .contact-link { display: none; }
  .shell { width: 100%; }
  .document-intro { padding-top: 0; }
  .document-layout { display: block; padding-bottom: 0; }
  .document-body h2 { break-after: avoid; }
}
