:root {
  /* ============================================================
     BRAND / ACCENT COLORS
     Swap only these three when reusing this template for a new
     site — everything else derives from them.
  ============================================================ */
  --doc-accent: #216778;
  --doc-accent-dark: #184e5c;
  --doc-accent-soft: #008080;

  /* ============================================================
     LIGHT THEME (default)
     This is the theme that renders if data-theme is never set —
     i.e. exactly what every page using this file looked like
     before dark mode existed. Nothing changes for a page that
     doesn't add the toggle button / flash-free script.
  ============================================================ */
  --doc-bg: #f7f8fa;
  --doc-surface: #ffffff;

  --doc-text: #222;
  --doc-muted: #666;

  --doc-heading: var(--doc-accent);
  --doc-link: var(--doc-accent);
  --doc-link-hover: var(--doc-accent-soft);

  --doc-border: #ddd;

  /* Button text color — kept as a token instead of a hardcoded
     "white" so a theme that uses a light accent color can flip it. */
  --doc-btn-text: #ffffff;

  /* Shadow color as an rgb triplet (not full rgba) so shadow
     opacity can still be tuned per-rule via rgba(var(--doc-shadow-rgb), x) */
  --doc-shadow-rgb: 0, 0, 0;

  --doc-radius: 14px;

  --doc-shadow: 0 10px 30px rgba(var(--doc-shadow-rgb), .08);
  --doc-shadow-btn: 0 6px 16px rgba(var(--doc-shadow-rgb), .18);
  --doc-shadow-btn-hover: 0 10px 22px rgba(var(--doc-shadow-rgb), .22);

  --doc-width: 1200px;

  --doc-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ================================================================
   DARK THEME OVERRIDE
   Only applies when <html data-theme="dark">. Toggled by the
   .theme-toggle button (see legal-document.js) and set flash-free
   by the inline <script> in each page's <head> — that script reads
   the SAME localStorage key the rest of the site uses for its own
   toggle, so the preference carries over automatically to any page
   opened from the main site (including in a new tab), with no
   extra wiring needed.
================================================================ */
[data-theme="dark"] {
  --doc-bg: #111111;
  --doc-surface: #1a1a1a;

  --doc-text: #f2f2f2;
  --doc-muted: #a3a3a3;

  --doc-heading: var(--doc-accent-soft);
  --doc-link: var(--doc-accent-soft);
  --doc-link-hover: var(--doc-accent);

  --doc-border: #333333;

  /* Shadows stay black-based in both themes on purpose — a black
     shadow still reads as "depth" against a dark surface, it's
     just softer. If a given brand wants a glow instead of a
     shadow in dark mode, override --doc-shadow-rgb here. */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--doc-bg);
  color: var(--doc-text);
  font-family: var(--doc-font);
  line-height: 1.75;
  transition: background-color .25s ease, color .25s ease;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.document-header {
  max-width: var(--doc-width);
  margin: auto;
  padding: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.brand-banner {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.brand-banner img {
  width: min(100%, 900px);
  aspect-ratio: 1200/630;
  object-fit: contain;
}

.document-title h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: var(--doc-heading);
}

.document-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.document-meta div {
  background: var(--doc-surface);
  padding: 1rem 1.5rem;
  border-radius: var(--doc-radius);
  box-shadow: var(--doc-shadow);
  border: 1px solid var(--doc-border);
}

.document-meta span {
  display: block;
  color: var(--doc-muted);
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 2rem;
  max-width: var(--doc-width);
  margin: auto;
  padding: 2rem;
}

.document-sidebar {
  position: sticky;
  top: 2rem;
  height: max-content;
}

.toc {
  background: var(--doc-surface);
  padding: 2rem 1.5rem;
  margin: 1rem 0 2rem;
  border-radius: var(--doc-radius);
  box-shadow: var(--doc-shadow);
  border: 1px solid var(--doc-border);
  max-width: 340px;
  font-weight: 600;
}

.toc a {
  color: var(--doc-link);
}

.toc a:hover {
  color: var(--doc-link-hover);
}

.document-content {
  background: var(--doc-surface);
  padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 4vw, 4rem);
  margin-bottom: 2rem;
  border-radius: var(--doc-radius);
  box-shadow: var(--doc-shadow);
  border: 1px solid var(--doc-border);
}

.document-content h2 {
  color: var(--doc-heading);
  margin-top: 3rem;
}

.document-content h3 {
  margin-top: 2rem;
}

.contact-info {
  font-style: normal;
  line-height: 1.9;
}

.contact-info a {
  color: var(--doc-link);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}

.contact-info a:hover {
  text-decoration: underline;
}

.contact-info a:focus-visible {
  outline: 2px solid var(--doc-link);
  outline-offset: 3px;
}

.document-footer {
  text-align: center;
  padding: 3rem;
  color: var(--doc-muted);
}

button {
  cursor: pointer;
  padding: .8rem 1.4rem;
  border: none;
  border-radius: var(--doc-radius);
  background: var(--doc-heading);
  color: var(--doc-btn-text);
  font-weight: 600;
  box-shadow: var(--doc-shadow-btn);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--doc-shadow-btn-hover);
  opacity: .92;
}

button:focus-visible {
  outline: 3px solid var(--doc-heading);
  outline-offset: 3px;
}

/* ================================================================
   THEME TOGGLE BUTTON
   Fixed to the top-right corner, matching the toggle on the main
   site's other pages. Only rendered if a page includes the markup
   (see privacy/index.html or terms/index.html for reference) —
   pages that don't add the button are completely unaffected.
================================================================ */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 30;

  width: 40px;
  height: 40px;
  flex-shrink: 0;

  border-radius: 50%;
  background: var(--doc-surface);
  border: 1px solid var(--doc-border);
  color: var(--doc-heading);

  font-size: 1rem;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: var(--doc-shadow);
}

.theme-toggle:hover {
  transform: translateY(-2px) rotate(12deg);
  opacity: 1;
  box-shadow: var(--doc-shadow-btn-hover);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 1000px) {
  .document-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .document-sidebar {
    margin-bottom: 0;
    position: relative;
  }

  .document-content {
    margin-top: .5rem;
  }
}

@media (max-width: 480px) {
  /* Move the toggle so it doesn't collide with the TOC's
     "Contents" button on narrow phones — both sit near the top
     of a page that has no navbar to anchor them to. */
  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
  }
}