:root {
    --cei-primary: #0ea5e9;
    --cei-primary-dark: #0369a1;
    --cei-accent: #f97316;
    --cei-accent-soft: #fdba74;
    --cei-navy: #1e3a5f;
    --cei-green: #10b981;
    --cei-bg: #f0f9ff;
    --cei-surface: rgba(255, 255, 255, 0.96);
    --cei-muted: #64748b;
    --cei-ok: #059669;
    --cei-err: #dc2626;
    --cei-radius: 18px;
    --cei-shadow: 0 18px 50px rgba(14, 165, 233, 0.14);
    --cei-tint: #e0f2fe;
    --cei-warm: #fff7ed;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, sans-serif;
    color: #0f172a;
    background:
        radial-gradient(circle at 12% 8%, rgba(14, 165, 233, 0.18), transparent 34%),
        radial-gradient(circle at 88% 12%, rgba(249, 115, 22, 0.14), transparent 30%),
        linear-gradient(160deg, #e0f2fe 0%, var(--cei-bg) 42%, #f8fafc 100%);
}

a { color: inherit; text-decoration: none; }

.cei-header {
    display: grid;
    gap: 14px;
    padding: 18px clamp(16px, 4vw, 40px) 20px;
    background: linear-gradient(135deg, var(--cei-navy) 0%, #0c4a6e 38%, var(--cei-primary) 72%, var(--cei-green) 100%);
    color: #f0f9ff;
}

.cei-header__top {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px 16px;
    width: 100%;
}

.cei-header__titles {
    width: 100%;
    padding-top: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.cei-header__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
}

.cei-header__logo-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.cei-header__logo-link--primary {
    padding: 8px 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.cei-header__logo-link--primary .cei-header__logo {
    height: 54px;
    max-width: min(260px, 46vw);
}

.cei-header__program-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

.cei-header__program-logo {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.cei-header__sponsors {
    flex: 1 1 280px;
    display: grid;
    gap: 8px;
    align-content: center;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    color: var(--cei-navy);
    min-width: min(100%, 320px);
}

.cei-header__sponsors-label {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cei-muted);
}

.cei-header__sponsors-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.cei-header__sponsor-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.1);
    min-height: 44px;
}

.cei-header__sponsor-chip img {
    display: block;
    height: 34px;
    width: auto;
    max-width: 108px;
    object-fit: contain;
}

.cei-header__logo {
    display: block;
    height: 46px;
    width: auto;
    max-width: min(220px, 42vw);
    object-fit: contain;
}

.cei-header__brand { display: flex; gap: 14px; flex: 1 1 280px; align-items: center; }

.cei-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    align-content: center;
    flex: 0 1 auto;
}

@media (max-width: 900px) {
    .cei-header__top {
        flex-direction: column;
        align-items: stretch;
    }
    .cei-header__actions {
        justify-content: flex-start;
    }
    .cei-header__logo-link--primary {
        align-self: flex-start;
    }
}

@media (max-width: 520px) {
    .cei-header__sponsors-logos {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cei-header__sponsor-chip {
        width: 100%;
    }
    .cei-header__sponsor-chip img {
        max-width: 100%;
    }
}

.cei-header__eyebrow {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}

.cei-header h1 {
    margin: 0;
    font-family: Outfit, Plus Jakarta Sans, Inter, sans-serif;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
}

.cei-header__desc { margin: 6px 0 0; opacity: 0.9; max-width: 72ch; }

.cei-header__user {
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.95;
}

.cei-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px clamp(16px, 4vw, 32px) 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary { background: linear-gradient(135deg, var(--cei-primary), var(--cei-primary-dark)); color: #fff; box-shadow: 0 8px 22px rgba(14, 165, 233, 0.28); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-soft { background: #fff; color: var(--cei-navy); border-color: rgba(30, 58, 95, 0.12); }
.cei-header .btn-soft { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.25); }
.btn-ghost { background: transparent; border-color: rgba(15, 23, 42, 0.15); }
.cei-header .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn.full { width: 100%; }

.panel {
    background: var(--cei-surface);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--cei-radius);
    padding: 20px 22px;
    box-shadow: var(--cei-shadow);
    margin-bottom: 20px;
}

.hint { color: var(--cei-muted); font-size: 0.92rem; line-height: 1.45; }

.cei-flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.cei-flash--ok { background: #dcfce7; color: var(--cei-ok); }
.cei-flash--err { background: #fee2e2; color: var(--cei-err); }

.cei-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.cei-card {
    background: var(--cei-surface);
    border-radius: var(--cei-radius);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--cei-shadow);
}

.cei-card__body { padding: 18px; display: grid; gap: 10px; }

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    width: fit-content;
}

.badge--pub { background: #dbeafe; color: #1d4ed8; }
.badge--draft { background: #fef3c7; color: #92400e; }
.badge--off { background: #e2e8f0; color: #475569; }

.cei-stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    margin-bottom: 20px;
}

.cei-stat {
    background: var(--cei-surface);
    border-radius: var(--cei-radius);
    padding: 18px;
    box-shadow: var(--cei-shadow);
}

.cei-stat__label { margin: 0; color: var(--cei-muted); font-size: 0.85rem; }
.cei-stat__value { margin: 6px 0 0; font-size: 2rem; font-weight: 800; font-family: Outfit, Plus Jakarta Sans, sans-serif; }

.cei-login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(20px, 4vw, 40px);
}

.cei-login-shell {
    width: min(980px, 100%);
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(320px, 420px) 1fr;
    align-items: stretch;
}

.cei-login-card {
    background: var(--cei-surface);
    border-radius: calc(var(--cei-radius) + 4px);
    box-shadow: var(--cei-shadow);
    overflow: hidden;
    border: 1px solid rgba(14, 165, 233, 0.14);
}

.cei-login-card__hero {
    padding: 28px 28px 22px;
    background: linear-gradient(145deg, var(--cei-navy) 0%, #0c4a6e 45%, var(--cei-primary) 100%);
    color: #f0f9ff;
    text-align: center;
}

.cei-login-card__brand {
    display: block;
    margin: 0 auto 14px;
    max-width: min(240px, 88%);
    height: auto;
    padding: 8px 12px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.cei-login-card__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.cei-login-card__hero h1 {
    margin: 0;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: 1.65rem;
}

.cei-login-card__tagline {
    margin: 8px 0 0;
    opacity: 0.92;
    font-size: 0.95rem;
}

.cei-login-card__body {
    padding: 24px 28px 28px;
    display: grid;
    gap: 12px;
}

.cei-login-side {
    padding: clamp(20px, 4vw, 36px);
    border-radius: calc(var(--cei-radius) + 4px);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(224, 242, 254, 0.88));
    border: 1px solid rgba(14, 165, 233, 0.16);
    box-shadow: var(--cei-shadow);
}

.cei-login-side__eyebrow {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cei-primary-dark);
}

.cei-login-side h2 {
    margin: 0 0 10px;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    color: var(--cei-navy);
    font-size: clamp(1.35rem, 2.5vw, 1.9rem);
}

.cei-login-side p {
    margin: 0;
    color: var(--cei-muted);
    line-height: 1.55;
}

.cei-login-form { display: grid; gap: 4px; }

@media (max-width: 860px) {
    .cei-login-shell { grid-template-columns: 1fr; }
    .cei-login-side { order: -1; }
}

.cei-login-card label { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 600; }
.cei-login-card input, .cei-form-grid input, .cei-form-grid select, .cei-form-grid textarea, .cei-form-inline input, .cei-form-inline select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    font: inherit;
}

.cei-form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cei-form-grid__full { grid-column: 1 / -1; }

.cei-form-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.cei-actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.cei-table-wrap { overflow: auto; }
.cei-table { width: 100%; border-collapse: collapse; }
.cei-table th, .cei-table td { padding: 10px 12px; border-bottom: 1px solid rgba(15, 23, 42, 0.08); text-align: left; }

.cei-check { display: flex; gap: 8px; margin-bottom: 8px; }

.cei-editor__layout { display: grid; gap: 20px; grid-template-columns: 280px 1fr; }
@media (max-width: 900px) { .cei-editor__layout { grid-template-columns: 1fr; } }

.cei-block-row { display: grid; gap: 8px; padding: 12px; border: 1px dashed rgba(15, 23, 42, 0.15); border-radius: 12px; margin-bottom: 10px; }

.cei-page-reader {
    background:
        radial-gradient(circle at 8% 18%, rgba(14, 165, 233, 0.16), transparent 30%),
        radial-gradient(circle at 90% 12%, rgba(249, 115, 22, 0.12), transparent 28%),
        linear-gradient(160deg, #e0f2fe 0%, #f0f9ff 48%, #f8fafc 100%);
    overflow: hidden;
}
.cei-reader {
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cei-reader__bar {
    flex-shrink: 0;
    padding: 6px clamp(10px, 2vw, 20px) 6px;
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    z-index: 10;
}
.cei-reader__bar-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
}
.cei-reader__bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.cei-reader__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 0.85rem; text-align: right; }
.cei-reader__progress { height: 3px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.cei-reader__progress span { display: block; height: 100%; width: var(--pct, 0%); background: var(--cei-primary); transition: width 0.3s; }
.cei-reader__fs-btn {
    gap: 6px;
}
.cei-reader__viewport {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: stretch;
    gap: clamp(4px, 1vw, 12px);
    padding: 4px clamp(6px, 1.2vw, 12px);
    overflow: hidden;
}
.cei-reader__page {
    width: 100%;
    max-width: min(1280px, 100%);
    margin: 0 auto;
    padding: 0;
    position: relative;
    overflow: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 28px;
    background: transparent;
    border: none;
    box-shadow: none;
}
.cei-reader__page:not(.cei-reader__page--cover) {
    background: transparent;
    border: none;
    box-shadow: none;
}
.cei-reader__page:not(.cei-reader__page--cover)::before,
.cei-reader__page:not(.cei-reader__page--cover)::after {
    display: none;
}
.cei-reader__sheet {
    position: relative;
    isolation: isolate;
    min-height: 100%;
    padding: clamp(18px, 3vw, 40px);
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(15, 118, 110, 0.12);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    background:
        linear-gradient(90deg, rgba(13, 148, 136, 0.96) 0 58px, transparent 58px),
        radial-gradient(circle at 93% 14%, rgba(14, 165, 233, 0.18), transparent 22%),
        linear-gradient(145deg, rgba(255,255,255,0.97), rgba(236,253,245,0.94));
}
.cei-reader__sheet-body {
    position: relative;
    z-index: 1;
}
/* Marco = márgenes sobre el diseño de la hoja (sin panel blanco encima) */
.cei-reader__sheet.has-content-frame,
.cei-reader__sheet.cei-sheet--designable.is-framing {
    padding-top: var(--fy, 10%);
    padding-right: var(--fr, 10%);
    padding-bottom: var(--fb, 12%);
    padding-left: var(--fx, 10%);
    box-sizing: border-box;
    overflow: visible;
}
.cei-reader__sheet.has-content-frame .cei-sheet__deco,
.cei-reader__sheet.cei-sheet--designable.is-framing .cei-sheet__deco {
    border-radius: inherit;
}
.cei-reader__sheet-body--framed {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 0;
    height: auto;
    overflow: visible;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}
.cei-frame__handle {
    display: none;
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #fff;
    border: 2px solid #0ea5e9;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.3);
    z-index: 8;
    pointer-events: auto;
}
.cei-frame__handle--nw { left: -7px; top: -7px; cursor: nwse-resize; }
.cei-frame__handle--ne { right: -7px; top: -7px; cursor: nesw-resize; }
.cei-frame__handle--sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.cei-frame__handle--se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.cei-page-design .cei-reader__sheet-body--framed {
    cursor: move;
    touch-action: none;
    min-height: 120px;
}
.cei-page-design .cei-reader__sheet-body--framed.is-frame-selected,
.cei-page-design .cei-reader__sheet-body--framed:hover {
    outline: 2px dashed rgba(14, 165, 233, 0.85);
    outline-offset: 4px;
    background: rgba(14, 165, 233, 0.04);
    box-shadow: none;
}
.cei-page-design .cei-reader__sheet-body--framed.is-frame-selected .cei-frame__handle,
.cei-page-design .cei-reader__sheet-body--framed:hover .cei-frame__handle {
    display: block;
}
.cei-page-design #cei-design-frame.is-active {
    background: rgba(14, 165, 233, 0.16);
    border-color: rgba(14, 165, 233, 0.4);
    color: #0369a1;
}

