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

html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

/* `.app-shell` (layout.css) is a `position: fixed; inset: 0` frame with its own
   `overflow: hidden`, and each `.page` inside it is `overflow-x: hidden` too —
   but that only stops *programmatic*/scrollbar overflow on those inner boxes.
   `html`/`body` themselves were left unconstrained, so once a nested
   horizontal scroller (a tab row) hits its own scroll boundary, an unconsumed
   touch-drag gesture chains up to them and the browser's native horizontal
   elastic/rubber-band bounce pans the whole viewport left, exposing blank
   space on the right — worst at a row's last item, where a user is most
   likely to keep dragging past the edge. `overscroll-behavior-y: none` already
   guarded the vertical case; this completes the same containment
   horizontally, at the one place — the document root — that actually stops a
   chain no matter which component initiated it. */
html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  /* Native apps don't flash a highlight box on tap or offer a text-selection
     handle on every button — the platform chrome should stay invisible. */
  -webkit-tap-highlight-color: transparent;
}

/* Visually hidden but still announced — for headings/labels that the visual
   design conveys some other way. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Locks background scrolling while a full-screen modal (search) is open. */
body.is-modal-open {
  overflow: hidden;
}

img, picture, svg {
  display: block;
  max-width: 100%;
  -webkit-touch-callout: none;
}

button, input {
  font: inherit;
  color: inherit;
}

button, a, .card, .icon-btn {
  touch-action: manipulation;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@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;
  }
}
