:root {
  color-scheme: light dark;
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-soft: #edf3f8;
  --text: #102037;
  --muted: #596a80;
  --line: rgba(31, 61, 94, 0.16);
  --accent: #087eb8;
  --accent-soft: rgba(22, 155, 220, 0.1);
  --notice: #fff8df;
  --notice-line: #dba72c;
  --max: 920px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08111f;
    --surface: #101d30;
    --surface-soft: #0c1728;
    --text: #f5f8fc;
    --muted: #aebbd0;
    --line: rgba(167, 190, 219, 0.18);
    --accent: #48b8f3;
    --accent-soft: rgba(72, 184, 243, 0.13);
    --notice: #29240f;
    --notice-line: #dba72c;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}

a:hover { text-decoration-thickness: 2px; }

:where(a, button):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.redirect-page {
  width: min(calc(100% - 32px), 720px);
  margin: 0 auto;
  padding: clamp(48px, 12vw, 120px) 0;
}

.redirect-page p {
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.legal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(calc(100% - 32px), 1160px);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
  font-size: 14px;
}

.legal-nav a { color: var(--muted); }
.legal-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }

.legal-layout {
  width: min(calc(100% - 32px), 1160px);
  margin: 0 auto;
  padding: 64px 0 88px;
  display: grid;
  grid-template-columns: 230px minmax(0, var(--max));
  gap: 56px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 100px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.toc strong {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
}

.toc a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.document {
  min-width: 0;
  padding: clamp(24px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.document-header {
  margin-bottom: 42px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h2 {
  margin: 48px 0 14px;
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h3 {
  margin: 28px 0 8px;
  font-size: 19px;
  line-height: 1.35;
}

p { margin: 0 0 14px; }
ul, ol { margin: 10px 0 18px; padding-left: 24px; }
li + li { margin-top: 8px; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 14px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
}

.notice {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--notice-line);
  border-radius: 8px;
  background: var(--notice);
}

.info {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
}

.document-footer {
  margin-top: 54px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .toc { position: static; }
  .toc div { columns: 2; }
}

@media (max-width: 650px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .legal-nav { justify-content: flex-start; }
  .legal-layout { width: min(calc(100% - 20px), 1160px); padding-bottom: 44px; }
  .document { padding: 22px 18px; border-radius: 16px; }
  .toc div { columns: 1; }
  h2 { margin-top: 38px; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #bbb; }
  .legal-header, .toc, .skip-link { display: none; }
  .legal-layout { display: block; width: auto; padding: 0; }
  .document { max-width: none; padding: 0; border: 0; }
  a { color: inherit; }
}
