/**
 * IDGRUPO Creador de Frases - Canva PRO Studio Stylesheet v2.0.0
 * Experiencia WYSIWYG pura: Edición directa sobre el lienzo sin texto duplicado.
 */

:root {
    --idg-primary: #1877f2;
    --idg-primary-hover: #1464cc;
    --idg-canva-purple: #8b5cf6;
    --idg-success: #10b981;
    --idg-warning: #f59e0b;
    --idg-danger: #ef4444;
    --idg-bg: #f1f5f9;
    --idg-surface: #ffffff;
    --idg-border: #e2e8f0;
    --idg-text: #0f172a;
    --idg-text-muted: #64748b;
    --idg-radius: 12px;
    --idg-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --idg-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
    overflow-x: hidden;
}

.idg-canva-app {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    background: #ffffff;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    box-sizing: border-box;
}

#idg-tab-view-crear,
.idg-top-nav-bar-wrap,
.idg-modal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--idg-text);
}

/* Ocupar el 100% de la ventana completa incluso si el tema tiene contenedor estrecho */
@media (min-width: 768px) {
    .idg-canva-app {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        min-height: 100vh;
        background: #0f172a;
    }
}

.idg-canva-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #0f172a;
}

.idg-canva-app * {
    box-sizing: border-box;
}

/* ============================================================== */
/* 0. BARRA SUPERIOR CANVA APP (ESTILO CYAN CANVA PRO)            */
/* ============================================================== */
.idg-canva-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(135deg, #00c4cc 0%, #0284c7 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(2, 132, 199, 0.25);
    position: relative;
    z-index: 100;
    gap: 12px;
    height: 48px;
    box-sizing: border-box;
}

.idg-canva-top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.idg-desktop-nav-slot {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.idg-canva-top-bar .idg-pill-nav-container {
    background: rgba(255, 255, 255, 0.22) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: none !important;
    padding: 3px 4px !important;
    gap: 4px !important;
    border-radius: 9999px !important;
}

.idg-canva-top-bar .idg-pill-nav-btn {
    color: rgba(255, 255, 255, 0.95) !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 9999px !important;
    border: none !important;
    background: transparent !important;
}

.idg-canva-top-bar .idg-pill-nav-btn:hover:not(.idg-pill-tab-active) {
    background: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}

.idg-canva-top-bar .idg-pill-nav-btn.idg-pill-tab-active {
    background: #ffffff !important;
    color: #0284c7 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16) !important;
}

.idg-canva-top-bar .idg-pill-nav-btn.idg-pill-tab-active .idg-pill-text {
    color: #0284c7 !important;
}

.idg-canva-top-bar .idg-pill-add-btn {
    background: rgba(255, 255, 255, 0.22) !important;
    border: 1px dashed rgba(255, 255, 255, 0.6) !important;
    color: #ffffff !important;
}

.idg-canva-top-bar .idg-pill-add-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
}

.idg-canva-top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.idg-canva-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.42);
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0 !important;
    flex-shrink: 0;
}

.idg-canva-nav-btn svg {
    display: block;
    stroke: #ffffff !important;
}

.idg-canva-nav-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.38);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.idg-canva-nav-btn:not(:disabled):active {
    transform: scale(0.95);
}

.idg-canva-nav-btn:disabled {
    opacity: 0.38 !important;
    cursor: not-allowed !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

.idg-canva-action-btn {
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.idg-canva-action-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.idg-canva-download-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    background: #ffffff;
    border: none;
    color: #0284c7 !important;
    font-size: 13.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.idg-canva-download-btn svg {
    stroke: #0284c7 !important;
}

.idg-canva-download-btn:hover {
    background: #f0fdf4;
    color: #0369a1 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

/* 0.1. BARRA DE NAVEGACIÓN SUPERIOR ESTILO PÍLDORA (DASHBOARD TABS) */
.idg-top-nav-bar-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--idg-border);
}

.idg-pill-nav-container {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    padding: 4px 5px;
    border-radius: 9999px;
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.07), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    gap: 4px;
}

.idg-pill-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.idg-pill-nav-btn:hover:not(.idg-pill-tab-active) {
    background: #f1f5f9;
    color: #0f172a;
}

.idg-pill-nav-btn.idg-pill-tab-active {
    background: #0f172a;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.28);
}

.idg-pill-nav-btn .idg-pill-icon {
    font-size: 15px;
    line-height: 1;
}

