:root {
  --ink: #18212a;
  --muted: #62707c;
  --accent: #07506d;
  --accent-dark: #063e55;
  --accent-soft: #eaf4f7;
  --line: #dce4e8;
  --paper: #ffffff;
  --canvas: #f3f6f7;
  --max-content: 800px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.65;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 1rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-dark);
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: white;
  background: var(--accent-dark);
  border-radius: 0.35rem;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  color: white;
  background: var(--accent-dark);
  box-shadow: 0 1px 0 rgb(255 255 255 / 12%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 2rem, 1180px);
  min-height: 4rem;
  margin-inline: auto;
}

.brand {
  color: white;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover {
  color: white;
}

.header-label {
  color: rgb(255 255 255 / 72%);
  font-size: 0.9rem;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, var(--max-content));
  gap: clamp(2rem, 5vw, 5rem);
  justify-content: center;
  width: min(100% - 2rem, 1180px);
  margin: 2rem auto 4rem;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 8rem);
  overflow: auto;
  font-size: 0.88rem;
}

.sidebar details {
  border-top: 2px solid var(--accent);
}

.sidebar summary {
  padding: 0.8rem 0;
  color: var(--accent-dark);
  font-weight: 750;
  cursor: pointer;
}

.sidebar ol {
  margin: 0;
  padding: 0 0 0 1.25rem;
}

.sidebar li {
  margin: 0.38rem 0;
  color: var(--muted);
}

.sidebar a {
  color: inherit;
  text-decoration: none;
}

.sidebar a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.legal-document {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 4rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: 0 1rem 3rem rgb(28 45 55 / 8%);
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding-bottom: 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

h1,
h2,
h3,
h4 {
  color: var(--accent-dark);
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 1.5rem 0 2rem;
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: -0.035em;
}

h2 {
  margin: 4rem 0 1.2rem;
  padding-top: 0.25rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

h3 {
  margin: 2.75rem 0 1rem;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
}

h4 {
  margin: 1.8rem 0 0.5rem;
  color: var(--ink);
  font-size: 1rem;
}

p {
  margin: 0 0 1rem;
  hyphens: auto;
}

.document-list {
  margin: 0.4rem 0 1.4rem;
  padding-left: 1.35rem;
}

.document-list li {
  margin: 0.35rem 0;
  padding-left: 0.2rem;
}

.document-list li::marker {
  color: var(--accent);
}

.placeholder {
  padding: 0.08em 0.25em;
  color: #6b4300;
  background: #fff0c2;
  border-radius: 0.2rem;
}

.document-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .page-shell {
    display: block;
    margin-top: 1rem;
  }

  .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 1rem;
    padding: 0.25rem 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0.5rem;
  }

  .sidebar details:not([open]) {
    padding-bottom: 0;
  }

  .legal-document {
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
  }
}

@media (max-width: 520px) {
  body {
    font-size: 0.96rem;
  }

  .header-inner,
  .page-shell {
    width: min(100% - 1rem, 1180px);
  }

  .legal-document {
    border-radius: 0.35rem;
  }
}

@media print {
  @page {
    size: A4;
    margin: 18mm 16mm;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 10.5pt;
  }

  .site-header,
  .sidebar,
  .skip-link,
  .document-footer {
    display: none;
  }

  .page-shell {
    display: block;
    width: auto;
    margin: 0;
  }

  .legal-document {
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  h1 {
    font-size: 24pt;
  }

  h2 {
    break-before: page;
    margin-top: 0;
    font-size: 17pt;
  }

  h3,
  h4 {
    break-after: avoid;
  }

  p,
  li {
    orphans: 3;
    widows: 3;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
