:root {
  --eva: #407ED7;
  --eva-rgb: 64, 126, 215;
  --ink: #0d1726;
  --ink-2: #13223a;
  --ink-3: #1c2f4d;
  --line: rgba(255, 255, 255, .10);
  --txt: #e8eef7;
  --txt-2: #9fb0c8;
  --ok: #10b981;
  --warn: #f5a524;
  --crit: #e5484d;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, 'Cascadia Mono', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--txt); font-family: var(--font); overflow: hidden; }
button, select, input, textarea { font-family: inherit; }
.hidden { display: none !important; }

#app { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
#app.bare { grid-template-rows: 0 1fr 0; }
#app.bare #pbar, #app.bare #impact { display: none; }

/* ── Barra del presentador ── */
#pbar { display: flex; align-items: center; gap: 18px; padding: 6px 16px; background: #0a1220; border-bottom: 1px solid var(--line); height: 50px; }
.pb-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .5px; }
.pb-brand img { width: 26px; height: 26px; }
.pb-brand em { font-style: normal; color: var(--eva); font-weight: 600; }
.pb-chapter { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
#pb-chnum { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--eva); font-weight: 700; font-size: 13px; }
#pb-chtitle { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.pb-date { font-size: 11px; color: var(--txt-2); text-transform: uppercase; letter-spacing: .6px; }
#pb-time { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: 1px; }
#pb-time.running { color: #7fd1ff; }
.pb-controls { display: flex; align-items: center; gap: 6px; }
.pb-controls button, .pb-controls select { background: var(--ink-3); color: var(--txt); border: 1px solid var(--line); border-radius: 6px; height: 32px; padding: 0 10px; cursor: pointer; font-size: 13px; }
.pb-controls button:hover { background: #26406a; }
#btn-play { min-width: 44px; font-size: 14px; }
#btn-play.on { background: var(--eva); }
#pb-beat { font-size: 12px; color: var(--txt-2); min-width: 46px; text-align: center; font-family: var(--mono); }

/* ── Escenario ── */
#stage { position: relative; overflow: hidden; }
.layer { position: absolute; inset: 0; display: none; }
.layer.active { display: flex; flex-direction: column; }
#screens { background: #2a3444; }
#screen-tabs { display: flex; align-items: stretch; gap: 2px; padding: 6px 10px 0; background: #1b2332; }
#screen-tabs button { display: flex; align-items: center; gap: 8px; background: #2b3647; color: #cfd8e6; border: 0; border-radius: 8px 8px 0 0; padding: 7px 14px; cursor: pointer; font-size: 13px; font-weight: 600; }
#screen-tabs button small { font-weight: 400; color: #8ea0b8; font-size: 11px; }
#screen-tabs button.active { background: #f4f6f9; color: #1d2733; }
#screen-tabs button.active small { color: #6b7a8c; }
#screen-tabs .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tabs-spacer { flex: 1; }
#zoom-ind { align-self: center; color: #8ea0b8; font-size: 11px; font-family: var(--mono); padding-right: 4px; }
#screen-area { flex: 1; position: relative; display: flex; gap: 6px; background: #f4f6f9; overflow: hidden; }
.scr { display: none; flex: 1 1 0; min-width: 0; position: relative; overflow: hidden; }
.scr.show { display: block; }
#screen-area.split .scr.show { border-right: 4px solid #1b2332; }
.scr-inner { position: absolute; inset: 0; transform-origin: 0 0; }

/* ── Callout ── */
#callout { position: absolute; right: 26px; bottom: 22px; max-width: 470px; z-index: 50; pointer-events: none; }
#callout .co-body { background: #fff8d6; color: #2b2410; border-left: 6px solid #f5b400; border-radius: 10px; padding: 14px 18px; font-size: 19px; line-height: 1.35; box-shadow: 0 12px 34px rgba(0, 0, 0, .35); animation: co-in .35s ease; }
#callout .co-body b { color: #9a2a00; }
#callout.on-slide .co-body { background: rgba(var(--eva-rgb), .15); color: var(--txt); border-left-color: var(--eva); backdrop-filter: blur(4px); }
#callout.on-slide .co-body b { color: #fff; }
@keyframes co-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Barra de impacto ── */
#impact { display: flex; align-items: center; gap: 16px; padding: 6px 16px; background: #0a1220; border-top: 1px solid var(--line); height: 60px; }
.im-chapters { display: flex; gap: 4px; }
.im-chapters button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-3); color: var(--txt-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.im-chapters button.done { background: #24416e; color: #cfe0ff; }
.im-chapters button.cur { background: var(--eva); color: #fff; border-color: var(--eva); }
.im-kpis { display: flex; flex: 1; justify-content: space-between; gap: 10px; }
.kpi { display: flex; flex-direction: column; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); }
.kpi label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--txt-2); white-space: nowrap; }
.kpi b { font-size: 19px; font-family: var(--mono); white-space: nowrap; }
.kpi small { font-size: 10.5px; color: var(--txt-2); }
.kpi b.ok { color: var(--ok); } .kpi b.warn { color: var(--warn); } .kpi b.crit { color: var(--crit); }
.kpi b.bump { animation: bump .6s ease; }
@keyframes bump { 30% { transform: scale(1.18); color: #fff; } }

/* ── Notas ── */
#notes { position: fixed; right: 0; top: 50px; bottom: 60px; width: 420px; background: #0f1a2c; border-left: 1px solid var(--line); z-index: 80; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0, 0, 0, .4); }
.nt-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.nt-head button { background: none; border: 0; color: var(--txt); font-size: 22px; cursor: pointer; }
#nt-body { padding: 16px; font-size: 16px; line-height: 1.5; overflow: auto; flex: 1; }
#nt-next { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--txt-2); }

/* ── Ayuda ── */
#help { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 100; display: grid; place-items: center; }
.help-card { background: #13223a; border: 1px solid var(--line); border-radius: 14px; padding: 24px 28px; width: 560px; }
.help-card h3 { margin: 0 0 12px; }
.help-card td { padding: 5px 10px 5px 0; font-size: 14px; }
.help-card kbd { background: #26406a; border-radius: 4px; padding: 1px 6px; font-family: var(--mono); font-size: 12px; }
.help-card p { color: var(--txt-2); font-size: 13px; }
.help-card button { background: var(--eva); color: #fff; border: 0; border-radius: 6px; padding: 8px 18px; cursor: pointer; }

/* Barra de desplazamiento discreta dentro de las pantallas */
.scr ::-webkit-scrollbar { width: 9px; height: 9px; }
.scr ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .22); border-radius: 5px; }

@media (max-width: 1400px) {
  #pbar { gap: 10px; }
  .pb-brand span { display: none; }
  #screen-tabs button small { display: none; }
  .kpi label { font-size: 9.5px; }
  .kpi b { font-size: 16px; }
  #callout .co-body { font-size: 16px; }
}
