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

html, body { margin: 0; padding: 0; }

body {
  /* The viewer's ground is painted explicitly: no dark mode anywhere, because the invoice is
     a white sheet, the field use is outdoors in daylight, and every dark variant doubles the
     print surface to verify. */
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-100);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: var(--lh-tight);
}

a { color: var(--c-accent-dk); }
a:hover { color: var(--c-accent); }

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

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

/* The prototype does `outline: none` and substitutes a 12%-alpha tint ring, which is too weak
   to be the only focus indicator. The native outline stays and the tint ring is ADDITIVE.
   accent-dk rather than accent: 8.3:1 against the paper instead of 5.3:1, and the 2px offset
   keeps the ring off the control so it reads even on an accent-filled button.

   NEVER put border-radius in this rule. It applies to the ELEMENT, not to the outline -- which
   already follows the element's own corners -- so a radius here flattened every button from 6px
   and every input from 10px to 3px the instant it was focused. The ring is outline,
   outline-offset and the additive tint, and nothing else. */
:focus-visible {
  outline: 2px solid var(--c-accent-dk);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(14 111 109 / .18);
}

/* Visible only to assistive technology: table captions, per-input labels in the billing grid,
   and the narrow-layout column captions. See caption.u-vh above -- a visually-hidden element
   that is absolutely positioned inside an unpositioned scroll container escapes its clipping
   and extends the page's scroll area. */
.u-vh {
  position: absolute !important;
  /* !important on the SIZE as well, not only the position. `.field input` sets width: 100% and
     outranks a bare `.u-vh` (0,1,1 against 0,1,0), so a visually-hidden input inside a .field --
     the journal's file picker, hidden behind its own <label> -- was laid out 375px wide and
     pushed the page into horizontal scroll on a phone. A utility that means "this is not on the
     screen" has to win against ordinary layout wherever it is applied. */
  width: 1px !important; height: 1px !important;
  /* padding too: border-box means .field input's 8px/12px padding would hold the box open at
     ~26px even at width: 1px. Clipped either way, but a hidden control should occupy nothing. */
  margin: -1px; padding: 0 !important;
  min-height: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-3);
  top: -3rem;
  z-index: var(--z-skip);
  background: var(--c-surface);
  border: 1px solid var(--c-accent);
  border-radius: var(--r-2);
  padding: var(--s-2) var(--s-4);
  text-decoration: none;
  transition: top var(--dur-1) var(--ease-1);
}
.skip-link:focus { top: var(--s-3); }

.eyebrow {
  font-size: var(--fs-50);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-ink-3);
  font-weight: 600;
}

.num { font-variant-numeric: tabular-nums; }