.idg-pill-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 2px;
    padding: 0;
}

.idg-pill-add-btn:hover {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4f46e5;
    transform: scale(1.08);
}

.idg-pill-tab-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 5px;
}

.idg-pill-tab-delete,
.idg-pill-tab-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    color: #94a3b8;
    transition: all 0.15s ease;
    cursor: pointer;
}

.idg-pill-nav-btn:hover .idg-pill-tab-edit {
    color: #3b82f6;
}

.idg-pill-tab-edit:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

.idg-pill-nav-btn:hover .idg-pill-tab-delete {
    color: #ef4444;
}

.idg-pill-tab-delete:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

.idg-btn-quick-emoji {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.idg-btn-quick-emoji:hover {
    background: #e2e8f0;
    transform: scale(1.15);
}

.idg-main-tab-panel {
    width: 100% !important;
    max-width: 100% !important;
}

/* Aislar el contenido de shortcodes externos para que conserven exactamente su tipografía, estilos y pesos originales */
.idg-main-tab-panel:not(#idg-tab-view-crear),
.idg-main-tab-panel:not(#idg-tab-view-crear) * {
    font-family: inherit;
    line-height: inherit;
    box-sizing: border-box;
}

.idg-saved-phrases-card {
    background: #ffffff;
    padding: 16px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 320px;
    box-sizing: border-box !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ============================================================== */
/* 1. BARRA SUPERIOR CANVA (MARCAS / PÁGINAS Y EXPORTACIÓN)      */
/* ============================================================== */
.idg-canva-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--idg-border);
    flex-wrap: wrap;
    gap: 12px;
}

.idg-canva-brand-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.idg-canva-logo {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--idg-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.idg-badge-pro {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.idg-canva-pages-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.idg-page-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1.5px solid transparent;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.idg-page-pill:hover {
    background: #e2e8f0;
}

.idg-page-pill.active {
    background: #fff;
    border-color: var(--idg-primary);
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.2);
}

.idg-page-pill-add {
    background: #eef2ff !important;
    border: 1.5px dashed #6366f1 !important;
    color: #4f46e5 !important;
    cursor: pointer;
    font-weight: 700;
}

.idg-page-pill-add:hover {
    background: #e0e7ff !important;
    border-color: #4338ca !important;
    transform: translateY(-1px);
}

.idg-pill-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    margin-left: 6px;
    border: none;
    cursor: pointer;
    opacity: 0.35;
    transition: all 0.2s ease;
    padding: 0;
}

.idg-page-pill:hover .idg-pill-delete-btn {
    opacity: 0.85;
}

.idg-pill-delete-btn:hover {
    opacity: 1 !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    transform: scale(1.15);
}

.idg-pill-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: #475569;
    flex: none;
}

.idg-pill-info {
    display: flex;
    flex-direction: column;
}

.idg-pill-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--idg-text);
}

.idg-pill-meta {
    display: none; /* Simplificado para la barra superior estilo Canva */
}



/* 2. FRANJA DE PÁGINAS / MARCAS */
.idg-canva-pages-bar {
    padding: 10px 18px;
    background: #ffffff;
    border-bottom: 1px solid var(--idg-border);
}

/* ============================================================== */
/* 2. BARRA DE HERRAMIENTAS CANVA (PINNED TOOLBAR)               */
/* ============================================================== */
.idg-canva-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--idg-border);
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}

.idg-toolbar-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.idg-toolbar-divider {
    width: 1px;
    height: 22px;
    background: #cbd5e1;
    margin: 0 4px;
}

.idg-canva-select-font {
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    color: var(--idg-text);
    cursor: pointer;
    min-width: 150px;
}

.idg-font-size-stepper {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
}

.idg-stepper-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #334155;
    transition: background 0.15s;
}

.idg-stepper-btn:hover {
    background: #f1f5f9;
}

.idg-stepper-input {
    width: 36px;
    border: none;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--idg-text);
    padding: 0;
    -moz-appearance: textfield;
}

