/* =========================================================
   MODO EDITOR — AUTENTICACIÓN Y PANEL
   Estilos aislados con prefijo editor-.
   ========================================================= */

.editor-floating-controls {
    position: fixed;
    right: 92px;
    bottom: 22px;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    pointer-events: none;
}

.editor-floating-controls > * {
    pointer-events: auto;
}

.editor-floating-authenticated {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    width: max-content;
}

.editor-floating-authenticated > .editor-welcome-pill,
.editor-floating-authenticated > .editor-fab {
    width: 100%;
}

.editor-floating-controls [hidden] {
    display: none !important;
}

.editor-fab,
.editor-welcome-pill {
    min-height: 48px;
    border: 1px solid color-mix(
        in srgb,
        var(--color-primary) 28%,
        var(--color-line)
    );
    border-radius: 999px;
    box-shadow: 0 14px 38px rgba(39, 23, 55, 0.2);
    backdrop-filter: blur(16px);
}

.editor-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--color-primary-strong),
        var(--color-primary)
    );
    cursor: pointer;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        opacity var(--transition);
}

.editor-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 46px rgba(63, 34, 101, 0.34);
}

.editor-fab:disabled {
    opacity: 0.58;
    cursor: wait;
    transform: none;
}

.editor-fab svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.editor-fab-icon {
    display: grid;
    place-items: center;
}

.editor-fab-logout {
    color: var(--color-text);
    background: color-mix(
        in srgb,
        var(--color-surface) 92%,
        transparent
    );
}

.editor-welcome-pill {
    padding: 7px 14px;
    display: grid;
    align-content: center;
    color: var(--color-text);
    background: color-mix(
        in srgb,
        var(--color-surface) 94%,
        transparent
    );
}

.editor-welcome-pill span {
    color: var(--color-muted);
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.editor-welcome-pill strong {
    margin-top: 3px;
    max-width: 150px;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-modal[hidden] {
    display: none !important;
}

.editor-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: rgba(6, 4, 9, 0.76);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}

.editor-login-modal {
    z-index: 12000;
}

.editor-panel-modal {
    z-index: 13000;
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.editor-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.editor-modal-card,
.editor-panel-shell {
    position: relative;
    border: 1px solid color-mix(
        in srgb,
        var(--color-primary) 24%,
        var(--color-line)
    );
    color: var(--color-text);
    background:
        radial-gradient(
            circle at 88% 8%,
            color-mix(
                in srgb,
                var(--color-primary) 13%,
                transparent
            ),
            transparent 32%
        ),
        var(--color-surface);
    box-shadow: 0 36px 110px rgba(0, 0, 0, 0.42);
    transform: translateY(18px) scale(0.985);
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.editor-modal.is-open .editor-modal-card,
.editor-modal.is-open .editor-panel-shell {
    transform: translateY(0) scale(1);
}

.editor-login-card {
    width: min(100%, 470px);
    padding: 34px;
    border-radius: 28px;
}

.editor-modal-close {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-line);
    border-radius: 50%;
    color: var(--color-text);
    background: var(--color-surface-2);
    cursor: pointer;
    transition:
        transform var(--transition),
        background var(--transition);
}

.editor-modal-close:hover {
    transform: rotate(5deg);
    background: var(--color-surface-3);
}

.editor-modal-close svg {
    width: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.editor-login-card > .editor-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
}

.editor-modal-heading {
    padding-right: 44px;
}

.editor-modal-kicker,
.editor-panel-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--color-primary);
    background: color-mix(
        in srgb,
        var(--color-primary) 11%,
        transparent
    );
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.editor-modal-heading h2 {
    margin: 14px 0 8px;
    font-size: clamp(30px, 5vw, 42px);
    line-height: 1.02;
}

.editor-modal-heading p {
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
}

.editor-login-form,
.editor-registration-form {
    margin-top: 26px;
    display: grid;
    gap: 17px;
}

.editor-field {
    display: grid;
    gap: 7px;
}

.editor-field > span:first-child {
    color: var(--color-text);
    font-size: 12px;
    font-weight: 700;
}

.editor-field input {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    color: var(--color-text);
    background: var(--color-surface-2);
    outline: none;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.editor-field input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(
        in srgb,
        var(--color-primary) 13%,
        transparent
    );
    background: var(--color-surface);
}

.editor-password-field {
    position: relative;
    display: block;
}

.editor-password-field input {
    padding-right: 50px;
}

.editor-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: var(--color-muted);
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.editor-password-toggle:hover {
    color: var(--color-primary);
    background: color-mix(
        in srgb,
        var(--color-primary) 9%,
        transparent
    );
}

.editor-password-toggle svg {
    grid-area: 1 / 1;
    width: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editor-password-toggle .eye-closed {
    display: none;
}

.editor-password-toggle.is-visible .eye-open {
    display: none;
}

.editor-password-toggle.is-visible .eye-closed {
    display: block;
}

.editor-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
}

.editor-submit:disabled {
    opacity: 0.58;
    cursor: wait;
    transform: none;
}

.editor-panel-shell {
    width: min(1180px, calc(100vw - 40px));
    height: min(780px, calc(100vh - 48px));
    height: min(780px, calc(100dvh - 48px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    min-height: 0;
    margin: auto;
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
    overflow: hidden;
    border-radius: 30px;
}

.editor-panel-sidebar {
    min-width: 0;
    min-height: 0;
    padding: 24px 18px 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(242, 123, 191, 0.16),
            transparent 32%
        ),
        linear-gradient(
            160deg,
            #120c19,
            #24142f 58%,
            #321c48
        );
    color: #fff;
}

.editor-panel-profile {
    flex: 0 0 auto;
    padding: 4px 8px 19px;
    display: grid;
}

.editor-panel-profile .editor-panel-badge {
    width: max-content;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.editor-panel-profile strong {
    margin-top: 14px;
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-panel-profile small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.58);
}

.editor-panel-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 6px 8px 6px 4px;
    display: grid;
    align-content: start;
    gap: 3px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color:
        rgba(255, 255, 255, 0.38)
        rgba(255, 255, 255, 0.08);
}

.editor-panel-nav::-webkit-scrollbar {
    width: 8px;
}

.editor-panel-nav::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.editor-panel-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
}

.editor-panel-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.58);
}

.editor-panel-nav button {
    width: 100%;
    min-height: 39px;
    padding: 8px 11px;
    border: 0;
    border-radius: 11px;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition:
        color var(--transition),
        background var(--transition),
        transform var(--transition);
}

.editor-panel-nav button:hover,
.editor-panel-nav button.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.editor-panel-logout {
    flex: 0 0 auto;
    min-height: 42px;
    margin: 14px 4px 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
}

.editor-panel-logout:hover {
    background: rgba(255, 255, 255, 0.13);
}

.editor-panel-main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--color-bg);
}

.editor-panel-header {
    min-height: 96px;
    padding: 20px 24px 18px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-bottom: 1px solid var(--color-line);
    background: var(--color-surface);
}

