/* Reset + base typography + utilities */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-14);
  font-weight: 400;
  line-height: 1.4;
  /* Inter reads slightly wider/heavier than Geist at the same weight — keep
     body at 400 and a hair of negative tracking so dense UI stays compact. */
  letter-spacing: -0.011em;
  /* Technical dashboard: keep digits tabular everywhere (IPs, ports, latency, dates) */
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

/* Mono is reserved for technical data (IPs, IDs, ports, logs) — never whole layouts.
   Tabular numerals are already global (body); mono reinforces alignment for scanning. */
code, .mono {
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* Inline SVG icons — without explicit size, browsers default SVGs to ~300×150 */
.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex: none;
  overflow: visible;
}

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

::selection { background: var(--blue-soft-2); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }

/* Scrollbars (subtle, WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
::-webkit-scrollbar-track { background: transparent; }

/* Theme flip: kill staggered color/background transitions so the whole UI
   switches light↔dark in one paint (see js/core/theme.js). */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
  animation: none !important;
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
