/* Elements and utilities. Only var(--…) tokens: no colour literals (tests/test_design_system.py). */

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font: var(--weight-regular) var(--text-sm) / var(--leading-body) var(--font-sans);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  /* shadcn: headings semibold with tight tracking; the body in the UI size (14 px) */
  h1, h2, h3, h4 { margin: 0; line-height: var(--leading-tight); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); }
  h4 { font-size: var(--text-md); }
  ::selection { background: var(--color-primary); color: var(--color-on-primary); }
  p, ul, ol, dl { margin: 0; }
  p + p { margin-top: var(--space-3); }
  /* flow: a heading after content gets room above it, and the content after it a little */
  :where(*) + :where(h2) { margin-top: var(--space-6); }
  :where(*) + :where(h3) { margin-top: var(--space-5); }
  :where(h2, h3) + :where(*) { margin-top: var(--space-3); }
  ul, ol { padding-left: var(--space-5); }
  li + li { margin-top: var(--space-1); }
  b, strong { font-weight: var(--weight-semibold); }
  a { color: var(--color-link); font-weight: var(--weight-medium); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
  a:hover { text-decoration-thickness: 2px; }
  :focus-visible { outline: var(--border-thick) solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
  hr { height: 1px; margin: var(--space-4) 0; border: 0; background: var(--color-border); } /* shadcn Separator */
  img, svg { max-width: 100%; }
  pre { margin: 0; font-family: var(--font-mono); }
  code { font-family: var(--font-mono); font-size: 0.875em; }
  input, select, textarea, button { font: inherit; color: inherit; }
  fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
  legend { padding: 0; }
  table { border-collapse: collapse; }
  [hidden] { display: none !important; }
}

@layer utilities {
  .num { text-align: right; font-variant-numeric: var(--font-numeric); }
  .muted { color: var(--color-text-muted); }
  .small { font-size: var(--text-sm); }
  .neg { color: var(--color-danger-solid); }
  .note { white-space: pre-wrap; }
  .mono { font-family: var(--font-mono); font-size: var(--text-sm); overflow-wrap: anywhere; }
  .visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .print-only { display: none; }
}