/* ---------- Modo Diseño de hoja (solo recuadro sobre plantilla) ---------- */
.cei-page-sheet-design .cei-reader__page--hoja {
    max-width: min(920px, calc(100% - 24px));
    margin: 0 auto;
}
.cei-sheet--hoja-edit {
    position: relative;
    min-height: min(88vh, 980px);
    padding: 0 !important;
    overflow: hidden;
}
.cei-sheet--hoja-edit .cei-sheet__deco img {
    opacity: 1;
}
.cei-sheet-frame {
    position: absolute;
    left: var(--fx, 10%);
    top: var(--fy, 10%);
    width: var(--fw, 76%);
    height: var(--fh, 72%);
    z-index: 3;
    box-sizing: border-box;
    border-radius: 18px;
    background: rgba(255, 252, 245, 0.82);
    border: 2px solid rgba(14, 165, 233, 0.85);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
    cursor: move;
    touch-action: none;
}
.cei-sheet-frame .cei-frame__handle {
    display: block;
}
.cei-sheet-frame__label {
    display: grid;
    gap: 4px;
    place-content: center;
    height: 100%;
    padding: 16px;
    text-align: center;
    color: #1e3a5f;
    pointer-events: none;
}
.cei-sheet-frame__label i {
    font-size: 1.4rem;
    color: #0284c7;
}
.cei-sheet-frame__label strong {
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: 1.05rem;
}
.cei-sheet-frame__label span {
    font-size: 0.85rem;
    color: #64748b;
    max-width: 280px;
    margin: 0 auto;
}
.cei-reader__design-badge--hoja {
    color: #065f46;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
}
.cei-design-toolbar__hint {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cei-muted, #64748b);
}
.cei-page-sheet-design .cei-reader__nav { padding-bottom: 72px; }
.cei-sheet-picker__actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cei-reader__nav {
    flex-shrink: 0;
    padding: 4px clamp(8px, 1.5vw, 16px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.92);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.04);
    z-index: 10;
    min-height: 0;
}
.cei-reader__nav-start,
.cei-reader__nav-end {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cei-reader__nav-start { justify-content: flex-start; }
.cei-reader__nav-end { justify-content: flex-end; }
.cei-reader__nav-center {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}
.cei-reader__nav-pager {
    font-weight: 700;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: 0.78rem;
    color: var(--cei-muted);
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.cei-reader__nav-finished {
    color: var(--cei-primary-dark);
    font-size: 0.85rem;
    opacity: 0.85;
}
.cei-reader__jump {
    display: flex;
    align-items: center;
    min-width: 0;
}
.cei-reader__jump-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cei-muted);
}
.cei-reader__jump-select {
    min-width: 0;
    width: min(220px, 42vw);
    max-width: 280px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 8px;
    padding: 4px 8px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e3a5f;
    background: #fff;
    cursor: pointer;
    line-height: 1.3;
}
.cei-reader__nav-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(14, 165, 233, 0.22);
    color: var(--cei-primary);
    font-size: 0.85rem;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.cei-reader__nav-btn:hover {
    background: var(--cei-tint);
    border-color: var(--cei-primary);
}
.cei-reader__nav-btn--primary {
    background: linear-gradient(135deg, var(--cei-primary), var(--cei-primary-dark));
    border-color: transparent;
    color: #fff;
}
.cei-reader__nav-btn--primary:hover {
    filter: brightness(1.06);
    background: linear-gradient(135deg, var(--cei-primary), var(--cei-primary-dark));
    color: #fff;
}

/* Pantalla completa / inmersivo */
.cei-reader.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    height: 100vh;
    height: 100svh;
    width: 100vw;
    background: #ecfeff;
}
.cei-reader:fullscreen,
.cei-reader:-webkit-full-screen {
    width: 100%;
    height: 100%;
    background: #ecfeff;
}
.cei-reader.is-fullscreen .cei-reader__bar,
.cei-reader:fullscreen .cei-reader__bar,
.cei-reader:-webkit-full-screen .cei-reader__bar {
    padding: 4px clamp(8px, 1.5vw, 14px);
    gap: 4px;
}
.cei-reader.is-fullscreen .cei-reader__meta span:not(.cei-reader__design-badge),
.cei-reader:fullscreen .cei-reader__meta span:not(.cei-reader__design-badge),
.cei-reader:-webkit-full-screen .cei-reader__meta span:not(.cei-reader__design-badge) {
    display: none;
}
.cei-reader.is-fullscreen .cei-reader__fs-label,
.cei-reader:fullscreen .cei-reader__fs-label,
.cei-reader:-webkit-full-screen .cei-reader__fs-label {
    display: none;
}
.cei-reader.is-fullscreen .cei-reader__viewport,
.cei-reader:fullscreen .cei-reader__viewport,
.cei-reader:-webkit-full-screen .cei-reader__viewport {
    padding: 4px clamp(4px, 1vw, 10px);
}
.cei-reader.is-fullscreen .cei-reader__nav,
.cei-reader:fullscreen .cei-reader__nav,
.cei-reader:-webkit-full-screen .cei-reader__nav {
    padding: 3px clamp(6px, 1.2vw, 12px);
    background: rgba(255,255,255,0.88);
}
.cei-reader__side-btn {
    align-self: center;
    display: grid;
    place-items: center;
    width: clamp(36px, 4vw, 48px);
    height: clamp(36px, 4vw, 48px);
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    border: 1.5px solid rgba(14, 165, 233, 0.22);
    color: var(--cei-primary);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
    font-size: 0.95rem;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.cei-reader__side-btn:hover {
    transform: translateY(-1px);
    background: var(--cei-tint);
    border-color: var(--cei-primary);
}

.reader-page-enter { animation: ceiPageIn 0.45s ease; }
.reader-page-exit { animation: ceiPageOut 0.28s ease forwards; }
@keyframes ceiPageIn {
  from { opacity: 0; transform: translateX(28px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes ceiPageOut {
  to { opacity: 0; transform: translateX(-22px) scale(0.985); }
}
.cei-page-fx {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0;
  background: linear-gradient(105deg, rgba(14, 165, 233, 0.18), rgba(16, 185, 129, 0.12));
  transition: opacity 0.2s ease;
}
.cei-page-fx.is-active { opacity: 1; }
@keyframes ceiFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cei-prose p { line-height: 1.7; }
.cei-quote { border-left: 4px solid var(--cei-primary); padding-left: 1rem; font-style: italic; }
.cei-media-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.cei-media-grid img { width: 100%; border-radius: 10px; margin-top: 8px; }

.activity-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 2px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.activity-option.is-selected { border-color: var(--cei-primary); background: var(--cei-tint); }
.activity-option.is-correct { border-color: #22c55e; }
.activity-option.is-wrong { border-color: #ef4444; }

textarea.code { font-family: ui-monospace, monospace; font-size: 0.85rem; width: 100%; }

.oculto { display: none !important; }

/* —— Editor mejorado —— */
.cei-editor__help { margin-bottom: 16px; }
.cei-editor__help p { margin: 0; line-height: 1.55; color: var(--cei-muted); }
#cei-persist-status { margin-top: 8px; min-height: 1.2em; font-weight: 600; }
.cei-persist-status--ok { color: #047857; }
.cei-persist-status--error { color: #dc2626; }

.cei-editor__sidebar-title { margin: 0 0 12px; font-family: Outfit, Plus Jakarta Sans, sans-serif; display: flex; align-items: center; gap: 8px; }

.cei-editor__add-pages { display: grid; gap: 8px; margin-bottom: 16px; }
.cei-add-page-form--activity { display: grid; gap: 8px; }
.cei-field--compact span { font-size: 0.82rem; }
.cei-field--activity-type { margin-bottom: 16px; }

.cei-activity-editor { display: grid; gap: 12px; margin-bottom: 20px; }
.cei-act-panel { display: none; gap: 12px; }
.cei-act-panel.is-active { display: grid; }
.cei-act-repeat-list { display: grid; gap: 12px; margin: 12px 0; }
.cei-act-repeat-list__title { margin: 0; font-weight: 600; color: #1e3a5f; font-size: 0.92rem; }
.cei-act-repeat-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
}

.cei-tf-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.cei-tf-btn.is-selected { border-color: var(--cei-primary); background: var(--cei-tint); }
.cei-fill-template { line-height: 1.8; font-size: 1.05rem; margin: 0 0 12px; }
.cei-fill-inputs { display: grid; gap: 10px; margin-bottom: 12px; }
.cei-dd-instruction { font-weight: 600; margin: 0 0 12px; }
.cei-dd-board { display: grid; gap: 16px; margin-bottom: 14px; }
.cei-dd-targets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.cei-dd-target {
  border: 1px solid rgba(30, 58, 95, 0.14);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-rows: 120px auto;
}
.cei-dd-target.is-correct { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2); }
.cei-dd-target.is-wrong { border-color: #ef4444; }
.cei-dd-target__img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}
.cei-dd-target__ph {
  display: grid;
  place-items: center;
  height: 120px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 1.6rem;
}
.cei-dd-target__drop {
  min-height: 52px;
  padding: 8px;
  display: grid;
  place-items: center;
  background: rgba(14, 165, 233, 0.06);
  border-top: 1px dashed rgba(14, 165, 233, 0.35);
  transition: background 0.15s ease;
}
.cei-dd-target__drop.is-over {
  background: rgba(14, 165, 233, 0.18);
}
.cei-dd-target__hint {
  font-size: 0.82rem;
  color: var(--cei-muted);
}
.cei-dd-pool {
  padding: 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px dashed rgba(30, 58, 95, 0.16);
}
.cei-dd-pool__label {
  margin: 0 0 8px;
  font-weight: 600;
  color: #1e3a5f;
  font-size: 0.9rem;
}
.cei-dd-pool__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}
.cei-dd-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.28);
}
.cei-dd-chip.is-dragging { opacity: 0.55; }
.cei-dd-chip.is-placed {
  background: #10b981;
  box-shadow: none;
}

/* Etiquetar diagrama (partes del ave) */
.cei-ld-instruction { font-weight: 600; margin: 0 0 12px; color: #1e3a5f; }
.cei-ld-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 200px);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}
.cei-ld-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid rgba(30, 58, 95, 0.12);
}
.cei-ld-img {
  display: block;
  width: 100%;
  height: auto;
}
.cei-ld-hotspot {
  position: absolute;
  left: var(--hx, 50%);
  top: var(--hy, 50%);
  transform: translate(-50%, -50%);
  z-index: 2;
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
}
.cei-ld-hotspot__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.85);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.55), 0 4px 12px rgba(15, 23, 42, 0.25);
  animation: cei-ld-pulse 1.6s ease-in-out infinite;
}
.cei-ld-hotspot.is-over .cei-ld-hotspot__dot,
.cei-ld-hotspot.is-over { filter: brightness(1.15); }
.cei-ld-hotspot.has-word { z-index: 3; }
.cei-ld-hotspot.is-ok .cei-ld-chip { background: #059669; }
.cei-ld-hotspot.is-wrong .cei-ld-chip { background: #dc2626; }
.cei-ld-pool {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f0f9ff, #ecfdf5);
  border: 1px dashed rgba(14, 165, 233, 0.35);
  position: sticky;
  top: 12px;
}
.cei-ld-pool__label {
  margin: 0 0 10px;
  font-weight: 700;
  color: #1e3a5f;
}
.cei-ld-pool__chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}
.cei-ld-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 800;
  cursor: grab;
  user-select: none;
  text-align: center;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.28);
  font-size: 0.92rem;
}
.cei-ld-chip.is-dragging { opacity: 0.5; }
.cei-ld-chip.is-placed {
  font-size: 0.78rem;
  padding: 6px 8px;
  border-radius: 10px;
  white-space: nowrap;
  max-width: 120px;
}
@keyframes cei-ld-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.cei-ld-editor__badge {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-weight: 700;
}
.cei-ld-map {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 10px 0;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(30, 58, 95, 0.16);
  background: #e2e8f0;
  touch-action: none;
  user-select: none;
}
.cei-ld-map__img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.cei-ld-pin {
  position: absolute;
  left: var(--px, 50%);
  top: var(--py, 50%);
  transform: translate(-50%, -50%);
  z-index: 3;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: grab;
  display: grid;
  justify-items: center;
  gap: 4px;
  font: inherit;
  color: inherit;
}
.cei-ld-pin.is-dragging {
  cursor: grabbing;
  z-index: 5;
}
.cei-ld-pin__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0ea5e9;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.55), 0 6px 14px rgba(15, 23, 42, 0.28);
}
.cei-ld-pin.is-dragging .cei-ld-pin__dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45), 0 8px 18px rgba(15, 23, 42, 0.35);
  transform: scale(1.15);
}
.cei-ld-pin__label {
  max-width: 110px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(30, 58, 95, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.cei-ld-editor__legend {
  margin: 0 0 10px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  color: #1e3a5f;
  font-weight: 600;
  font-size: 0.9rem;
}
.cei-ld-editor__legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0ea5e9;
  margin-right: 6px;
}
.cei-ld-editor__legend small {
  color: var(--cei-muted);
  font-weight: 500;
}
.cei-ld-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cei-ld-editor__preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin: 10px 0;
}
.cei-ld-editor__img {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  border: 1px solid rgba(30, 58, 95, 0.12);
}
.cei-ld-editor__labels {
  margin: 0;
  padding-left: 1.1rem;
  color: #1e3a5f;
  font-weight: 600;
}
@media (max-width: 720px) {
  .cei-ld-board { grid-template-columns: 1fr; }
  .cei-ld-pool__chips { flex-direction: row; flex-wrap: wrap; }
  .cei-ld-editor__preview { grid-template-columns: 1fr; }
  .cei-ld-map { max-width: 100%; }
}

