:root {
  color-scheme: light;
  --bg: #f2fbf4;
  --surface: #ffffff;
  --surface-soft: #e7f6ea;
  --ink: #163f27;
  --muted: #5c7564;
  --primary: #24a148;
  --primary-dark: #176a33;
  --line: #d6e8da;
  --warm: #fff7e6;
  --warm-line: #f1cf85;
  --shadow: 0 8px 24px rgba(22, 63, 39, 0.08);
  --content: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary);
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(36, 161, 72, 0.25);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(214, 232, 218, 0.9);
  background: rgba(242, 251, 244, 0.96);
  backdrop-filter: blur(14px);
}

.header-inner,
.page-width {
  width: min(calc(100% - 40px), var(--content));
  margin-inline: auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.header-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.legal-home {
  padding: 72px 0 84px;
}

.intro {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08;
  font-weight: 780;
}

.lead {
  max-width: 690px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 44px;
}

.document-card {
  min-height: 216px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.document-card:hover {
  transform: translateY(-2px);
  border-color: #9fd6ad;
  box-shadow: 0 12px 30px rgba(22, 63, 39, 0.12);
  color: var(--ink);
}

.document-tag {
  align-self: flex-start;
  padding: 4px 10px;
  border: 1px solid #b8dec1;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 750;
}

.document-card h2 {
  margin: 22px 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.document-card p {
  margin: 0;
  color: var(--muted);
}

.document-action {
  margin-top: auto;
  padding-top: 24px;
  color: var(--primary-dark);
  font-weight: 750;
}

.support-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.support-band h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.support-band p {
  margin: 0;
  color: var(--muted);
}

.support-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid #a9d8b4;
  border-radius: 8px;
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.document-main {
  padding: 36px 0 88px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 28px;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.document-hero {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.document-hero h1 {
  max-width: 920px;
  font-size: clamp(32px, 5vw, 48px);
}

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

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.metadata span {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.document-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
  margin-top: 36px;
}

.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 124px);
  overflow: auto;
  padding-right: 12px;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 7px 0 7px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.toc a:hover {
  border-left-color: var(--primary);
  color: var(--primary-dark);
}

.toc-mobile {
  display: none;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.toc-mobile summary {
  padding: 14px 16px;
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 750;
}

.toc-mobile ol {
  margin: 0;
  padding: 0 20px 16px 38px;
}

.toc-mobile li + li {
  margin-top: 7px;
}

.legal-copy {
  min-width: 0;
  padding: 4px 0 0;
}

.legal-intro {
  margin-bottom: 34px;
  padding: 20px 22px;
  border-left: 4px solid var(--primary);
  background: var(--surface-soft);
}

.legal-intro p {
  margin: 0;
}

.legal-section {
  padding: 0 0 34px;
}

.legal-section + .legal-section {
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.3;
}

.legal-section h3 {
  margin: 26px 0 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.4;
}

.legal-section p {
  margin: 0 0 16px;
  color: #294f37;
}

.legal-list {
  margin: 0 0 18px;
  padding-left: 24px;
}

.legal-list li {
  padding-left: 6px;
  color: #294f37;
}

.legal-list li + li {
  margin-top: 10px;
}

.legal-note {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--warm-line);
  border-radius: 8px;
  background: var(--warm);
  color: #5c471a;
}

.document-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #eaf6ed;
}

.footer-inner {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.not-found {
  min-height: calc(100vh - 173px);
  display: grid;
  place-items: center;
  padding: 48px 0;
  text-align: center;
}

.not-found h1 {
  margin-inline: auto;
}

.not-found p {
  color: var(--muted);
}

@media (max-width: 820px) {
  .document-grid {
    grid-template-columns: 1fr;
  }

  .document-layout {
    display: block;
    margin-top: 26px;
  }

  .toc {
    display: none;
  }

  .toc-mobile {
    display: block;
  }

  .legal-copy {
    padding-top: 28px;
  }
}

@media (max-width: 620px) {
  .header-inner,
  .page-width {
    width: min(calc(100% - 28px), var(--content));
  }

  .header-inner {
    min-height: 62px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .header-label {
    display: none;
  }

  .legal-home {
    padding: 48px 0 60px;
  }

  h1 {
    font-size: 36px;
  }

  .lead,
  .document-summary {
    font-size: 17px;
  }

  .document-card {
    min-height: 200px;
    padding: 22px;
  }

  .support-band {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .support-link {
    width: 100%;
  }

  .document-main {
    padding: 26px 0 58px;
  }

  .back-link {
    margin-bottom: 20px;
  }

  .document-hero {
    padding-bottom: 24px;
  }

  .legal-intro {
    padding: 18px;
  }

  .legal-section h2 {
    font-size: 22px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 24px;
  }
}

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

  .document-card {
    transition: none;
  }
}
