/* ==========================================================================
   QZONE OMS — BASE
   Reset, document defaults, typography, focus, scrollbars.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Never let the page itself scroll sideways — wide content scrolls in its
     own container instead. This is what keeps 360px viewports honest.
     `clip`, NOT `hidden`: `overflow-x: hidden` forces overflow-y to compute to
     `auto`, which turns the root into a scroll container and silently kills
     `position: sticky` for every descendant — including the shell's rail and
     panel. `clip` suppresses the same overflow without creating one. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--qz-bg);
  color: var(--qz-text);
  font-family: var(--qz-font-body);
  font-size: var(--qz-fs-base);
  line-height: var(--qz-lh-base);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;   /* see the note on html above */
}

/* ---- Headings: display face, tight tracking, no decoration -------------- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  margin: 0 0 var(--qz-s-3);
  font-family: var(--qz-font-display);
  font-weight: 600;
  line-height: var(--qz-lh-tight);
  letter-spacing: var(--qz-track-tight);
  color: var(--qz-text);
  text-wrap: balance;
}

h1, .h1 { font-size: var(--qz-fs-xl); }
h2, .h2 { font-size: var(--qz-fs-lg); }
h3, .h3 { font-size: var(--qz-fs-md); }
h4, .h4 { font-size: var(--qz-fs-base); }
h5, .h5 { font-size: var(--qz-fs-sm); }
h6, .h6 {
  font-size: var(--qz-fs-2xs);
  font-weight: 600;
  letter-spacing: var(--qz-track-label);
  text-transform: uppercase;
  color: var(--qz-text-mute);
}

p { margin: 0 0 var(--qz-s-3); }
p:last-child { margin-bottom: 0; }

small, .small { font-size: var(--qz-fs-xs); }

a {
  color: var(--qz-accent);
  text-decoration: none;
  transition: color var(--qz-dur-fast) var(--qz-ease);
}
a:hover { color: var(--qz-accent-hi); text-decoration: none; }

hr {
  height: 1px;
  margin: var(--qz-s-5) 0;
  border: 0;
  background: var(--qz-line);
  opacity: 1;
}

code, kbd, pre, samp, .qz-mono {
  font-family: var(--qz-font-mono);
  font-size: 0.92em;
  font-variant-ligatures: none;
}

code {
  padding: 1px 5px;
  border-radius: var(--qz-r-sm);
  background: var(--qz-surface-inset);
  box-shadow: var(--qz-ring);
  color: var(--qz-accent);
}

/* All figures are tabular so columns of numbers align across rows. This is
   the single highest-impact typographic choice for a data-dense console. */
.qz-num, .qz-figure, td .qz-num, .table td, .table th {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

img, svg, video, canvas { max-width: 100%; height: auto; vertical-align: middle; }

/* ---- Focus: one visible ring everywhere, keyboard-only ------------------ */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--qz-focus);
  border-radius: var(--qz-r-sm);
}

/* ---- Selection --------------------------------------------------------- */
::selection {
  background: var(--qz-accent);
  color: var(--qz-on-accent);
}

/* ---- Scrollbars: thin, neutral, only visible against their own track ---- */
* { scrollbar-width: thin; scrollbar-color: var(--qz-line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--qz-line-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--qz-text-faint); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- Skip link --------------------------------------------------------- */
.qz-skip {
  position: fixed;
  top: var(--qz-s-2);
  left: var(--qz-s-2);
  z-index: 999;
  padding: var(--qz-s-2) var(--qz-s-4);
  border-radius: var(--qz-r-md);
  background: var(--qz-accent);
  color: var(--qz-on-accent);
  font-size: var(--qz-fs-xs);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--qz-dur) var(--qz-ease);
}
.qz-skip:focus { transform: translateY(0); color: var(--qz-on-accent); }

/* ---- Shared micro-typography ------------------------------------------- */

/* The small-caps label is the workhorse of this design: it marks every metric,
   field group, table header and section without needing a heavier weight. */
.qz-label {
  display: block;
  font-family: var(--qz-font-body);
  font-size: var(--qz-fs-2xs);
  font-weight: 600;
  letter-spacing: var(--qz-track-label);
  text-transform: uppercase;
  color: var(--qz-text-mute);
}

.qz-figure {
  font-family: var(--qz-font-mono);
  font-size: var(--qz-fs-2xl);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--qz-text);
}

.qz-dim   { color: var(--qz-text-dim); }
.qz-mute  { color: var(--qz-text-mute); }
.qz-faint { color: var(--qz-text-faint); }

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