.chronos-shell {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    background: radial-gradient(circle at 38% 58%, #ffd24d 0%, var(--chronos-secondary) 45%, #c85a00 100%);
    color: #111827;
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
    position: relative;
}

.chronos-shell * {
    box-sizing: border-box;
}

.chronos-sidebar {
    width: 298px;
    max-width: 100%;
    min-width: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 28px 20px 24px;
    gap: 20px;
    background: linear-gradient(180deg, rgba(255,248,207,0.72) 0%, rgba(255,248,207,0.32) 100%);
    border-right: 4px solid var(--chronos-primary);
    backdrop-filter: blur(8px);
    z-index: 3;
}

.chronos-brand-kicker,
.chronos-brand-title {
    display: block;
    font-family: 'Fredoka', cursive;
    line-height: 1;
}

.chronos-brand-kicker {
    font-size: 2rem;
}

.chronos-brand-title {
    font-size: 3.2rem;
    color: #d62828;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.16);
}

.chronos-brand-subtitle {
    margin: 12px 0 0;
    padding: 10px 12px;
    border: 3px solid var(--chronos-primary);
    background: rgba(255, 255, 255, 0.86);
    font-weight: 800;
    line-height: 1.4;
}

.chronos-location-list {
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.chronos-location-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 3px solid var(--chronos-primary);
    background: linear-gradient(180deg, #fff54b 0%, #ffcc00 100%);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.16);
    cursor: pointer;
    font-weight: 900;
    text-align: left;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.chronos-location-btn:hover,
.chronos-location-btn.is-active {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.18);
}

.chronos-location-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: #111827;
    flex-shrink: 0;
}

.chronos-location-btn.is-active .chronos-location-dot {
    background: #d62828;
}

.chronos-location-copy {
    min-width: 0;
}

.chronos-location-copy strong,
.chronos-location-copy span {
    display: block;
}

.chronos-location-copy strong {
    font-size: 1rem;
    line-height: 1.2;
}

.chronos-location-copy span {
    margin-top: 4px;
    font-size: .76rem;
    color: #334155;
    text-transform: uppercase;
}

.chronos-sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chronos-active-chip {
    padding: 12px 14px;
    border: 3px solid var(--chronos-primary);
    background: rgba(255, 255, 255, 0.88);
}

.chronos-active-chip span,
.chronos-active-chip strong {
    display: block;
}

.chronos-active-chip span {
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
}

.chronos-active-chip strong {
    margin-top: 4px;
    font-size: .96rem;
}

.chronos-exit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 3px solid var(--chronos-primary);
    background: #fff8cf;
    color: #0f172a;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.14);
}

.chronos-main {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    z-index: 2;
}

.chronos-topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: linear-gradient(180deg, #00c800 0%, #009900 100%);
    border-bottom: 4px solid #006e00;
    color: #fff;
    position: relative;
    z-index: 5;
}

.chronos-topbar-left,
.chronos-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chronos-era-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.18);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .78rem;
}

.chronos-era-pill strong {
    color: #fff54b;
}

.chronos-topbar-btn,
.chronos-icon-btn,
.chronos-fullscreen-btn,
.chronos-immersive-btn,
.chronos-nav-btn,
.chronos-floating-btn,
.chronos-restore-info,
.chronos-dossier-close {
    border: 3px solid var(--chronos-primary);
    background: linear-gradient(180deg, #fff54b 0%, #ffcc00 100%);
    color: #111827;
    font-weight: 900;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.chronos-topbar-btn:hover,
.chronos-icon-btn:hover,
.chronos-fullscreen-btn:hover,
.chronos-immersive-btn:hover,
.chronos-nav-btn:hover,
.chronos-floating-btn:hover,
.chronos-restore-info:hover,
.chronos-dossier-close:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.18);
}

.chronos-topbar-btn,
.chronos-fullscreen-btn,
.chronos-immersive-btn,
.chronos-floating-btn,
.chronos-restore-info,
.chronos-dossier-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
}

.chronos-icon-btn {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.chronos-icon-btn--wide {
    width: auto;
    padding: 0 10px;
    min-width: 56px;
}

.chronos-search-wrap {
    position: relative;
}

.chronos-search-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 320px;
    padding: 12px;
    background: rgba(255, 253, 240, 0.98);
    border: 3px solid var(--chronos-primary);
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.16);
    z-index: 20;
}

.chronos-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--chronos-primary);
    background: #fff;
    font-weight: 800;
}

.chronos-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.chronos-search-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 2px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-weight: 800;
}

.chronos-search-item strong,
.chronos-search-item span {
    display: block;
}

.chronos-search-item span {
    margin-top: 4px;
    font-size: .76rem;
    color: #475569;
}

.chronos-stage-shell {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 22px 18px;
    overflow: hidden;
}

.chronos-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    border: 4px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    border-radius: 24px;
}

.chronos-stage-progress {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.28);
    z-index: 3;
}

.chronos-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
}

.chronos-progress-dot.is-active {
    width: 32px;
    border-radius: 999px;
    background: #fff;
}

.chronos-stage-canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.12);
}

