@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #16212E;
  --ink-2: #475567;
  --ink-3: #66768A;
  --paper: #EDF1F4;
  --surface: #FFFFFF;
  --line: #D3DCE4;
  --go: #0E6B56;
  --go-hover: #0A5747;
  --signal: #FF3D57;
  --danger: #B3261E;
  --focus: #2F6FEB;
  --stage: #202A36;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.18; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus { outline: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.btn:hover { border-color: #AEBBC7; }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.primary { background: var(--go); border-color: var(--go); color: #fff; }
.btn.primary:hover { background: var(--go-hover); border-color: var(--go-hover); }
.btn.danger { color: var(--danger); border-color: #E7B4B0; }
.btn.danger:hover { background: #FCEFEE; }
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C2A04A;
  flex: none;
}
.dot.live { background: var(--signal); box-shadow: 0 0 0 0 rgba(255, 61, 87, 0.5); animation: live 1.8s ease-out infinite; }
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(255, 61, 87, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(255, 61, 87, 0); }
}

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.seg button {
  border: 0;
  background: none;
  padding: 6px 12px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 32px));
  z-index: 50;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(10, 18, 28, 0.25);
  animation: toast-in 180ms ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* Video fuente: debe estar en el DOM y "visible" para que los navegadores lo decodifiquen. */
.offscreen-video {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

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