/* Reset, type and controls shared by every page. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1rem; line-height: 1.4; }
a { color: var(--accent-strong); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
strong { font-weight: 650; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  padding: 8px 12px; border-radius: var(--radius-2);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-1);
}
.skip-link:focus { top: 12px; }

/* Numbers line up in columns and don't jitter as they change. */
.num, output, table, input { font-variant-numeric: tabular-nums; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-2);
  background: var(--surface); color: var(--text);
  font-size: 0.875rem; font-weight: 550; line-height: 1.2; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--surface-3); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--quiet:hover { background: var(--surface-3); color: var(--text); }
.btn svg { width: 16px; height: 16px; flex: none; }

input[type="text"], input[type="number"], select {
  width: 100%; min-height: 38px; padding: 6px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-1);
  background: var(--surface); color: var(--text);
  font-size: 1rem; /* 16px keeps iOS from zooming into the field */
}
input:hover, select:hover { border-color: var(--text-3); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

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