.cei-dd-pair-row { grid-template-columns: 1fr; }
.cei-dd-pair-media {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.cei-dd-pair-preview-wrap {
  width: 100%;
  max-width: 220px;
  min-height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.1);
  display: grid;
  place-items: center;
}
.cei-dd-pair-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.cei-dd-rows { display: grid; gap: 12px; margin-bottom: 12px; }
.cei-dd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cei-dd-row select { min-width: 160px; }
.cei-open-answer { width: 100%; margin: 12px 0; min-height: 120px; resize: vertical; }
.cei-feedback { margin-top: 12px; font-weight: 600; }
.cei-feedback--ok { color: #15803d; }
.cei-feedback--warn { color: #b91c1c; }

.cei-activity-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.cei-activity-toolbar__type { min-width: 200px; flex: 1; }
.cei-activity-toolbar__hint { margin: 0 0 12px; }
#cei-add-bird-parts { white-space: nowrap; }
.cei-activities-list { display: grid; gap: 16px; margin-bottom: 12px; }
.cei-act-card {
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(248, 250, 252, 0.85);
  display: grid;
  gap: 10px;
}
.cei-act-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cei-act-card__actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.cei-preview-badge {
  background: rgba(14, 165, 233, 0.12) !important;
  color: #0369a1 !important;
}
.cei-preview-badge i { color: #0284c7 !important; }
.cei-act-card__body { display: grid; gap: 10px; }

.cei-activities-launcher {
  margin-top: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
  justify-items: start;
}
.cei-activities-launcher__title {
  margin: 0;
  font-weight: 700;
  color: #1e3a5f;
  font-size: 1.05rem;
}
.cei-activities-launcher__meta { display: flex; gap: 8px; flex-wrap: wrap; }
.cei-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: #0c4a6e;
  font-size: 0.9rem;
}
.cei-score-chip i { color: #f59e0b; }

body.cei-quiz-open { overflow: hidden; }
.cei-quiz-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}
.cei-quiz-modal.oculto { display: none !important; }
.cei-quiz-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.cei-quiz-modal__panel {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f0f9ff);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  padding: 18px 18px 14px;
  animation: ceiQuizIn 0.35s ease;
}
@keyframes ceiQuizIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.cei-quiz-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.cei-quiz-modal__eyebrow {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0284c7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cei-quiz-modal__head h3 {
  margin: 0;
  color: #1e3a5f;
  font-family: Outfit, Plus Jakarta Sans, sans-serif;
}
.cei-quiz-modal__score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}
.cei-quiz-modal__score i { color: #f59e0b; }
.cei-quiz-modal__progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.15);
  overflow: hidden;
  margin-bottom: 14px;
}
.cei-quiz-modal__progress span {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  border-radius: inherit;
  transition: width 0.35s ease;
}
.cei-quiz-modal__body { min-height: 180px; }
.cei-quiz-modal__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.cei-quiz-modal__toast {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  animation: ceiToastPop 0.35s ease;
}
.cei-quiz-toast--ok { background: #dcfce7; color: #166534; }
.cei-quiz-toast--bad { background: #fee2e2; color: #991b1b; }
@keyframes ceiToastPop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.cei-activity--shake { animation: ceiShake 0.45s ease; }
.cei-activity--success { animation: ceiSuccessPulse 0.55s ease; }
@keyframes ceiShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes ceiSuccessPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
}

.cei-fill-blank-block { margin: 12px 0; }
.cei-fill-blank-block__label {
  margin: 0 0 8px;
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}
.cei-fill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cei-fill-option.is-selected {
  border-color: var(--cei-primary);
  background: var(--cei-tint);
  color: #0c4a6e;
}

.cei-quiz-summary {
  text-align: center;
  padding: 24px 8px;
  position: relative;
}
.cei-quiz-summary__score {
  font-size: 1.35rem;
  color: #1e3a5f;
  margin: 12px 0;
}
.cei-quiz-summary__burst {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b 55%, transparent 70%);
  animation: ceiBurst 0.8s ease;
}
@keyframes ceiBurst {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cei-activities-reader { display: grid; gap: 28px; margin-top: 12px; }
.cei-activity-item-wrap {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(30, 58, 95, 0.1);
  background: rgba(255, 255, 255, 0.72);
}
.cei-activity-item-wrap__label {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e3a5f;
}

/* Sopa de letras */
.cei-ws-grid {
  display: grid;
  grid-template-columns: repeat(var(--ws-cols, 10), minmax(28px, 1fr));
  gap: 4px;
  max-width: 520px;
  margin: 12px 0;
  user-select: none;
}
.cei-ws-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(30, 58, 95, 0.18);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  color: #1e3a5f;
  cursor: pointer;
  padding: 0;
  font-size: clamp(0.7rem, 2.4vw, 0.95rem);
}
.cei-ws-cell.is-selecting { background: #bae6fd; border-color: var(--cei-primary); }
.cei-ws-cell.is-start {
  background: #38bdf8;
  border-color: #0284c7;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
  transform: scale(1.06);
}
.cei-ws-cell.is-miss {
  background: #fecaca;
  border-color: #ef4444;
  animation: ceiShake 0.35s ease;
}
.cei-ws-cell.is-found { background: #bbf7d0; border-color: #16a34a; color: #166534; }
.cei-ws-hint { margin: 0 0 10px; }
.cei-ws-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.cei-ws-words li {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  font-weight: 600;
  font-size: 0.88rem;
}
.cei-ws-words li.is-found {
  background: #dcfce7;
  color: #166534;
  text-decoration: line-through;
}

/* Crucigrama */
.cei-cw-grid {
  display: grid;
  grid-template-columns: repeat(var(--cw-cols, 8), minmax(28px, 36px));
  gap: 2px;
  margin: 12px 0;
  width: max-content;
  max-width: 100%;
}
.cei-cw-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid rgba(30, 58, 95, 0.25);
}
.cei-cw-cell--empty {
  background: transparent;
  border-color: transparent;
}
.cei-cw-num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #475569;
  line-height: 1;
  pointer-events: none;
}
.cei-cw-input {
  width: 100%;
  height: 100%;
  border: 0;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  background: transparent;
  color: #1e3a5f;
  font-size: 0.95rem;
  padding: 0;
}
.cei-cw-clues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0 16px;
}
.cei-cw-clues h4 { margin: 0 0 8px; color: #1e3a5f; }
.cei-cw-clue-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
@media (max-width: 700px) {
  .cei-cw-clues { grid-template-columns: 1fr; }
}

/* Ahorcado — muñeco animado infantil */
.cei-hm-lives {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 4px;
}
.cei-hm-heart {
  font-size: 1.35rem;
  line-height: 1;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}
.cei-hm-heart.is-on {
  color: #ef4444;
  animation: cei-hm-heartbeat 1.2s ease-in-out infinite;
}
.cei-hm-heart.is-off {
  color: #94a3b8;
  opacity: 0.35;
  transform: scale(0.85);
  filter: grayscale(1);
  animation: none;
}
.cei-hm-heart.is-break {
  animation: cei-hm-heart-break 0.55s ease-out both;
}
@keyframes cei-hm-heartbeat {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.18); }
  60% { transform: scale(0.96); }
}
@keyframes cei-hm-heart-break {
  0% { transform: scale(1) rotate(0); opacity: 1; }
  40% { transform: scale(1.4) rotate(-12deg); }
  100% { transform: scale(0.7) rotate(8deg); opacity: 0.35; filter: grayscale(1); }
}