.editor-panel-header span {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.editor-panel-header h2 {
    margin: 3px 0 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
}

.editor-panel-content {
    min-height: 0;
    padding: clamp(24px, 4vw, 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.editor-panel-welcome,
.editor-construction-card {
    width: min(100%, 720px);
    min-height: 300px;
    margin: auto;
    padding: clamp(26px, 4vw, 44px);
    display: grid;
    align-content: center;
    justify-items: start;
    border: 1px solid var(--color-line);
    border-radius: 26px;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.editor-panel-welcome-icon,
.editor-construction-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--color-primary-strong),
        var(--color-primary)
    );
}

.editor-panel-welcome-icon svg,
.editor-construction-icon svg {
    width: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.editor-panel-welcome h3,
.editor-construction-card h3 {
    margin: 22px 0 8px;
    font-size: clamp(25px, 4vw, 36px);
}

.editor-panel-welcome p,
.editor-construction-card p {
    max-width: 590px;
    margin: 0;
    color: var(--color-muted);
}

.editor-panel-user-summary {
    width: 100%;
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.editor-panel-user-summary > div {
    padding: 15px;
    display: grid;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: var(--color-surface-2);
}

.editor-panel-user-summary small {
    color: var(--color-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.editor-panel-user-summary strong {
    margin-top: 4px;
}

.editor-panel-visits {
    width: 100%;
    margin-top: 12px;
    padding: 18px 20px;
    display: grid;
    gap: 14px;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            color-mix(
                in srgb,
                var(--color-primary) 8%,
                var(--color-surface-2)
            ),
            var(--color-surface-2)
        );
}

.editor-panel-visits-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.editor-panel-visits-heading > div {
    display: grid;
    gap: 3px;
}

.editor-panel-visits-heading small,
.editor-panel-visits-grid small {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.editor-panel-visits-heading strong {
    color: var(--color-text);
    font-size: 15px;
}

.editor-panel-visits-heading > span {
    color: var(--color-muted);
    font-size: 10px;
}

.editor-panel-visits-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.editor-panel-visits-grid article {
    padding: 14px;
    display: grid;
    gap: 5px;
    border: 1px solid var(--color-line);
    border-radius: 13px;
    background: var(--color-surface);
}

.editor-panel-visits-grid strong {
    color: var(--color-text);
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.editor-panel-visits > p {
    max-width: none;
    margin: 0;
    color: var(--color-muted);
    font-size: 10px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .editor-panel-visits-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .editor-panel-visits-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 460px) {
    .editor-panel-visits-grid {
        grid-template-columns: 1fr;
    }
}

.editor-toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 30000;
    width: min(390px, calc(100vw - 36px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.editor-toast {
    position: relative;
    padding: 14px 44px 14px 16px;
    border: 1px solid var(--color-line);
    border-radius: 15px;
    color: var(--color-text);
    background: var(--color-surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    opacity: 0;
    transform: translateY(-10px);
    transition:
        opacity 180ms ease,
        transform 180ms ease;
    pointer-events: auto;
}

.editor-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.editor-toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 15px 0 0 15px;
    background: var(--color-primary);
}

.editor-toast.is-success::before {
    background: var(--color-success);
}

.editor-toast.is-error::before {
    background: var(--color-error);
}

.editor-toast strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.editor-toast span {
    display: block;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.45;
}

.editor-toast-close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    color: var(--color-muted);
    background: transparent;
    cursor: pointer;
}

.editor-toast-close:hover {
    color: var(--color-text);
    background: var(--color-surface-2);
}

/* Página de registro inicial */

.editor-registration-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 18px;
    display: grid;
    place-items: start center;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(
            circle at 12% 18%,
            rgba(141, 91, 236, 0.18),
            transparent 31%
        ),
        radial-gradient(
            circle at 86% 12%,
            rgba(242, 123, 191, 0.14),
            transparent 28%
        ),
        var(--color-bg);
}

.editor-registration-wrap {
    width: min(100%, 650px);
    margin-block: 0;
}

@media (min-height: 900px) and (min-width: 701px) {
    .editor-registration-page {
        align-content: center;
    }
}

.editor-registration-card {
    padding: clamp(24px, 5vw, 44px);
    border: 1px solid var(--color-line);
    border-radius: 30px;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}

.editor-registration-logo {
    width: min(210px, 58vw);
    max-height: 80px;
    margin-bottom: 22px;
    object-fit: contain;
    object-position: left center;
}

.editor-registration-card h1 {
    margin: 14px 0 8px;
    font-size: clamp(32px, 7vw, 48px);
    line-height: 1;
}

.editor-registration-card > p {
    margin: 0;
    color: var(--color-muted);
}

.editor-registration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.editor-registration-actions {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.editor-registration-back {
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .editor-panel-shell {
        height: min(860px, calc(100vh - 24px));
        height: min(860px, calc(100dvh - 24px));
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .editor-panel-sidebar {
        padding-inline: 13px;
    }
}

@media (max-width: 700px) {
    .editor-floating-controls {
        right: 15px;
        bottom: 78px;
        align-items: flex-end;
    }

    .editor-floating-authenticated {
        align-items: flex-end;
        flex-direction: column;
    }

    .editor-welcome-pill {
        display: none;
    }

    .editor-fab {
        min-height: 44px;
        padding-inline: 14px;
        font-size: 12px;
    }

    .editor-modal {
        padding: 10px;
        align-items: stretch;
    }

    .editor-login-card {
        margin: auto;
        padding: 28px 20px 22px;
        border-radius: 22px;
    }

    .editor-panel-shell {
        width: 100%;
        height: calc(100vh - 20px);
        height: calc(100dvh - 20px);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(190px, 34vh) minmax(0, 1fr);
        border-radius: 22px;
    }

    .editor-panel-sidebar {
        padding: 16px 12px 10px;
    }

    .editor-panel-profile {
        padding-bottom: 8px;
    }

    .editor-panel-profile strong {
        margin-top: 8px;
        font-size: 15px;
    }

    .editor-panel-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px;
    }

    .editor-panel-nav button {
        min-height: 34px;
        padding: 5px 7px;
        font-size: 11px;
    }

    .editor-panel-logout {
        display: none;
    }

    .editor-panel-header {
        min-height: 78px;
        padding: 13px 14px 12px 18px;
    }

    .editor-panel-content {
        padding: 18px;
    }

    .editor-panel-welcome,
    .editor-construction-card {
        min-height: 230px;
        padding: 24px;
        border-radius: 20px;
    }

    .editor-panel-user-summary,
    .editor-registration-grid {
        grid-template-columns: 1fr;
    }

    .editor-registration-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .editor-registration-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .editor-modal,
    .editor-modal-card,
    .editor-panel-shell,
    .editor-toast {
        transition: none !important;
    }
}


/* Carga multimedia reutilizable */
.editor-upload-progress[hidden] {
    display: none !important;
}

.editor-upload-progress {
    width: 100%;
    display: grid;
    gap: 7px;
}

.editor-upload-progress-track {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-surface-3);
}

.editor-upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--color-primary-strong),
        var(--color-primary)
    );
    transition: width 120ms linear;
}

.editor-upload-progress-text {
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.35;
}


/* =========================================================
   FASE 3 — FORMULARIOS DE CONTENIDO
   ========================================================= */

.editor-panel-nav [data-editor-section] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.editor-nav-section-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-nav-source {
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--color-muted);
    background: color-mix(in srgb, var(--color-surface) 72%, transparent);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.editor-panel-nav [data-editor-section-source="actual"] .editor-nav-source {
    color: #fff;
    background: var(--color-primary);
}

.editor-panel-loading {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    color: var(--color-muted);
}

.editor-panel-loading-dot {
    width: 34px;
    height: 34px;
    border: 3px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: editor-phase3-spin 700ms linear infinite;
}

@keyframes editor-phase3-spin {
    to { transform: rotate(360deg); }
}

.editor-source-card {
    margin-bottom: 18px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--color-line);
    border-radius: 18px;
    background: color-mix(in srgb, var(--color-surface-2) 82%, transparent);
}

.editor-source-card small {
    display: block;
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.editor-source-card strong {
    display: block;
    margin-top: 3px;
    font-size: 17px;
}

.editor-source-warning {
    margin: 7px 0 0;
    max-width: 640px;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.5;
}

.editor-source-actions {
    flex: 0 0 auto;
    padding: 4px;
    display: flex;
    gap: 4px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    background: var(--color-surface);
}

.editor-source-actions button {
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    color: var(--color-muted);
    background: transparent;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.editor-source-actions button.is-active {
    color: #fff;
    background: var(--color-primary);
}

.editor-phase3-grid,
.editor-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.editor-form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-edit-card {
    margin-bottom: 18px;
    padding: 20px;
    display: grid;
    gap: 16px;
    border: 1px solid var(--color-line);
    border-radius: 20px;
    background: var(--color-surface);
}

.editor-phase3-grid .editor-edit-card {
    margin-bottom: 0;
}

.editor-edit-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.editor-edit-card-heading small {
    display: block;
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.editor-edit-card-heading h3 {
    margin: 3px 0 0;
    font-size: 18px;
}

.editor-content-badge {
    padding: 5px 9px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 850;
}

.editor-content-badge.is-actual {
    color: #fff;
    border-color: transparent;
    background: var(--color-primary);
}

.editor-field textarea,
.editor-field select {
    width: 100%;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    color: var(--color-text);
    background: var(--color-surface-2);
    font: inherit;
}

.editor-field textarea {
    min-height: 110px;
    padding: 12px 14px;
    resize: vertical;
}

.editor-field select {
    min-height: 46px;
    padding: 0 42px 0 14px;
}

.editor-field input[readonly] {
    opacity: 0.7;
    cursor: default;
}

.editor-field > small {
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.4;
}

.editor-link-config {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 12px;
}

.editor-link-config [hidden] {
    display: none !important;
}

.editor-form-divider {
    height: 1px;
    margin: 2px 0;
    background: var(--color-line);
}

.editor-nested-card {
    padding: 15px;
    display: grid;
    gap: 12px;
    border: 1px solid color-mix(in srgb, var(--color-line) 82%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--color-surface-2) 72%, transparent);
}

.editor-nested-card > strong {
    font-size: 13px;
}

.editor-order-list,
.editor-stats-editor,
.editor-image-list {
    display: grid;
    gap: 9px;
}

.editor-order-item {
    min-height: 44px;
    padding: 8px 10px 8px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 13px;
    background: var(--color-surface-2);
}

.editor-order-item span {
    font-size: 12px;
    font-weight: 800;
}

.editor-order-item div,
.editor-stat-order,
.editor-image-actions {
    display: flex;
    gap: 5px;
}

.editor-order-item button,
.editor-stat-order button,
.editor-image-actions button {
    min-width: 32px;
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid var(--color-line);
    border-radius: 9px;
    color: var(--color-text);
    background: var(--color-surface);
    cursor: pointer;
}

.editor-image-preview {
    min-height: 120px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background: var(--color-surface-2);
}

.editor-logo-preview img {
    width: min(100%, 260px);
    max-height: 120px;
    object-fit: contain;
}

.editor-logo-preview [data-header-logo-image][hidden],
.editor-logo-preview [data-header-logo-placeholder][hidden],
.editor-header-logo-tools [data-header-logo-cancel][hidden],
.editor-header-logo-tools [data-header-logo-remove][hidden] {
    display: none !important;
}


.editor-header-logo-placeholder {
    width: min(100%, 360px);
    padding: 18px;
    display: grid;
    place-items: center;
    gap: 5px;
    text-align: center;
}

.editor-header-logo-placeholder strong {
    color: var(--color-text);
    font-size: 12px;
}

.editor-header-logo-placeholder span {
    max-width: 300px;
    color: var(--color-muted);
    font-size: 10px;
    line-height: 1.45;
}

.editor-header-logo-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.editor-header-logo-tools > small {
    min-width: 0;
    color: var(--color-muted);
    font-size: 10px;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .editor-header-logo-tools {
        align-items: stretch;
        flex-direction: column;
    }
}

.editor-image-item {
    padding: 10px;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 15px;
    background: var(--color-surface-2);
}

.editor-image-item > img {
    width: 86px;
    height: 74px;
    display: block;
    object-fit: contain;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-surface-3) 80%, transparent);
}

.editor-image-item strong,
.editor-image-item small {
    display: block;
}

.editor-image-item strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-image-item small {
    margin-top: 3px;
    color: var(--color-muted);
    font-size: 10px;
}

.editor-image-actions [data-phase3-delete-hero] {
    color: #b42318;
}

.editor-empty-note {
    margin: 0;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.55;
}

.editor-stats-readonly-list {
    display: grid;
    gap: 9px;
}

.editor-stat-readonly-item {
    padding: 14px 15px;
    display: grid;
    gap: 4px;
    border: 1px solid var(--color-line);
    border-radius: 15px;
    background: var(--color-surface-2);
}

.editor-stat-readonly-item strong {
    color: var(--color-text);
    font-size: 18px;
    letter-spacing: -0.02em;
}

.editor-stat-readonly-item span {
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.5;
}

.editor-stats-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.editor-stat-edit-item {
    padding: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 0.7fr) minmax(0, 1.3fr) auto;
    align-items: end;
    gap: 10px;
    border: 1px solid var(--color-line);
    border-radius: 15px;
    background: var(--color-surface-2);
}

.editor-danger-button,
.editor-secondary-button {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.editor-danger-button {
    border: 1px solid color-mix(in srgb, #b42318 35%, var(--color-line));
    color: #b42318;
    background: color-mix(in srgb, #b42318 7%, var(--color-surface));
}

.editor-secondary-button {
    justify-self: start;
    border: 1px solid var(--color-line);
    color: var(--color-text);
    background: var(--color-surface-2);
}

@media (max-width: 900px) {
    .editor-phase3-grid,
    .editor-form-grid,
    .editor-form-grid-3 {
        grid-template-columns: 1fr;
    }

    .editor-source-card {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-source-actions {
        align-self: flex-start;
    }

    .editor-stat-edit-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .editor-stat-edit-item .editor-field {
        grid-column: 2;
    }

    .editor-stat-edit-item .editor-danger-button {
        grid-column: 2;
        justify-self: start;
    }
}

@media (max-width: 620px) {
    .editor-link-config {
        grid-template-columns: 1fr;
    }

    .editor-image-item {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .editor-image-item > img {
        width: 70px;
        height: 64px;
    }

    .editor-image-actions {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   FASE 4 — REDES SOCIALES Y PRÓXIMAS FECHAS
   ========================================================= */

.editor-social-editor,
.editor-tour-editor {
    display: grid;
    gap: 12px;
}

.editor-social-item {
    padding: 14px;
    display: grid;
    grid-template-columns:
        minmax(180px, 0.8fr)
        minmax(240px, 1.4fr)
        auto;
    align-items: end;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background: var(--color-surface-2);
}

.editor-social-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    align-self: center;
}

.editor-social-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--color-primary);
}

.editor-social-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.editor-social-identity strong,
.editor-social-identity small {
    display: block;
}

.editor-social-identity strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-social-identity small {
    margin-top: 3px;
    color: var(--color-muted);
    font-size: 10px;
}

.editor-social-item .editor-image-actions {
    align-self: center;
}

.editor-social-item .editor-readonly-value {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.45;
}

.editor-tour-item {
    padding: 16px;
    display: grid;
    gap: 14px;
    border: 1px solid var(--color-line);
    border-radius: 17px;
    background: var(--color-surface-2);
}

.editor-tour-item-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.editor-tour-item-heading > strong {
    font-size: 13px;
}

@media (max-width: 1050px) {
    .editor-social-item {
        grid-template-columns:
            minmax(160px, 0.8fr)
            minmax(220px, 1.2fr)
            auto;
    }

    .editor-social-item .editor-stat-order {
        grid-column: 3;
    }
}

@media (max-width: 760px) {
    .editor-social-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .editor-social-item .editor-stat-order {
        grid-column: auto;
    }

}



.editor-tour-admin-form,
.editor-tour-table-card {
    gap: 18px;
}

.editor-tour-form-actions,
.editor-tour-tool-actions,
.editor-tour-row-actions,
.editor-tour-pagination,
.editor-tour-pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-tour-form-actions {
    flex-wrap: wrap;
}

.editor-tour-table-tools {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        minmax(180px, 0.55fr)
        auto;
    align-items: end;
    gap: 10px;
}

.editor-tour-tool-actions {
    min-height: 50px;
    align-self: end;
}

.editor-icon-button,
.editor-tour-page-button {
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--color-line);
    border-radius: 11px;
    color: var(--color-text);
    background: var(--color-surface);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.editor-icon-button:hover,
.editor-icon-button:focus-visible,
.editor-tour-page-button:hover,
.editor-tour-page-button:focus-visible {
    background: var(--color-surface-2);
    border-color: color-mix(
        in srgb,
        var(--color-primary) 30%,
        var(--color-line)
    );
}

.editor-icon-button:active,
.editor-tour-page-button:active {
    transform: translateY(1px);
}

.editor-icon-button:disabled,
.editor-tour-page-button:disabled {
    cursor: default;
    opacity: 0.48;
    transform: none;
}

.editor-icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editor-icon-button-danger {
    color: #b42318;
}

.editor-tour-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-line);
    border-radius: 15px;
    background: var(--color-surface);
}

.editor-tour-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.editor-tour-table th,
.editor-tour-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--color-line);
    vertical-align: middle;
    text-align: left;
}

.editor-tour-table th {
    color: var(--color-muted);
    background: var(--color-surface-2);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.editor-tour-table tbody tr:last-child td {
    border-bottom: 0;
}

.editor-tour-table td {
    color: var(--color-text);
    font-size: 11px;
}

.editor-tour-table td strong,
.editor-tour-table td small {
    display: block;
}

.editor-tour-table td strong {
    font-size: 11px;
}

.editor-tour-table td small {
    margin-top: 3px;
    color: var(--color-muted);
    font-size: 9px;
}

.editor-tour-actions-column,
.editor-tour-row-actions {
    width: 96px;
    text-align: right !important;
}

.editor-tour-row-actions {
    justify-content: flex-end;
}

.editor-tour-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
}

.editor-tour-status.is-upcoming {
    color: var(--color-primary-strong);
    background: color-mix(
        in srgb,
        var(--color-primary) 8%,
        var(--color-surface)
    );
}

.editor-tour-status.is-past {
    color: var(--color-muted);
    background: var(--color-surface-2);
}

.editor-tour-pagination {
    justify-content: center;
    flex-wrap: wrap;
}

.editor-tour-pagination-pages {
    flex-wrap: wrap;
    justify-content: center;
}

.editor-tour-page-button.is-active {
    color: #fff;
    border-color: var(--color-primary);
    background: var(--color-primary);
    opacity: 1;
}

.editor-tour-pagination-ellipsis {
    min-width: 18px;
    color: var(--color-muted);
    text-align: center;
    font-size: 11px;
    font-weight: 800;
}

.editor-tour-readonly-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.editor-tour-readonly-item {
    min-width: 0;
    padding: 12px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 15px;
    background: var(--color-surface-2);
}

.editor-tour-readonly-date {
    width: 58px;
    height: 58px;
    display: grid;
    place-content: center;
    justify-items: center;
    border-radius: 11px;
    color: #fff;
    background: #17131d;
}

.editor-tour-readonly-date small {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.editor-tour-readonly-date strong {
    font-size: 22px;
    line-height: 1;
}

.editor-tour-readonly-item > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.editor-tour-readonly-item > div > strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-tour-readonly-item > div > span,
.editor-tour-readonly-item > div > small {
    overflow: hidden;
    color: var(--color-muted);
    font-size: 9px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="dark"] .editor-tour-readonly-date {
    background: #08070a;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 840px) {
    .editor-tour-table-tools {
        grid-template-columns: 1fr 1fr;
    }

    .editor-tour-tool-actions {
        grid-column: 1 / -1;
        min-height: 0;
    }

    .editor-tour-readonly-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .editor-tour-table-tools {
        grid-template-columns: 1fr;
    }

    .editor-tour-tool-actions {
        grid-column: auto;
    }

    .editor-tour-pagination {
        align-items: stretch;
    }

    .editor-tour-pagination-pages {
        order: 3;
        width: 100%;
    }
}


/* =========================================================
   FASE 5 - EVENTOS Y GALERIA
   ========================================================= */

.editor-gallery-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.editor-pending-badge {
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, #b7791f 34%, var(--color-line));
    border-radius: 999px;
    color: #8a5a00;
    background: color-mix(in srgb, #f6c453 14%, var(--color-surface));
    font-size: 10px;
    font-weight: 850;
}

.editor-pending-badge[hidden] {
    display: none !important;
}

.editor-gallery-list {
    display: grid;
    gap: 12px;
}

.editor-gallery-item {
    padding: 12px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background: var(--color-surface-2);
}

.editor-gallery-thumb {
    position: relative;
    width: 120px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 13px;
    background: var(--color-surface-3);
}

.editor-gallery-focus-hint {
    position: absolute;
    z-index: 3;
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 7px 9px;
    border-radius: 10px;
    color: #fff;
    background: rgba(18, 12, 25, 0.76);
    font-size: 10px;
    font-weight: 850;
    line-height: 1.25;
    text-align: center;
    pointer-events: none;
}

.editor-gallery-focus-hint[hidden] {
    display: none !important;
}

.editor-gallery-item [data-phase5-focus-image][aria-pressed="true"] {
    color: #fff;
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.editor-gallery-item.is-focus-editing {
    grid-template-columns: minmax(0, 1fr) auto;
}

.editor-gallery-item.is-focus-editing .editor-gallery-thumb {
    grid-column: 1 / -1;
    width: min(100%, var(--phase5-crop-width, 620px));
    aspect-ratio: var(--phase5-crop-ratio, 681.67 / 482);
    justify-self: start;
    border-color: color-mix(in srgb, var(--color-primary) 58%, var(--color-line));
    border-radius: var(--radius-md);
    background: #09070d;
    cursor: grab;
    touch-action: none;
}

.editor-gallery-item.is-focus-editing .editor-gallery-thumb.is-position-dragging {
    cursor: grabbing;
}

.editor-gallery-item.is-focus-editing > .editor-field {
    grid-column: 1;
}

.editor-gallery-item.is-focus-editing > .editor-gallery-meta {
    grid-column: 2;
}

.editor-gallery-crop-tools {
    grid-column: 1 / -1;
    width: min(100%, 620px);
    padding: 11px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.9fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 13px;
    background: var(--color-surface);
}

.editor-gallery-crop-tools[hidden] {
    display: none !important;
}

.editor-gallery-crop-tools strong,
.editor-gallery-crop-tools small {
    display: block;
}

.editor-gallery-crop-tools strong {
    font-size: 11px;
}

.editor-gallery-crop-tools small {
    margin-top: 2px;
    color: var(--color-muted);
    font-size: 9px;
    line-height: 1.35;
}

.editor-gallery-zoom-control {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(90px, 1fr) 42px;
    align-items: center;
    gap: 8px;
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
}

.editor-gallery-zoom-control input[type="range"] {
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
}

.editor-gallery-zoom-control output {
    color: var(--color-text);
    text-align: right;
}

.editor-gallery-reset-focus {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 10px;
}

.editor-gallery-thumb.is-missing {
    padding: 10px;
    display: grid;
    place-items: center;
    text-align: center;
}

.editor-gallery-thumb.is-missing span {
    color: #b42318;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
}

.editor-gallery-meta {
    min-width: 120px;
    display: grid;
    justify-items: end;
    gap: 10px;
}

.editor-gallery-meta > small {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 700;
}

.editor-gallery-item .editor-image-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.editor-gallery-item .editor-image-actions .editor-icon-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    line-height: 1;
}

.editor-gallery-item [data-phase5-delete-image] {
    color: #b42318;
}

@media (max-width: 760px) {
    .editor-gallery-item {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .editor-gallery-thumb {
        width: 92px;
    }

    .editor-gallery-meta {
        grid-column: 1 / -1;
        min-width: 0;
        justify-items: start;
    }

    .editor-gallery-item .editor-image-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .editor-gallery-item,
    .editor-gallery-item.is-focus-editing {
        grid-template-columns: 1fr;
    }

    .editor-gallery-item.is-focus-editing > .editor-field,
    .editor-gallery-item.is-focus-editing > .editor-gallery-meta,
    .editor-gallery-item.is-focus-editing > .editor-gallery-crop-tools {
        grid-column: 1;
    }

    .editor-gallery-crop-tools {
        grid-template-columns: 1fr;
    }

    .editor-gallery-thumb {
        width: 100%;
        max-width: 220px;
    }
}


/* =========================================================
   FASE 6 - NOVEDADES Y TAGS
   ========================================================= */

.editor-news-list {
    display: grid;
    gap: 14px;
}

.editor-news-item {
    padding: 16px;
    display: grid;
    gap: 14px;
    border: 1px solid var(--color-line);
    border-radius: 18px;
    background: var(--color-surface-2);
}

.editor-news-item-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.editor-news-item-heading > strong {
    font-size: 13px;
}

.editor-news-media {
    padding: 12px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    border: 1px solid color-mix(in srgb, var(--color-line) 86%, transparent);
    border-radius: 15px;
    background: var(--color-surface);
}

.editor-news-media-preview {
    position: relative;
    width: 150px;
    height: 150px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: #000;
}

/*
 * Novedades: una sola implementación de preview.
 * No se usa <img> + object-fit. La fotografía se dibuja como background
 * con contain, centrada y sin repetición. Así no puede recortarse por reglas
 * heredadas de imágenes del sitio público.
 */
.editor-news-current-preview,
.editor-news-local-preview {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background-color: #000;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
}

.editor-news-local-preview {
    z-index: 2;
}

.editor-news-local-preview[hidden] {
    display: none !important;
}

.editor-news-media-empty {
    padding: 12px;
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    background-image: none !important;
}

.editor-news-media-empty.is-error {
    color: #b42318;
}

.editor-news-media-controls {
    min-width: 0;
    display: grid;
    gap: 10px;
}

.editor-news-media-actions,
.editor-news-footer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.editor-news-footer-actions {
    justify-content: space-between;
}

.editor-news-media-actions .editor-danger-button,
.editor-news-media-actions .editor-secondary-button {
    justify-self: auto;
}

@media (max-width: 700px) {
    .editor-news-media {
        grid-template-columns: 1fr;
    }

    .editor-news-media-preview {
        width: min(100%, 320px);
        height: 220px;
    }

    .editor-news-footer-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-news-footer-actions > button {
        width: 100%;
    }
}


/* UX transversal del Modo Editor */
.editor-char-counter {
    margin-top: 4px;
    display: block;
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 700;
    text-align: right;
}

.editor-drag-handle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
    cursor: grab;
    user-select: none;
}


.editor-tag-catalog {
    padding: 14px;
    display: grid;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background: var(--color-surface-2);
}

.editor-tag-catalog small,
.editor-tag-catalog strong,
.editor-tag-catalog p {
    display: block;
}

.editor-tag-catalog strong {
    margin-top: 3px;
    font-size: 13px;
}

.editor-tag-catalog p {
    margin: 6px 0 0;
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.45;
}

.editor-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.editor-tag-chip {
    padding: 6px 9px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    color: var(--color-primary-strong);
    background: var(--color-surface);
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.editor-tag-chip:hover {
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-line));
    background: var(--color-primary-soft);
}

.editor-news-save-progress {
    min-height: 2px;
}


/* =========================================================
   AJUSTE RESPONSIVE GLOBAL DEL MODO EDITOR
   Los campos se reorganizan según el ancho REAL disponible
   dentro del panel, no solo según el ancho de la ventana.
   ========================================================= */

.editor-panel-main {
    container-type: inline-size;
    container-name: dj-editor-main;
}

.editor-panel-content,
.editor-panel-content form,
.editor-panel-content section,
.editor-panel-content .editor-edit-card,
.editor-panel-content .editor-nested-card,
.editor-panel-content .editor-field,
.editor-panel-content .editor-field > *,
.editor-panel-content .editor-form-grid > *,
.editor-panel-content .editor-link-config > * {
    min-width: 0;
}

.editor-panel-content .editor-phase3-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(min(360px, 100%), 1fr)
        );
}

