/* Base element styles: a small modern reset plus document defaults. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-padding-top: calc(var(--topbar-height) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font: var(--type-body-s);
  letter-spacing: var(--track-body-s);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: inherit;
  font-size: inherit;
}

ul[role="list"], ol[role="list"], ul.plain, ol.plain {
  margin: 0;
  padding: 0;
  list-style: none;
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

img, video {
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

a {
  color: inherit;
  text-decoration: none;
}

a:not([class]) {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-fast) var(--ease-out);
}

a:not([class]):hover {
  text-decoration-color: var(--brand-red);
}

strong, b {
  font-weight: 600;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

hr {
  height: 1px;
  margin: var(--space-6) 0;
  border: 0;
  background: var(--border-subtle);
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

dialog {
  padding: 0;
  border: 0;
  color: inherit;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: color-mix(in srgb, var(--brand-red) 38%, transparent);
  color: var(--text-primary);
}

/* Focus: a visible ring for keyboard users only. */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--brand-red-bright);
  outline-offset: 2px;
}

/* Scrollbars that sit quietly on the dark canvas. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--radius-full);
  background: var(--border-strong) padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* Accessibility helpers. Every declaration is !important: a utility must beat
   component rules such as `fieldset.field > legend { width: 100% }`, which made
   an absolutely positioned sr-only legend as wide as the viewport and scrolled
   the page sideways (scrollWidth 1876 at 1440). */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  float: none !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-toast) + 1);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  background: var(--brand-red);
  color: var(--base-white);
  font: var(--type-button-m);
  transform: translateY(-160%);
  transition: transform var(--duration) var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
}

/* Numbers that line up in columns. */
.tnum {
  font-variant-numeric: tabular-nums;
}

.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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