.cei-hm-stage {
  display: flex;
  justify-content: center;
  margin: 6px 0 4px;
}

.cei-hm-figure {
  position: relative;
  width: 220px;
  height: 230px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
}

.cei-hm-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.65) 0 12px, transparent 13px),
    radial-gradient(circle at 82% 26%, rgba(255, 255, 255, 0.5) 0 8px, transparent 9px),
    linear-gradient(180deg, #7dd3fc 0%, #bae6fd 42%, #d1fae5 100%);
  z-index: 0;
}
.cei-hm-sky::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(16, 185, 129, 0.35));
}

.cei-hm-gallows {
  position: absolute;
  z-index: 1;
  left: 42px;
  top: 18px;
  width: 100px;
  height: 168px;
  border-left: 8px solid #1e3a5f;
  border-top: 8px solid #1e3a5f;
  border-radius: 4px 8px 0 0;
  box-shadow: 3px 0 0 rgba(30, 58, 95, 0.15);
}
.cei-hm-gallows::before {
  content: "";
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 22px;
  background: #1e3a5f;
  border-radius: 0 0 6px 6px;
}
.cei-hm-gallows::after {
  content: "";
  position: absolute;
  left: -22px;
  bottom: -2px;
  width: 52px;
  height: 10px;
  background: #1e3a5f;
  border-radius: 6px;
}
.cei-hm-base { display: none; }

.cei-hm-rope {
  position: absolute;
  z-index: 2;
  top: 40px;
  left: 138px;
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, #92400e, #b45309);
  border-radius: 2px;
  opacity: 0;
  transform-origin: top center;
}
.cei-hm-rope.is-visible {
  opacity: 1;
  height: 26px;
  animation: cei-hm-rope-drop 0.35s ease-out both, cei-hm-sway 2.4s ease-in-out 0.35s infinite;
}

.cei-hm-buddy {
  position: absolute;
  z-index: 3;
  top: 62px;
  left: 112px;
  width: 56px;
  height: 120px;
  opacity: 0;
  transform-origin: 28px -4px;
  pointer-events: none;
}
.cei-hm-buddy.is-visible {
  opacity: 1;
  animation: cei-hm-sway 2.4s ease-in-out infinite;
}