.editor-panel-content .editor-form-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(min(260px, 100%), 1fr)
        );
}

.editor-panel-content .editor-form-grid-3 {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(min(210px, 100%), 1fr)
        );
}

.editor-panel-content .editor-link-config {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(min(220px, 100%), 1fr)
        );
}

.editor-panel-content .editor-field input,
.editor-panel-content .editor-field select,
.editor-panel-content .editor-field textarea {
    min-width: 0;
    max-width: 100%;
}

.editor-panel-content .editor-field textarea:focus,
.editor-panel-content .editor-field select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(
        in srgb,
        var(--color-primary) 13%,
        transparent
    );
    background: var(--color-surface);
}

.editor-panel-content input[type="file"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 54px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    color: var(--color-muted);
    background: var(--color-surface-2);
    font: inherit;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.editor-panel-content input[type="file"]:hover {
    border-color: color-mix(
        in srgb,
        var(--color-primary) 46%,
        var(--color-line)
    );
    background: var(--color-surface);
}

.editor-panel-content input[type="file"]:focus,
.editor-panel-content input[type="file"]:focus-visible {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(
        in srgb,
        var(--color-primary) 13%,
        transparent
    );
}

.editor-panel-content input[type="file"]::file-selector-button {
    min-height: 40px;
    margin: 0 12px 0 0;
    padding: 0 15px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--color-primary-strong),
        var(--color-primary)
    );
    box-shadow: 0 8px 20px color-mix(
        in srgb,
        var(--color-primary) 20%,
        transparent
    );
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    transition:
        transform var(--transition),
        filter var(--transition),
        box-shadow var(--transition);
}

