/* Base: reset, type, controls. Colours, fonts, radii and spacing come only from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 25px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
svg { flex: 0 0 auto; }

.eyebrow {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.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; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); font-size: 14px; line-height: 21px; }
.muted-sm { color: var(--ink-muted); font-size: 13px; line-height: 18px; }

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 90%;
  font-size: 18px;
  line-height: 24px;
}

/* ---- controls: 44px targets, visible focus, press feedback */
.chip, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms ease, border-color 150ms ease;
}
.chip[aria-pressed="true"], .chip--on {
  border-color: var(--insights);
  background: var(--insights-soft);
  color: var(--insights);
}
.chip--static { cursor: default; }
.btn--icon { width: 44px; padding: 0; }
.chip:active:not(.chip--static), .btn:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .chip:not([aria-pressed="true"]):not(.chip--static):hover, .btn:hover { background: var(--paper); }
}

/* The transparent outline shows in forced-colors mode, where box-shadow is removed. */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); }
.main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

.status {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  z-index: 20;
  max-width: min(480px, calc(100vw - 32px));
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  line-height: 21px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.status.is-visible { opacity: 1; transform: translate(-50%, 0); }

.noscript { padding: var(--space-6); }

/* Windows High Contrast removes backgrounds; keep the data marks, swatches and cells drawn in their own colours. */
@media (forced-colors: active) {
  .wf-bar, .wf-hbar, .mp-seg, .bridge-bar, .pay-bar__paid, .pay-bar__held, .goal__fill, .goal__track,
  .swatch, .hm-cell, .cal-day, .bubble, .spark, .ix-bar, .rt-bar, .rt-bar__fill { forced-color-adjust: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .chip:active, .btn:active { transform: none; }
}