.cei-hm-head,
.cei-hm-body,
.cei-hm-arm-l,
.cei-hm-arm-r,
.cei-hm-leg-l,
.cei-hm-leg-r {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.2);
}
.cei-hm-head.is-visible,
.cei-hm-body.is-visible,
.cei-hm-arm-l.is-visible,
.cei-hm-arm-r.is-visible,
.cei-hm-leg-l.is-visible,
.cei-hm-leg-r.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.cei-hm-head {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  top: 0;
  left: 7px;
  background: radial-gradient(circle at 35% 30%, #fff7ed, #fdba74 55%, #fb923c 100%);
  border: 3px solid #ea580c;
  box-shadow: 0 4px 0 rgba(234, 88, 12, 0.25), inset 0 -4px 8px rgba(234, 88, 12, 0.12);
}
.cei-hm-head.is-pop { animation: cei-hm-pop-head 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

.cei-hm-eye {
  position: absolute;
  top: 14px;
  width: 7px;
  height: 9px;
  background: #1e3a5f;
  border-radius: 50%;
  animation: cei-hm-blink 3.2s ease-in-out infinite;
}
.cei-hm-eye--l { left: 10px; }
.cei-hm-eye--r { right: 10px; animation-delay: 0.15s; }
.cei-hm-eye::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
}

.cei-hm-cheek {
  position: absolute;
  top: 22px;
  width: 8px;
  height: 5px;
  background: rgba(244, 63, 94, 0.35);
  border-radius: 50%;
}
.cei-hm-cheek--l { left: 4px; }
.cei-hm-cheek--r { right: 4px; }

.cei-hm-mouth {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 14px;
  height: 8px;
  margin-left: -7px;
  border: 2px solid #c2410c;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: transparent;
  transition: transform 0.25s ease, border-radius 0.25s ease, height 0.25s ease;
}

.cei-hm-body {
  width: 22px;
  height: 36px;
  top: 40px;
  left: 17px;
  border-radius: 12px 12px 10px 10px;
  background: linear-gradient(180deg, #38bdf8, #0284c7);
  border: 2px solid #0369a1;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.cei-hm-body.is-pop { animation: cei-hm-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.cei-hm-body::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.cei-hm-arm-l,
.cei-hm-arm-r {
  width: 10px;
  height: 28px;
  top: 44px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fdba74, #f97316);
  border: 2px solid #ea580c;
  transform-origin: top center;
}
.cei-hm-arm-l {
  left: 4px;
  transform: rotate(18deg);
}
.cei-hm-arm-r {
  right: 4px;
  left: auto;
  transform: rotate(-18deg);
}
.cei-hm-arm-l.is-visible {
  animation: cei-hm-wave-l 1.1s ease-in-out infinite;
}
.cei-hm-arm-r.is-visible {
  animation: cei-hm-wave-r 1.1s ease-in-out 0.15s infinite;
}
.cei-hm-arm-l.is-pop { animation: cei-hm-pop-arm-l 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.cei-hm-arm-r.is-pop { animation: cei-hm-pop-arm-r 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

.cei-hm-leg-l,
.cei-hm-leg-r {
  width: 11px;
  height: 26px;
  top: 72px;
  border-radius: 8px;
  background: linear-gradient(180deg, #34d399, #059669);
  border: 2px solid #047857;
  transform-origin: top center;
}
.cei-hm-leg-l {
  left: 16px;
  transform: rotate(-8deg);
}
.cei-hm-leg-r {
  left: 29px;
  transform: rotate(8deg);
}
.cei-hm-leg-l.is-visible { animation: cei-hm-kick-l 1.4s ease-in-out infinite; }
.cei-hm-leg-r.is-visible { animation: cei-hm-kick-r 1.4s ease-in-out 0.2s infinite; }
.cei-hm-leg-l.is-pop { animation: cei-hm-pop-leg-l 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.cei-hm-leg-r.is-pop { animation: cei-hm-pop-leg-r 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* Expresiones según intentos fallidos */
.cei-hm-figure[data-wrong="1"] .cei-hm-mouth,
.cei-hm-figure[data-wrong="2"] .cei-hm-mouth {
  height: 10px;
  width: 16px;
  margin-left: -8px;
  border-radius: 0 0 14px 14px;
}
.cei-hm-figure[data-wrong="3"] .cei-hm-mouth,
.cei-hm-figure[data-wrong="4"] .cei-hm-mouth {
  height: 3px;
  border-radius: 4px;
  border: 0;
  background: #c2410c;
}
.cei-hm-figure[data-wrong="5"] .cei-hm-mouth,
.cei-hm-figure[data-wrong="6"] .cei-hm-mouth {
  height: 8px;
  width: 14px;
  margin-left: -7px;
  border: 2px solid #c2410c;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  bottom: 7px;
}
.cei-hm-figure[data-wrong="5"] .cei-hm-eye,
.cei-hm-figure[data-wrong="6"] .cei-hm-eye {
  height: 3px;
  border-radius: 3px;
  top: 16px;
  animation: none;
}
.cei-hm-figure[data-wrong="5"] .cei-hm-eye::after,
.cei-hm-figure[data-wrong="6"] .cei-hm-eye::after { display: none; }

.cei-hm-figure.is-cheer .cei-hm-buddy {
  animation: cei-hm-jump 0.7s ease-in-out 2;
}
.cei-hm-figure.is-cheer .cei-hm-mouth {
  height: 12px;
  width: 18px;
  margin-left: -9px;
  border-radius: 0 0 16px 16px;
  border-color: #c2410c;
  background: transparent;
  border-bottom: 2px solid #c2410c;
  border-top: 0;
}
.cei-hm-figure.is-oops .cei-hm-figure,
.cei-hm-figure.is-oops .cei-hm-buddy {
  animation: cei-hm-shake 0.45s ease-in-out;
}

.cei-hm-figure.is-won .cei-hm-buddy {
  animation: cei-hm-victory 0.9s ease-in-out infinite;
}
.cei-hm-figure.is-won .cei-hm-sparkles {
  opacity: 1;
}
.cei-hm-figure.is-won .cei-hm-mouth {
  height: 12px;
  width: 18px;
  margin-left: -9px;
  border-radius: 0 0 16px 16px;
}
.cei-hm-figure.is-won .cei-hm-arm-l.is-visible {
  animation: cei-hm-cheer-l 0.55s ease-in-out infinite;
}
.cei-hm-figure.is-won .cei-hm-arm-r.is-visible {
  animation: cei-hm-cheer-r 0.55s ease-in-out infinite;
}

.cei-hm-figure.is-lost .cei-hm-buddy {
  animation: cei-hm-droop 1.2s ease-in-out infinite;
}
.cei-hm-figure.is-lost .cei-hm-sky {
  filter: saturate(0.55) brightness(0.92);
}
.cei-hm-figure.is-lost .cei-hm-arm-l.is-visible,
.cei-hm-figure.is-lost .cei-hm-arm-r.is-visible,
.cei-hm-figure.is-lost .cei-hm-leg-l.is-visible,
.cei-hm-figure.is-lost .cei-hm-leg-r.is-visible {
  animation: none;
}
.cei-hm-figure.is-lost .cei-hm-arm-l { transform: rotate(35deg); }
.cei-hm-figure.is-lost .cei-hm-arm-r { transform: rotate(-35deg); }

.cei-hm-sparkles {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
}
.cei-hm-figure.is-cheer .cei-hm-sparkles,
.cei-hm-figure.is-won .cei-hm-sparkles {
  opacity: 1;
}
.cei-hm-sparkles i {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fbbf24;
  border-radius: 2px;
  animation: cei-hm-sparkle 1.1s ease-in-out infinite;
}
.cei-hm-sparkles i:nth-child(1) { top: 18%; left: 18%; animation-delay: 0s; }
.cei-hm-sparkles i:nth-child(2) { top: 12%; right: 22%; animation-delay: 0.15s; background: #f472b6; }
.cei-hm-sparkles i:nth-child(3) { top: 40%; left: 10%; animation-delay: 0.3s; background: #34d399; }
.cei-hm-sparkles i:nth-child(4) { top: 36%; right: 12%; animation-delay: 0.45s; background: #60a5fa; }
.cei-hm-sparkles i:nth-child(5) { bottom: 28%; left: 22%; animation-delay: 0.2s; background: #a78bfa; }
.cei-hm-sparkles i:nth-child(6) { bottom: 22%; right: 18%; animation-delay: 0.55s; }

@keyframes cei-hm-sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes cei-hm-rope-drop {
  from { height: 0; opacity: 0; }
  to { height: 26px; opacity: 1; }
}
@keyframes cei-hm-pop {
  0% { opacity: 0; transform: scale(0.1); }
  70% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes cei-hm-pop-head {
  0% { opacity: 0; transform: scale(0.1) translateY(-20px); }
  70% { opacity: 1; transform: scale(1.25) translateY(4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes cei-hm-pop-arm-l {
  0% { opacity: 0; transform: scale(0.2) rotate(-40deg); }
  100% { opacity: 1; transform: scale(1) rotate(18deg); }
}
@keyframes cei-hm-pop-arm-r {
  0% { opacity: 0; transform: scale(0.2) rotate(40deg); }
  100% { opacity: 1; transform: scale(1) rotate(-18deg); }
}
@keyframes cei-hm-pop-leg-l {
  0% { opacity: 0; transform: scale(0.2) rotate(20deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}
@keyframes cei-hm-pop-leg-r {
  0% { opacity: 0; transform: scale(0.2) rotate(-20deg); }
  100% { opacity: 1; transform: scale(1) rotate(8deg); }
}
@keyframes cei-hm-wave-l {
  0%, 100% { transform: rotate(12deg); }
  50% { transform: rotate(38deg); }
}
@keyframes cei-hm-wave-r {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(-38deg); }
}
@keyframes cei-hm-kick-l {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(-22deg); }
}
@keyframes cei-hm-kick-r {
  0%, 100% { transform: rotate(6deg); }
  50% { transform: rotate(22deg); }
}
@keyframes cei-hm-blink {
  0%, 46%, 50%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(0.1); }
}
@keyframes cei-hm-jump {
  0%, 100% { transform: rotate(0) translateY(0); }
  40% { transform: rotate(-2deg) translateY(-14px); }
  70% { transform: rotate(2deg) translateY(2px); }
}
@keyframes cei-hm-victory {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-10px); }
}
@keyframes cei-hm-cheer-l {
  0%, 100% { transform: rotate(-20deg); }
  50% { transform: rotate(-55deg); }
}
@keyframes cei-hm-cheer-r {
  0%, 100% { transform: rotate(20deg); }
  50% { transform: rotate(55deg); }
}
@keyframes cei-hm-shake {
  0%, 100% { transform: rotate(0) translateX(0); }
  25% { transform: rotate(-8deg) translateX(-4px); }
  75% { transform: rotate(8deg) translateX(4px); }
}
@keyframes cei-hm-droop {
  0%, 100% { transform: rotate(0) translateY(2px); }
  50% { transform: rotate(3deg) translateY(6px); }
}
@keyframes cei-hm-sparkle {
  0%, 100% { transform: scale(0.4) rotate(0deg); opacity: 0.3; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
}

.cei-hm-word {
  text-align: center;
  font-size: 1.7rem;
  letter-spacing: 0.28em;
  font-weight: 800;
  color: #1e3a5f;
  margin: 10px 0 4px;
  transition: transform 0.3s ease, color 0.3s ease;
}
.cei-hm-word.is-reveal {
  animation: cei-hm-word-pop 0.45s ease;
  color: #059669;
}
@keyframes cei-hm-word-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.cei-hm-attempts {
  text-align: center;
  margin: 0 0 4px;
}
.cei-hm-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 12px 0;
}
.cei-hm-key {
  min-width: 2.1rem;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}
.cei-hm-key:not(:disabled):hover {
  transform: translateY(-2px) scale(1.06);
}
.cei-hm-key:not(:disabled):active {
  transform: scale(0.94);
}
.cei-hm-key.is-used {
  opacity: 0.55;
}
.cei-hm-key.is-hit {
  background: #d1fae5 !important;
  color: #047857 !important;
  border-color: #34d399 !important;
  opacity: 1;
}
.cei-hm-key.is-miss {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #f87171 !important;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .cei-hm-heart.is-on,
  .cei-hm-rope.is-visible,
  .cei-hm-buddy.is-visible,
  .cei-hm-arm-l.is-visible,
  .cei-hm-arm-r.is-visible,
  .cei-hm-leg-l.is-visible,
  .cei-hm-leg-r.is-visible,
  .cei-hm-eye,
  .cei-hm-sparkles i,
  .cei-hm-figure.is-won .cei-hm-buddy,
  .cei-hm-figure.is-lost .cei-hm-buddy {
    animation: none !important;
  }
}

.cei-page-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }

.cei-page-list__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    align-items: stretch;
    border-radius: 14px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.cei-page-list__item.is-dragging { opacity: 0.55; }
.cei-page-list__item.is-drag-over .cei-page-list__link { border-color: var(--cei-accent); background: var(--cei-warm); }

.cei-page-list__drag {
    display: grid;
    place-items: center;
    width: 34px;
    border: none;
    border-radius: 12px;
    background: var(--cei-tint);
    color: var(--cei-primary-dark);
    cursor: grab;
    font-size: 0.95rem;
}
.cei-page-list__drag:active { cursor: grabbing; }

.cei-page-list__link {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid rgba(30, 58, 95, 0.1);
    background: #fff;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cei-page-list__item.is-active .cei-page-list__link {
    border-color: var(--cei-primary);
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.12);
}
.cei-page-list__link:hover { border-color: rgba(14, 165, 233, 0.45); }

.cei-page-list__delete {
    display: grid;
    place-items: center;
    width: 38px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 12px;
    background: #fff5f5;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.9rem;
}
.cei-page-list__delete:hover { background: #fee2e2; }

.cei-page-list__hint { margin: 8px 0 0; min-height: 1.2em; }
.cei-page-list__hint--error { color: var(--cei-err); }

.cei-page-list__num {
    width: 28px; height: 28px; border-radius: 999px; background: var(--cei-tint); color: var(--cei-primary-dark);
    display: grid; place-items: center; font-weight: 800; font-size: 0.85rem;
}
.cei-page-list__icon { color: var(--cei-primary); font-size: 1.1rem; }
.cei-page-list__text { display: grid; gap: 2px; }
.cei-page-list__text strong { font-size: 0.95rem; }
.cei-page-list__text small { color: var(--cei-muted); font-size: 0.78rem; }

.cei-editor__section-head { margin-bottom: 16px; }
.cei-editor__section-head h2 { margin: 0 0 6px; font-family: Outfit, Plus Jakarta Sans, sans-serif; display: flex; align-items: center; gap: 8px; }

.cei-field { display: grid; gap: 6px; margin-bottom: 14px; }
.cei-field > span { font-weight: 600; font-size: 0.9rem; }
.cei-field--inline { grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.cei-field input, .cei-field select, .cei-field textarea { width: 100%; padding: 10px 12px; border: 1px solid rgba(15, 23, 42, 0.12); border-radius: 10px; font: inherit; }
.cei-field textarea { min-height: 100px; resize: vertical; }

.cei-block-toolbar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 14px 0; margin-top: 8px; border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.cei-block-toolbar__label { width: 100%; margin: 0 0 4px; font-weight: 600; color: var(--cei-muted); font-size: 0.88rem; }

.cei-blocks-list { display: grid; gap: 14px; margin-bottom: 8px; }

.cei-block-card {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    background: #fafafa;
    overflow: hidden;
}
.cei-block-card__head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 10px 14px; background: linear-gradient(135deg, #e0f2fe, #f0f9ff); border-bottom: 1px solid rgba(14, 165, 233, 0.18);
    font-weight: 700;
    color: var(--cei-navy);
}
.cei-block-card__head span { display: inline-flex; align-items: center; gap: 8px; }
.cei-block-card__actions { display: flex; gap: 4px; }
.cei-block-card__body { padding: 14px; background: #fff; }

.cei-image-block { display: grid; gap: 10px; }
.cei-image-block__preview { min-height: 120px; border: 2px dashed rgba(15, 23, 42, 0.12); border-radius: 12px; display: grid; place-items: center; padding: 8px; background: #f8fafc; }
.cei-block-preview-img { max-width: 100%; max-height: 200px; border-radius: 8px; object-fit: contain; }

.cei-save-btn { margin-top: 12px; width: 100%; max-width: 320px; }

.cei-empty-state { text-align: center; padding: 48px 24px; color: var(--cei-muted); }
.cei-empty-state i { font-size: 2rem; color: var(--cei-primary); margin-bottom: 12px; display: block; }
.cei-empty-state--small { padding: 24px 12px; }

/* —— Portada —— */
.cei-cover {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: var(--cei-shadow);
    background: #0f172a;
}
.cei-cover--reader {
    overflow: visible; /* no recortar el título */
    background: transparent;
    box-shadow: none;
}
.cei-cover--reader .cei-cover__frame {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    line-height: normal;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--cei-shadow);
    background: #0f172a;
}
.cei-cover__bg {
    position: relative;
    z-index: 0;
    line-height: 0;
    font-size: 0;
}
.cei-cover__bg img {
    width: 100%;
    height: auto;
    max-height: min(calc(100vh - 168px), 920px);
    display: block;
    object-fit: contain;
    object-position: center center;
    font-size: 16px;
}

/* Título sobre portada: solo letras (sin recuadro verde) */
.cei-cover__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 28px 20px 22px;
    background: transparent;
    color: #fff;
    line-height: normal;
}
.cei-cover__title {
    margin: 0;
    color: #fff !important;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: clamp(1.45rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.85),
        0 4px 18px rgba(0, 0, 0, 0.55);
    letter-spacing: -0.02em;
}
.cei-cover__subtitle {
    margin: 10px 0 0;
    color: #fff !important;
    font-weight: 600;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.85),
        0 4px 14px rgba(0, 0, 0, 0.5);
}

/*
 * Capa de título/audio sobre la portada.
 * !important: .cei-reader__blocks--free { position:relative } viene después
 * y, sin esto, el stage colapsa (altura 0) y el título “desaparece” en Diseñar.
 */
.cei-cover__stage,
.cei-cover__stage.cei-reader__blocks,
.cei-cover__stage.cei-reader__blocks--free {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 50;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    pointer-events: none;
    overflow: visible;
    line-height: normal !important;
    font-size: 16px;
    display: block !important;
}
.cei-cover__stage .cei-block {
    pointer-events: auto;
    line-height: normal !important;
}
.cei-cover__stage .cei-block--free {
    position: absolute !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
/* Solo letras: sin recuadro verde */
.cei-cover__stage .cei-block--title,
.cei-cover__stage .cei-block--subtitle {
    min-width: 36%;
    padding: 2px 4px;
    border-radius: 4px;
    background: transparent !important;
    box-shadow: none !important;
}
.cei-cover__stage .cei-block-title,
.cei-cover__stage .cei-block-subtitle {
    color: #fff !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    display: block !important;
    opacity: 1 !important;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 4px 18px rgba(0, 0, 0, 0.55);
}
.cei-cover__stage .cei-block-title {
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-weight: 800;
    font-size: clamp(1.35rem, 3.5vw, 2.35rem);
    letter-spacing: -0.02em;
}
.cei-cover__stage .cei-block--sized .cei-block-title,
.cei-cover__stage .cei-block--sized .cei-block-subtitle {
    font-size: var(--bfs) !important;
}
.cei-cover__stage .cei-block--audio {
    width: auto !important;
    max-width: 3.25rem;
    min-width: 2.75rem;
}
.cei-page-design .cei-cover__stage .cei-block--audio {
    width: var(--bw, 12%) !important;
    max-width: none;
    min-width: 2.75rem;
}
.cei-cover__stage .cei-audio,
.cei-cover__stage .cei-audio--compact {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.cei-cover__stage .cei-patrocinadores--block,
.cei-cover__stage .cei-patrocinadores {
    margin: 0;
    padding: 10px 14px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(226, 232, 240, 0.95);
    line-height: normal;
}
.cei-cover__stage .cei-patrocinadores__title {
    margin: 0 0 8px;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    text-align: center;
    font-weight: 700;
}
.cei-cover__stage .cei-patrocinadores__logos {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-evenly;
    align-items: center;
    gap: 8px 12px;
}
.cei-cover__stage .cei-patrocinadores__logos img {
    height: 36px;
    max-width: 110px;
    width: auto;
    object-fit: contain;
    filter: none;
    opacity: 1;
}

/* En diseño: borde azul al seleccionar (sin relleno verde) */
.cei-page-design .cei-cover__stage .cei-block {
    cursor: move;
    touch-action: none;
}
.cei-page-design .cei-cover__stage .cei-block--title:hover,
.cei-page-design .cei-cover__stage .cei-block--subtitle:hover {
    outline: 1px dashed rgba(14, 165, 233, 0.55);
    background: rgba(14, 165, 233, 0.08) !important;
}
.cei-page-design .cei-cover__stage .cei-block.is-selected {
    outline: 2px solid #0ea5e9;
    background: rgba(14, 165, 233, 0.12) !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.cei-cover-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 8px; }
.cei-cover-picker__item {
    display: grid; gap: 6px; cursor: pointer; text-align: center;
    border: 2px solid rgba(15, 23, 42, 0.1); border-radius: 12px; padding: 8px; background: #fff;
    position: relative;
}
.cei-cover-picker__item:has(input:checked) { border-color: var(--cei-primary); background: var(--cei-tint); }
.cei-cover-picker__item input { position: absolute; opacity: 0; width: 0; height: 0; }
.cei-cover-picker__item { cursor: pointer; }
.cei-cover-picker__item img { width: 100%; aspect-ratio: 3/4; object-fit: contain; border-radius: 8px; background: #0f172a; }
.cei-cover-picker__item span { font-size: 0.78rem; color: var(--cei-muted); }

.cei-cover-preview { margin: 16px 0; overflow: hidden; }
.cei-cover-preview .cei-cover { max-width: min(360px, 100%); }
.cei-cover-preview .cei-cover__bg img { max-height: 480px; }

.cei-check--block { margin: 12px 0; }

/* —— Patrocinadores —— */
.cei-patrocinadores {
    padding: 16px 20px;
    background: rgba(255,255,255,0.92);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.cei-patrocinadores__title {
    margin: 0 0 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cei-muted);
    text-align: center;
}
.cei-patrocinadores__logos {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px 24px;
}
.cei-patrocinadores__logos img {
    height: 44px; width: auto; max-width: 120px; object-fit: contain;
    filter: grayscale(10%); opacity: 0.92;
}
.cei-patrocinadores--cover {
    position: relative; z-index: 2;
    background: rgba(255,255,255,0.96);
    border-top: none;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
    padding: 12px 16px 14px;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
}
.cei-patrocinadores--cover .cei-patrocinadores__title {
    margin: 0 0 8px;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    text-align: center;
    font-weight: 700;
}
.cei-patrocinadores--cover .cei-patrocinadores__logos {
    flex-wrap: nowrap;
    justify-content: space-evenly;
    gap: 10px 16px;
}
.cei-patrocinadores--cover .cei-patrocinadores__logos img {
    height: 40px;
    max-width: 118px;
    filter: none;
    opacity: 1;
}
.cei-patrocinadores--reader { max-width: 900px; margin: 0 auto; width: 100%; }
.cei-patrocinadores--top {
    border-top: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--cei-radius);
    margin-bottom: 4px;
}
.cei-patrocinadores--login { margin-top: 20px; background: transparent; border: none; padding: 0; }
.cei-patrocinadores--login .cei-patrocinadores__logos img { height: 32px; }
.cei-logo--pajareando {
    height: 52px !important;
    width: 52px !important;
    max-width: 52px !important;
    border-radius: 50%;
    object-fit: cover;
    filter: none;
    opacity: 1;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.18);
}
.cei-header__sponsor-chip .cei-logo--pajareando {
    height: 40px !important;
    width: 40px !important;
    max-width: 40px !important;
}
.cei-patrocinadores--cover .cei-patrocinadores__logos .cei-logo--pajareando,
.cei-patrocinadores--login .cei-patrocinadores__logos .cei-logo--pajareando {
    height: 44px !important;
    width: 44px !important;
    max-width: 44px !important;
}
.cei-login-program {
    display: grid;
    justify-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.16);
}
.cei-login-program__logo {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 28px rgba(30, 58, 95, 0.2);
}
.cei-login-program__name {
    margin: 4px 0 0;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--cei-navy);
    text-align: center;
}
.cei-login-program__tag {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cei-primary);
    text-align: center;
}
.cei-login-program__meta {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--cei-muted);
    text-align: center;
}

/* —— Modal multimedia —— */
.cei-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; }
.cei-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.cei-modal__panel { position: relative; z-index: 1; width: min(720px, 100%); max-height: 85vh; overflow: auto; }
.cei-media-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.cei-media-picker__item {
    display: grid; gap: 4px; padding: 8px; border: 2px solid rgba(15, 23, 42, 0.1); border-radius: 10px;
    background: #fff; cursor: pointer; text-align: center; font: inherit;
}
.cei-media-picker__item:hover { border-color: var(--cei-primary); }
.cei-media-picker__item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.cei-media-picker__item span { font-size: 0.7rem; color: var(--cei-muted); word-break: break-all; }
.cei-media-modal-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.cei-media-modal-url {
  display: grid;
  gap: 8px;
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px dashed rgba(30, 58, 95, 0.22);
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.06);
}
.cei-media-modal-url .cei-field { margin: 0; }
.cei-media-upload-status { font-size: 0.85rem; }
.cei-media-upload-status--error { color: #dc2626; }
.cei-media-upload-form { display: grid; gap: 12px; max-width: 32rem; }
.cei-media-filter-form { max-width: 24rem; }
.cei-media-picker-empty { grid-column: 1 / -1; }

/* —— Lector / bloques —— */
.cei-reader__page--cover {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}
.cei-reader__page--cover .cei-cover--reader {
    width: fit-content;
    max-width: 100%;
    max-height: 100%;
    flex: 0 1 auto;
    border-radius: 20px;
}
.cei-reader__page--cover .cei-cover__bg img {
    max-height: min(calc(100vh - 168px), 920px);
}

/* —— Estudio de especie (ficha) —— */
.cei-species {
    position: relative;
    margin: 0 auto;
    max-width: 920px;
    padding: 22px 22px 28px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(240, 249, 255, 0.95), rgba(236, 253, 245, 0.92)),
        radial-gradient(circle at 12% 8%, rgba(14, 165, 233, 0.16), transparent 42%),
        radial-gradient(circle at 88% 0%, rgba(16, 185, 129, 0.14), transparent 40%);
    border: 1px solid rgba(30, 58, 95, 0.12);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}
.cei-species__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    color: #0369a1;
    font-weight: 800;
    font-size: 0.82rem;
}
.cei-species__header { margin-bottom: 16px; }
.cei-species__common {
    margin: 0;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
    color: #1e3a5f;
}
.cei-species__scientific {
    margin: 6px 0 0;
    font-style: italic;
    font-weight: 600;
    color: #334155;
    opacity: 0.9;
}
.cei-species__photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 18px;
}
.cei-species__photo {
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #e2e8f0;
    border: 1px solid rgba(30, 58, 95, 0.1);
}
.cei-species__photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.cei-species__photo video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #0f172a;
}
.cei-species__photo figcaption {
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e3a5f;
    background: rgba(255, 255, 255, 0.72);
}
.cei-species__photos-empty { margin: 0 0 16px; }
.cei-species__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}
.cei-species__meta-item {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 58, 95, 0.08);
}
.cei-species__meta-item dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 800;
}
.cei-species__meta-item dd {
    margin: 4px 0 0;
    color: #1e3a5f;
    font-weight: 700;
}
.cei-species__section { margin: 0 0 16px; }
.cei-species__section-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cei-species__chars {
    margin: 0;
    padding-left: 1.15rem;
    color: #1e3a5f;
    font-weight: 600;
    line-height: 1.55;
}
.cei-species__info {
    color: #334155;
    line-height: 1.65;
}
.cei-species__info p { margin: 0; }
.cei-species__fun {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
    font-weight: 600;
    line-height: 1.45;
}
.cei-species__audio {
    width: 100%;
    margin-top: 4px;
}
.cei-reader__page--species {
    padding-top: 12px;
}

/* Editor de especie */
.cei-species-editor { display: grid; gap: 14px; margin-bottom: 18px; }
.cei-species-editor__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.cei-species-editor__grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cei-species-editor__photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.cei-species-editor__photo-field,
.cei-species-editor__audio {
    display: grid;
    gap: 8px;
}
.cei-field__label {
    display: block;
    font-weight: 700;
    color: #1e3a5f;
    font-size: 0.9rem;
}
.cei-species-editor__preview {
    min-height: 150px;
    border-radius: 14px;
    border: 1px dashed rgba(30, 58, 95, 0.22);
    background: #f8fafc;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 8px;
}
.cei-species-editor__preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
}
.cei-species-editor__preview video {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 10px;
    background: #0f172a;
}
.cei-species-editor__photo-actions,
.cei-species-editor__audio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.cei-species-editor__media-link {
    margin: 0;
    width: 100%;
}
.cei-species-editor__media-link input[type="url"] {
    font-size: 0.9rem;
}
.cei-species-editor__audio-player { max-width: 100%; flex: 1; min-width: 180px; }
.cei-species-preview { margin-top: 8px; }
.cei-species-preview .cei-species { box-shadow: none; }

