*, *::before, *::after { box-sizing: border-box; }

html { background: var(--color-bg); }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img { max-width: 100%; height: auto; }

/*
 * The UA stylesheet gives [hidden] a display:none that any class-level display
 * rule outranks — and almost every panel here sets display:flex. Without this,
 * hiding a screen has no effect and all three render at once.
 */
[hidden] { display: none !important; }

/*
 * Content defence. Option text and explanations are authored copy, but a tenant
 * can put a long URL or an unbroken policy name into configuration, and a flex
 * child will happily push past its container rather than break a long word.
 */
body { overflow-wrap: break-word; }
p, li, dd, dt, h1, h2, h3, legend { min-width: 0; }

/* One visible focus treatment everywhere, including on non-interactive review
   rows that are focusable so keyboard users can read every explanation. */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-4); }

/* Keep the focus ring visible when the forced palette overrides outline colour. */
@media (forced-colors: active) {
  :focus-visible { outline: 3px solid CanvasText; outline-offset: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