.idg-stepper-input::-webkit-outer-spin-button,
.idg-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.idg-canva-tool-btn {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.idg-canva-tool-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.idg-canva-tool-btn.active {
    background: #e0e7ff;
    border-color: #6366f1;
    color: #4338ca;
}

/* Icono A de Color de Texto */
.idg-color-tool-icon {
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
}

.idg-color-tool-bar {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    display: block;
    margin-top: 1px;
}

.idg-canva-bg-color-picker {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.idg-canva-select-small {
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #fff;
    cursor: pointer;
}

.idg-accent-btn {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

/* ============================================================== */
/* 3. ESCENARIO DE TRABAJO (CANVA WORKSPACE)                       */
/* ============================================================== */
.idg-canva-workspace {
    background: #0f172a; /* Fondo oscuro estilo Canva para resaltar el póster */
    padding: 20px 20px 36px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center; /* Se coloca directamente debajo de la barra sin espacio muerto */
    gap: 14px;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    overflow: auto;
}

/* EL PÓSTER REAL EN PANTALLA */
.idg-poster-artboard {
    position: relative;
    border-radius: 12px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    user-select: text;
    transition: width 0.2s ease, height 0.2s ease;
}

.idg-poster-artboard.format-4-5 {
    width: 620px;
    height: 775px; /* Ratio 4:5 exacto */
}

.idg-poster-artboard.format-1-1 {
    width: 660px;
    height: 660px; /* Ratio 1:1 exacto */
}

@media (min-width: 1400px) {
    .idg-poster-artboard.format-4-5 {
        width: 660px;
        height: 825px;
    }
    .idg-poster-artboard.format-1-1 {
        width: 710px;
        height: 710px;
    }
}

/* CAPA DE FONDO (Gradiente y Viñeta) */
.idg-poster-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    transition: background 0.2s ease;
}

/* CONTENEDOR DE ENCUADRE Y CENTRADO VERTICAL ESTILO CANVA */
.idg-text-box-wrapper {
    position: absolute;
    top: 8%;
    left: 8%;
    right: 8%;
    bottom: 16%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrado vertical estilo Canva */
    pointer-events: auto; /* Permite hacer clic en cualquier parte del recuadro */
    cursor: text;
    overflow: hidden; /* Garantiza que jamás el texto desborde las líneas del marco */
}

/* CAJA DE TEXTO EDITABLE DIRECTAMENTE (WYSIWYG) */
.idg-editable-text-box {
    display: block !important; /* CRUCIAL: FLUJO INLINE NATURAL SIN SALTO DE FILA */
    width: 100%;
    min-height: 120px; /* EVITA QUE LA CAJA COLAPSE A 0PX AL BORRAR TODO */
    outline: none;
    border: none;
    color: #ffffff;
    cursor: text;
    pointer-events: auto;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.25 !important; /* INTERLINEADO COMPACTO Y ELEGANTE ESTILO CANVA */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    transition: none;
}

/* Placeholder visual cuando se borra todo el texto para ver dónde escribir */
.idg-editable-text-box:empty::before,
.idg-editable-text-box[data-empty="true"]::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    opacity: 0.65;
    pointer-events: none;
    display: inline-block;
    cursor: text;
}

/* TODOS LOS ELEMENTOS HIJOS HEREDAN EL TAMAÑO DE FUENTE INMEDIATAMENTE */
.idg-editable-text-box * {
    font-size: inherit !important;
}

/* Formato a nivel de caja completa */
.idg-editable-text-box.is-box-bold {
    font-weight: 700 !important;
}

.idg-editable-text-box.is-box-italic {
    font-style: italic !important;
}

.idg-editable-text-box.is-box-underline {
    text-decoration: underline !important;
}

.idg-editable-text-box.align-center {
    text-align: center !important;
}

.idg-editable-text-box.align-left {
    text-align: left !important;
}

/* PREVENIR QUE NEGRITA SE VUELVA COLOR NEGRO Y PREVENIR SALTOS DE LÍNEA */
.idg-editable-text-box b,
.idg-editable-text-box strong {
    font-weight: 700 !important;
    display: inline !important;
    color: inherit !important; /* MANTIENE EL COLOR ORIGINAL, NUNCA SE VUELVE NEGRO */
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

.idg-editable-text-box em,
.idg-editable-text-box i,
.idg-editable-text-box u {
    display: inline !important;
    line-height: inherit !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

.idg-editable-text-box span {
    display: inline !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

.idg-editable-text-box font {
    display: inline !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* PÁRRAFOS Y BLOQUES: ELIMINAR CUALQUIER MARGEN BRUTO IMPUESTO POR TEMAS DE WORDPRESS */
.idg-editable-text-box p,
.idg-editable-text-box div {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    line-height: inherit !important;
    text-align: inherit !important;
}

/* Si hay un párrafo o div vacío (salto de línea), separación limpia y armónica */
.idg-editable-text-box div:empty,
.idg-editable-text-box p:empty {
    height: 0.6em !important;
    min-height: 0.6em !important;
}

/* Bounding Box Canva (recuadro violeta interactivo) */
.idg-canva-selection-border {
    position: absolute;
    top: 7%;
    left: 7%;
    right: 7%;
    bottom: 15%;
    border: 2px solid var(--idg-canva-purple);
    border-radius: 4px;
    pointer-events: none;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.idg-poster-artboard:hover .idg-canva-selection-border,
.idg-text-box-wrapper:focus-within ~ .idg-canva-selection-border,
.idg-editable-text-box:focus ~ .idg-canva-selection-border,
.idg-editable-text-box.is-box-active ~ .idg-canva-selection-border {
    opacity: 1;
}

.idg-canva-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border: 2px solid var(--idg-canva-purple);
    border-radius: 50%;
}

.handle-nw { top: -4px; left: -4px; }
.handle-ne { top: -4px; right: -4px; }
.handle-sw { bottom: -4px; left: -4px; }
.handle-se { bottom: -4px; right: -4px; }

.idg-canva-box-toolbar {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1b4b;
    color: #c7d2fe;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.idg-canva-box-toolbar:hover {
    background: #312e81;
    color: #ffffff;
}

/* ============================================================== */
/* MENÚ FLOTANTE CONTEXTUAL TIPO CANVA (SELECCIÓN DE TEXTO)       */
/* ============================================================== */
.idg-floating-canva-bar {
    position: fixed;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 3px 6px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.18), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
    z-index: 999999;
    user-select: none;
    -webkit-user-select: none;
    animation: idgFloatPop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes idgFloatPop {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.idg-float-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 5px 10px;
    min-width: 36px;
    height: 36px;
    border-radius: 20px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.idg-float-btn:hover {
    background: #f1f5f9;
    color: #4f46e5;
}

.idg-float-btn:active,
.idg-float-btn.active {
    background: #e0e7ff;
    color: #4338ca;
}

.idg-float-divider {
    width: 1px;
    height: 18px;
    background: #e2e8f0;
    margin: 0 3px;
}

.idg-float-color-a {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.idg-float-color-bar {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    margin-top: 2px;
}

/* PIE DE PÓSTER */
.idg-poster-footer {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    pointer-events: auto;
}

.idg-poster-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.idg-footer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #cbd5e1;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.idg-footer-text-wrap {
    display: flex;
    flex-direction: column;
}

.idg-footer-name {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.idg-footer-handle {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ==============================================================
   ESTILO CITA / TWEET VIRAL (Cabecera superior, fondo blanco)
   ============================================================== */
.idg-poster-artboard.layout-tweet {
    background-color: #ffffff !important;
}

.idg-poster-artboard.layout-tweet .idg-poster-bg-layer {
    background: #ffffff !important;
}

/* Cabecera de Marca Tweet */
.idg-poster-header-brand {
    display: none; /* Oculto en layout clásico */
}

.idg-poster-artboard.layout-tweet .idg-poster-header-brand {
    display: flex;
    position: relative;
    width: 100%;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px; /* Separación fija y elegante con el texto */
    z-index: 10;
    pointer-events: auto;
    flex-shrink: 0;
}

.idg-header-avatar-wrap {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.idg-header-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #f1f5f9;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.idg-header-avatar-wrap:hover .idg-header-avatar {
    border-color: var(--idg-canva-purple);
    transform: scale(1.03);
}

.idg-header-avatar-edit-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.idg-header-avatar-wrap:hover .idg-header-avatar-edit-badge {
    opacity: 1;
}

.idg-header-text-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.25;
    position: relative;
    z-index: 25;
}

.idg-header-name {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    outline: none;
    border-radius: 4px;
    padding: 1px 4px;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 30;
    min-width: 30px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.idg-header-name:focus {
    background: rgba(226, 232, 240, 0.7);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.idg-header-name:hover {
    background: rgba(226, 232, 240, 0.5);
}

.idg-header-name:empty:before {
    content: "Nombre de página";
    color: #94a3b8;
    pointer-events: none;
}

.idg-header-handle {
    font-size: 14px;
    font-weight: 400;
    color: #64748b;
    outline: none;
    border-radius: 4px;
    padding: 1px 4px;
    margin-top: 2px;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 30;
    min-width: 30px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.idg-header-handle:focus {
    background: rgba(226, 232, 240, 0.7);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.idg-header-handle:hover {
    background: rgba(226, 232, 240, 0.5);
}

.idg-header-handle:empty:before {
    content: "@usuario";
    color: #94a3b8;
    pointer-events: none;
}

/* Alineaciones verticales para la caja de texto */
.idg-text-box-wrapper,
.idg-text-box-wrapper.valign-middle {
    justify-content: center !important;
    padding-top: 0 !important;
}

.idg-text-box-wrapper.valign-top {
    justify-content: flex-start !important;
    padding-top: 30px !important;
}

/* En modo Tweet, el wrapper contiene cabecera y texto centrados verticalmente juntos */
.idg-poster-artboard.layout-tweet .idg-text-box-wrapper {
    top: 36px;
    left: 42px;
    right: 42px;
    bottom: 36px;
    justify-content: center !important; /* Centrado automático arriba y abajo de todo el conjunto */
    padding-top: 0 !important;
    pointer-events: auto;
    cursor: text;
    overflow: hidden !important;
}

.idg-poster-artboard.layout-tweet .idg-text-box-wrapper.valign-top {
    justify-content: flex-start !important;
    padding-top: 15px !important;
}

/* En modo Tweet, el texto es negro/oscuro elegante y sin sombra */
.idg-poster-artboard.layout-tweet .idg-editable-text-box {
    color: #0f172a !important;
    text-shadow: none !important;
}

/* En modo Tweet, ocultar el footer inferior */
.idg-poster-artboard.layout-tweet .idg-poster-footer {
    display: none !important;
}

/* Bounding box en modo Tweet */
.idg-poster-artboard.layout-tweet .idg-canva-selection-border {
    top: 28px;
    left: 34px;
    right: 34px;
    bottom: 28px;
}

.idg-footer-action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.15s ease;
}

.idg-footer-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================================== */
/* BOTONES DE EXPORTACIÓN Y ACCIÓN                                */
/* ============================================================== */
.idg-btn-primary {
    background: var(--idg-primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, transform 0.1s;
}

.idg-btn-primary:hover {
    background: var(--idg-primary-hover);
    transform: translateY(-1px);
}

.idg-btn-secondary {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.idg-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.idg-btn-clear {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.idg-btn-clear:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.idg-btn-tool-clear:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}

/* Toast flotante discreto de confirmación */
.idg-editor-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
    z-index: 999999;
    display: none;
    pointer-events: none;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================================================== */
/* POPOVER COLOR DEL TEXTO ESTILO CANVA                           */
/* ============================================================== */
.idg-color-dropdown-wrap {
    position: relative;
}

.idg-color-popover-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid var(--idg-border);
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.08);
    width: 290px;
    padding: 16px;
}

.idg-color-popover-menu.active {
    display: block;
}

.idg-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--idg-border);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    color: var(--idg-text);
    letter-spacing: 0.5px;
}

.idg-popover-close-x {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

.idg-eyedropper-btn {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: background 0.15s;
}

.idg-eyedropper-btn:hover {
    background: #e2e8f0;
}

.idg-popover-section {
    margin-bottom: 12px;
}

.idg-popover-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.idg-swatches-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.idg-text-swatch-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.idg-text-swatch-item:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--idg-canva-purple);
}

.idg-popover-custom-wrap {
    padding-top: 10px;
    border-top: 1px solid var(--idg-border);
}

/* POPOVER EMOJIS ESTILO CANVA (VENTANA FLOTANTE LATERAL QUE NO TAPA EL PÓSTER) */
.idg-emoji-dropdown-wrap {
    position: relative;
}

.idg-emoji-popover-menu {
    display: none;
    position: fixed;
    top: 150px;
    right: 28px;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid var(--idg-border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.08);
    width: 340px;
    padding: 14px;
    user-select: none;
}

.idg-emoji-popover-menu.active {
    display: block;
}

.idg-emoji-categories-wrap {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Scrollbar fina elegante para emojis */
.idg-emoji-categories-wrap::-webkit-scrollbar {
    width: 5px;
}
.idg-emoji-categories-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.idg-emoji-section-title {
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    margin: 12px 0 6px 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.idg-emoji-section-title:first-child {
    margin-top: 0;
}

.idg-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.idg-emoji-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
    padding: 0;
}

.idg-emoji-item:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    transform: scale(1.25);
}

.idg-emoji-popover-hint {
    font-size: 11px;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    line-height: 1.4;
}

.idg-emoji-popover-hint kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: inherit;
    font-weight: bold;
    color: #1e293b;
}

/* ============================================================== */
/* MODAL: SUBIR FUENTES                                           */
/* ============================================================== */
.idg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.idg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.idg-modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 680px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: var(--idg-shadow-lg);
}

.idg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--idg-border);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.idg-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.idg-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

/* Pestañas del Modal de Fuentes */
.idg-font-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--idg-border);
    margin-bottom: 18px;
}

.idg-font-tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--idg-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
}

.idg-font-tab-btn:hover {
    color: var(--idg-primary);
}

.idg-font-tab-btn.active {
    color: var(--idg-primary);
    border-bottom-color: var(--idg-primary);
}

.idg-font-tab-content {
    display: none;
}

.idg-font-tab-content.active {
    display: block;
}

/* Dropzone para archivos y carpetas */
.idg-font-dropzone {
    border: 2px dashed #93c5fd;
    background: #f8fafc;
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.idg-font-dropzone.dragover {
    border-color: var(--idg-primary);
    background: #eff6ff;
    transform: scale(1.01);
}

.idg-dropzone-icon {
    font-size: 38px;
    margin-bottom: 10px;
}

.idg-dropzone-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.idg-dropzone-sub {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 18px;
}

.idg-dropzone-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.idg-btn-file-label {
    cursor: pointer;
    margin: 0;
}

/* Barra de progreso */
.idg-font-progress-wrap {
    margin-top: 18px;
    background: #f8fafc;
    border: 1px solid var(--idg-border);
    border-radius: 10px;
    padding: 14px;
}

.idg-progress-bar-bg {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.idg-progress-bar-fill {
    background: linear-gradient(90deg, #10b981, #059669);
    height: 100%;
    transition: width 0.25s ease;
}

.idg-font-upload-log {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
    max-height: 80px;
    overflow-y: auto;
}

/* Tab de Gestión y Eliminación Múltiple */
.idg-font-manage-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--idg-border);
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.idg-font-select-all-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.idg-btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.idg-btn-danger:hover:not(:disabled) {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.idg-btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.idg-custom-fonts-list {
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.idg-font-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: background 0.15s ease, border-color 0.15s ease;
    gap: 12px;
}

.idg-font-card-item:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.idg-font-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.idg-font-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.idg-font-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.idg-font-card-preview {
    font-size: 18px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.idg-font-badge-ext {
    font-size: 10px;
    font-weight: 800;
    background: #e0e7ff;
    color: #3730a3;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.idg-btn-font-del-single {
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.idg-btn-font-del-single:hover {
    color: #ef4444;
    background: #fee2e2;
}

.idg-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.idg-text-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--idg-border);
    border-radius: 8px;
    font-size: 13px;
}

/* ============================================================== */
/* OVERLAY EXTRACTOR DE TEXTO OCR (INTELIGENCIA ARTIFICIAL)       */
/* ============================================================== */
.idg-ocr-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    padding: 24px;
    color: #ffffff;
    text-align: center;
    box-sizing: border-box;
}

.idg-ocr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 290px;
}

.idg-ocr-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: idg-ocr-spin 0.8s linear infinite;
}

@keyframes idg-ocr-spin {
    to { transform: rotate(360deg); }
}

.idg-ocr-status-text {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.idg-ocr-progress-bar {
    width: 220px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.idg-ocr-progress-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border-radius: 10px;
    transition: width 0.2s ease;
}

.idg-ocr-tip {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

/* ============================================================== */
/* VERSIÓN MÓVIL TOTALMENTE OPTIMIZADA (CANVA PRO MOBILE)         */
/* ============================================================== */
@media (max-width: 768px) {
    /* 1. ESTRUCTURA Y ORDEN: LA HOJA APARECE PRIMERO */
    .idg-canva-app {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: clip !important;
    }

    /* BARRA SUPERIOR CANVA FIJA EN MÓVIL EN TODO MOMENTO (AL SUBIR O BAJAR) */
    .idg-canva-top-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 48px !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
        z-index: 2147483647 !important;
        background: linear-gradient(135deg, #00c4cc 0%, #0284c7 100%) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28) !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin: 0 !important;
        transform: none !important;
    }

    .entry-content,
    .site-content,
    .content-area,
    #idg-frases-app-root,
    #idg-tab-view-crear {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .idg-desktop-nav-slot,
    .idg-top-nav-bar-wrap,
    .idg-mobile-nav-wrap,
    #idg-mobile-nav-slot,
    #idg-pill-nav-container {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        overflow: hidden !important;
    }

    .idg-canva-pages-pills {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        gap: 6px !important;
        padding: 4px 0 !important;
    }

    .idg-page-pill {
        flex-shrink: 0 !important;
        padding: 5px 10px !important;
        font-size: 11px !important;
    }

    .idg-pill-avatar {
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
    }

    .idg-pill-name {
        font-size: 11px !important;
    }

    .idg-canva-top-bar-left {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .idg-canva-top-bar-right {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .idg-canva-top-bar .idg-canva-nav-btn {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.35) !important;
        color: #ffffff !important;
    }

    .idg-canva-top-bar .idg-canva-nav-btn svg {
        stroke: #ffffff !important;
    }

    .idg-canva-top-bar .idg-canva-action-btn {
        height: 36px !important;
        padding: 0 8px !important;
        font-size: 12px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: 1px solid rgba(255, 255, 255, 0.35) !important;
        color: #ffffff !important;
    }

    .idg-canva-top-bar .idg-canva-download-btn {
        height: 36px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
        background: #ffffff !important;
        color: #0284c7 !important;
        border: none !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }

    .idg-canva-top-bar .idg-canva-download-btn svg {
        stroke: #0284c7 !important;
    }

    .idg-desktop-only {
        display: none !important;
    }

    /* FRANJA DE PÁGINAS COMPACTA DIRECTA BAJO LA BARRA CANVA FIJA (SIN ESPACIO MUERTO) */
    .idg-canva-pages-bar {
        padding: 6px 10px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #e2e8f0 !important;
        margin: 0 !important;
    }

    /* 2. LA HOJA PRIMERO: ESCENARIO VISIBLE Y ENFOCADO */
    .idg-canva-workspace {
        order: 2 !important;
        padding: 14px 10px !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 10px !important;
        background: #0f172a !important;
    }

    .idg-poster-artboard {
        width: calc(100vw - 24px) !important;
        max-width: 350px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
        border-radius: 10px !important;
    }

    .idg-poster-artboard.format-4-5 {
        height: auto !important;
        aspect-ratio: 4 / 5 !important;
    }

    .idg-poster-artboard.format-1-1 {
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }

    /* Adaptación de la cabecera del Tweet para pantallas móviles */
    .idg-poster-artboard.layout-tweet .idg-poster-header-brand {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    .idg-header-avatar {
        width: 44px !important;
        height: 44px !important;
    }

    .idg-header-name {
        font-size: 15px !important;
        cursor: text !important;
        pointer-events: auto !important;
        user-select: text !important;
        -webkit-user-select: text !important;
    }

    .idg-header-handle {
        font-size: 12px !important;
        cursor: text !important;
        pointer-events: auto !important;
        user-select: text !important;
        -webkit-user-select: text !important;
    }

    .idg-poster-artboard.layout-tweet .idg-text-box-wrapper {
        top: 18px !important;
        left: 18px !important;
        right: 18px !important;
        bottom: 18px !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .idg-poster-artboard.layout-tweet .idg-canva-selection-border {
        top: 12px !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
    }

    /* 3. OCULTAR BARRA DE HERRAMIENTAS SECUNDARIA EN MÓVIL (Petición usuario) */
    .idg-canva-toolbar {
        display: none !important;
    }

    .idg-floating-canva-bar {
        padding: 4px 6px !important;
        box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.28) !important;
    }

    .idg-float-btn {
        min-width: 38px !important;
        height: 38px !important;
        font-size: 15px !important;
        padding: 6px 11px !important;
    }

    /* 4. POPOVER EMOJIS: MODAL CENTRADO EN MÓVIL, NUNCA TAPADO POR TECLADO */
    .idg-emoji-popover-menu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        bottom: auto !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 92% !important;
        max-width: 360px !important;
        border-radius: 20px !important;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 0 1000px rgba(0, 0, 0, 0.45) !important;
        z-index: 9999999 !important;
        max-height: 72vh !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }

    .idg-emoji-popover-menu.active {
        display: block !important;
    }

    /* Ocultar el badge estático que sobresalía en la parte superior en móvil */
    .idg-canva-box-toolbar {
        display: none !important;
    }

    .idg-emoji-categories-wrap {
        max-height: 46vh !important;
    }

    .idg-emoji-item {
        width: 34px !important;
        height: 34px !important;
        font-size: 20px !important;
    }

    /* 5. POPOVER COLOR: BOTTOM SHEET MODERNO EN MÓVIL */
    .idg-color-popover-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.45) !important;
        z-index: 999999 !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }

    /* 6. MODALES EN MÓVIL */
    .idg-modal-box {
        width: 95% !important;
        max-width: 95% !important;
        padding: 16px !important;
    }

    /* Ajustes compactos para que el botón 🖼️ Imagen quepa en barra móvil sin desbordar */
    .idg-canva-top-bar .idg-img-btn-label {
        display: none !important;
    }

    .idg-canva-top-bar .idg-btn-insert-img {
        min-width: 34px !important;
        padding: 0 7px !important;
        justify-content: center !important;
    }

    .idg-image-controls-bar {
        width: calc(100vw - 24px) !important;
        max-width: 350px !important;
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .idg-img-ctrl-divider {
        display: none !important;
    }
}

/* ============================================================== */
/* IMAGEN / ILUSTRACIÓN INSERTADA DEBAJO DE LA FRASE              */
/* ============================================================== */
.idg-poster-artboard.has-poster-image .idg-editable-text-box {
    min-height: 32px !important;
}

.idg-poster-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 22px;
    flex-shrink: 0;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.idg-poster-image-frame {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    line-height: 0;
}

.idg-poster-image-el {
    display: block;
    object-fit: contain;
    max-width: 100%;
    border-radius: 10px;
    transition: border-radius 0.15s ease, width 0.1s ease, height 0.1s ease;
    pointer-events: auto;
    cursor: pointer;
}

.idg-poster-image-el.blend-multiply {
    mix-blend-mode: multiply;
}

.idg-poster-img-quick-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #ef4444;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
    z-index: 25;
    padding: 0;
}

.idg-poster-image-frame:hover .idg-poster-img-quick-remove,
.idg-poster-img-quick-remove:focus {
    opacity: 1;
    transform: scale(1);
}

.idg-poster-img-quick-remove:hover {
    background: #dc2626;
    transform: scale(1.08);
}

@media (hover: none) {
    .idg-poster-img-quick-remove {
        opacity: 0.92;
        transform: scale(1);
    }
}

/* BARRA DE CONTROLES DE LA IMAGEN INSERTADA (ESTILO CANVA DARK PILL) */
.idg-image-controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    color: #f8fafc;
    max-width: 680px;
    box-sizing: border-box;
}

