/* Shared by FastAPI documents and React. Keep the ground and public palette here. */
:root {
  color-scheme: light;
  --site-background: hsl(210 25% 98%);
  --site-foreground: hsl(222 20% 10%);
  --site-card: hsl(0 0% 100%);
  --site-muted: hsl(210 20% 94%);
  --site-muted-foreground: hsl(215 15% 40%);
  --site-border: hsl(220 13% 85%);
  --site-primary: hsl(222 20% 10%);
  --site-primary-foreground: hsl(0 0% 100%);
  --site-success: hsl(150 55% 30%);
  --site-stream: 160 20% 34%;
  --site-accent: #08767c;
  --site-accent-text: #08767c;
  --site-focus: hsl(178 70% 28%);
  --site-glass: hsl(0 0% 100% / 0.75);
  --site-glass-edge: var(--site-border);
  --site-glass-shadow: hsl(224 25% 40% / 0.15);
}
.dark {
  color-scheme: dark;
  --site-background: hsl(0 0% 4%);
  --site-foreground: hsl(0 0% 95%);
  --site-card: hsl(0 0% 8%);
  --site-muted: hsl(0 0% 12%);
  --site-muted-foreground: hsl(0 0% 66%);
  --site-border: hsl(0 0% 18%);
  --site-primary: hsl(0 0% 92%);
  --site-primary-foreground: hsl(0 0% 6%);
  --site-success: hsl(150 28% 69%);
  --site-stream: 160 10% 70%;
  --site-accent: #0e878e;
  --site-accent-text: color-mix(in srgb, var(--site-accent) 92%, white);
  --site-focus: hsl(180 65% 54%);
  --site-glass: hsl(0 0% 0% / 0.45);
  --site-glass-edge: hsl(0 0% 100% / 0.2);
  --site-glass-shadow: hsl(0 0% 0% / 0.9);
}
body {
  isolation: isolate;
  background: var(--site-background);
}
.ac-dots {
  --grid-glow: #8f72ff;
  --grid-dot: color-mix(in oklab, var(--grid-glow) 12%, transparent);
  --grid-dot-hi: color-mix(in oklab, var(--grid-glow) 22%, transparent);
  background: linear-gradient(135deg, color-mix(in oklab, var(--grid-glow) 7%, transparent), transparent 30%), linear-gradient(28deg, rgb(59 26 120 / 0.1), transparent 46%), var(--site-background);
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}
[data-theme-scope="app"] .ac-dots { display: none; }
.ac-dots::before, .ac-dots::after {
  background-size: 8px 8px;
  content: "";
  inset: 0;
  position: absolute;
}
.ac-dots::before {
  background-image: radial-gradient(circle at 4px 4px, var(--grid-dot) 1px, transparent 1.35px);
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.85), rgb(0 0 0 / 0.3));
  opacity: 0.75;
}
.ac-dots::after {
  background-image: radial-gradient(circle at 4px 4px, var(--grid-dot-hi) 1px, transparent 1.35px);
  mask-image: radial-gradient(300px circle at var(--mx, 50vw) var(--my, 30vh), rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.3) 44%, transparent 72%);
}
@media (prefers-reduced-motion: no-preference) {
  .ac-dots::before { animation: ac-dots-drift 32s linear infinite; }
  .ac-dots::after { animation: ac-dots-drift 22s linear infinite reverse; }
}
@keyframes ac-dots-drift { from { background-position: 0 0; } to { background-position: 16px 16px; } }
.site-theme-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 36px;
  justify-content: center;
  width: 36px;
}
.site-theme-toggle:hover { background: var(--site-muted); }
.site-theme-toggle svg { height: 16px; width: 16px; }
.light [data-theme-icon="light"], .dark [data-theme-icon="dark"] { display: none; }

/* VerbalWars' learn-page frame: sticky side list, compact scrolling row on phones. */
.legal-layout {
  display: grid;
  flex: 1;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1072px;
  padding: 32px 0 64px;
  width: calc(100% - 64px);
}
.legal-sidebar, .legal-content { min-width: 0; }
.legal-back {
  color: var(--site-muted-foreground);
  display: none;
  font: 400 0.875rem/1.5 "Geist", system-ui, sans-serif;
  margin: 0 0 8px;
  padding: 0 10px;
}
.legal-back:hover { color: var(--site-foreground); }
.legal-navigation {
  display: flex;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  position: relative;
}
.legal-link {
  align-items: center;
  border-radius: 999px;
  color: var(--site-muted-foreground);
  display: flex;
  flex-shrink: 0;
  font: 400 0.875rem/1.5 "Geist", system-ui, sans-serif;
  min-height: 44px;
  padding: 8px 12px;
  position: relative;
  text-decoration: none;
  transition: color 150ms ease;
  white-space: nowrap;
  z-index: 1;
}
.legal-link:hover { color: var(--site-foreground); }
.legal-link[aria-current="page"] { background: var(--site-muted); color: var(--site-foreground); }
.legal-content { line-height: 1.7; max-width: 68ch; padding: 0; width: 100%; }
.legal-path { color: var(--site-muted-foreground); font-size: 0.7rem; margin: 0 0 18px; }
.legal-path b { color: var(--site-primary); }
@media (min-width: 768px) {
  .legal-layout { gap: 40px; grid-template-columns: 15rem minmax(0, 1fr); }
  .legal-sidebar { align-self: start; position: sticky; top: 16px; }
  .legal-back { display: block; }
  .legal-navigation { display: grid; overflow: visible; padding: 0; }
  .legal-navigation[data-legal-ready]::before {
    background: var(--site-muted);
    border-radius: 999px;
    content: "";
    height: var(--legal-active-height);
    inset: 0 0 auto;
    pointer-events: none;
    position: absolute;
    transform: translateY(var(--legal-active-top));
    transition: transform 200ms ease, height 200ms ease;
  }
  .legal-navigation[data-legal-ready] .legal-link[aria-current="page"] { background: transparent; }
}
@media (max-width: 520px) {
  .legal-layout { width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .legal-link, .legal-navigation[data-legal-ready]::before { transition: none; }
}
