/* =========================================================================
   COBAX — sistema de diseno comun (Fase 9)
   Dos temas: "Noche" (oscuro, acento dorado) y "Titanio" (claro, sin blanco puro: cristal blanco al 50 %).
   Todo local: sin fuentes, iconos ni estilos de internet.
   El tema se elige con <html data-theme="noche|titanio"> (lo pone cobax-ui.js).
   ========================================================================= */

/* 2.31.4 «Cobax premium»: la misma marca (negro y oro / titanio) con más profundidad y contraste. El fondo lleva
   luz (degradados suaves), las tarjetas son de cristal (--cristal) y flotan; menús, ventanas y avisos siguen opacos
   (--surface) para que siempre se lean. */
:root,
[data-theme="noche"] {
  --bg: #07070a;
  --bg-grad:
    radial-gradient(900px 560px at 10% -10%, rgba(224, 184, 74, 0.24), transparent 62%),
    radial-gradient(800px 640px at 105% 40%, rgba(80, 64, 160, 0.2), transparent 65%),
    linear-gradient(180deg, #0c0b10 0%, #07070a 60%);
  --surface: #141319;
  --surface-2: #1b1a21;
  --surface-3: #23222a;
  --cristal: rgba(255, 255, 255, 0.045);
  --cristal-brillo: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f6f3ec;
  --text-2: #b9b4aa;
  --muted: #7f7b74;
  --accent: #e3ba4c;
  --accent-2: #f1cf6c;
  --accent-ink: #1a1405;
  --accent-soft: rgba(227, 186, 76, 0.14);
  --accent-line: rgba(227, 186, 76, 0.4);
  --oro: linear-gradient(180deg, #f6d77a 0%, #d9ac39 55%, #b88a1f 100%);
  --oro-sombra: rgba(212, 170, 60, 0.7);
  --ok: #4fd08f;
  --ok-soft: rgba(79, 208, 143, 0.13);
  --warn: #e6a532;
  --warn-soft: rgba(230, 165, 50, 0.14);
  --danger: #ec5f57;
  --danger-soft: rgba(236, 95, 87, 0.13);
  --info: #5fb0e8;
  --info-soft: rgba(95, 176, 232, 0.13);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 10px 30px -16px rgba(0, 0, 0, 0.8);
  --video-bg: #050507;
  color-scheme: dark;
}

[data-theme="titanio"] {
  --bg: #eceff3;
  --bg-grad:
    radial-gradient(1000px 520px at 50% -12%, rgba(176, 196, 222, 0.75), transparent 68%),
    radial-gradient(700px 500px at 0% 40%, rgba(214, 186, 112, 0.16), transparent 65%),
    linear-gradient(180deg, #e5eaf1 0%, #eff1f4 55%, #e9ecf0 100%);
  --surface: #f0f2f5;
  --surface-2: #e9ecf0;
  --surface-3: #e1e5eb;
  --cristal: rgba(255, 255, 255, 0.5);
  --cristal-brillo: rgba(255, 255, 255, 0.8);
  --border: rgba(30, 40, 60, 0.08);
  --border-strong: rgba(30, 40, 60, 0.15);
  --text: #15181e;
  --text-2: #4a505b;
  --muted: #7d838f;
  --accent: #a27b12;
  --accent-2: #8a670c;
  --accent-ink: #fffaf0;
  --accent-soft: rgba(162, 123, 18, 0.11);
  --accent-line: rgba(162, 123, 18, 0.35);
  --oro: linear-gradient(180deg, #c9a03a 0%, #a27b12 60%, #876409 100%);
  --oro-sombra: rgba(140, 105, 20, 0.45);
  --ok: #1d8a52;
  --ok-soft: rgba(29, 138, 82, 0.12);
  --warn: #a96c0f;
  --warn-soft: rgba(169, 108, 15, 0.13);
  --danger: #b8372f;
  --danger-soft: rgba(184, 55, 47, 0.11);
  --info: #2a70a8;
  --info-soft: rgba(42, 112, 168, 0.11);
  --shadow: 0 26px 50px -28px rgba(40, 55, 80, 0.35);
  --shadow-sm: 0 14px 34px -22px rgba(40, 55, 80, 0.32);
  --video-bg: #1c1e22;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
.mono, code, kbd { font-family: "Cascadia Mono", Consolas, ui-monospace, "SFMono-Regular", Menlo, monospace; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.cbx-icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.cbx-icon.sm { width: 15px; height: 15px; }
.cbx-icon.lg { width: 22px; height: 22px; }

/* -------------------------------------------------------------- layout -- */
.cbx-page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
.cbx-page.wide { max-width: 1600px; }
.cbx-row { display: flex; align-items: center; gap: 10px; }
.cbx-spacer { flex: 1; }
.cbx-stack { display: flex; flex-direction: column; gap: 16px; }
.cbx-grid { display: grid; gap: 16px; }
.cbx-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cbx-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .cbx-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cbx-grid.c2, .cbx-grid.c3 { grid-template-columns: 1fr; }
  .cbx-page { padding: 16px 16px 40px; }
}

.cbx-title { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
.cbx-subtitle { color: var(--text-2); margin: 4px 0 0; }
.cbx-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 10px; }

/* -------------------------------------------------------------- header -- */
.cbx-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.cbx-header-in { max-width: 1600px; margin: 0 auto; height: 58px; padding: 0 20px;
  display: flex; align-items: center; gap: 18px; }
.cbx-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.cbx-brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.cbx-brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; }
.cbx-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.cbx-nav::-webkit-scrollbar { display: none; }
.cbx-nav a { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px;
  color: var(--text-2); font-weight: 500; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.cbx-nav a:hover { background: var(--surface-2); color: var(--text); }
.cbx-nav a.on { background: var(--accent-soft); color: var(--accent); }
/* en idiomas con palabras largas (de, fr) el menu no cabe a 1280 px: un poco mas apretado */
@media (max-width: 1440px) { .cbx-nav a { padding: 7px 6px; gap: 4px; } }
.cbx-header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) {
  .cbx-nav a span { display: none; }
  .cbx-brand small { display: none; }
}
.cbx-nav .solo-movil { display: none; }
@media (max-width: 560px) {
  .cbx-header-in { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .cbx-nav { order: 3; width: 100%; justify-content: space-between; }
  /* en el movil: 6 botones con su nombre debajo; Mosaico, Grabaciones, Ajustes y Ayuda dentro de "Mas" */
  .cbx-nav a.en-mas { display: none; }
  .cbx-nav .solo-movil { display: flex; }
  .cbx-nav a { flex-direction: column; gap: 3px; padding: 6px 4px; flex: 1; min-width: 0; }
  .cbx-nav a span { display: block; font-size: 10.5px; line-height: 1; }
}
.cbx-mas-hoja { position: fixed; z-index: 1200; top: 104px; right: 10px; width: 210px; background: var(--surface); border: 1px solid var(--border);
                border-radius: 14px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.cbx-mas-hoja a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; color: var(--text); font-weight: 500; }
.cbx-mas-hoja a.on { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------- buttons -- */
.cbx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 10px; cursor: pointer; user-select: none;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-weight: 550; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.cbx-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.cbx-btn:active { transform: translateY(1px); }
.cbx-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cbx-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cbx-btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.cbx-btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.cbx-btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.cbx-btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.cbx-btn.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.cbx-btn.encasa { background: var(--info-soft); border-color: transparent; color: var(--info); }   /* no «.info»: choca con estilos de páginas */
.cbx-btn.icon { width: 36px; padding: 0; }
.cbx-btn.sm { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.cbx-btn.sm.icon { width: 30px; }

/* -------------------------------------------------------------- panels -- */
.cbx-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.cbx-card-pad { padding: 18px; }
.cbx-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cbx-card-head h3 { margin: 0; font-size: 14px; font-weight: 650; }

.cbx-tile {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-sm); transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; min-height: 168px;
}
.cbx-tile:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.cbx-tile-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.cbx-tile h3 { margin: 0; font-size: 16px; font-weight: 650; }
.cbx-tile p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.cbx-tile-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 12.5px; }
.cbx-tile-foot .go { color: var(--accent); display: flex; align-items: center; gap: 4px; font-weight: 600; opacity: 0;
  transform: translateX(-4px); transition: opacity 0.18s, transform 0.18s; }
.cbx-tile:hover .cbx-tile-foot .go { opacity: 1; transform: none; }

.cbx-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; }
.cbx-stat b { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.cbx-stat span { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------- pills / badges -- */
.cbx-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap; }
.cbx-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cbx-pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.cbx-pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.cbx-pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.cbx-pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.cbx-pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.cbx-pill.live .dot { animation: cbx-pulse 1.6s ease-in-out infinite; }
@keyframes cbx-pulse { 50% { opacity: 0.35; } }

/* -------------------------------------------------------------- forms --- */
.cbx-input, .cbx-select, .cbx-textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.cbx-textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.cbx-input:focus, .cbx-select:focus, .cbx-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cbx-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.cbx-switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border-strong); cursor: pointer; transition: background 0.15s; flex: none; }
.cbx-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-2); transition: transform 0.15s, background 0.15s; }
.cbx-switch.on { background: var(--accent); border-color: var(--accent); }
.cbx-switch.on::after { transform: translateX(18px); background: var(--accent-ink); }

/* -------------------------------------------------------------- tabs ---- */
.cbx-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; width: max-content; max-width: 100%; overflow-x: auto; }
.cbx-tab { height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2);
  cursor: pointer; font-weight: 550; white-space: nowrap; }
