* { box-sizing: border-box; }

/* Единый тонкий ползунок везде — как в сайдбаре. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Атрибут hidden должен побеждать любой display из компонентов. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  padding-bottom: 26px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

code, pre, textarea, .timing { font-family: var(--mono); }

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  overflow-x: auto;
  font-size: var(--text-sm);
  color: var(--pre-text);
}

details summary { cursor: pointer; color: var(--muted); font-size: var(--text-md); }
details[open] summary { margin-bottom: 8px; }

.muted-note { color: var(--muted); font-size: var(--text-sm); }
.spacer { flex: 1; }

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

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