/* ==========================================================================
   BASE / RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
/* html/body never scroll themselves — only .app-main does (see layout.css).
   Setting overflow-x alone here (as this used to) computes overflow-y to
   `auto` too (a CSS spec quirk), which turns <body> into its own scroll
   container instead of the true viewport. That's what let scrolling reach
   the sidebar: the sidebar and content stopped sharing one predictable
   scroll owner. Locking both axes here removes that ambiguity entirely. */
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  max-width: 100vw;
  font-family: var(--font-family);
  font-size: var(--fs-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--sp-2) 0; font-weight: var(--fw-semibold); line-height: 1.25; }
p { margin: 0 0 var(--sp-3) 0; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--color-primary-light); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Utility */
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-danger { color: var(--color-danger); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
