/* ==========================================================================
   Reset
   --------------------------------------------------------------------------
   Deliberately small: only the rules that remove genuine friction, not a
   wholesale normalisation of every element (spec §36 — avoid bloat).
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Anchors and focus jumps land below the sticky header rather than under it. */
  scroll-padding-block-start: calc(var(--header-height) + var(--space-4));
}

body {
  min-block-size: 100vh;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-inline-size: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

/* `overflow-wrap` prevents a long unbroken token — an M3U URL, an account id —
   from forcing horizontal scroll on mobile. */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  inline-size: 100%;
}

/* Hidden by attribute, regardless of any `display` a component sets. */
[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Reduced motion (spec §19, §35)
   --------------------------------------------------------------------------
   Animations are reduced to a near-instant step rather than removed outright:
   a duration of exactly 0 stops `transitionend` from firing, which several
   components rely on to clean up after themselves.
   -------------------------------------------------------------------------- */

@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;
  }
}
