/* Accessibility, focus discipline, overflow guard, and reduced-motion rules */

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 14px;
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

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

button,
[role="button"],
a,
input,
select {
  touch-action: manipulation;
}

button,
.icon-btn,
.nav-link,
.sidebar-btn,
.filter-chip,
.ai-prompt-chip,
.subtab-btn,
.cta-btn,
.copy-btn {
  min-height: 44px;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

dialog::backdrop {
  background: rgb(4 6 6 / 78%);
  backdrop-filter: blur(6px);
}

[inert] {
  pointer-events: none;
  user-select: none;
}

@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;
  }
}