.idg-img-ctrl-group {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.idg-img-ctrl-label {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
    margin: 0;
}

.idg-img-ctrl-range {
    width: 96px;
    accent-color: #38bdf8;
    cursor: pointer;
    margin: 0;
}

.idg-img-ctrl-range-sm {
    width: 72px;
}

.idg-img-ctrl-value {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    min-width: 34px;
    text-align: right;
    font-family: monospace;
}

.idg-img-ctrl-divider {
    width: 1px;
    height: 22px;
    background: rgba(148, 163, 184, 0.25);
}

.idg-img-ctrl-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f1f5f9;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.idg-img-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
}

.idg-img-ctrl-btn.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28);
}

.idg-img-ctrl-danger {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.idg-img-ctrl-danger:hover {
    background: #dc2626;
    border-color: #ef4444;
    color: #ffffff;
}

/* MODAL DE DECISIÓN AL PEGAR IMAGEN (CTRL+V) */
.idg-paste-choice-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 12px;
}

.idg-paste-preview-wrap {
    width: 100%;
    max-height: 180px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.idg-paste-preview-wrap img {
    max-width: 100%;
    max-height: 158px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.idg-paste-choice-subtitle {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    text-align: center;
}

.idg-paste-choice-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.idg-paste-choice-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
    box-sizing: border-box;
}

.idg-paste-choice-btn:hover {
    transform: translateY(-1px);
}

.idg-choice-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.idg-choice-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.idg-choice-texts strong {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.idg-choice-texts small {
    font-size: 12px;
    opacity: 0.88;
    line-height: 1.25;
}

.idg-paste-choice-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #4f46e5 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.idg-paste-choice-primary:hover {
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.42);
}

.idg-paste-choice-secondary {
    background: #f8fafc;
    color: #0f172a;
    border: 1.5px solid #cbd5e1;
}

.idg-paste-choice-secondary:hover {
    background: #eef2ff;
    border-color: #818cf8;
}