.chronos-stage-media {
    position: absolute;
    inset: 0;
    cursor: grab;
    transform-origin: center center;
    user-select: none;
}

.chronos-stage-media.is-dragging {
    cursor: grabbing;
}

.chronos-stage-media img,
.chronos-stage-media iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    object-fit: cover;
    pointer-events: none;
}

.chronos-stage-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, transparent 25%, rgba(0, 0, 0, 0.48) 100%);
    pointer-events: none;
}

.chronos-stage-loading {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 248, 207, 0.2);
    backdrop-filter: blur(4px);
    z-index: 4;
    font-weight: 900;
}

.chronos-stage-credit {
    position: absolute;
    left: 18px;
    bottom: 18px;
    padding: 8px 12px;
    background: rgba(255, 248, 207, 0.88);
    border: 2px solid var(--chronos-primary);
    font-size: .75rem;
    font-weight: 800;
    z-index: 3;
}

.chronos-zoom-controls {
    position: absolute;
    top: 86px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3;
}

.chronos-zoom-hint {
    width: 116px;
    padding: 8px 10px;
    border: 2px solid var(--chronos-primary);
    background: rgba(255, 248, 207, 0.92);
    font-size: .72rem;
    font-weight: 900;
    line-height: 1.35;
    color: #334155;
}

.chronos-fullscreen-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
}

.chronos-immersive-btn {
    position: absolute;
    right: 160px;
    bottom: 24px;
    z-index: 3;
}

.chronos-floating-card {
    position: absolute;
    left: 26px;
    bottom: 26px;
    max-width: 380px;
    padding: 26px 26px 20px;
    background: rgba(255, 248, 207, 0.94);
    border: 4px solid var(--chronos-primary);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.18);
    z-index: 3;
}

.chronos-card-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 2px solid var(--chronos-primary);
    background: #fff;
    font-weight: 900;
    cursor: pointer;
}

.chronos-floating-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 2px solid var(--chronos-primary);
    background: #fff54b;
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.chronos-floating-card h2 {
    margin: 14px 0 10px;
    font-family: 'Fredoka', cursive;
    font-size: 2rem;
    line-height: .95;
    color: var(--chronos-primary);
}

.chronos-floating-card p {
    margin: 0;
    line-height: 1.55;
    color: #334155;
}

.chronos-floating-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.chronos-floating-hint {
    font-size: .76rem;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
}

.chronos-restore-info {
    position: absolute;
    left: 26px;
    bottom: 74px;
    z-index: 3;
}

.chronos-nav-controls {
    position: absolute;
    right: 24px;
    bottom: 24px;
    display: flex;
    gap: 12px;
    z-index: 3;
}

.chronos-nav-btn {
    width: 62px;
    height: 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.chronos-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 10px 14px;
    border: 3px solid #007a00;
    background: rgba(255, 248, 207, 0.92);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
}

.chronos-footer-label,
.chronos-footer-count {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.chronos-timeline {
    position: relative;
    flex: 1 1 auto;
    min-height: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chronos-timeline::before {
    content: '';
    position: absolute;
    inset: 6px 0 auto;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
}

.chronos-timeline-fill {
    position: absolute;
    left: 0;
    top: 6px;
    height: 4px;
    background: #fff54b;
    z-index: 1;
}

.chronos-timeline-item {
    position: relative;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 3px solid #ffffff;
    background: #0f172a;
    cursor: pointer;
}

.chronos-timeline-item.is-past {
    background: #fff54b;
}

.chronos-timeline-item.is-active {
    transform: scale(1.2);
    background: #d62828;
}

.chronos-dossier {
    position: absolute;
    top: 22px;
    right: 22px;
    width: min(460px, calc(100% - 44px));
    height: calc(100% - 82px);
    padding: 24px 24px 24px 22px;
    background: rgba(250, 249, 246, 0.98);
    border: 4px solid var(--chronos-primary);
    box-shadow: -10px 10px 0 rgba(0, 0, 0, 0.14);
    transform: translateX(calc(100% + 30px));
    transition: transform .28s ease;
    z-index: 6;
}

.chronos-shell.is-panel-open .chronos-dossier {
    transform: translateX(0);
}

.chronos-dossier-body {
    height: calc(100% - 40px);
    overflow-y: auto;
    padding-right: 6px;
}

.chronos-dossier-kicker {
    display: inline-flex;
    padding: 6px 10px;
    background: var(--chronos-surface);
    border: 2px solid var(--chronos-primary);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.chronos-dossier h2 {
    margin: 18px 0 12px;
    font-family: 'Fredoka', cursive;
    color: var(--chronos-primary);
    font-size: 2.4rem;
    line-height: .95;
}

.chronos-dossier-description {
    margin: 0;
    padding-left: 16px;
    border-left: 4px solid var(--chronos-primary);
    color: #334155;
    font-size: 1rem;
    line-height: 1.7;
}

.chronos-dossier-section,
.chronos-dossier-reflection {
    margin-top: 28px;
}

.chronos-dossier-section h4,
.chronos-dossier-reflection h4 {
    margin: 0 0 16px;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #475569;
}

.chronos-fact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chronos-fact-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.55;
}

.chronos-fact-index {
    color: var(--chronos-primary);
    font-weight: 900;
}

.chronos-dossier-reflection {
    padding: 18px 18px 16px;
    border: 3px solid var(--chronos-primary);
    background: rgba(255, 248, 207, 0.6);
}

.chronos-dossier-reflection blockquote {
    margin: 0;
    color: #334155;
    font-style: italic;
    line-height: 1.75;
}

.chronos-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 3px solid var(--chronos-primary);
    background: rgba(255, 248, 207, 0.96);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.14);
    z-index: 50;
}

