/* Grundlagen der neuen Oberfläche (AP-08): Rücksetzung, Elemente, Fokus, Symbole. Farben nur aus tokens.css. */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, blockquote { margin: 0; }
  fieldset { min-width: 0; padding: 0; border: 0; }
  legend { padding: 0; }
  ul[class], ol[class] { padding: 0; list-style: none; }
  input, button, select, textarea { font: inherit; color: inherit; }
  table { border-collapse: collapse; border-spacing: 0; }
  svg { overflow: hidden; }
}

@layer base {
  :root {
    font-family: var(--zs-font-sans);
    font-size: 100%;
    line-height: var(--zs-leading);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  /* Jeder Teilbaum mit eigenem Schema malt seine Fläche selbst; vererbte Farben werden dort neu berechnet. */
  :root, [data-theme] {
    color: var(--zs-color-text);
    background-color: var(--zs-color-bg);
  }
  body { min-height: 100vh; font-size: var(--zs-text-md); }
  h1, h2, h3, h4 { line-height: var(--zs-leading-tight); font-weight: var(--zs-weight-strong); overflow-wrap: anywhere; }
  h1 { font-size: var(--zs-text-title); }
  h2 { font-size: var(--zs-text-xl); }
  h3 { font-size: var(--zs-text-lg); }
  h4 { font-size: var(--zs-text-md); }
  @media (min-width: 40em) {
    h1 { font-size: var(--zs-text-title-wide); }
  }
  p, li, dd { max-width: var(--zs-measure); }
  strong, b, th { font-weight: var(--zs-weight-strong); }
  small { font-size: var(--zs-text-sm); }
  code, kbd, samp { font-family: var(--zs-font-mono); font-size: max(0.9375em, var(--zs-text-sm)); overflow-wrap: anywhere; }

  a {
    color: var(--zs-color-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }
  a:hover, a[data-demo~="hover"] {
    color: var(--zs-color-accent-hover);
    text-decoration-thickness: 2px;
  }

  /* Ein Fokusring für alles: 3 px Akzent mit 2 px Abstand (Plan Kap. 5.3); nie nur ein Schatten. */
  :focus-visible, [data-demo~="fokus"] {
    outline: var(--zs-focus-width) solid var(--zs-color-focus);
    outline-offset: var(--zs-focus-offset);
  }

  /* Symbole: lokales SVG-Sprite, Strich in der Textfarbe, immer mit Text oder zugänglichem Namen. */
  .zs-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  .zs-icon {
    display: inline-block;
    flex: none;
    width: var(--zs-icon-size);
    height: var(--zs-icon-size);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.25em;
  }

  @media (forced-colors: active) {
    :focus-visible, [data-demo~="fokus"] { outline-color: Highlight; }
  }
}

@layer utilities {
  .zs-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .zs-num { font-variant-numeric: tabular-nums; }
  .zs-muted { color: var(--zs-color-text-muted); }
  .zs-nowrap { white-space: nowrap; }
  .zs-mono { font-family: var(--zs-font-mono); }
}
