.danpex-agenda-wrapper { width: 100%; }
.danpex-agenda-canvas { position: relative; width: 100%; touch-action: pan-y; }
.danpex-agenda-canvas canvas { display: block; width: 100%; height: 100%; outline: none; }
.danpex-agenda-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 14px; opacity: .6; pointer-events: none;
}
.danpex-agenda-error { color: #d63638; }
p#danpex-spot-titulo {
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 10px;
    font-size: 1.2em;
}
/* ---------- Capa oscura: la barra sale centrada solo al inicio ---------- */
html.danpex-spot-open { overflow: hidden; }

.danpex-spot-overlay {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; align-items: center; justify-content: center;
    width: 100vw; height: 100vh; height: 100dvh;
    padding: 20px; box-sizing: border-box; overflow-y: auto;
    background: rgba(10, 10, 12, .86);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; transition: opacity .25s ease;
}
.danpex-spot-overlay[hidden] { display: none; }
.danpex-spot-overlay.is-visible { opacity: 1; }
.danpex-spot-overlay .danpex-spot { margin: auto !important; } /* centrada en la pantalla */

/* ---------- Barra "Personaliza tu experiencia" (estilo Spotlight) ---------- */
.danpex-spot {
    --spot-bg: rgba(38, 38, 42, .78);
    --spot-borde: rgba(255, 255, 255, .14);
    --spot-texto: #f5f5f7;
    --spot-suave: rgba(245, 245, 247, .55);
    --spot-boton: rgba(255, 255, 255, .12);
    --spot-boton-hover: rgba(255, 255, 255, .22);
    --spot-foco: rgba(10, 132, 255, .55);
    --spot-error: #e5484d;
    margin-bottom: 0px !important;
    width: 100%; max-width: 560px; margin: 0 auto 16px; padding: 0 12px;
    box-sizing: border-box; text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}
.danpex-spot *, .danpex-spot *::before, .danpex-spot *::after { box-sizing: border-box; }

.danpex-spot__title { margin: 0 0 10px; font-size: 18px; font-weight: 600; line-height: 1.3; }

.danpex-spot__bar {
    display: flex; align-items: center; gap: 8px;
    height: 56px; padding: 8px 8px 8px 18px;
    border: none;
    background: transparent; color: var(--spot-texto);
    -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .25);
    transition: box-shadow .15s ease;
}

.danpex-spot__lead {
    display: flex;
    padding: 10px;
    border-radius: 50px;
    flex: none;
    background: #252525;
    color: var(--spot-suave);
}

.danpex-spot__input {
    flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; padding: 0;
    border: 0; outline: 0; background: transparent; box-shadow: none;
    color: inherit; font: inherit; font-size: 17px; text-align: left;
    text-overflow: ellipsis;
}
.danpex-spot__input::placeholder { color: var(--spot-suave); opacity: 1; }

.danpex-spot__btn {
    position: relative; flex: none; display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin: 0; padding: 0;
    border: 0; border-radius: 50%;
    background: var(--spot-boton) center / 68% no-repeat; color: var(--spot-texto);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: background-color .15s ease, transform .1s ease, opacity .15s ease;
}
.danpex-spot__btn:hover { background-color: var(--spot-boton-hover); }
.danpex-spot__btn:active { transform: scale(.92); }
.danpex-spot__btn:focus-visible { outline: 2px solid var(--spot-foco); outline-offset: 2px; }

/* Con logotipo cargado, el botón muestra su miniatura. */
.danpex-spot__btn.is-on {
    padding: 7px; background-size: contain; background-origin: content-box;
    box-shadow: 0 0 0 2px var(--spot-foco);
}
.danpex-spot__btn.is-on svg { opacity: 0; }

