/* ============================================================================
   Widget Style Editor
   Page-specific styles for /settings/channels/web/style. Uses CSS variables
   from neon-theme.css; do not introduce hardcoded colors here.
   ============================================================================ */

.widget-style-editor__back {
    align-self: flex-start;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Desktop: titulo a la izquierda, botones a la derecha en una fila.
   Mobile (<600px): stack vertical — titulo arriba, botones abajo full width. */
.widget-style-editor__header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.widget-style-editor__header-title {
    flex: 1 1 240px;
    min-width: 0;
}

.widget-style-editor__title {
    font-weight: 700;
    word-wrap: break-word;
}

.widget-style-editor__subtitle {
    color: var(--text-tertiary);
}

.widget-style-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.widget-style-editor__action-btn {
    height: 42px;
    font-weight: 600;
}

.widget-style-editor__divider {
    border-color: var(--neon-border);
}

@media (max-width: 600px) {
    .widget-style-editor__header {
        flex-direction: column;
        align-items: stretch;
    }

    .widget-style-editor__header-title {
        flex: 1 1 auto;
    }

    .widget-style-editor__actions {
        width: 100%;
        flex-direction: column;
    }

    .widget-style-editor__action-btn {
        width: 100%;
        justify-content: center;
    }
}

.widget-style-editor__section {
    margin-bottom: 1.5rem;
}

.widget-style-editor__section-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.widget-style-editor__section-help {
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.widget-style-editor__template-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.widget-style-editor__history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    gap: 12px;
    border-bottom: 1px solid var(--border-medium);
    line-height: 1.2;
}

.widget-style-editor__history-row:last-child {
    border-bottom: none;
}

.widget-style-editor__history-meta {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.widget-style-editor__history-version {
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.widget-style-editor__history-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Boton "Restaurar" del historial — compacto, sin padding extra. */
.widget-style-editor__history-btn {
    flex-shrink: 0;
    min-width: 0;
}

.widget-style-editor__expert-toggle-card {
    background: var(--surface-hover);
    border: 1px dashed var(--border-medium);
    margin-bottom: 1rem;
}

/* Monaco wrapper — height is dynamic and lives on the element style attr;
   everything else is owned by these classes. */
.brain-monaco-editor {
    width: 100%;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    overflow: hidden;
}

/* Preview iframe inside the MudDialog. */
.widget-preview-iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 6px;
    background: var(--surface-hover);
}

.widget-preview-dialog__hint {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
