:root {
  --ink: #241a30;
  --muted: #6d6176;
  --surface: #ffffff;
  --canvas: #faf7fc;
  --brand: #321a84;
  --brand-dark: #211057;
  --accent: #ffce00;
  --line: #e8e1ed;
  --shadow: 0 14px 38px rgba(50, 26, 132, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.shell { width: min(1220px, calc(100% - 48px)); margin: 0 auto; }
.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(50, 26, 132, 0.97);
  backdrop-filter: blur(14px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; opacity: 0.92; }
.brand-mark { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #fff; }
.brand-label { font-size: 1.08rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.brand-label small { display: block; margin-top: 4px; color: #ddd3ff; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a { padding: 8px 11px; border-radius: 8px; color: #f9f7ff; font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #27115f; background: var(--accent); }

.doc-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 46px; align-items: start; padding: 58px 0 48px; }
.toc { position: sticky; top: 104px; max-height: calc(100vh - 130px); overflow: auto; padding: 18px 4px 18px 0; }
.toc h2 { margin: 0 0 12px; color: var(--brand); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li + li { margin-top: 7px; }
.toc a { display: block; color: var(--muted); font-size: 0.84rem; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--brand); text-decoration: underline; }

.legal-document { min-width: 0; padding: clamp(26px, 5vw, 58px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.document-header { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; letter-spacing: -0.025em; }
h1 { margin: 0; max-width: 760px; font-size: clamp(2.05rem, 5vw, 3.55rem); }
h2 { margin: 3.1rem 0 0.95rem; padding-top: 0.2rem; font-size: clamp(1.42rem, 2.5vw, 1.86rem); scroll-margin-top: 104px; }
h3 { margin: 1.85rem 0 0.6rem; font-size: 1.15rem; scroll-margin-top: 104px; }
.document-meta { margin: 14px 0 0; color: var(--muted); font-size: 0.92rem; }
.document-actions { display: flex; gap: 12px; margin-top: 22px; }
.button-link { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 15px; border-radius: 9px; color: #fff; background: var(--brand); font-size: 0.9rem; font-weight: 800; text-decoration: none; }
.button-link:hover { color: #fff; background: var(--brand-dark); }
.document-copy > :first-child { margin-top: 31px; }
.document-copy p, .document-copy li { overflow-wrap: anywhere; }
.document-copy p { margin: 1rem 0; }
.document-copy ul, .document-copy ol { margin: 1rem 0; padding-left: 1.4rem; }
.document-copy li + li { margin-top: 0.48rem; }
.document-copy blockquote { margin: 1.45rem 0; padding: 18px 20px; border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; color: #3e3150; background: #f7f3ff; }
.document-copy blockquote p { margin: 0; }
.document-copy table { width: 100%; margin: 1.4rem 0; border-collapse: collapse; font-size: 0.9rem; }
.document-copy th, .document-copy td { padding: 12px 13px; border: 1px solid var(--line); vertical-align: top; text-align: left; }
.document-copy th { color: #fff; background: var(--brand); font-weight: 800; }
.document-copy tr:nth-child(even) td { background: #fcfaff; }
.document-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.site-footer { padding: 24px 0 38px; color: var(--muted); font-size: 0.84rem; text-align: center; }
.site-footer p { margin: 0; }

@media (max-width: 880px) {
  .shell { width: min(100% - 32px, 760px); }
  .doc-layout { display: block; padding-top: 32px; }
  .toc { position: static; max-height: none; margin-bottom: 25px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .toc ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

@media (max-width: 580px) {
  body { font-size: 15px; }
  .shell { width: min(100% - 24px, 760px); }
  .header-inner { min-height: 68px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-label { font-size: 0.98rem; }
  .brand-label small { display: none; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 7px 7px; font-size: 0.73rem; text-align: center; }
  .doc-layout { padding-top: 23px; }
  .toc ul { display: block; }
  .legal-document { padding: 24px 19px; border-radius: 12px; }
  h2 { margin-top: 2.5rem; }
  .document-copy table { display: block; overflow-x: auto; white-space: normal; }
  .document-copy th, .document-copy td { min-width: 150px; }
}

@media print {
  body { background: #fff; font-size: 10.5pt; }
  .site-header, .toc, .document-actions, .site-footer { display: none; }
  .shell { width: auto; margin: 0; }
  .doc-layout { display: block; padding: 0; }
  .legal-document { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  h1 { font-size: 28pt; }
  h2 { page-break-after: avoid; }
  table, blockquote { break-inside: avoid; }
}