.editor-panel-content input[type="file"]::-webkit-file-upload-button {
    min-height: 40px;
    margin: 0 12px 0 0;
    padding: 0 15px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--color-primary-strong),
        var(--color-primary)
    );
    box-shadow: 0 8px 20px color-mix(
        in srgb,
        var(--color-primary) 20%,
        transparent
    );
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.editor-panel-content input[type="file"]::file-selector-button:hover {
    filter: brightness(1.05);
}

.editor-panel-content .editor-edit-card-heading,
.editor-panel-content .editor-tour-item-heading,
.editor-panel-content .editor-news-item-heading,
.editor-panel-content .editor-phase9-list-head,
.editor-panel-content .editor-phase10-section-title {
    min-width: 0;
    flex-wrap: wrap;
}

.editor-panel-content .editor-source-actions,
.editor-panel-content .editor-order-item,
.editor-panel-content .editor-image-actions,
.editor-panel-content .editor-stat-order,
.editor-panel-content .editor-news-media-actions,
.editor-panel-content .editor-news-footer-actions {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
}

.editor-panel-content .editor-order-item > span,
.editor-panel-content .editor-order-item > div {
    min-width: 0;
}

.editor-panel-content .editor-order-item > span {
    overflow-wrap: anywhere;
}

@container dj-editor-main (max-width: 760px) {
    .editor-panel-content .editor-phase3-grid,
    .editor-panel-content .editor-form-grid,
    .editor-panel-content .editor-form-grid-3,
    .editor-panel-content .editor-link-config {
        grid-template-columns: 1fr;
    }

    .editor-panel-content .editor-social-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .editor-panel-content .editor-social-item .editor-stat-order {
        grid-column: auto;
    }

    .editor-panel-content .editor-stat-edit-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .editor-panel-content .editor-stat-edit-item .editor-field,
    .editor-panel-content .editor-stat-edit-item .editor-danger-button {
        grid-column: auto;
    }

    .editor-panel-content .editor-visibility-toggle,
    .editor-panel-content .editor-secondary-button,
    .editor-panel-content .editor-danger-button {
        justify-self: start;
    }
}