.chronos-toast-icon {
    font-size: 1.4rem;
}

.chronos-toast-copy {
    display: flex;
    flex-direction: column;
}

.chronos-toast-copy strong {
    font-size: .85rem;
    font-weight: 900;
}

.chronos-toast-copy span {
    font-size: .8rem;
    color: #475569;
}

@media (max-width: 1080px) {
    .chronos-shell {
        flex-direction: column;
    }

    .chronos-sidebar {
        width: 100%;
        max-width: 100%;
        border-right: 0;
        border-bottom: 2px solid rgba(0,0,0,0.1);
        padding: 12px 10px;
        gap: 10px;
        background: rgba(255, 248, 207, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        z-index: 20;
    }

    .chronos-brand,
    .chronos-sidebar-footer {
        display: none !important; /* Hide on mobile to save space */
    }

    .chronos-location-list {
        flex-direction: row;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        min-width: 0;
        max-width: 100%;
        padding-bottom: 4px;
        gap: 8px;
    }
    
    .chronos-location-list::-webkit-scrollbar {
        height: 4px;
    }

    .chronos-location-btn {
        flex: 0 0 auto;
        min-width: auto;
        width: auto;
        white-space: nowrap;
        padding: 8px 14px;
        border-width: 2px;
        border-radius: 12px;
        box-shadow: 0 4px 0 rgba(0,0,0,0.1);
        height: auto;
        display: inline-flex;
    }
    
    .chronos-location-btn:active {
        box-shadow: 0 0 0 rgba(0,0,0,0.1);
        transform: translateY(4px);
    }

    .chronos-loc-icon {
        display: none; /* Hide dot indicator on mobile */
    }
    
    .chronos-loc-text {
        font-size: 0.9rem;
    }
    .chronos-loc-era {
        display: none; /* Hide subtitle to keep buttons small */
    }

    .chronos-main {
        min-width: 0;
        max-width: 100%;
        min-height: 0;
    }

    .chronos-topbar {
        height: auto;
        padding: 10px;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        background: transparent;
        border-bottom: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        pointer-events: none;
    }

    .chronos-topbar > * {
        pointer-events: auto;
    }
    
    .chronos-topbar-btn span:last-child,
    .chronos-era-pill {
        display: none !important; /* Hide text, only show icons */
    }

    .chronos-topbar-left,
    .chronos-topbar-right {
        flex-wrap: nowrap;
        flex-direction: row;
        width: auto;
        gap: 8px;
    }

    .chronos-topbar-btn {
        padding: 8px;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
    }

    .chronos-stage-shell {
        padding: 0; /* Full screen edge-to-edge on mobile */
        height: 100%;
    }

    .chronos-stage {
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    /* Make the floating card a Bottom Sheet */
    .chronos-floating-card {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        max-height: 50vh !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 24px 20px 20px !important;
        border: none !important;
        border-top: 4px solid var(--chronos-primary) !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2) !important;
    }
    
    /* Add a drag handle indicator */
    .chronos-floating-card::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(0,0,0,0.15);
        border-radius: 10px;
    }

    .chronos-card-title {
        font-size: 1.5rem;
        margin-right: 30px;
    }
    
    .chronos-card-desc {
        font-size: 0.95rem;
    }

    .chronos-nav-controls {
        right: 12px;
        bottom: calc(50vh + 16px); /* Float just above the bottom sheet */
        transition: bottom 0.25s ease;
    }
    .info-card-hidden .chronos-nav-controls {
        bottom: 16px !important;
    }

    .chronos-immersive-btn {
        left: 12px;
        right: auto;
        bottom: calc(50vh + 16px);
        padding: 8px 12px;
        font-size: 0.8rem;
        transition: bottom 0.25s ease;
    }
    .info-card-hidden .chronos-immersive-btn {
        bottom: 16px !important;
    }
    
    .chronos-immersive-btn i {
        display: none;
    }

    .chronos-dossier {
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 16px !important;
    }

    .chronos-footer {
        display: none; /* Hide footer entirely on mobile to save space */
    }

    .chronos-zoom-hint {
        display: none !important;
    }

    .chronos-search-panel {
        width: calc(100vw - 20px) !important;
        right: -10px !important;
    }

    .chronos-toast {
        bottom: auto !important;
        top: 90px !important;
        width: calc(100% - 24px) !important;
        max-width: 360px !important;
    }
}

/* Anular padding de ck-main cuando contiene el player de chronos */
.ck-main:has(> .chronos-shell) {
    padding: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    height: 100% !important;
}