/* Grundlagen: Reset, Typografie, Fokus, Hilfsklassen, Animationen.
   Farben ausschließlich über Rollen-Tokens aus tokens.css. */

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; height: auto; }

a { color: var(--accent-text); }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

/* Per Skript fokussierte Elemente mit tabindex=-1 zeigen keinen Fokusrahmen, solange der Fokus
   nicht von der Tastatur kommt. Tastaturfokus bleibt sichtbar (z. B. bei Roving-Tabindex).
   Große Container (#view, Seitenblatt, Popover, Dialog) blenden den Rahmen in shell.css bzw.
   overlays.css ganz aus. */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

/* ---------- Hilfsklassen ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mono { font-family: var(--f-mono); font-stretch: 80%; font-size: .86em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--ink-3); }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.block { display: block; }
.r { text-align: right; }

/* Icons: Inline-SVG aus ui/icons.js (ic) */
.i {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i.fill { fill: currentColor; }

kbd {
  font-family: var(--f-mono);
  font-stretch: 80%;
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink-2);
}

/* ---------- Animationen ---------- */
@keyframes blink { 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cellp { 50% { opacity: .45; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--good-fill) 70%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; }
}
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes out { to { opacity: 0; transform: scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes indet { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes ntring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
}

/* Einblenden einer neuen Ansicht (router.js setzt die Klasse, nicht bei reduzierter Bewegung) */
.view-in { animation: viewIn .28s cubic-bezier(.2, .8, .2, 1); }

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