.cbx-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* -------------------------------------------------------- toast / modal -- */
.cbx-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.cbx-toast { min-width: 240px; max-width: 360px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start;
  animation: cbx-in 0.2s ease; }
.cbx-toast.ok { border-left: 3px solid var(--ok); }
.cbx-toast.danger { border-left: 3px solid var(--danger); }
.cbx-toast.warn { border-left: 3px solid var(--warn); }
@keyframes cbx-in { from { opacity: 0; transform: translateY(6px); } }

.cbx-modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center;
  padding: 16px; animation: cbx-in 0.15s ease; }
.cbx-modal { width: min(960px, 100%); max-height: 92vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }

/* ------------------------------------------------------------ tablas ---- */
.cbx-table { width: 100%; border-collapse: collapse; }
.cbx-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px;
  border-bottom: 1px solid var(--border); }
.cbx-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cbx-table tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------- medidor de FPS ------- */
.cbx-fps { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: 9px;
  background: color-mix(in srgb, var(--video-bg) 72%, transparent); color: #e9e9ee; font-size: 12px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap; }
@media (max-width: 640px) { .cbx-fps .sep, .cbx-fps .sep ~ * { display: none; } }
.cbx-fps b { font-variant-numeric: tabular-nums; font-weight: 650; }
.cbx-fps .dot { width: 7px; height: 7px; border-radius: 50%; background: #3fbf7f; }
.cbx-fps.medio .dot { background: #e6a532; }
.cbx-fps.bajo .dot { background: #e5574f; }
.cbx-fps .sep { width: 1px; height: 14px; background: rgba(255, 255, 255, 0.15); }

/* ---------------------------------------------------------------- login - */
.cbx-center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.cbx-pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0 22px; }
.cbx-pin-dots span { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--border-strong); transition: 0.15s; }
.cbx-pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.cbx-pin-dots.err span { border-color: var(--danger); background: var(--danger); animation: cbx-shake 0.35s; }
@keyframes cbx-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cbx-keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; }
.cbx-key { height: 60px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 22px; font-weight: 550; cursor: pointer; transition: background 0.12s, transform 0.05s; }
.cbx-key:hover { background: var(--surface-3); }
.cbx-key:active { transform: scale(0.97); }
.cbx-key.soft { background: transparent; border-color: transparent; color: var(--text-2); font-size: 14px; }

/* --------------------------------------------------- scrollbar discreta - */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ------------------------------------------------------ video y reproductor */
.cbx-video { position: relative; background: var(--video-bg); border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.cbx-video > .cbx-stream { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.cbx-video:fullscreen { border-radius: 0; border: 0; }
.cbx-ov { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; align-items: center; gap: 8px;
  pointer-events: none; z-index: 3; }
.cbx-ov > * { pointer-events: auto; }
.cbx-ov .cbx-pill { background: rgba(10, 10, 14, 0.62); color: #e9e9ee; border-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cbx-ov .cbx-pill.vivo { color: #ff6b62; }
.cbx-ov .cbx-pill.archivo { color: #e6c35a; }
.cbx-sin-senal { position: absolute; inset: 0; display: grid; place-items: center; color: #8a8a94; font-size: 13px;
  text-align: center; pointer-events: none; }

.cbx-player { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 26px 14px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.35) 60%, transparent);
  color: #f2f2f5; transition: opacity 0.25s ease; }
.cbx-video.ocioso .cbx-player, .cbx-video.ocioso .cbx-ov { opacity: 0; }
.cbx-video.ocioso { cursor: none; }

.cbx-prog { position: relative; height: 16px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.cbx-prog .pista { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.24);
  transition: height 0.12s; }
.cbx-prog:hover .pista, .cbx-prog.arrastrando .pista { height: 6px; }
.cbx-prog .hecho { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.cbx-prog .sobre { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: rgba(255, 255, 255, 0.28); }
.cbx-prog .bola { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25); transform: scale(0); transition: transform 0.12s; }
.cbx-prog:hover .bola, .cbx-prog.arrastrando .bola { transform: scale(1); }
.cbx-prog .globo { position: absolute; bottom: 20px; transform: translateX(-50%); padding: 3px 7px; border-radius: 6px;
  background: rgba(10, 10, 14, 0.9); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transition: opacity 0.12s; pointer-events: none; }
.cbx-prog:hover .globo, .cbx-prog.arrastrando .globo { opacity: 1; }

.cbx-ctrls { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.cbx-pb { width: 38px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent;
  color: #f2f2f5; cursor: pointer; transition: background 0.12s; }
.cbx-pb:hover { background: rgba(255, 255, 255, 0.12); }
.cbx-pb .cbx-icon { width: 21px; height: 21px; }
.cbx-pb.on { color: var(--accent-2); }
.cbx-pb.txt { width: auto; padding: 0 10px; font-size: 13px; font-weight: 650; }
.cbx-tiempo { margin: 0 8px; font-size: 13px; font-variant-numeric: tabular-nums; color: #e3e3e8; white-space: nowrap; }
.cbx-tiempo span { color: #a6a6b0; }
.cbx-menu-vel { position: absolute; right: 14px; bottom: 56px; padding: 6px; border-radius: 12px;
  background: rgba(14, 14, 18, 0.95); border: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 2px; min-width: 120px; }
.cbx-menu-vel button { height: 32px; border: 0; background: transparent; color: #e9e9ee; text-align: left; padding: 0 12px;
  border-radius: 8px; cursor: pointer; font-size: 13px; }
.cbx-menu-vel button:hover { background: rgba(255, 255, 255, 0.1); }
.cbx-menu-vel button.on { color: var(--accent-2); font-weight: 650; }
@media (max-width: 640px) {
  .cbx-pb.solo-escritorio { display: none; }
  .cbx-pb { width: 34px; }
  .cbx-player { padding: 22px 8px 6px; }
}

/* pantalla completa (real o simulada en iPhone): video a todo el ancho y alto, con ✕ y ⤢ siempre visibles */
.cbx-completa { position: fixed !important; inset: 0 !important; z-index: 1000 !important; width: 100vw !important; height: 100dvh !important;
                max-width: none !important; max-height: none !important; margin: 0 !important; border-radius: 0 !important; }
.cbx-en-completa { background: #000 !important; border: 0 !important; border-radius: 0 !important; aspect-ratio: auto !important;
                   max-height: none !important; display: flex !important; align-items: center; justify-content: center; }
.cbx-en-completa > img, .cbx-en-completa > .cbx-stream { width: 100% !important; height: 100% !important; max-width: none; max-height: none; object-fit: contain; }
.cbx-en-completa.cbx-llenar-on > img, .cbx-en-completa.cbx-llenar-on > .cbx-stream { object-fit: cover; }
.cbx-en-completa .cbx-ov { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: 184px; }   /* 3 botones: ⟳ ⤢ ✕ */
.cbx-completa-botones { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 6;
                        display: flex; gap: 8px; }
.cbx-completa-botones button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
                               background: rgba(0,0,0,.62); color: #fff; font-size: 20px; cursor: pointer;
                               backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cbx-en-completa.cbx-llenar-on .cbx-llenar { background: var(--accent); color: #111; }
/* 2.18.1: movil en vertical -> el contenido se gira 90° y llena la pantalla (sin la pantalla completa del navegador) */
.cbx-completa.cbx-girada { inset: auto !important; top: 0 !important; left: 100vw !important; width: 100dvh !important; height: 100vw !important;
                           transform: rotate(90deg); transform-origin: top left; }
.cbx-en-completa.cbx-girada .cbx-girar { background: var(--accent); color: #111; }
.cbx-en-completa.cbx-girada-on .cbx-girar { background: var(--accent); color: #111; }
/* 2.31: letras y botones en las franjas negras de los lados (no tapan la imagen) */
.cbx-en-completa.cbx-franjas .cbx-ov { left: max(6px, env(safe-area-inset-left)); right: auto; width: calc(var(--franja) - 12px);
                                       flex-direction: column; align-items: stretch; gap: 6px; }
.cbx-en-completa.cbx-franjas .cbx-ov .cbx-spacer { display: none; }
.cbx-en-completa.cbx-franjas .cbx-ov .cbx-pill { white-space: normal; height: auto; min-height: 26px; padding: 4px 8px; line-height: 1.25;
                                                 font-size: 12px; max-width: 100%; overflow-wrap: anywhere; }
.cbx-en-completa.cbx-franjas .cbx-fps { flex-wrap: wrap; height: auto; padding: 4px 8px; gap: 4px 6px; font-size: 12px; max-width: 100%; }
.cbx-en-completa.cbx-franjas .cbx-fps .sep { display: none; }
.cbx-en-completa.cbx-franjas .cbx-completa-botones { flex-direction: column; gap: 6px;
                                                     right: calc(max(0px, env(safe-area-inset-right)) + (var(--franja) - 44px) / 2); }
.cbx-en-completa.cbx-franjas .cbx-completa-botones button { width: 44px; height: 44px; font-size: 18px; }
.cbx-en-completa.cbx-franjas .acciones-video { flex-direction: column; gap: 6px; bottom: max(10px, env(safe-area-inset-bottom));
                                               right: calc(max(0px, env(safe-area-inset-right)) + (var(--franja) - 44px) / 2); }
.cbx-en-completa.cbx-franjas .acciones-video button { width: 44px; height: 44px; }
/* sin franjas: se esconden solos (vuelven al tocar) */
.cbx-en-completa .cbx-ov, .cbx-en-completa .cbx-completa-botones, .cbx-en-completa .acciones-video { transition: opacity .25s; }
.cbx-en-completa.cbx-sin-controles .cbx-ov, .cbx-en-completa.cbx-sin-controles .cbx-completa-botones,
.cbx-en-completa.cbx-sin-controles .acciones-video { opacity: 0 !important; pointer-events: none; }
.cbx-en-completa.cbx-sin-controles .cbx-ov > * { pointer-events: none; }
.cbx-en-completa > video { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: contain; background: #000; }
.cbx-en-completa.cbx-llenar-on > video { object-fit: cover; }
.cbx-en-completa > img.cbx-zoom { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
                                   object-fit: contain; cursor: zoom-in; user-select: none; -webkit-user-select: none; transition: transform .06s linear; }
.cbx-en-completa.cbx-ampliada > img.cbx-zoom { cursor: grab; }
.cbx-en-completa.cbx-ampliada .cbx-stream { cursor: grab; }
.cbx-en-completa .cbx-fluido-capa { pointer-events: none; }

/* guia paso a paso (Cobax.guia) */
.cbx-guia-fondo { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px;
                  animation: cbx-in .15s ease; }
.cbx-guia { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); color: var(--text);
            border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.cbx-guia-cab { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.cbx-guia-x { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
              font-size: 15px; cursor: pointer; }
.cbx-guia-dibujo { display: grid; place-items: center; min-height: 120px; border-radius: 14px; background: #0b0c0f; margin-bottom: 14px;
                   font-size: 54px; overflow: hidden; }
.cbx-guia-dibujo svg { width: 100%; height: auto; max-height: 190px; display: block; }
.cbx-guia h3 { margin: 0 0 8px; font-size: 18px; }
.cbx-guia-texto { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.cbx-guia-texto p { margin: 0 0 10px; }
.cbx-guia-texto ul { margin: 0 0 10px; padding-left: 20px; }
.cbx-guia-texto li { margin-bottom: 4px; }
.cbx-guia-puntos { display: flex; justify-content: center; gap: 7px; margin: 14px 0 12px; }
.cbx-guia-puntos button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: var(--border-strong); cursor: pointer; }
.cbx-guia-puntos button.on { background: var(--accent); width: 22px; border-radius: 5px; }
.cbx-guia-pie { display: flex; justify-content: space-between; gap: 10px; }
.cbx-guia-pie .cbx-btn { min-width: 120px; justify-content: center; height: 44px; }

/* barra "te faltan N pasos" (hasta terminar Primeros pasos) */
.cbx-pendientes { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; font-size: 13.5px;
                  background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--accent); text-decoration: none; }
.cbx-pendientes small { color: var(--text-2); }
.cbx-pendientes b { color: var(--accent); white-space: nowrap; }

/* ---------------------------------------------------------------- guias interactivas (cobax-guias.js) */
.cbx-ayuda-btn { font-weight: 800; font-size: 15px; }
.cbx-tour-velo { position: fixed; inset: 0; z-index: 1300; background: rgba(0,0,0,.55); pointer-events: none; }
.cbx-tour-foco { position: fixed; z-index: 1300; border-radius: 12px; pointer-events: none;
                 box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(0,0,0,.55); transition: all .25s ease; }
.cbx-tour-globo { position: fixed; z-index: 1301; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--text);
                  border: 1px solid var(--accent); border-radius: 16px; padding: 12px 14px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.45);
                  animation: cbx-in .18s ease; }
.cbx-tour-globo.centro { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.cbx-tour-globo.abajo-fijo { left: 12px !important; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); top: auto !important; }
.cbx-tour-globo.abajo-fijo.arriba-fijo { bottom: auto; top: calc(12px + env(safe-area-inset-top)) !important; }
.cbx-tour-globo .cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.cbx-tour-globo .cab .cerrar { width: 32px; height: 32px; }
.cbx-tour-globo .barra { height: 3px; background: var(--border); border-radius: 2px; margin: 6px 0 10px; overflow: hidden; }
.cbx-tour-globo .barra i { display: block; height: 100%; background: var(--accent); }
.cbx-tour-globo h4 { margin: 0 0 6px; font-size: 16px; }
.cbx-tour-globo .tx { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.cbx-tour-globo .tx ul { margin: 4px 0; padding-left: 18px; }
.cbx-tour-globo .tx .nota { margin-top: 8px; color: var(--accent); font-weight: 600; font-size: 13px; }
.cbx-tour-globo .pie { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.cbx-tour-globo .pie .cbx-btn { height: 40px; min-width: 96px; justify-content: center; }
.cbx-ayuda-panel { position: fixed; z-index: 1250; top: 64px; right: 12px; width: min(340px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto;
                   background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; box-shadow: 0 16px 44px rgba(0,0,0,.4); }
.cbx-ayuda-panel .cab { padding: 4px 6px 8px; font-size: 14px; }
.cbx-ayuda-panel button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px; border-radius: 10px; border: 0;
                          background: none; color: var(--text); font: inherit; cursor: pointer; }
.cbx-ayuda-panel button:hover { background: var(--surface-2); }
.cbx-ayuda-panel .ic { font-size: 20px; width: 28px; text-align: center; }
.cbx-ayuda-panel b { display: block; font-size: 13.5px; }
.cbx-ayuda-panel small { color: var(--muted); font-size: 12px; }
.cbx-ayuda-panel p { color: var(--muted); font-size: 13px; padding: 4px 6px; margin: 0; }
.cbx-ayuda-panel .todas { display: block; padding: 10px 6px 4px; color: var(--accent); font-size: 13px; text-decoration: none; font-weight: 600; }

/* (i) explicacion de palabras tecnicas */
.cbx-i { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--border-strong);
         background: var(--surface-2); color: var(--text-2); font: italic 700 11px/1 Georgia, serif; cursor: pointer; vertical-align: middle; padding: 0; }
.cbx-i:hover { border-color: var(--accent); color: var(--accent); }
.cbx-i-pop { position: fixed; z-index: 1400; width: min(300px, calc(100vw - 16px)); background: var(--surface); color: var(--text-2); border: 1px solid var(--accent);
             border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 12px 34px rgba(0,0,0,.4); }
.cbx-i-pop b { display: block; color: var(--text); margin-bottom: 4px; font-size: 13.5px; }

/* 2.18: elegir modo (Fuera / En casa / Desarmado) */
#cbx-armado { white-space: nowrap; }
.cbx-modos-pop { position: fixed; z-index: 1400; width: min(320px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--border);
                 border-radius: 14px; padding: 6px; box-shadow: 0 14px 38px rgba(0,0,0,.42); display: grid; gap: 4px; }
.cbx-modos-pop button { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 10px; border-radius: 10px;
                        border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; }
.cbx-modos-pop button:hover { background: var(--surface-2); }
.cbx-modos-pop button.on { border-color: var(--accent); background: var(--accent-soft); }
.cbx-modos-pop button b { display: block; color: var(--text); font-size: 14px; }
.cbx-modos-pop button small { display: block; font-size: 12px; line-height: 1.4; margin-top: 2px; }
.cbx-modos-pop button.ok svg { color: var(--ok); } .cbx-modos-pop button.encasa svg { color: var(--info); } .cbx-modos-pop button.danger svg { color: var(--danger); }
.cbx-modos-pop svg { flex: 0 0 auto; margin-top: 2px; }

/* narrador de las guias (voz) */
.cbx-narrador { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 2px; }
.cbx-narrador:empty { display: none; }
.cbx-narrador .cbx-btn { min-width: 38px; padding-inline: 8px; font-variant-numeric: tabular-nums; }
.cbx-narrador .cbx-btn.on { color: var(--accent, #c9a227); border-color: currentColor; }
.cbx-narrador .nota-voz { font-size: 12px; color: var(--muted); }
.cbx-guia-voz:empty { display: none; }
/* selector de idioma (Ajustes) */
.cbx-idiomas { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.cbx-idiomas button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.cbx-idiomas button.on { border-color: var(--accent, #c9a227); box-shadow: 0 0 0 1px var(--accent, #c9a227) inset; font-weight: 600; }
.cbx-idiomas button small { color: var(--muted); font-size: 11px; margin-left: auto; text-transform: uppercase; }


/* 2.31.4: momentos a pantalla completa (Cobax.momento) */
.cbx-momento { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 32px 24px;
               background: #050507; color: #f4f1ea; opacity: 0; transition: opacity .45s ease; cursor: pointer;
               -webkit-user-select: none; user-select: none; overflow: hidden; }
.cbx-momento.on { opacity: 1; }
.cbx-momento-luz { position: absolute; width: 140vmax; height: 140vmax; left: 50%; top: 50%; transform: translate(-50%, -50%);
                   background: radial-gradient(circle at center, rgba(212,175,55,.16) 0, rgba(212,175,55,.05) 22%, transparent 48%);
                   animation: cbx-respira 7s ease-in-out infinite; pointer-events: none; }
@keyframes cbx-respira { 50% { transform: translate(-50%, -50%) scale(1.08); opacity: .75; } }
.cbx-momento-centro { position: relative; width: min(760px, 100%); min-height: 40vh; display: grid; place-items: center; }
.cbx-momento-frase { grid-area: 1 / 1; text-align: center; font-size: clamp(24px, 4.6vw, 40px); font-weight: 600; line-height: 1.22;
                     letter-spacing: -.015em; opacity: 0; transform: translateY(14px); filter: blur(6px);
                     transition: opacity .7s ease, transform .9s cubic-bezier(.2,.7,.2,1), filter .7s ease; }
.cbx-momento-frase.grande { font-size: clamp(44px, 10vw, 88px); font-weight: 700; letter-spacing: -.035em;
                            background: linear-gradient(180deg, #fff 0%, #d4af37 130%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cbx-momento-frase.dentro { opacity: 1; transform: none; filter: none; }
.cbx-momento-frase.fuera { opacity: 0; transform: translateY(-10px); filter: blur(4px); transition-duration: .45s; }
.cbx-momento-foto { display: block; width: min(520px, 100%); max-height: 46vh; object-fit: contain; margin: 0 auto 22px;
                    border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); }
.cbx-momento-boton { display: block; margin: 30px auto 0; height: 50px; padding: 0 30px; font-size: 16px; border-radius: 14px; }
.cbx-momento-pie { position: absolute; bottom: max(26px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center;
                   font-size: 13px; color: rgba(244,241,234,.38); letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) {
  .cbx-momento, .cbx-momento-frase { transition: none; }
  .cbx-momento-luz { animation: none; }
}
.cbx-momento-son { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 18px; width: 42px; height: 42px;
                   border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
                   color: #f4f1ea; font-size: 18px; cursor: pointer; opacity: .65; }
.cbx-momento-son:hover { opacity: 1; }


/* =========================================================================
   2.31.4 «Cobax premium»: tarjetas de cristal, títulos y números con presencia, oro con relieve
   ========================================================================= */
.cbx-card, .cbx-stat, .cbx-tile {
  background: var(--cristal);
  border-radius: 24px;
  backdrop-filter: blur(22px) saturate(1.25); -webkit-backdrop-filter: blur(22px) saturate(1.25);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--cristal-brillo);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cbx-card, .cbx-stat, .cbx-tile { background: var(--surface); }      /* sin cristal: opaco, que se lea igual */
}
.cbx-stat { padding: 18px 20px; }
.cbx-stat b { font-size: 34px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.cbx-title { font-size: 32px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.cbx-subtitle { font-size: 15px; }
.cbx-section-title { letter-spacing: 0.1em; color: var(--text-2); }
.cbx-btn { border-radius: 14px; }
.cbx-btn.sm { border-radius: 10px; }
.cbx-btn.primary { background: var(--oro); border-color: transparent; font-weight: 650;
  box-shadow: 0 8px 22px -10px var(--oro-sombra), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.cbx-btn.primary:hover { filter: brightness(1.06); background: var(--oro); border-color: transparent; }
.cbx-header { background: color-mix(in srgb, var(--bg) 55%, transparent); border-bottom-color: transparent;
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); }
.cbx-nav a { border-radius: 14px; }
.cbx-nav a.on { box-shadow: inset 0 0 0 1px var(--accent-line); }
.cbx-brand-mark { background: var(--oro); color: #1a1405; border: 0; box-shadow: 0 6px 18px -8px var(--oro-sombra); }
.cbx-modal, .cbx-toast { border-radius: 20px; }
@media (max-width: 640px) {
  .cbx-title { font-size: 28px; }
  .cbx-stat b { font-size: 30px; }
}
