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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-height) + var(--space-6));
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  background-color: var(--bg-app);
  color: var(--font-primary);
  caret-color: var(--accent-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

a {
  color: var(--font-link);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }

input, textarea, button { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

::selection { background: var(--selection-bg); color: var(--font-primary); }

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-pill); }
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

.icon { width: 16px; height: 16px; }
.icon-lg { width: 20px; height: 20px; }
.icon-flip { transform: rotate(180deg); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--button-radius);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
}
.skip-link:focus { top: var(--space-2); }

.mono { font-family: var(--font-mono); font-size: 0.875em; font-variant-numeric: tabular-nums; }