@container dj-editor-main (max-width: 520px) {
    .editor-panel-content {
        padding-inline: 16px;
    }

    .editor-panel-content .editor-edit-card,
    .editor-panel-content .editor-nested-card {
        padding-inline: 14px;
    }

    .editor-panel-content input[type="file"] {
        min-height: 52px;
    }

    .editor-panel-content input[type="file"]::file-selector-button,
    .editor-panel-content input[type="file"]::-webkit-file-upload-button {
        max-width: 68%;
        margin-right: 8px;
        padding-inline: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}


/* =========================================================
   ALINEACIÓN VERTICAL GLOBAL DE CAMPOS
   Cada campo conserva su altura natural; los textos de ayuda
   y contadores crecen hacia abajo sin desplazar el control vecino.
   ========================================================= */

.editor-field {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: start;
    gap: 7px;
}

.editor-form-grid,
.editor-form-grid-3,
.editor-link-config {
    align-items: start;
}

.editor-field input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.editor-field select {
    width: 100%;
    min-width: 0;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    box-sizing: border-box;
    flex: 0 0 50px;
}

.editor-field textarea {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 110px;
    max-height: none;
    box-sizing: border-box;
    flex: 0 0 auto;
}

.editor-field input[type="file"] {
    flex: 0 0 auto;
}

.editor-field > small,
.editor-field > .editor-char-counter {
    flex: 0 0 auto;
}

.editor-link-config > *,
.editor-form-grid > *,
.editor-form-grid-3 > * {
    align-self: start;
}

/* Los controles de contraseña conservan el mismo alto contractual. */
.editor-password-field {
    width: 100%;
    min-width: 0;
    flex: 0 0 50px;
}

.editor-password-field input {
    height: 50px;
    min-height: 50px;
    max-height: 50px;
}


/* =========================================================
   GESTIÓN DE USUARIOS DEL MODO EDITOR
   ========================================================= */

.editor-panel-nav [data-editor-admin-section] .editor-nav-source {
    color: var(--color-primary-strong);
    background: color-mix(
        in srgb,
        var(--color-primary) 10%,
        var(--color-surface)
    );
}

.editor-users-layout {
    display: grid;
    gap: 18px;
}

.editor-users-create-card {
    margin-bottom: 0;
}

.editor-users-intro {
    margin: 0;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.55;
}

.editor-users-form-actions {
    display: flex;
    justify-content: flex-end;
}

.editor-users-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background: var(--color-surface-2);
}

