/* Printlane — reset, typography and primitives. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 650;
                 letter-spacing: -.018em; }
h1 { font-size: var(--t-4xl); letter-spacing: -.028em; }
h2 { font-size: var(--t-2xl); letter-spacing: -.022em; }
h3 { font-size: var(--t-lg); }
h4 { font-size: var(--t-md); }
p  { margin: 0; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* numbers must not jitter while a counter ticks */
.num, .kpi-value, .bignum, td.num, .tabular { font-variant-numeric: tabular-nums; }

.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-2); }
.dim   { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.strong { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.row   { display: flex; align-items: center; gap: var(--sp-2); }
.row-between { display: flex; align-items: center; justify-content: space-between;
               gap: var(--sp-3); flex-wrap: wrap; }
.col   { display: flex; flex-direction: column; gap: var(--sp-2); }
.wrap  { flex-wrap: wrap; }
.grow  { flex: 1 1 auto; min-width: 0; }
.none  { flex: none; }
/* Single-column grids declare minmax(0,1fr) rather than relying on the
   implicit track. A bare implicit track is `auto`, which is floored at
   min-content, so ONE wide descendant (a long filename, a nowrap status row, a
   table) inflates the shared track and every sibling in it — which is how a
   390px phone ended up with a 506px document. minmax(0,…) lets the track
   shrink and pushes the overflow down to the element that should scroll. */
.stack, .stack-sm, .stack-lg {
  display: grid; grid-template-columns: minmax(0, 1fr);
}
.stack { gap: var(--sp-3); }
.stack-sm { gap: var(--sp-2); }
.stack-lg { gap: var(--sp-5); }

.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;
}

/* Screen-reader-only until focused — used by the skip link. */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--surface); color: var(--ink); padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--sh-md); transition: top var(--speed) var(--ease);
}
.skip-link:focus { top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--n-300); border-radius: var(--r-full);
  border: 3px solid var(--page);
}
::-webkit-scrollbar-thumb:hover { background: var(--n-400); }
* { scrollbar-width: thin; scrollbar-color: var(--n-300) transparent; }
