/* EMMCB — global reset, typography, and primitives */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

html { color-scheme: light; }

body {
  background: var(--app-bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "ss01" 1;
  overflow: hidden; /* the shell scrolls its panes, not the page */
}

h1, h2, h3, h4, h5 {
  margin: 0;
  line-height: var(--lh-tight);
  letter-spacing: -0.011em;
  font-weight: 600;
}
h1 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.018em; }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs-sm); }

p { margin: 0; }

a {
  color: var(--accent-ink);
  text-decoration: none;
}
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

ul, ol { margin: 0; padding: 0; list-style: none; }

svg { display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Numerics -------------------------------------------------------- */
/* Every comparable number in this product aligns on its digits. */
.num, .mono, td.num, th.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

/* ---- Text roles ------------------------------------------------------ */
.t-label {
  font-size: var(--fs-tiny);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.t-secondary { color: var(--ink-2); font-size: var(--fs-sm); }
.t-muted     { color: var(--ink-3); font-size: var(--fs-xs); }
.t-strong    { font-weight: 600; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }

/* ---- Utility --------------------------------------------------------- */
.stack     { display: flex; flex-direction: column; }
.row       { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap1 { gap: var(--s1); } .gap2 { gap: var(--s2); } .gap3 { gap: var(--s3); }
.gap4 { gap: var(--s4); } .gap5 { gap: var(--s5); } .gap6 { gap: var(--s6); }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }

.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;
}

/* ---- Scrollbars ------------------------------------------------------ */
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 6px;
}
.scroll::-webkit-scrollbar-thumb:hover { background-color: var(--ink-3); background-clip: content-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
