:root {
  color-scheme: dark;
  --background: #090b0f;
  --surface: #141820;
  --surface-raised: #1b2029;
  --text: #f4f6f8;
  --muted: #a2abb8;
  --line: #2a303b;
  --accent: #7bc6dd;
  --accent-ink: #071014;
  --focus: #b5e5f2;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.page-shell {
  width: min(940px, calc(100% - 40px));
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(56px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.brand-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 11px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}

.brand > span {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 17px;
  line-height: 1.25;
}

.brand span span,
.language-field > span {
  color: var(--muted);
  font-size: 12px;
}

.language-field {
  display: grid;
  gap: 5px;
}

select {
  min-width: 170px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 36px 0 12px;
  font: inherit;
}

select:focus-visible,
.document-tab:focus-visible,
.legal-section a:focus-visible,
footer a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.document-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.document-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 9px 12px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.document-tab[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.document {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(24px, 5vw, 58px);
}

.document-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.document-badge {
  border: 1px solid #35505a;
  border-radius: 999px;
  background: #13262c;
  color: var(--accent);
  padding: 4px 10px;
  font-weight: 700;
}

h1 {
  max-width: 760px;
  margin: 24px 0 12px;
  font-size: clamp(32px, 6vw, 54px);
  hyphens: auto;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.document-summary {
  max-width: 720px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 18px;
}

.section-list {
  display: grid;
  gap: 12px;
}

.legal-section {
  border-top: 1px solid var(--line);
  padding: 26px 0 8px;
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.3;
}

.legal-section p { margin: 0 0 12px; }

.legal-section a,
footer a {
  color: var(--accent);
  overflow-wrap: anywhere;
  text-underline-offset: 3px;
}

.legal-section ul {
  margin: 8px 0 12px;
  padding-inline-start: 23px;
}

.legal-section li { margin: 7px 0; }

.legal-section p,
.legal-section li,
footer {
  color: #c8ced7;
}

footer {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  font-size: 13px;
}

footer p { margin: 5px 0; }

@media (max-width: 640px) {
  .page-shell { width: min(100% - 28px, 940px); }
  .topbar { align-items: flex-start; gap: 16px; }
  .brand-icon { width: 44px; height: 44px; }
  select { min-width: 132px; max-width: 44vw; }
  .document-tabs { grid-template-columns: 1fr; }
  .document-tab { justify-content: flex-start; min-height: 44px; }
  .document { padding: 24px 20px; }
  .document-meta { align-items: flex-start; flex-direction: column; gap: 8px; }
  h1 { font-size: 34px; }
  .document-summary { font-size: 16px; }
}

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

@media (prefers-contrast: more) {
  :root { --line: #717986; --muted: #d0d5dc; }
  .document-tab[aria-current="page"] { border-color: #ffffff; }
}