.editor-users-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.editor-users-table th,
.editor-users-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-line);
    text-align: left;
    vertical-align: middle;
}

.editor-users-table tr:last-child td {
    border-bottom: 0;
}

.editor-users-table th {
    color: var(--color-muted);
    background: color-mix(
        in srgb,
        var(--color-surface-3) 72%,
        transparent
    );
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.editor-users-table td {
    color: var(--color-text);
    font-size: 12px;
}

.editor-user-name strong,
.editor-user-name small {
    display: block;
}

.editor-user-name strong {
    font-size: 12px;
}

.editor-user-name small {
    margin-top: 3px;
    color: var(--color-muted);
    font-size: 10px;
}

.editor-user-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    color: var(--color-muted);
    background: var(--color-surface);
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

.editor-user-status::before {
    width: 7px;
    height: 7px;
    content: "";
    border-radius: 50%;
    background: currentColor;
}

.editor-user-status.is-active {
    color: #137333;
    border-color: color-mix(
        in srgb,
        #137333 26%,
        var(--color-line)
    );
    background: color-mix(
        in srgb,
        #137333 7%,
        var(--color-surface)
    );
}

.editor-user-status.is-inactive {
    color: #b42318;
    border-color: color-mix(
        in srgb,
        #b42318 26%,
        var(--color-line)
    );
    background: color-mix(
        in srgb,
        #b42318 6%,
        var(--color-surface)
    );
}

.editor-user-self {
    color: var(--color-muted);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.editor-user-action {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid var(--color-line);
    border-radius: 10px;
    color: var(--color-text);
    background: var(--color-surface);
    font: inherit;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
}

.editor-user-action.is-danger {
    color: #b42318;
    border-color: color-mix(
        in srgb,
        #b42318 30%,
        var(--color-line)
    );
}

.editor-user-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@container dj-editor-main (max-width: 760px) {
    .editor-users-form-actions {
        justify-content: stretch;
    }

    .editor-users-form-actions .button {
        width: 100%;
    }
}


/* =========================================================
   PILOTO OPTIMIZACIÓN — NOVEDADES Y CONTENIDO
   ========================================================= */

.editor-nav-meta {
    min-width: 0;
    display: grid;
    justify-items: end;
    gap: 4px;
}

.editor-nav-upload {
    max-width: 112px;
    padding: 3px 7px;
    overflow: hidden;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    font-size: 8px;
    font-weight: 850;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-nav-upload[data-upload-state="uploading"] {
    background: color-mix(
        in srgb,
        var(--color-primary) 72%,
        #fff
    );
}

.editor-nav-upload[data-upload-state="complete"] {
    background: #137333;
}

.editor-nav-upload[data-upload-state="error"] {
    background: #b42318;
}

.editor-tag-selector {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-self: start;
    gap: 7px;
}

.editor-field-label {
    color: var(--color-text);
    font-size: 11px;
    font-weight: 800;
}

.editor-tag-search-wrap {
    position: relative;
    min-width: 0;
}

.editor-tag-search-wrap > input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    color: var(--color-text);
    background: var(--color-surface);
    font: inherit;
    font-size: 12px;
}

.editor-tag-search-wrap > input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(
        in srgb,
        var(--color-primary) 13%,
        transparent
    );
}

.editor-tag-suggestions {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.editor-tag-suggestions[hidden] {
    display: none !important;
}

.editor-tag-suggestions button {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: var(--color-text);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.editor-tag-suggestions button:hover,
.editor-tag-suggestions button:focus-visible {
    outline: none;
    background: var(--color-surface-2);
}

.editor-tag-suggestions button.is-create {
    color: var(--color-primary-strong);
}

.editor-tag-selected-wrap {
    min-height: 50px;
    display: flex;
    align-items: center;
}

.editor-tag-selected-wrap[hidden] {
    display: none !important;
}

.editor-tag-selected {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px 8px 12px;
    border: 1px solid color-mix(
        in srgb,
        var(--color-primary) 35%,
        var(--color-line)
    );
    border-radius: 999px;
    color: var(--color-primary-strong);
    background: var(--color-primary-soft);
    font-size: 11px;
    font-weight: 850;
}

.editor-tag-selected > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-tag-selected button,
.editor-tag-catalog-item button {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: inherit;
    background: color-mix(
        in srgb,
        currentColor 9%,
        transparent
    );
    font: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.editor-tag-catalog-item {
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 10px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    color: var(--color-primary-strong);
    background: var(--color-surface);
    font-size: 10px;
    font-weight: 800;
}

.editor-tag-catalog-item > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-readonly-card {
    display: grid;
    gap: 18px;
}

.editor-readonly-note,
.editor-empty-state-card {
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    color: var(--color-muted);
    background: var(--color-surface-2);
    font-size: 11px;
    line-height: 1.55;
}

.editor-empty-state-card strong,
.editor-empty-state-card p {
    display: block;
}

.editor-empty-state-card p {
    margin: 5px 0 0;
}

.editor-readonly-header {
    display: grid;
    gap: 6px;
}

.editor-readonly-header small {
    color: var(--color-primary-strong);
    font-weight: 850;
}

.editor-readonly-header h4,
.editor-readonly-header p {
    margin: 0;
}

.editor-readonly-header p {
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.55;
}

.editor-news-readonly-list {
    display: grid;
    gap: 10px;
}

.editor-news-readonly-item {
    padding: 10px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: var(--color-surface);
}

.editor-news-readonly-image {
    width: 120px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--color-surface-3);
}

.editor-news-readonly-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.editor-news-readonly-item > div:last-child {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 4px;
}

.editor-news-readonly-item small {
    color: var(--color-primary-strong);
    font-size: 9px;
    font-weight: 850;
}

.editor-news-readonly-item strong {
    font-size: 12px;
}

.editor-news-readonly-item p {
    margin: 0;
    display: -webkit-box;
    overflow: hidden;
    color: var(--color-muted);
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

@container dj-editor-main (max-width: 520px) {
    .editor-news-readonly-item {
        grid-template-columns: 1fr;
    }

    .editor-news-readonly-image {
        width: min(100%, 320px);
    }
}


/* =========================================================
   FASE 5 - GALERÍA MIGRADA A BORRADOR LOCAL
   ========================================================= */
.editor-gallery-thumb {
    position: relative;
    display: grid;
    place-items: center;
    background: #000;
}

.editor-gallery-thumb > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: var(--gallery-focus-x, 50%) var(--gallery-focus-y, 0%);
    transform: scale(var(--gallery-scale, 1));
    transform-origin: var(--gallery-focus-x, 50%) var(--gallery-focus-y, 0%);
    background: #000;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.editor-gallery-thumb [data-phase5-local-preview] {
    z-index: 2;
}

.editor-gallery-thumb [data-phase5-local-preview][hidden],
.editor-gallery-thumb [data-phase5-current-preview][hidden],
.editor-gallery-thumb [data-phase5-missing-message][hidden] {
    display: none !important;
}

.editor-gallery-thumb.has-local-preview {
    border-color: color-mix(in srgb, var(--color-primary) 48%, var(--color-line));
}

.editor-gallery-item.is-pending {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--color-primary) 42%, var(--color-line));
}

.editor-gallery-add-zone {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px dashed color-mix(in srgb, var(--color-primary) 38%, var(--color-line));
    border-radius: 16px;
    background: color-mix(in srgb, var(--color-primary) 4%, var(--color-surface));
    transition: border-color 160ms ease, background 160ms ease;
}

.editor-gallery-add-zone.is-dragover {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
}

.editor-gallery-add-zone > div {
    min-width: 0;
}

.editor-gallery-add-zone small,
.editor-gallery-add-zone strong,
.editor-gallery-add-zone p {
    display: block;
}

.editor-gallery-add-zone small {
    color: var(--color-primary-strong);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.editor-gallery-add-zone strong {
    margin-top: 3px;
    font-size: 13px;
}

.editor-gallery-add-zone p {
    margin: 5px 0 0;
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.5;
}

.editor-gallery-add-button {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    cursor: pointer;
}

/*
 * El selector global del panel para input[type="file"] es más específico
 * que la regla antigua de Fase 5. Por eso el input invisible recuperaba
 * width:100% y min-height:54px y, al volver del selector de archivos,
 * Chrome podía mantener el foco en un control absoluto fuera de su botón
 * y ampliar el overflow del modal. Lo anclamos al propio botón y anulamos
 * por completo las dimensiones/estilos globales del file input.
 */
.editor-panel-content .editor-gallery-add-button input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: inherit;
    opacity: 0;
    clip: auto;
    clip-path: none;
    background: transparent;
    box-shadow: none;
    white-space: normal;
    cursor: pointer;
}

.editor-panel-content .editor-gallery-add-button input[type="file"]:focus,
.editor-panel-content .editor-gallery-add-button input[type="file"]:focus-visible {
    border: 0;
    outline: none;
    box-shadow: none;
}

.editor-gallery-add-button:has(input:disabled) {
    cursor: default;
    opacity: 0.48;
    pointer-events: none;
}

.editor-gallery-readonly-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.editor-gallery-readonly-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: #000;
}

