*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background-color: var(--bg);
  height: 100%;
  min-height: 100%;
}
@supports (min-height: 100lvh) {
  html { min-height: 100lvh; }
}
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); background-color: var(--bg); color: var(--text);
  min-height: 100%;
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
@supports (min-height: 100lvh) {
  body { min-height: 100lvh; }
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: .95rem; font-weight: 650; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
/* 16px inputs prevent iOS zoom on focus */
input, select, textarea { font-size: 16px; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px;
  background: var(--accent); color: var(--accent-contrast); border-radius: var(--radius-sm);
  transform: translateY(-200%); text-decoration: none; font-weight: 600;
}
.skip-link:focus { transform: none; }

::selection { background: var(--accent-soft); color: var(--text); }

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

/* Server-rendered narrow pages (task 404, etc.) — CSP style-src 'self' */
.page-narrow {
  max-width: 32rem;
  margin: 4rem auto;
  padding: 1.5rem;
}
