/* =============================================================================
   Modern reset — minimal, opinionated, post-Meyer.

   Token fallbacks repeat the resolved values in variables.css, because
   login.html loads this file without it. The line-height and tracking tokens
   have none on purpose: login sets its own type, and those would reflow it.
   ============================================================================= */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Honor system safe areas on mobile (notches, home indicator). */
  padding-inline: env(safe-area-inset-left, 0) env(safe-area-inset-right, 0);
  /* Smooth in-page jumps (anchor links, scrollIntoView). Disabled below for
     users who prefer reduced motion. */
  scroll-behavior: smooth;
}

/* Motion is enabled app-wide through the design tokens (see variables.css).
   We honor the OS "reduce motion" setting with a single guard so every
   transition and animation is neutralized without per-component edits —
   the accessible replacement for the old blanket motion kill. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

body {
  min-height: 100svh;
  line-height: var(--leading-normal);
  font-family: var(--font-sans, "Inter", "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif);
  color: var(--text-primary, #13110e);
  background: var(--surface-canvas, #fcfaf7);
  font-feature-settings: "kern", "liga", "ss01", "cv11";
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Better default text wrapping (Chrome 114+/Safari 17.4+; ignored elsewhere). */
:where(p, li, dd, dt, blockquote, figcaption) {
  text-wrap: pretty;
}
:where(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast, 120ms) var(--ease-standard, cubic-bezier(0.2, 0, 0, 1));
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Tabular numerics where it matters. */
:where(td, th, .num, .stat-value, .timer, code, pre) {
  font-variant-numeric: tabular-nums;
}

/* A clear, single-source focus ring used everywhere. Drawn with `outline`
   rather than box-shadow so it never collides with components that use
   box-shadow for elevation (e.g. solid buttons). outline-offset reproduces the
   inset-gap look, and modern engines trace the element's own border-radius. */
:focus-visible {
  outline: 2px solid var(--brand-500, #355c9e);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Reasonable selection color — quiet, on-brand. */
::selection {
  background: var(--navy-100, #e4ecf9);
  color: var(--navy-900, #030d20);
}

/* Quiet, on-brand scrollbars app-wide (the sidebar already styled its own).
   Applies to content panes, modals, table-wrappers — anything that scrolls. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-400, #b8b3ad) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300, #d7d4cf);
  border-radius: var(--radius-pill, 9999px);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400, #b8b3ad); background-clip: padding-box; }