.editor-gallery-readonly-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.editor-gallery-save-progress {
    min-height: 2px;
}

@container dj-editor-main (max-width: 650px) {
    .editor-gallery-add-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-gallery-add-button {
        width: 100%;
        justify-content: center;
    }

    .editor-gallery-readonly-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Portada optimizada: imágenes Hero completas, sin recorte. */
.editor-hero-list {
    display: grid;
    gap: 14px;
}

.editor-hero-item {
    min-width: 0;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(108px, 150px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: var(--color-surface-2);
}

.editor-hero-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 0.78;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    background:
        radial-gradient(circle at 70% 20%, rgba(141, 91, 236, 0.13), transparent 34%),
        var(--color-surface);
}

.editor-hero-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center center;
    transform:
        translate3d(
            var(--hero-editor-pan-x, 0px),
            var(--hero-editor-pan-y, 0px),
            0
        )
        scale(var(--hero-editor-scale, 1));
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.editor-hero-thumb img[hidden] {
    display: none !important;
}

.editor-hero-item.is-focus-editing {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.editor-hero-item.is-focus-editing .editor-hero-thumb {
    grid-column: 1 / -1;
    width: min(100%, 360px);
    aspect-ratio: 0.78;
    justify-self: start;
    border-color: color-mix(
        in srgb,
        var(--color-primary) 58%,
        var(--color-line)
    );
    border-radius: 24px 24px 76px 24px;
    clip-path: polygon(
        0 0,
        100% 0,
        100% 84%,
        88% 100%,
        0 100%
    );
    cursor: grab;
    touch-action: none;
}

.editor-hero-item.is-focus-editing .editor-hero-thumb.is-dragging {
    cursor: grabbing;
}

.editor-hero-item.is-focus-editing .editor-hero-meta,
.editor-hero-item.is-focus-editing .editor-image-actions,
.editor-hero-item.is-focus-editing .editor-hero-focus-hint,
.editor-hero-item.is-focus-editing .editor-hero-focus-controls {
    grid-column: 1 / -1;
}

.editor-hero-focus-hint {
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.45;
}

.editor-hero-focus-controls {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.editor-hero-focus-controls[hidden],
.editor-hero-focus-hint[hidden] {
    display: none !important;
}

.editor-hero-focus-controls label {
    min-width: min(100%, 280px);
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.editor-hero-focus-controls label > span,
.editor-hero-focus-controls output {
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 750;
}

.editor-hero-focus-controls input[type="range"] {
    width: 100%;
}


.editor-hero-thumb.is-missing {
    border-style: dashed;
}

.editor-hero-thumb > span {
    padding: 12px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    text-align: center;
}

.editor-hero-meta {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.editor-hero-meta strong,
.editor-hero-meta small {
    overflow-wrap: anywhere;
}

.editor-hero-meta small {
    color: var(--color-muted);
}

.editor-hero-list-readonly {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.editor-hero-readonly-thumb {
    min-height: 190px;
}

@media (max-width: 760px) {
    .editor-hero-item {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .editor-hero-item .editor-image-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .editor-hero-list-readonly {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .editor-hero-list-readonly {
        grid-template-columns: 1fr;
    }
}


/* Fase 7 optimizada: DJ Sessions paginadas */
.editor-phase7-tools {
    grid-template-columns:
        minmax(190px, 1fr)
        minmax(160px, 0.7fr)
        minmax(150px, 0.5fr);
}

.editor-phase7-tools .editor-tour-tool-actions {
    grid-column: 1 / -1;
    min-height: 0;
    justify-content: flex-end;
}

.editor-phase7-table {
    min-width: 900px;
}

.editor-phase7-table th:first-child,
.editor-phase7-table td:first-child {
    width: 132px;
}

.editor-phase7-table-thumb {
    width: 120px;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    border: 1px solid var(--color-line);
    border-radius: 10px;
    background: var(--color-surface-2);
}

.editor-phase7-tags-text {
    max-width: 220px;
    display: -webkit-box;
    overflow: hidden;
    color: var(--color-muted);
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.editor-phase7-featured {
    width: max-content;
    margin-top: 5px !important;
    padding: 3px 7px;
    border: 1px solid color-mix(
        in srgb,
        var(--color-primary) 35%,
        var(--color-line)
    );
    border-radius: 999px;
    color: var(--color-primary-strong) !important;
    background: color-mix(
        in srgb,
        var(--color-primary) 8%,
        var(--color-surface)
    );
    font-weight: 800;
}

.editor-phase7-empty-table {
    padding: 20px 8px;
    color: var(--color-muted);
    text-align: center;
    font-size: 11px;
}

.editor-phase7-form-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.editor-phase7-admin-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: var(--color-surface-2);
}

.editor-phase7-admin-preview[hidden] {
    display: none !important;
}

.editor-phase7-admin-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.editor-phase7-form-fields {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.editor-phase7-feature-toggle {
    width: max-content;
    min-height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    color: var(--color-text);
    background: var(--color-surface);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.editor-phase7-feature-toggle input {
    width: 17px;
    height: 17px;
    accent-color: var(--color-primary);
}

.editor-phase7-tag-field {
    position: relative;
}

.editor-phase7-suggestions {
    position: absolute;
    z-index: 40;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 220px;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
}

.editor-phase7-suggestions[hidden] {
    display: none !important;
}

.editor-phase7-suggestion {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    display: block;
    border: 0;
    border-radius: 8px;
    color: var(--color-text);
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
}

.editor-phase7-suggestion:hover,
.editor-phase7-suggestion:focus-visible {
    background: var(--color-surface-2);
}

.editor-phase7-edit-form {
    scroll-margin-top: 18px;
}

@media (max-width: 980px) {
    .editor-phase7-tools {
        grid-template-columns:
            minmax(180px, 1fr)
            minmax(150px, 0.8fr);
    }
}

@media (max-width: 760px) {
    .editor-phase7-tools,
    .editor-phase7-form-layout {
        grid-template-columns: 1fr;
    }

    .editor-phase7-admin-preview {
        width: min(100%, 320px);
    }

    .editor-phase7-tools .editor-tour-tool-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}