/* Texto emergente ("Cargar logotipo", "Cerrar") */
.danpex-spot__btn::after {
    content: attr(data-tip);
    position: absolute; top: calc(100% + 10px); right: 50%;
    --tx: 50%; --ty: -4px; transform: translate(var(--tx), var(--ty));
    padding: 7px 11px; border-radius: 8px;
    background: rgba(20, 20, 22, .95); color: #fff;
    font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
    opacity: 0; pointer-events: none; z-index: 2;
    transition: opacity .15s ease, transform .15s ease;
}
.danpex-spot__btn--cerrar::after { right: 0; --tx: 0; }
.danpex-spot__btn:focus-visible::after { opacity: 1; --ty: 0; }
@media (hover: hover) { .danpex-spot__btn:hover::after { opacity: 1; --ty: 0; } }
input.danpex-spot__input {
    background: transparent !important;
    color: #fff !important;
    border-radius: 50px;
    border-color: #3f3e41;
}
input.danpex-spot__input:focus { border-color: var(--spot-foco); }
.danpex-spot__hint {    color: #ffffff; font-family: 'Poppins', sans-serif; min-height: 18px; margin: 8px 0 0; font-size: 12px; line-height: 18px; opacity: .65; }
.danpex-spot__hint.is-error { color: var(--spot-error); opacity: 1; font-weight: 500; }

@media (max-width: 480px) {
    .danpex-spot { padding: 0 10px; }
    .danpex-spot__title { font-size: 17px; }
    .danpex-spot__bar { padding-left: 16px; gap: 6px; }
    .danpex-spot__input { font-size: 16px; } /* 16px evita el zoom automático de iOS */
    .danpex-spot__input::placeholder { font-size: 14px; } /* para que quepa el texto completo */
}
@media (max-width: 380px) {
    .danpex-spot__lead { display: none; } /* gana espacio para el texto */
    .danpex-spot__bar { padding-left: 18px; }
    .danpex-spot__input::placeholder { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .danpex-spot-overlay, .danpex-spot__bar, .danpex-spot__btn, .danpex-spot__btn::after { transition: none; }
}

/* ---------- Panel de calibración (solo admin, ?danpex_preview=1) ---------- */
.danpex-panel {
    position: fixed; top: 12px; right: 12px; z-index: 2147482000;
    width: min(320px, 92vw); max-height: calc(100vh - 24px); overflow: auto;
    padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.97); color: #1a1a1a;
    box-shadow: 0 8px 30px rgba(0,0,0,.3); font: 12px/1.4 system-ui, sans-serif; box-sizing: border-box;
}
.danpex-panel *, .danpex-panel *::before, .danpex-panel *::after { box-sizing: border-box; }
.danpex-panel [hidden] { display: none !important; }
.danpex-panel__cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13px; }
.danpex-panel__toggle { border: 1px solid #ccc; background: #fff; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; }
.danpex-panel__estado { margin: 0 0 6px; padding: 6px; background: #f3f3f6; border-radius: 6px; white-space: pre-wrap; font: 11px/1.4 ui-monospace, monospace; }
.danpex-panel__leyenda { margin-bottom: 8px; font-size: 11px; opacity: .7; }
.danpex-panel__grupo { margin: 0 0 8px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 6px; }
.danpex-panel__grupo legend { padding: 0 4px; font-weight: 700; }
.danpex-panel__fila-titulo { margin-top: 4px; font-weight: 600; }
.danpex-panel__campo { display: grid; grid-template-columns: 38px 1fr 64px; gap: 6px; align-items: center; margin: 2px 0; }
.danpex-panel__campo input[type="number"] { width: 100%; padding: 2px 4px; font-size: 12px; }
.danpex-panel__campo input[type="range"] { width: 100%; }
.danpex-panel__pie { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.danpex-panel__btn { padding: 8px; border: 0; border-radius: 6px; background: #1a1a1a; color: #fff; font-weight: 600; cursor: pointer; }
.danpex-panel__btn:disabled { opacity: .6; }
.danpex-panel__aviso { min-height: 16px; }
