:root{
  --bg: #1B2027;
  --surface: #222933;
  --surface-raised: #2C3440;
  --text: #ECE7DC;
  --text-muted: #8A93A0;
  --rule: #363F4B;
  --accent: #7C8CFF;
  --accent-soft: rgba(124, 140, 255, 0.16);
  --accent-ink: #0A0D1F;
}
*{ box-sizing: border-box; }
html, body{ margin: 0; }
html{ scroll-behavior: smooth; }
body{
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection{ background: var(--accent); color: var(--accent-ink); }
.skip-link{
  position: fixed; top: 12px; left: 12px; z-index: 30; transform: translateY(-160%);
  padding: 10px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  font: 600 14px/1 'IBM Plex Sans', sans-serif; text-decoration: none;
}
.skip-link:focus{ transform: translateY(0); outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- Header (matches the app) ---------- */
header{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; row-gap: 8px;
  padding: 14px 20px; border-bottom: 1px solid var(--rule);
  background: var(--surface); position: sticky; top: 0; z-index: 10;
}
.brand{ display: flex; align-items: baseline; gap: 10px; padding-block: 12px; text-decoration: none; color: var(--text); }
.brand-mark{
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto;
}
.brand-name{ font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }
.doc-label{ font-size: 13px; color: var(--text-muted); }
.back-link{
  font-size: 13.5px; font-weight: 500; color: var(--text); text-decoration: none;
  border: 1px solid var(--rule); border-radius: 8px; padding: 8px 14px;
}
.back-link:hover{ border-color: var(--accent); color: var(--accent); }
.back-link:focus-visible, .brand:focus-visible, .toc a:focus-visible, .doc a:focus-visible, .legal-footer a:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* ---------- Layout ---------- */
.legal-wrap{
  max-width: 1040px; margin: 0 auto; padding: 40px 24px 100px;
  display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 56px; justify-content: center;
}
@media (max-width: 820px){
  .legal-wrap{ grid-template-columns: 1fr; }
  nav.toc{ position: static; order: 2; margin-top: 40px; }
}

/* ---------- Table of contents rail ---------- */
nav.toc{ position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; }
nav.toc .toc-title{
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 10px;
}
nav.toc ol{ list-style: none; margin: 0; padding: 0; counter-reset: none; }
nav.toc li{ margin: 0; }
nav.toc a{
  display: block; padding: 6px 10px; margin: 1px 0; border-radius: 6px;
  color: var(--text-muted); text-decoration: none; font-size: 13px; line-height: 1.4;
}
nav.toc a:hover{ background: var(--surface-raised); color: var(--text); }

/* ---------- Document body ---------- */
.doc{ font-family: 'Source Serif 4', Georgia, serif; font-size: 17px; line-height: 1.75; }
.doc > h1:first-child{
  font-family: 'IBM Plex Sans', sans-serif; font-size: 30px; font-weight: 600;
  margin: 0 0 6px; scroll-margin-top: 90px; color: var(--text);
}
.doc .doc-dates{ font-family: 'IBM Plex Sans', sans-serif; font-size: 13.5px; color: var(--text-muted); margin: 0 0 36px; }
.doc h2{
  font-family: 'IBM Plex Sans', sans-serif; font-size: 20px; font-weight: 600;
  color: var(--text); margin: 44px 0 14px; padding-top: 18px; border-top: 1px solid var(--rule);
  scroll-margin-top: 84px;
}
.doc h1 + .doc-dates + h2, .doc > h2:nth-of-type(1){ border-top: none; padding-top: 0; }
.doc h3{
  font-family: 'IBM Plex Sans', sans-serif; font-size: 15.5px; font-weight: 600;
  color: var(--text); margin: 26px 0 10px; scroll-margin-top: 84px;
}
.doc p{ margin: 0 0 16px; color: var(--text); }
.doc p, .doc li{ overflow-wrap: break-word; }
.doc ul, .doc ol{ margin: 0 0 16px; padding-left: 26px; }
.doc li{ margin: 0 0 8px; }
.doc strong{ color: var(--text); font-weight: 600; }
.doc a{ color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-soft); }
.doc a:hover{ text-decoration-color: var(--accent); }
.doc hr{ border: none; border-top: 1px solid var(--rule); margin: 36px 0; }

/* Placeholder text the site owner still needs to fill in before publishing */
.fill-in{
  background: var(--accent-soft); color: var(--accent);
  border-radius: 4px; padding: 1px 5px; font-family: 'IBM Plex Sans', sans-serif; font-size: 0.85em;
}

/* Larger callouts flagging something for attorney review — distinct from short fill-in blanks */
.review-note{
  background: rgba(251, 113, 133, 0.08); border: 1px dashed rgba(251, 113, 133, 0.5);
  border-radius: 6px; padding: 12px 16px; margin: 0 0 16px; font-size: 14px; line-height: 1.6;
  font-family: 'IBM Plex Sans', sans-serif; color: var(--text-muted);
}
.review-note strong{ color: #FDA4AF; }

.lang-select{
  background: transparent; color: var(--text);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 8px 14px; font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
}
.lang-select:hover{ border-color: var(--accent); color: var(--accent); }
.lang-select:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

.legal-footer{
  max-width: 680px; margin: 60px auto 0; padding: 20px 24px 0; border-top: 1px solid var(--rule);
  font-size: 13px; color: var(--text-muted); text-align: center;
}
.legal-footer a{ display: inline-block; padding: 12px 4px; color: var(--text-muted); }
.legal-footer a:hover{ color: var(--accent); }

@media (max-width: 540px){
  header{ padding: 12px 16px; }
  .doc-label{ order: 3; width: 100%; }
  .legal-wrap{ padding: 30px 16px 72px; }
  .doc{ font-size: 16px; line-height: 1.7; }
  .doc > h1:first-child{ font-size: 28px; }
  .doc h2{ font-size: 19px; margin-top: 36px; }
  .doc ul, .doc ol{ padding-left: 22px; }
  .legal-footer{ margin-top: 40px; padding-inline: 16px; line-height: 1.9; }
}

@media (prefers-reduced-motion: reduce){ html{ scroll-behavior: auto; } }
