/* Reset + global behaviors. */

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

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100dvh;
  height: var(--app-height, 100dvh); /* visualViewport fallback sets --app-height */
  overflow: hidden;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* Icons (inline SVG from js/ui/icons.js) */
.icon {
  width: 1em;
  height: 1em;
  display: block;
  flex-shrink: 0;
}

/* Icon buttons — 44px hit target floor everywhere */
.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--accent);
  touch-action: manipulation;
}
.icon-btn:disabled {
  color: var(--text-3);
  cursor: default;
}

/* Numeric readouts never jitter */
.tabular,
time {
  font-variant-numeric: tabular-nums;
}

/* Focus is visible and neutral */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--text-2);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-dim);
  color: var(--text-1);
}

/* Scrollbars: quiet, canvas-toned */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}

/* First paint is frozen: no transition/animation may run before the first
 * frame commits. main.js strips the class after one rAF.
 * (Pattern from .archive/hf-realtime-voice.) */
body.booting,
body.booting *,
body.booting *::before,
body.booting *::after {
  transition: none !important;
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

/* Reduced-motion floor: kill pulses and slides, keep opacity-only cues. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

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