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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  min-height: 100dvh;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea { font: inherit; color: inherit; border: none; outline: none; background: transparent; width: 100%; }
h1, h2, h3 { text-wrap: balance; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection {
  background: oklch(from var(--accent, #9E68D2) l c h / 0.2);
  color: var(--text);
}

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

/* ── Smooth theme transitions ───────────────────────────────────────────── */
body, .raised, .raised-sm, .inset, .panel,
.app-header, header, aside, main, footer,
.field input, .field select, textarea,
.toast, .select-wrap, .type-btn, .act-btn, .gen-btn, .import-btn {
  transition: background-color 220ms ease, color 220ms ease;
}
