/* MySWMS design kit: base styles (ADR-0031; plan docs/plans/2026-12-02-design-kit-beta.md).
   Mobile first (user, 02/12/2026): every rule here is for a phone about 375 pixels wide. Wider screens only ADD rules,
   in min-width blocks at the end. Element styles only: no classes and no parts, so each website builds its own parts
   to match the design library. Every colour, size, spacing, corner and font comes from tokens.css (values.json).
   Load order: fonts.css, tokens.css, then this file. No scripts anywhere in the kit, so pages work with scripts off. */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--text-base)/1.6 var(--font-body);
  /* The side gutter clears a phone's notch or side bar. */
  padding-left: max(var(--space-4), env(safe-area-inset-left, var(--space-0)));
  padding-right: max(var(--space-4), env(safe-area-inset-right, var(--space-0)));
}

/* Readable line length for running text. */
p, li, dd, blockquote, figcaption { max-width: 66ch; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: var(--space-6) 0 var(--space-3);
}
h1 { font-size: var(--text-display); font-weight: 700; }
h2 { font-size: var(--text-2xl); font-weight: 700; }
h3 { font-size: var(--text-xl); font-weight: 600; }
h4 { font-size: var(--text-lg); font-weight: 600; }
p, ul, ol, dl, table, figure, blockquote { margin: 0 0 var(--space-4); }
small { font-size: var(--text-sm); }

a { color: var(--info); text-underline-offset: 3px; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: var(--text-sm); }
pre { overflow-x: auto; }
img, svg, video { max-width: 100%; height: auto; }

/* Tables scroll inside themselves, never the page. Wrap a wide table in an element with overflow-x: auto. */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
th { font-weight: 600; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-6) 0; }

/* Taps (screen checklist): every tap target at least 44 by 44 pixels (40 + 4 from the spacing values). */
button, input, select, textarea { font: inherit; color: inherit; }
button, [role="button"], input[type="submit"], input[type="button"], select, summary {
  min-height: calc(var(--space-10) + var(--space-1));
  min-width: calc(var(--space-10) + var(--space-1));
}
/* Field text is 16 pixels, so a phone doesn't zoom in when someone taps a field. */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  font-size: var(--text-field);
  min-height: calc(var(--space-10) + var(--space-1));
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  width: 100%;
}
label { display: block; font-weight: 600; margin-bottom: var(--space-1); }
input[type="checkbox"], input[type="radio"] { width: var(--space-6); height: var(--space-6); accent-color: var(--accent); }

/* Keyboard focus is always visible. */
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }

/* Less movement when the phone or computer asks for it. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Wider screens: only additions. */
@media (min-width: 48rem) {
  body { font-size: var(--text-lg); }
}