@media (max-width: 820px) {
    .cei-species__photos,
    .cei-species-editor__photos,
    .cei-species-editor__grid,
    .cei-species-editor__grid--3 {
        grid-template-columns: 1fr;
    }
}

.cei-reader__page-title {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100% - 88px));
    margin: 0 auto 22px;
    padding-bottom: 14px;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: clamp(1.75rem, 4vw, 3rem);
    color: var(--cei-navy);
    text-align: center;
}
.cei-reader__page-title::after {
    content: "";
    display: block;
    width: 120px;
    height: 4px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9, #10b981);
}
.cei-block-title { font-family: Outfit, Plus Jakarta Sans, sans-serif; font-size: clamp(1.75rem, 3vw, 2.5rem); margin: 0 0 12px; color: var(--cei-navy); }
.cei-block-title--center { text-align: center; }
.cei-block-title--right { text-align: right; }
.cei-block-subtitle { color: #1e3a5f; margin: 0 0 16px; font-size: clamp(1.2rem, 2.2vw, 1.65rem); }
.cei-block-subtitle--center { text-align: center; }
.cei-block-subtitle--right { text-align: right; }
.cei-prose {
    font-size: clamp(1.02rem, 1.3vw, 1.22rem);
    line-height: 1.8;
    color: #102033;
}
.cei-prose p { margin: 0 0 1rem; }
.cei-quote {
    margin: 8px 0;
    padding: 22px 24px;
    border-left: 6px solid #10b981;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(236,253,245,0.95), rgba(240,249,255,0.95));
    box-shadow: 0 12px 30px rgba(15, 118, 110, 0.08);
}
.cei-quote p { margin: 0; font-size: 1.15rem; font-weight: 700; color: #1e3a5f; }
.cei-quote cite { display: block; margin-top: 10px; color: var(--cei-muted); font-style: normal; }
.cei-figure {
    margin: 16px auto;
    padding: 12px;
    max-width: min(760px, 100%);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
}
.cei-figure img { width: 100%; max-height: 54vh; object-fit: contain; border-radius: 14px; display: block; }
.cei-figure figcaption { margin-top: 8px; color: var(--cei-muted); font-size: 0.9rem; text-align: center; }

.cei-audio {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.18);
}
.cei-audio__title { margin: 0 0 10px; font-weight: 700; color: #1e3a5f; }
.cei-audio__player { width: 100%; }
.cei-audio__caption { margin: 10px 0 0; color: var(--cei-muted); font-size: 0.9rem; }

/* Reproductor compacto: solo botón play */
.cei-audio--compact {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  width: fit-content;
  max-width: 100%;
  position: relative;
}
.cei-audio--compact .cei-audio__player {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}
.cei-audio__btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, #0ea5e9, #0284c7);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cei-audio__btn:hover,
.cei-audio__btn:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.5);
  outline: none;
}
.cei-audio__btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 8px 20px rgba(2, 132, 199, 0.5);
}
.cei-audio__btn i {
  font-size: 0.95rem;
  margin-left: 2px; /* play ópticamente centrado */
  line-height: 1;
}
.cei-audio__btn.is-playing {
  background: linear-gradient(145deg, #10b981, #059669);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}
.cei-audio__btn.is-playing i {
  margin-left: 0;
}
.cei-cover__stage .cei-audio__btn {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}
.cei-cover__stage .cei-audio__btn:hover,
.cei-cover__stage .cei-audio__btn:focus-visible {
  background: rgba(14, 165, 233, 0.92);
}
.cei-cover__stage .cei-audio__btn.is-playing {
  background: rgba(16, 185, 129, 0.92);
}
.cei-block--free .cei-audio--compact {
  margin: 0;
}

.cei-youtube { margin: 1.25rem 0; }
.cei-youtube__title { margin: 0 0 10px; font-weight: 700; color: #1e3a5f; }
.cei-youtube__list { display: grid; gap: 18px; }
.cei-youtube__item-title { margin: 0 0 8px; font-weight: 600; color: #334155; }
.cei-youtube__embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.cei-youtube__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cei-block--free .cei-youtube,
.cei-block--free .cei-video-page,
.cei-block--free .cei-webpage {
  margin: 0;
  width: 100%;
}
.cei-block--free .cei-youtube__list,
.cei-block--free .cei-webpage__list {
  gap: 12px;
}
.cei-block--free .cei-video-page__player,
.cei-block--free .cei-video-page__embed {
  max-width: none;
  width: 100%;
}
.cei-block--free .cei-video-page__player video {
  width: 100%;
  height: auto;
  display: block;
}
.cei-page-design .cei-block--youtube iframe,
.cei-page-design .cei-block--video iframe,
.cei-page-design .cei-block--video video,
.cei-page-design .cei-block--webpage iframe {
  pointer-events: none;
}
.cei-page-design .cei-block--youtube,
.cei-page-design .cei-block--video,
.cei-page-design .cei-block--webpage {
  min-width: 120px;
}
.cei-youtube__embed--preview { margin-top: 10px; }
.cei-youtube__caption { margin: 10px 0 0; color: var(--cei-muted); font-size: 0.9rem; text-align: center; }

.cei-video-page {
  margin: 0.5rem 0 1.5rem;
  padding: 1.1rem 1.15rem 1.25rem;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.08), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(30, 58, 95, 0.1);
}
.cei-video-page__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  color: #0c4a6e;
  font-size: 0.82rem;
  font-weight: 700;
}
.cei-video-page__title {
  margin: 0 0 8px;
  color: #1e3a5f;
  font-size: 1.45rem;
  line-height: 1.25;
}
.cei-video-page__desc {
  margin: 0 0 14px;
  color: #475569;
  line-height: 1.5;
}
.cei-video-page__player,
.cei-video-page__embed {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}
.cei-video-page__player video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #0f172a;
}
.cei-video-page__embed {
  padding-bottom: 56.25%;
  height: 0;
}
.cei-video-page__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cei-video-page__caption {
  margin: 12px 0 0;
  color: var(--cei-muted);
  font-size: 0.92rem;
  text-align: center;
}
.cei-video-page__empty { margin: 0.5rem 0; }

.cei-video-editor { display: grid; gap: 1rem; }
.cei-video-editor__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .cei-video-editor__grid { grid-template-columns: 1fr; }
}
.cei-video-editor__source,
.cei-video-editor__live { display: grid; gap: 0.65rem; }
.cei-video-editor__preview,
.cei-video-editor__poster {
  min-height: 140px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(30, 58, 95, 0.22);
  background: #fff;
}
.cei-video-editor__preview video,
.cei-video-editor__poster img {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 10px;
  object-fit: contain;
  background: #0f172a;
}
.cei-video-editor__poster img { background: #f1f5f9; object-fit: cover; }
.cei-video-editor__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cei-media-picker__item--video .cei-media-picker__icon { color: #0ea5e9; }

.cei-block-preview-audio { width: 100%; margin-top: 6px; }
.cei-audio-block__preview,
.cei-youtube-block__preview { margin: 12px 0; }
.cei-youtube-videos-list { display: grid; gap: 12px; margin-bottom: 10px; }
.cei-youtube-video-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
}

.cei-webpage { margin: 1.25rem 0; }
.cei-webpage__title { margin: 0 0 10px; font-weight: 700; color: #1e3a5f; }
.cei-webpage__list { display: grid; gap: 20px; }
.cei-webpage__item-title { margin: 0 0 8px; font-weight: 600; color: #334155; }
.cei-webpage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.cei-webpage__host {
  font-size: 0.82rem;
  color: var(--cei-muted);
  word-break: break-all;
}
.cei-webpage__frame {
  position: relative;
  width: 100%;
  min-height: min(58vh, 520px);
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid rgba(30, 58, 95, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.cei-webpage__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.cei-webpage__frame--preview { min-height: 280px; }
.cei-webpage__note { margin: 8px 0 0; font-size: 0.82rem; }
.cei-webpage__caption { margin: 10px 0 0; color: var(--cei-muted); font-size: 0.9rem; text-align: center; }
.cei-webpage-block__preview { margin: 12px 0; }
.cei-webpage-links-list { display: grid; gap: 12px; margin-bottom: 10px; }
.cei-webpage-link-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
}
.cei-media-picker__item--audio {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}
.cei-media-picker__icon {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--cei-primary-dark);
  font-size: 1.5rem;
}

.cei-editor__section-head--nested {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.cei-editor__section-head--nested h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #1e3a5f;
}
.cei-reader__blocks {
    position: relative;
    z-index: 1;
    display: grid;
    gap: clamp(16px, 2vw, 24px);
    width: min(920px, calc(100% - 88px));
    margin: 0 auto;
}
.cei-reader__blocks > * { min-width: 0; }
.cei-reader__blocks--free {
    position: relative;
    display: block;
    min-height: min(70vh, 720px);
    width: 100%;
    max-width: none;
    margin: 0;
}
.cei-block {
    position: relative;
    min-width: 0;
}
.cei-block--free {
    position: absolute;
    left: var(--bx, 0%);
    top: var(--by, 0%);
    width: var(--bw, 40%);
    z-index: var(--bz, 1);
    margin: 0;
}
.cei-block--free .cei-figure img {
    max-height: none;
    width: 100%;
    height: auto;
}
.cei-block--sized .cei-block-title,
.cei-block--sized .cei-block-subtitle,
.cei-block--sized .cei-prose,
.cei-block--sized .cei-prose p,
.cei-block--sized .cei-quote,
.cei-block--sized .cei-quote p {
    font-size: var(--bfs);
}
.cei-align-left { text-align: left; }
.cei-align-center { text-align: center; }
.cei-align-right { text-align: right; }
.cei-align-justify { text-align: justify; }
.cei-prose--left { text-align: left; }
.cei-prose--center { text-align: center; }
.cei-prose--right { text-align: right; }
.cei-prose--justify { text-align: justify; }
.cei-block-title--justify,
.cei-block-subtitle--justify { text-align: justify; }
.cei-block__handle {
    display: none;
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: #fff;
    border: 2px solid #0ea5e9;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
    z-index: 6;
    pointer-events: auto;
}
.cei-block__handle--nw { left: -6px; top: -6px; cursor: nwse-resize; }
.cei-block__handle--ne { right: -6px; top: -6px; cursor: nesw-resize; }
.cei-block__handle--sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.cei-block__handle--se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.cei-page-design .cei-block {
    outline: 1px dashed transparent;
    cursor: move;
    touch-action: none;
}
.cei-page-design .cei-block:hover {
    outline-color: rgba(14, 165, 233, 0.45);
}
.cei-page-design .cei-block.is-selected {
    outline: 2px solid #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
}
.cei-page-design .cei-block.is-selected .cei-block__handle,
.cei-page-design .cei-block:hover .cei-block__handle {
    display: block;
}
.cei-page-design .cei-reader__blocks:not(.cei-cover__stage) {
    min-height: min(75vh, 820px);
}

/* Líneas guía (centrado / tercios) en Diseñar contenido */
.cei-page-design .cei-reader__blocks--free,
.cei-page-design .cei-cover__stage {
    --cei-guide-color: rgba(14, 165, 233, 0.42);
    --cei-guide-center: rgba(236, 72, 153, 0.55);
}
.cei-design-guides {
    position: absolute;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    overflow: hidden;
}
.cei-page-design.cei-guides-off .cei-design-guides {
    display: none;
}
.cei-design-guides__line {
    position: absolute;
    background: var(--cei-guide-color);
    opacity: 0.85;
    transition: background 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}
.cei-design-guides__line--v {
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
}
.cei-design-guides__line--h {
    left: 0;
    right: 0;
    height: 1px;
    transform: translateY(-50%);
}
.cei-design-guides__line--center {
    background: var(--cei-guide-center);
    opacity: 0.9;
}
.cei-design-guides__line--v.cei-design-guides__line--center {
    width: 1.5px;
}
.cei-design-guides__line--h.cei-design-guides__line--center {
    height: 1.5px;
}
.cei-design-guides__line.is-active {
    background: #f43f5e;
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.35), 0 0 10px rgba(244, 63, 94, 0.45);
}
#cei-design-guides-toggle.is-active {
    border-color: rgba(14, 165, 233, 0.55);
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.cei-design-toolbar {
    position: fixed;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    max-width: calc(100vw - 24px);
}
.cei-design-toolbar__font {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cei-design-toolbar__font-label select {
    min-width: 5.5rem;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    font-size: 0.85rem;
    font-weight: 600;
    background: #fff;
    color: #1e3a5f;
}
.cei-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.cei-design-toolbar__status {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cei-muted);
    min-width: 7rem;
}
.cei-design-toolbar__status.is-dirty { color: #b45309; }
.cei-design-toolbar__status.is-ok { color: #047857; }
.cei-design-toolbar__sep {
    width: 1px;
    height: 24px;
    background: rgba(15, 23, 42, 0.12);
}
.cei-page-design .cei-reader__nav { padding-bottom: 72px; }
.cei-reader__design-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0c4a6e;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.35);
}
.cei-reader__page-title--design small {
    font-weight: 600;
    color: var(--cei-muted, #64748b);
}
#cei-activity,
.cei-activity-item {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 auto;
}
#cei-activity h3,
.cei-activity-item h3 {
    margin-top: 0;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: clamp(1.35rem, 2.8vw, 2rem);
    color: #1e3a5f;
}
.activity-option {
    font-size: 1rem;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.activity-option:hover { transform: translateY(-1px); }

@media (max-width: 720px) {
    .cei-reader__viewport {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        padding: 4px 6px;
    }
    .cei-reader__side-btn { display: none; }
    .cei-reader__page { padding: 0; }
    .cei-reader__blocks,
    .cei-reader__page-title,
    #cei-activity,
    .cei-activity-item { width: 100%; }
    .cei-reader__nav {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 6px;
        padding: 4px 8px;
    }
    .cei-reader__nav-start,
    .cei-reader__nav-end { justify-content: center; }
    .cei-reader__jump-select { width: min(160px, 38vw); }
    .cei-reader__fs-label { display: none; }
    .cei-reader__meta strong {
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.cei-card__cover { border-radius: 12px 12px 0 0; overflow: hidden; aspect-ratio: 3/4; }
.cei-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cei-card__tag { color: var(--cei-muted); margin: 0; font-size: 0.92rem; }

/* ---------- Índice automático estilo libro ---------- */
.cei-toc {
    width: min(680px, 100%);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.cei-toc--book .cei-toc__head {
    text-align: center;
    margin-bottom: clamp(22px, 3.5vw, 36px);
}
.cei-toc__book-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(145deg, #0ea5e9, #10b981);
    box-shadow: 0 12px 28px rgba(14, 165, 233, 0.28);
}
.cei-toc__title {
    margin: 0 0 10px;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: #1e3a5f;
    line-height: 1.1;
    font-weight: 800;
}
.cei-toc__rule {
    width: 88px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9, #10b981);
}
.cei-toc__adventure {
    margin: 0;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: 700;
    color: #1e3a5f;
}
.cei-toc__adventure i { color: #0ea5e9; margin-right: 6px; }
.cei-toc__empty { margin: 24px 0 0; text-align: center; }
.cei-toc__list {
    list-style: none;
    margin: 0;
    padding: 8px 4px 0;
    display: grid;
    gap: 6px;
}
.cei-toc__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 10px 12px;
    padding: 10px 8px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.18s ease, transform 0.18s ease;
}
a.cei-toc__row:hover {
    background: rgba(14, 165, 233, 0.08);
    transform: translateX(2px);
}
.cei-toc__row--static { cursor: default; }
.cei-toc__item.is-current .cei-toc__row {
    background: rgba(16, 185, 129, 0.1);
}
.cei-toc__ico {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #0d9488;
    background: rgba(16, 185, 129, 0.12);
    font-size: 0.92rem;
    flex-shrink: 0;
    margin-bottom: 2px;
}
.cei-toc__line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    width: 100%;
}
.cei-toc__name {
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-size: clamp(1.05rem, 2.2vw, 1.22rem);
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
    max-width: 72%;
}
.cei-toc__leaders {
    flex: 1 1 auto;
    min-width: 18px;
    border-bottom: 2px dotted rgba(30, 58, 95, 0.35);
    transform: translateY(-4px);
}
.cei-toc__page {
    flex: 0 0 auto;
    font-family: Outfit, Plus Jakarta Sans, sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: #0d9488;
    min-width: 1.4rem;
    text-align: right;
}
.cei-toc-editor-preview {
    margin-top: 16px;
    padding: clamp(16px, 2.5vw, 28px);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(240,253,250,0.9));
}
.cei-toc--compact .cei-toc__book-badge { width: 48px; height: 48px; font-size: 1.2rem; }
.cei-toc--compact .cei-toc__title { font-size: 1.35rem; }
.cei-toc--compact .cei-toc__name { max-width: 58%; font-size: 0.98rem; }

.cei-toc-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;
}
.cei-toc-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
}
.cei-toc-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(420px, 100%);
    height: 100%;
    background: linear-gradient(180deg, #ffffff, #f0fdfa);
    box-shadow: -18px 0 48px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cei-toc-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.cei-toc-drawer__head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #1e3a5f;
}
.cei-toc-drawer__body {
    flex: 1;
    overflow: auto;
    padding: 16px 18px 28px;
}
.cei-toc-drawer .cei-toc { width: 100%; }

/* ---------- Plantillas de hoja (interiores) ---------- */
.cei-sheet-picker-field { margin: 14px 0 18px; }
.cei-sheet__deco {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}
.cei-sheet__deco img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0.42;
    display: block;
}
.cei-reader__sheet.cei-sheet--paramo {
    background:
        linear-gradient(90deg, rgba(13, 148, 136, 0.97) 0 58px, transparent 58px),
        linear-gradient(145deg, rgba(255,255,255,0.92), rgba(224, 242, 254, 0.88));
}
.cei-reader__sheet.cei-sheet--nubes {
    background:
        radial-gradient(circle at 12% 10%, rgba(56, 189, 248, 0.35), transparent 28%),
        radial-gradient(circle at 88% 16%, rgba(125, 211, 252, 0.4), transparent 30%),
        linear-gradient(160deg, #e0f2fe, #f0f9ff 45%, #ffffff);
    border-color: rgba(14, 165, 233, 0.25);
}
.cei-reader__sheet.cei-sheet--flora {
    background:
        linear-gradient(90deg, rgba(5, 150, 105, 0.95) 0 54px, transparent 54px),
        linear-gradient(150deg, #d1fae5, #ecfdf5 40%, #ffffff);
    border-color: rgba(16, 185, 129, 0.28);
}
.cei-reader__sheet.cei-sheet--aves {
    background:
        linear-gradient(180deg, rgba(14, 165, 233, 0.28) 0 70px, transparent 70px),
        linear-gradient(145deg, #fff7ed, #ffffff 48%, #e0f2fe);
    border-color: rgba(251, 146, 60, 0.28);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12), inset 0 0 0 10px rgba(255, 247, 237, 0.55);
}
.cei-reader__sheet.cei-sheet--aventura {
    background:
        radial-gradient(circle at 92% 8%, rgba(251, 191, 36, 0.45), transparent 26%),
        radial-gradient(circle at 8% 92%, rgba(56, 189, 248, 0.35), transparent 28%),
        linear-gradient(160deg, #dbeafe, #eff6ff 40%, #ffffff);
    border-color: rgba(59, 130, 246, 0.3);
}
.cei-reader__sheet.cei-sheet--agua {
    background:
        linear-gradient(180deg, rgba(2, 132, 199, 0.28), transparent 26%),
        linear-gradient(160deg, #bae6fd, #e0f2fe 40%, #f0fdfa);
    border-color: rgba(14, 165, 233, 0.32);
}
.cei-reader__sheet.cei-sheet--cuaderno {
    background:
        repeating-linear-gradient(
            transparent,
            transparent 26px,
            rgba(14, 165, 233, 0.14) 27px
        ),
        linear-gradient(90deg, rgba(248, 113, 113, 0.35) 0 4px, transparent 4px),
        linear-gradient(180deg, #fffbeb, #ffffff);
    border-color: rgba(148, 163, 184, 0.35);
}
.cei-reader__sheet.cei-sheet--cuaderno .cei-sheet__deco img { opacity: 0.22; }
.cei-reader__sheet.cei-sheet--indice {
    background:
        linear-gradient(90deg, rgba(13, 148, 136, 0.97) 0 54px, transparent 54px),
        linear-gradient(165deg, #ccfbf1, #ecfeff 40%, #ffffff);
    border-color: rgba(13, 148, 136, 0.28);
}
.cei-reader__sheet.cei-sheet--kjic-ucumari {
    background:
        linear-gradient(180deg, transparent 78%, rgba(30, 58, 95, 0.08) 100%),
        linear-gradient(90deg, rgba(14, 165, 233, 0.92) 0 52px, transparent 52px),
        linear-gradient(155deg, #e0f2fe, #f0fdfa 42%, #ffffff);
    border-color: rgba(30, 58, 95, 0.22);
}
.cei-reader__sheet.cei-sheet--kjic-ucumari .cei-sheet__deco img {
    opacity: 0.55;
    object-position: center bottom;
}
.cei-reader__page--index .cei-reader__sheet {
    padding-top: clamp(28px, 4vw, 48px);
}
.cei-toc__empty {
    margin: 28px auto 0;
    max-width: 420px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px dashed rgba(14, 165, 233, 0.35);
    color: #1e3a5f;
    font-weight: 600;
}

@media (max-width: 720px) {
    .cei-toc__name { max-width: 62%; }
    .cei-reader__sheet {
        padding: 18px 14px;
    }
    .cei-reader__sheet.cei-sheet--paramo,
    .cei-reader__sheet.cei-sheet--flora,
    .cei-reader__sheet.cei-sheet--indice,
    .cei-reader__sheet.cei-sheet--kjic-ucumari {
        background:
            linear-gradient(180deg, rgba(13, 148, 136, 0.95) 0 14px, transparent 14px),
            linear-gradient(145deg, rgba(255,255,255,0.95), rgba(236,253,245,0.92));
    }
    .cei-sheet__deco img { opacity: 0.3; }
    .cei-reader__jump-select { width: min(160px, 42vw); max-width: 200px; }

    /*
     * Layout libre (diseñado en escritorio): en móvil se apila en flujo normal
     * para que no queden huecos ni solapes. En modos diseño se mantiene libre.
     * La portada conserva el layout libre sobre la imagen completa.
     */
    body:not(.cei-page-design):not(.cei-page-sheet-design) .cei-reader__blocks--free:not(.cei-cover__stage) {
        display: grid;
        gap: 1rem;
        min-height: 0;
        width: 100%;
        max-width: none;
        margin: 0;
    }
    body:not(.cei-page-design):not(.cei-page-sheet-design) .cei-reader__blocks--free:not(.cei-cover__stage) .cei-block--free {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100%;
        z-index: auto !important;
        margin: 0;
    }
    body:not(.cei-page-design):not(.cei-page-sheet-design) .cei-reader__blocks--free:not(.cei-cover__stage) .cei-block--free .cei-figure img {
        max-height: min(52vh, 360px);
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    body:not(.cei-page-sheet-design) .cei-reader__sheet.has-content-frame {
        padding: 16px 12px 20px !important;
    }
    body:not(.cei-page-design) .cei-block--sized .cei-block-title,
    body:not(.cei-page-design) .cei-block--sized .cei-block-subtitle {
        font-size: clamp(1.15rem, 5.5vw, var(--bfs, 1.6rem)) !important;
    }
    body:not(.cei-page-design) .cei-block--sized .cei-prose,
    body:not(.cei-page-design) .cei-block--sized .cei-prose p,
    body:not(.cei-page-design) .cei-block--sized .cei-quote,
    body:not(.cei-page-design) .cei-block--sized .cei-quote p {
        font-size: clamp(0.95rem, 4.2vw, var(--bfs, 1.05rem)) !important;
    }
    body:not(.cei-page-design) .cei-reader__blocks {
        width: 100%;
    }
}
