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

:root {
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --radius: 14px;
  --ok: #2f9e44;
  --warn: #f08c00;
  --late: #e03131;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Solo para lectores de pantalla */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.brand .logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

/* [hidden] siempre gana, aunque el componente declare su propio display. */
[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

:focus-visible {
  outline: 3px solid #4dabf7;
  outline-offset: 2px;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.8;
}
.conn::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--late);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--late) 25%, transparent);
}
.conn.on::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}

.toasts {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 999px;
  background: #1d1a16;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
  animation: toast-in 0.25s var(--ease);
  transition: opacity 0.3s, transform 0.3s;
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}
.toast button {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-weight: 800;
}
.toast-err {
  background: #b42020;
}
.toast.out {
  opacity: 0;
  transform: translateY(8px);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

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