/* ============================================================
   Reset, typography, page grid
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Numbers align in columns everywhere; this is a data console. */
.mono, code, kbd, samp, pre, .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

code {
  font-size: var(--fs-sm);
  color: var(--text-strong);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-ctl);
}

a {
  color: var(--info);
  text-decoration: none;
}
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Keyboard focus is always visible; mouse users never see the ring. */
:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -.01em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-title); }
h3 { font-size: var(--fs-body); color: var(--muted); font-weight: 600; }

p { margin: 0 0 var(--s3); }

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

/* -- page shell ------------------------------------------------ */

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s7);
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s5);
}
.page-head .titles { flex: 1; min-width: 220px; }
.page-head .sub {
  margin-top: var(--s1);
  color: var(--muted);
  font-size: var(--fs-sm);
  max-width: 78ch;
}
.page-head .actions {
  display: flex;
  gap: var(--s2);
  align-items: center;
  flex-wrap: wrap;
}

.crumb {
  font-size: var(--fs-sm);
  color: var(--faint);
  margin-bottom: var(--s3);
  font-family: var(--mono);
}
.crumb a { color: var(--muted); }
.crumb .sep { padding: 0 var(--s1); color: var(--faint); }

/* -- layout helpers -------------------------------------------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}
.grid-side {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--s4);
  align-items: start;
}
@media (max-width: 980px) {
  .grid-2, .grid-side { grid-template-columns: minmax(0, 1fr); }
}

.stack > * + * { margin-top: var(--s4); }
.row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}
.spacer { flex: 1; }

/* Tables scroll horizontally on narrow viewports instead of breaking layout. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-x:focus-visible { outline-offset: -2px; }

.text-muted { color: var(--muted); }
.text-faint { color: var(--faint); }
.text-sm { font-size: var(--fs-sm); }
.text-micro { font-size: var(--fs-micro); }
.nowrap { white-space: nowrap; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copyable { cursor: copy; }
.copyable:hover { color: var(--text-strong); }
