/* ==============================================================
           PALETA OFICIAL INSTITUCIONAL - EJÉRCITO ECUATORIANO
           - Rojo (primario):    #CF0A2C (Pantone 186 C)
           - Gris (primario):    #84898F (Pantone 430 C)
           - Azul (secundario):  #0068AD (Pantone 300 C)
           - Verde (secundario): #42783C (Pantone 364 C)
           ============================================================== */

        :root {
            color-scheme: light;
            /* Paleta Oficial */
            --ee-rojo: #CF0A2C;
            --ee-rojo-hover: #b00824;
            --ee-rojo-light: #fef2f4;
            --ee-rojo-border: #f8c9d1;

            --ee-gris: #84898F;
            --ee-gris-dark: #5c6268;
            --ee-gris-light: #f1f3f5;
            --ee-gris-border: #d2d5d8;

            --ee-azul: #0068AD;
            --ee-azul-hover: #00528a;
            --ee-azul-light: #eff6fc;
            --ee-azul-border: #bee0f7;

            --ee-verde: #42783C;
            --ee-verde-hover: #34602f;
            --ee-verde-light: #f0f7ef;
            --ee-verde-border: #c8e3c6;

            /* Superficies Modo Día (Blanco predominante) */
            --bg: #f8fafc;
            --card: #ffffff;
            --card-subtle: #f8fafc;
            --card-border: #e2e8f0;
            --card-border-hover: #cbd5e1;

            --text: #0f172a;
            --text-secondary: #334155;
            --muted: #64748b;
            --border: #e2e8f0;
            --border-hover: #cbd5e1;

            /* Resaltado de sintaxis HTML Día */
            --syn-tag: #0068AD;
            --syn-tagname: #CF0A2C;
            --syn-hashtag: #CF0A2C;
            --syn-bracket: #84898F;
            --syn-attr: #42783C;

            --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
            --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.06), 0 4px 8px -2px rgba(15, 23, 42, 0.02);
            --radius-lg: 14px;
            --radius-md: 8px;
            --radius-sm: 6px;
        }

        :root[data-theme="dark"] {
            color-scheme: dark;
            /* Paleta Oficial en Modo Noche */
            --ee-rojo: #e3183b;
            --ee-rojo-hover: #cf0a2c;
            --ee-rojo-light: rgba(207, 10, 44, 0.16);
            --ee-rojo-border: rgba(207, 10, 44, 0.35);

            --ee-gris: #84898F;
            --ee-gris-dark: #9ea3a9;
            --ee-gris-light: rgba(132, 137, 143, 0.14);
            --ee-gris-border: rgba(132, 137, 143, 0.3);

            --ee-azul: #218ed6;
            --ee-azul-hover: #0068AD;
            --ee-azul-light: rgba(0, 104, 173, 0.18);
            --ee-azul-border: rgba(33, 142, 214, 0.35);

            --ee-verde: #52964b;
            --ee-verde-hover: #42783C;
            --ee-verde-light: rgba(66, 120, 60, 0.2);
            --ee-verde-border: rgba(82, 150, 75, 0.35);

            /* Superficies Modo Noche (Gris Táctico Militar Grafito) */
            --bg: #0e1217;
            --card: #161b22;
            --card-subtle: #1c232c;
            --card-border: #26303d;
            --card-border-hover: #3d4c5f;

            --text: #f8fafc;
            --text-secondary: #cbd5e1;
            --muted: #84898F;
            --border: #26303d;
            --border-hover: #3d4c5f;

            /* Resaltado de sintaxis HTML Noche */
            --syn-tag: #53b4f5;
            --syn-tagname: #ff4767;
            --syn-hashtag: #ff4767;
            --syn-bracket: #84898F;
            --syn-attr: #74c96c;

            --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
            --shadow-md: 0 14px 32px -8px rgba(0, 0, 0, 0.6);
        }

        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg);
            color: var(--text);
            margin: 0;
            padding: 16px 20px 40px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: background-color 0.25s ease, color 0.25s ease;
        }

        /* --- BARRA SUPERIOR INSTITUCIONAL (COMUNICACIÓN SOCIAL) --- */
        .app-header {
            width: 100%;
            max-width: 1260px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.25rem;
            flex-wrap: wrap;
            gap: 12px;
            padding: 6px 0 14px;
            border-bottom: 1px solid var(--border);
        }

        .app-brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .brand-badge {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--card);
            border: 1px solid var(--border);
            padding: 6px 14px;
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-sm);
        }

        .tricolor-stripe {
            display: flex;
            flex-direction: column;
            width: 5px;
            height: 30px;
            border-radius: 3px;
            overflow: hidden;
            flex-shrink: 0;
        }

        .stripe-red {
            background: var(--ee-rojo);
            height: 40%;
        }

        .stripe-blue {
            background: var(--ee-azul);
            height: 30%;
        }

        .stripe-green {
            background: var(--ee-verde);
            height: 30%;
        }

        .brand-info {
            display: flex;
            flex-direction: column;
        }

        .brand-subtext {
            font-size: 0.68rem;
            font-weight: 800;
            color: var(--ee-rojo);
            text-transform: uppercase;
            letter-spacing: 0.14em;
            line-height: 1.2;
        }

        .brand-title {
            font-size: 1.25rem;
            font-weight: 800;
            color: var(--text);
            margin: 0;
            letter-spacing: -0.02em;
            line-height: 1.15;
        }

        .header-controls {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        /* Selector de herramientas en 3 pestañas */
        .nav-tabs {
            display: inline-flex;
            background: var(--card);
            border: 1px solid var(--border);
            padding: 4px;
            border-radius: var(--radius-md);
            box-shadow: var(--shadow-sm);
            gap: 2px;
        }

        .tab-btn {
            border: none;
            background: transparent;
            color: var(--muted);
            font-family: inherit;
            font-size: 0.81rem;
            font-weight: 700;
            padding: 7px 14px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .tab-btn:hover {
            color: var(--text);
        }

        .tab-btn.is-active {
            background: var(--ee-azul);
            color: white;
            box-shadow: 0 2px 8px rgba(0, 104, 173, 0.3);
        }

        .tab-btn.tab-joomla.is-active {
            background: var(--ee-rojo);
            color: white;
            box-shadow: 0 2px 8px rgba(207, 10, 44, 0.3);
        }

        .tab-btn.tab-bold.is-active {
            background: var(--ee-verde);
            color: white;
            box-shadow: 0 2px 8px rgba(66, 120, 60, 0.3);
        }

        .tab-btn.tab-video.is-active {
            background: linear-gradient(135deg, #D84315, #BF360C);
            color: white;
            box-shadow: 0 2px 8px rgba(216, 67, 21, 0.35);
        }

        .tab-btn.tab-download.is-active {
            background: linear-gradient(135deg, #7c3aed, #5b21b6);
            color: white;
            box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
        }

        /* --- BOTÓN SELECTOR DE TEMA DÍA / NOCHE / OLED CON MÁXIMO CONTRASTE --- */
        .theme-toggle {
            width: 38px;
            height: 38px;
            border-radius: var(--radius-md);
            border: 1.5px solid var(--border);
            background: var(--card);
            color: #0f172a;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-sm);
            transition: all 0.2s ease;
        }

        .theme-toggle svg, .theme-toggle #themeIcon {
            width: 18px;
            height: 18px;
            color: #0f172a !important;
            stroke: #0f172a !important;
            fill: none;
            stroke-width: 2.2;
            transition: stroke 0.2s ease, transform 0.2s ease;
        }

        .theme-toggle:hover {
            border-color: var(--ee-rojo);
            color: var(--ee-rojo);
            transform: scale(1.05);
        }

        .theme-toggle:hover svg, .theme-toggle:hover #themeIcon {
            color: var(--ee-rojo) !important;
            stroke: var(--ee-rojo) !important;
        }

        /* Modo Día Claro explícito */
        [data-theme="light"] .theme-toggle {
            background: #ffffff !important;
            border-color: #cbd5e1 !important;
            color: #0f172a !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }
        [data-theme="light"] .theme-toggle svg,
        [data-theme="light"] .theme-toggle #themeIcon {
            color: #0f172a !important;
            stroke: #0f172a !important;
        }

        /* Modo Noche Táctico */
        [data-theme="dark"] .theme-toggle {
            background: #1c232c !important;
            border-color: #3d4c5f !important;
            color: #f59e0b !important;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        }
        [data-theme="dark"] .theme-toggle svg,
        [data-theme="dark"] .theme-toggle #themeIcon {
            color: #f59e0b !important;
            stroke: #f59e0b !important;
        }

        /* Modo Negro OLED Militar */
        [data-theme="oled"] .theme-toggle {
            background: #000000 !important;
            border-color: #334155 !important;
            color: #38bdf8 !important;
            box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
        }
        [data-theme="oled"] .theme-toggle svg,
        [data-theme="oled"] .theme-toggle #themeIcon {
            color: #38bdf8 !important;
            stroke: #38bdf8 !important;
        }

        /* --- WRAPPER DE LA HERRAMIENTA PRINCIPAL (1260px) --- */
        .tools-wrapper {
            width: 100%;
            max-width: 1260px;
        }

        .tool-card {
            background: var(--card);
            padding: 1.5rem 1.75rem 1.75rem;
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            width: 100%;
            border: 1px solid var(--card-border);
            position: relative;
            transition: background-color 0.25s ease, border-color 0.25s ease;
        }

        .tool-card.is-hidden {
            display: none !important;
        }

        /* Barra superior del panel */
        .card-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.15rem;
            flex-wrap: wrap;
            gap: 12px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border);
        }

        .card-title-group h1,
        .card-title-group h2 {
            font-size: 1.45rem;
            margin: 0 0 3px;
            color: var(--ee-azul);
            font-weight: 800;
            letter-spacing: -0.02em;
        }

        .joomla-card .card-title-group h2 {
            color: var(--ee-rojo);
        }

        .bold-card .card-title-group h1 {
            color: var(--ee-verde);
        }

        .card-title-group p {
            font-size: 0.83rem;
            color: var(--muted);
            margin: 0;
        }

        /* --- WORKSPACE EN 2 COLUMNAS (DESKTOP) --- */
        .workspace-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 22px;
            align-items: stretch;
        }

        .workspace-column {
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-width: 0;
            border-radius: var(--radius-md);
            padding: 12px;
            background: var(--card-subtle);
            border: 1.5px solid var(--border);
            transition: all 0.25s ease;
        }

        .column-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            height: 30px;
        }

        .column-badge {
            font-size: 0.73rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: var(--radius-sm);
            transition: all 0.2s ease;
        }

        /* Distinción en Joomla */
        .joomla-card .workspace-column:first-child {
            border-top: 4px solid var(--ee-rojo);
            border-color: var(--ee-rojo-border);
        }

        .joomla-card .workspace-column:first-child .column-badge {
            background: var(--ee-rojo-light);
            color: var(--ee-rojo);
            border: 1px solid var(--ee-rojo-border);
        }

        .joomla-card .workspace-column:last-child {
            border-top: 4px solid var(--ee-azul);
            border-color: var(--ee-azul-border);
        }

        .joomla-card .workspace-column:last-child .column-badge {
            background: var(--ee-azul-light);
            color: var(--ee-azul);
            border: 1px solid var(--ee-azul-border);
        }

        /* Distinción en Formateador HTML */
        .html-card .workspace-column:first-child {
            border-top: 4px solid var(--ee-azul);
            border-color: var(--ee-azul-border);
        }

        .html-card .workspace-column:first-child .column-badge {
            background: var(--ee-azul-light);
            color: var(--ee-azul);
            border: 1px solid var(--ee-azul-border);
        }

        .html-card .workspace-column:last-child {
            border-top: 4px solid var(--ee-verde);
            border-color: var(--ee-verde-border);
        }

        .html-card .workspace-column:last-child .column-badge {
            background: var(--ee-verde-light);
            color: var(--ee-verde);
            border: 1px solid var(--ee-verde-border);
        }

        /* Distinción en Bold Italic */
        .workspace-column.is-normal-box {
            border-top: 4px solid var(--ee-azul) !important;
            border-color: var(--ee-azul-border) !important;
            background: var(--card) !important;
        }

        .workspace-column.is-normal-box .column-badge {
            background: var(--ee-azul-light) !important;
            color: var(--ee-azul) !important;
            border: 1px solid var(--ee-azul-border) !important;
        }

        .workspace-column.is-bold-box {
            border-top: 4px solid var(--ee-rojo) !important;
            border-color: var(--ee-rojo-border) !important;
            background: var(--card) !important;
        }

        .workspace-column.is-bold-box .column-badge {
            background: var(--ee-rojo-light) !important;
            color: var(--ee-rojo) !important;
            border: 1px solid var(--ee-rojo-border) !important;
        }

        /* --- WORKFLOW DE PASOS PARA PUBLICADOR JOOMLA --- */
        .workflow-step-card {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 12px 14px;
            margin-bottom: 12px;
            box-shadow: var(--shadow-sm);
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .workflow-step-card:hover {
            border-color: var(--border-hover);
        }

        .step-title-card {
            border-left: 4px solid var(--ee-rojo);
        }

        .step-body-card {
            border-left: 4px solid var(--ee-azul);
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .step-meta-card {
            border-left: 4px solid var(--ee-verde);
        }

        .step-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 9px;
            flex-wrap: wrap;
        }

        .step-title-group {
            display: flex;
            align-items: center;
            gap: 9px;
        }

        .step-number-badge {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.78rem;
            font-weight: 800;
            color: white;
            flex-shrink: 0;
        }

        .badge-step-1 {
            background: var(--ee-rojo);
            box-shadow: 0 2px 5px rgba(207, 10, 44, 0.35);
        }

        .badge-step-2 {
            background: var(--ee-azul);
            box-shadow: 0 2px 5px rgba(0, 104, 173, 0.35);
        }

        .badge-step-3 {
            background: var(--ee-verde);
            box-shadow: 0 2px 5px rgba(66, 120, 60, 0.35);
        }

        .step-title-text h3 {
            font-size: 0.86rem;
            font-weight: 800;
            color: var(--text);
            margin: 0;
            letter-spacing: -0.01em;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .step-subtitle {
            font-size: 0.71rem;
            color: var(--muted);
            font-weight: 500;
            display: block;
            margin-top: 1px;
        }

        .meta-grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .select-mini-badge {
            background: var(--card-subtle);
            border: 1px solid var(--border);
            color: var(--text);
            font-size: 0.72rem;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            outline: none;
            transition: all 0.15s ease;
        }

        .select-mini-badge:focus {
            border-color: var(--ee-azul);
        }

        .btn-field-action.is-highlight {
            background: var(--ee-azul-light);
            color: var(--ee-azul);
            border-color: var(--ee-azul-border);
            font-weight: 800;
        }

        .btn-field-action.is-highlight:hover {
            background: var(--ee-azul);
            color: white;
        }

        .province-quick-bar {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            padding: 2px 0 4px;
        }

        .province-dropdown {
            background: var(--card);
            border: 1.5px solid var(--border);
            color: var(--text);
            font-size: 0.74rem;
            font-weight: 700;
            padding: 4px 8px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            outline: none;
            transition: all 0.15s ease;
            max-width: 230px;
        }

        .province-dropdown:hover,
        .province-dropdown:focus {
            border-color: var(--ee-azul);
            background: var(--card-subtle);
        }

        .province-dropdown optgroup {
            font-weight: 800;
            color: var(--ee-rojo);
            background: var(--card);
        }

        .province-dropdown option {
            font-weight: 600;
            color: var(--text);
            background: var(--card);
        }

        .province-quick-label {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--muted);
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .advanced-accordion {
            margin-top: 11px;
            border: 1px dashed var(--border);
            border-radius: var(--radius-sm);
            background: var(--card-subtle);
            padding: 6px 11px;
        }

        .advanced-summary {
            font-size: 0.74rem;
            font-weight: 700;
            color: var(--muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            user-select: none;
        }

        .advanced-summary:hover {
            color: var(--text);
        }

        .advanced-hint {
            font-size: 0.68rem;
            color: var(--ee-azul);
            font-weight: 600;
        }

        .advanced-body {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px dashed var(--border);
        }

        .joomla-card .editor-container,
        .joomla-card textarea {
            min-height: 210px;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

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

        .form-group.full-width {
            grid-column: 1 / -1;
        }

        .form-label {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .input-with-action {
            display: flex;
            align-items: stretch;
            gap: 4px;
        }

        input[type="text"],
        input[type="date"],
        .meta-textarea {
            width: 100%;
            padding: 7px 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 0.82rem;
            font-family: inherit;
            background: var(--card-subtle);
            color: var(--text);
            outline: none;
            transition: all 0.15s ease;
        }

        input[type="text"]:focus,
        input[type="date"]:focus,
        .meta-textarea:focus {
            border-color: var(--ee-rojo);
            background: var(--card);
            box-shadow: 0 0 0 2px var(--ee-rojo-light);
        }

        .btn-field-action {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text-secondary);
            font-size: 0.73rem;
            font-weight: 700;
            padding: 0 9px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .btn-field-action:hover {
            border-color: var(--ee-rojo);
            color: var(--ee-rojo);
            background: var(--ee-rojo-light);
        }

        /* Barra de Provincias */
        .province-bar {
            background: var(--card-subtle);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 8px 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            flex-wrap: wrap;
        }

        .province-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            align-items: center;
        }

        .chip-prov {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text-secondary);
            font-size: 0.74rem;
            font-weight: 700;
            padding: 4px 9px;
            border-radius: 999px;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
        }

        .chip-prov:hover {
            border-color: var(--ee-azul);
            color: var(--ee-azul);
            background: var(--ee-azul-light);
            transform: translateY(-1px);
        }

        .chip-prov.is-active {
            background: var(--ee-azul);
            color: white;
            border-color: var(--ee-azul);
        }

        .province-select {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text);
            font-size: 0.74rem;
            font-weight: 600;
            padding: 4px 8px;
            border-radius: 999px;
            outline: none;
            cursor: pointer;
        }

        /* --- TEXTAREA Y CAJAS DE RESULTADOS --- */
        .editor-container {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 280px;
        }

        textarea {
            width: 100%;
            height: 100%;
            min-height: 280px;
            flex: 1;
            padding: 14px 16px;
            border: 1.5px solid var(--border);
            border-radius: var(--radius-md);
            font-size: 14.5px;
            line-height: 1.6;
            font-family: inherit;
            background: var(--card-subtle);
            color: var(--text);
            resize: vertical;
            outline: none;
            transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
        }

        textarea:focus-visible {
            background: var(--card);
        }

        /* Caja de Resultados */
        .result-box {
            background: var(--card-subtle);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-md);
            padding: 14px 16px;
            flex: 1;
            min-height: 380px;
            max-height: 600px;
            overflow-y: auto;
            position: relative;
            word-break: break-word;
            transition: border-color 0.2s ease;
        }

        .html-code-view {
            font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
            font-size: 0.83rem;
            line-height: 1.6;
            color: var(--text);
            white-space: pre-wrap;
            tab-size: 2;
            margin: 0;
            padding: 0;
        }

        /* Resaltado de sintaxis */
        .token-tag {
            color: var(--syn-tag);
            font-weight: 600;
        }

        .token-tagname {
            color: var(--syn-tagname);
            font-weight: 700;
        }

        .token-hashtag {
            color: var(--syn-hashtag);
            font-weight: 800;
        }

        .token-attr {
            color: var(--syn-attr);
        }

        .html-preview-view {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            font-size: 0.95rem;
            line-height: 1.65;
            color: var(--text);
        }

        .joomla-web-preview {
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            background: var(--card);
            padding: 18px 22px;
        }

        .jw-header {
            margin-bottom: 14px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border);
        }

        .jw-title {
            font-size: 1.35rem;
            font-weight: 800;
            color: var(--ee-rojo);
            margin: 0 0 6px;
            line-height: 1.25;
        }

        .jw-meta {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 0.78rem;
            color: var(--muted);
            font-weight: 600;
        }

        .jw-summary-box {
            background: var(--card-subtle);
            border-left: 3px solid var(--ee-azul);
            padding: 8px 12px;
            margin-bottom: 14px;
            font-size: 0.88rem;
            color: var(--text-secondary);
            font-style: italic;
        }

        /* Salida Bold Italic */
        #output {
            font-family: serif;
            font-size: 1.25rem;
            line-height: 1.6;
            color: var(--text);
            min-height: 200px;
        }

        #output.normal-font {
            font-family: 'Inter', sans-serif;
            font-size: 1.05rem;
        }

        /* Pestañas de vista de salida */
        .output-view-tabs {
            display: flex;
            gap: 4px;
            background: var(--card);
            border: 1px solid var(--border);
            padding: 2px;
            border-radius: var(--radius-sm);
        }

        .btn-view-tab {
            border: none;
            background: transparent;
            color: var(--muted);
            font-family: inherit;
            font-size: 0.74rem;
            font-weight: 700;
            padding: 3px 9px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .btn-view-tab.is-active {
            background: var(--ee-azul);
            color: white;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .joomla-card .btn-view-tab.is-active {
            background: var(--ee-rojo);
        }

        /* --- TOOLBARS Y FILTROS COMPACTOS --- */
        .panel-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 4px;
        }

        .toolbar-group {
            display: flex;
            align-items: center;
            gap: 5px;
            flex-wrap: wrap;
        }

        .btn-tool {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text-secondary);
            padding: 6px 11px;
            border-radius: var(--radius-sm);
            font-size: 0.76rem;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 32px;
            transition: all 0.15s ease;
            box-shadow: var(--shadow-sm);
        }

        .btn-tool:hover:not(:disabled) {
            background: var(--ee-azul-light);
            color: var(--ee-azul);
            border-color: var(--ee-azul-border);
            transform: translateY(-1px);
        }

        .joomla-card .btn-tool:hover:not(:disabled) {
            background: var(--ee-rojo-light);
            color: var(--ee-rojo);
            border-color: var(--ee-rojo-border);
        }

        .btn-tool:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            color: var(--muted);
        }

        .btn-tool.is-paste {
            background: var(--ee-rojo-light);
            color: var(--ee-rojo);
            border-color: var(--ee-rojo-border);
        }

        .html-card .btn-tool.is-paste {
            background: var(--ee-azul-light);
            color: var(--ee-azul);
            border-color: var(--ee-azul-border);
        }

        .btn-tool.is-trash {
            color: var(--muted);
        }

        .btn-tool.is-trash:hover:not(:disabled) {
            background: var(--ee-rojo-light);
            color: var(--ee-rojo);
            border-color: var(--ee-rojo-border);
        }

        .btn-tool svg {
            width: 14px;
            height: 14px;
        }

        /* --- BOTONES DE ACCIÓN PERFECCIONADOS --- */
        .action-bar {
            display: flex;
            align-items: center;
            gap: 7px;
            margin-top: 4px;
            flex-wrap: wrap;
        }

        .btn-action-primary {
            background: linear-gradient(135deg, var(--ee-rojo), #b00824);
            color: white;
            border: 1px solid rgba(0, 0, 0, 0.1);
            border-radius: var(--radius-sm);
            padding: 7px 14px;
            font-size: 0.81rem;
            font-weight: 700;
            height: 36px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            box-shadow: 0 2px 6px rgba(207, 10, 44, 0.25);
            transition: all 0.15s ease;
        }

        .html-card .btn-action-primary {
            background: linear-gradient(135deg, var(--ee-azul), #005a96);
            box-shadow: 0 2px 6px rgba(0, 104, 173, 0.25);
        }

        .bold-card .btn-action-primary {
            background: linear-gradient(135deg, var(--ee-verde), #2e5527);
            box-shadow: 0 2px 6px rgba(66, 120, 60, 0.25);
        }

        .btn-action-primary:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 4px 10px rgba(207, 10, 44, 0.35);
        }

        .btn-action-primary:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            box-shadow: none;
        }

        .btn-action-primary.is-success {
            background: linear-gradient(135deg, var(--ee-verde), #2e5527) !important;
            box-shadow: 0 2px 8px rgba(66, 120, 60, 0.35) !important;
        }

        .btn-action-secondary {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text-secondary);
            border-radius: var(--radius-sm);
            padding: 7px 12px;
            font-size: 0.79rem;
            font-weight: 700;
            height: 36px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            box-shadow: var(--shadow-sm);
            transition: all 0.15s ease;
        }

        .btn-action-secondary:hover:not(:disabled) {
            border-color: var(--ee-azul);
            color: var(--ee-azul);
            background: var(--ee-azul-light);
            transform: translateY(-1px);
        }

        .btn-action-secondary:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .btn-action-secondary svg {
            width: 14px;
            height: 14px;
        }

        /* Stats pills */
        .stats-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .stat-pill {
            background: var(--card);
            border: 1px solid var(--border);
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 0.72rem;
            color: var(--text-secondary);
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .stat-pill strong {
            color: var(--ee-rojo);
            font-weight: 800;
        }

        /* Toast flotante */
        .toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: var(--card);
            color: var(--text);
            border: 1px solid var(--border);
            padding: 9px 18px;
            border-radius: 999px;
            font-size: 0.84rem;
            font-weight: 700;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
            display: flex;
            align-items: center;
            gap: 8px;
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            z-index: 1000;
        }

        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* --- COMPRESOR DE VIDEO (< 1 MB) --- */
        .video-card .card-title-group h2 {
            color: #D84315;
        }

        .video-drop-zone {
            background: var(--card-subtle);
            border: 2px dashed var(--border);
            border-radius: var(--radius-md);
            padding: 26px 18px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .video-drop-zone:hover,
        .video-drop-zone.dragover {
            border-color: #D84315;
            background: rgba(216, 67, 21, 0.05);
        }

        .drop-zone-icon {
            width: 52px;
            height: 52px;
            border-radius: 50%;
            background: var(--card);
            border: 1px solid var(--border);
            color: #D84315;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 12px;
            transition: all 0.2s ease;
        }

        .video-drop-zone:hover .drop-zone-icon {
            transform: scale(1.08);
            border-color: #D84315;
        }

        .drop-zone-title {
            font-size: 0.95rem;
            font-weight: 800;
            color: var(--text);
            margin: 0 0 6px;
        }

        .drop-zone-desc {
            font-size: 0.78rem;
            color: var(--muted);
            max-width: 380px;
            margin: 0 auto;
            line-height: 1.45;
        }

        .video-meta-card {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .video-meta-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .video-meta-title-group {
            display: flex;
            align-items: center;
            gap: 8px;
            overflow: hidden;
        }

        .video-file-icon {
            font-size: 1.25rem;
        }

        .video-file-name {
            font-size: 0.85rem;
            font-weight: 800;
            color: var(--text);
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 260px;
        }

        .video-file-sub {
            font-size: 0.72rem;
            color: var(--muted);
        }

        .video-preview-wrapper {
            background: #000;
            border-radius: var(--radius-sm);
            overflow: hidden;
            position: relative;
        }

        .video-stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
        }

        .v-stat-box {
            background: var(--card-subtle);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 6px 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .v-stat-label {
            font-size: 0.68rem;
            color: var(--muted);
            font-weight: 700;
            text-transform: uppercase;
        }

        .v-stat-val {
            font-size: 0.84rem;
            font-weight: 800;
            color: var(--text);
            margin-top: 2px;
        }

        .v-stat-val.is-heavy {
            color: var(--ee-rojo);
        }

        .compress-progress-container {
            height: 12px;
            background: var(--card-subtle);
            border-radius: 999px;
            overflow: hidden;
            border: 1px solid var(--border);
            position: relative;
        }

        .compress-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #D84315, #FF7043, var(--ee-verde));
            border-radius: 999px;
            transition: width 0.15s ease;
        }

        .comparison-card {
            display: flex;
            align-items: center;
            justify-content: space-around;
            background: var(--card-subtle);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-md);
            padding: 12px;
            gap: 8px;
        }

        .comp-col {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
        }

        .comp-label {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
        }

        .comp-val {
            font-size: 0.95rem;
            font-weight: 800;
        }

        .comp-val.is-bad {
            color: var(--ee-rojo);
            text-decoration: line-through;
        }

        .comp-val.is-good {
            color: var(--ee-verde);
            font-size: 1.05rem;
        }

        .comp-val.is-badge {
            background: var(--ee-verde);
            color: white;
            padding: 2px 7px;
            border-radius: 4px;
            font-size: 0.74rem;
        }

        .comp-arrow {
            font-size: 1.1rem;
            color: var(--muted);
            font-weight: 800;
        }

        /* Recorte de Video (Trimming) */
        .video-trim-section {
            background: var(--card-subtle);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 10px 12px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 8px;
        }

        .trim-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 6px;
        }

        .trim-badge-info {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--ee-azul);
            background: rgba(0, 102, 204, 0.08);
            border: 1px solid rgba(0, 102, 204, 0.25);
            padding: 2px 8px;
            border-radius: 999px;
        }

        .trim-chips-row {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
        }

        .chip-trim {
            background: var(--bg);
            border: 1px solid var(--border);
            color: var(--text);
            padding: 4px 9px;
            border-radius: 999px;
            font-size: 0.72rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
        }

        .chip-trim:hover {
            border-color: #D84315;
            color: #D84315;
            transform: translateY(-1px);
        }

        .chip-trim.is-active {
            background: #D84315;
            border-color: #D84315;
            color: #ffffff;
            box-shadow: 0 2px 6px rgba(216, 67, 21, 0.35);
        }

        .trim-inputs-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .trim-input-group {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .trim-input-label {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--muted);
            text-transform: uppercase;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .trim-input-wrap {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .trim-input-number {
            width: 100%;
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text);
            font-size: 0.82rem;
            font-weight: 700;
            padding: 5px 8px;
            font-family: inherit;
        }

        .trim-input-number:focus {
            outline: none;
            border-color: #D84315;
        }

        .btn-time-sync {
            background: var(--card);
            border: 1px solid var(--border);
            color: var(--text);
            font-size: 0.7rem;
            font-weight: 700;
            padding: 5px 8px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.15s ease;
        }

        .btn-time-sync:hover {
            background: #D84315;
            color: #fff;
            border-color: #D84315;
        }

        .trim-preview-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding-top: 6px;
            border-top: 1px dashed var(--border);
        }

        .btn-preview-fragment {
            background: var(--bg);
            border: 1px solid var(--border);
            color: var(--text);
            font-size: 0.72rem;
            font-weight: 700;
            padding: 5px 10px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: all 0.15s ease;
        }

        .btn-preview-fragment:hover {
            border-color: var(--ee-verde);
            color: var(--ee-verde);
        }

        /* ========================================================= */
        /* HERRAMIENTA 5: ENCUADRE Y REDIMENSIONADOR (1024 × 722)     */
        /* ========================================================= */
        .tab-image {
            border-bottom-color: #00897B;
        }

        .tab-image.is-active {
            background: linear-gradient(135deg, #00897B, #00695C) !important;
            color: #ffffff !important;
            border-color: #00897B !important;
        }

        .crop-canvas-container {
            position: relative;
            background: #151515;
            border-radius: var(--radius-md);
            border: 2px solid var(--border);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            aspect-ratio: 1024 / 722;
            cursor: grab;
            user-select: none;
            touch-action: none;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        }

        .crop-canvas-container:active {
            cursor: grabbing;
        }

        .crop-canvas {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: contain;
        }

        .crop-overlay-guides {
            position: absolute;
            inset: 0;
            pointer-events: none;
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            grid-template-rows: 1fr 1fr 1fr;
            border: 1px dashed rgba(255, 255, 255, 0.25);
            transition: opacity 0.2s ease;
        }

        .crop-overlay-guides > div {
            border: 0.5px dashed rgba(255, 255, 255, 0.18);
        }

        .crop-drag-hint {
            position: absolute;
            bottom: 12px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(5px);
            color: #fff;
            padding: 4px 14px;
            border-radius: 999px;
            font-size: 0.72rem;
            font-weight: 700;
            pointer-events: none;
            border: 1px solid rgba(255, 255, 255, 0.25);
            transition: opacity 0.3s ease;
            white-space: nowrap;
        }

        .crop-badge-dim {
            position: absolute;
            top: 10px;
            left: 10px;
            background: rgba(0, 137, 123, 0.88);
            color: #fff;
            padding: 3px 9px;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 800;
            pointer-events: none;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
            letter-spacing: 0.5px;
        }

        .crop-slider-control {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .crop-slider-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.74rem;
            font-weight: 700;
            color: var(--text);
        }

        .crop-slider-val {
            font-size: 0.72rem;
            color: #00897B;
            font-weight: 800;
            background: rgba(0, 137, 123, 0.12);
            padding: 1px 7px;
            border-radius: 4px;
            border: 1px solid rgba(0, 137, 123, 0.25);
        }

        .crop-range-input {
            width: 100%;
            accent-color: #00897B;
            height: 6px;
            cursor: pointer;
        }

        .crop-quick-btns {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }

        .btn-crop-pos {
            background: var(--bg);
            border: 1.5px solid var(--border);
            color: var(--text);
            padding: 6px 11px;
            border-radius: var(--radius-sm);
            font-size: 0.74rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .btn-crop-pos:hover {
            border-color: #00897B;
            color: #00897B;
            transform: translateY(-1px);
        }

        .btn-crop-pos.is-active {
            background: #00897B;
            border-color: #00897B;
            color: #ffffff;
            box-shadow: 0 2px 6px rgba(0, 137, 123, 0.35);
        }

        /* Nuevos estilos Pro para Redimensionador de Fotos */
        .dim-presets-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 6px;
        }

        .btn-dim-preset {
            background: var(--bg);
            border: 1.5px solid var(--border);
            color: var(--text);
            padding: 5px 9px;
            border-radius: var(--radius-sm);
            font-size: 0.72rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .btn-dim-preset:hover {
            border-color: #00897B;
            color: #00897B;
            transform: translateY(-1px);
        }

        .btn-dim-preset.is-active {
            background: #00897B;
            border-color: #00897B;
            color: #ffffff;
            box-shadow: 0 2px 6px rgba(0, 137, 123, 0.35);
        }

        .custom-dim-box {
            background: var(--card-subtle);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 8px 10px;
            display: grid;
            grid-template-columns: 1fr auto 1fr auto auto;
            gap: 8px;
            align-items: center;
            margin-top: 8px;
        }

        .dim-input-col {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .dim-input-col label {
            font-size: 0.68rem;
            color: var(--muted);
            font-weight: 700;
            text-transform: uppercase;
        }

        .dim-number-input {
            width: 100%;
            background: var(--bg);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text);
            font-size: 0.85rem;
            font-weight: 800;
            padding: 5px 8px;
            font-family: inherit;
        }

        .dim-number-input:focus {
            outline: none;
            border-color: #00897B;
        }

        .btn-dim-tool {
            background: var(--bg);
            border: 1.5px solid var(--border);
            color: var(--text);
            padding: 5px 8px;
            border-radius: var(--radius-sm);
            font-size: 0.74rem;
            font-weight: 700;
            cursor: pointer;
            height: 33px;
            display: flex;
            align-items: center;
            justify-content: center;
            align-self: flex-end;
            transition: all 0.15s ease;
            white-space: nowrap;
        }

        .btn-dim-tool:hover {
            background: #00897B;
            color: #fff;
            border-color: #00897B;
        }

        .btn-dim-tool.is-locked {
            background: rgba(0, 137, 123, 0.15);
            color: #00897B;
            border-color: #00897B;
        }

        .format-chips-row {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 6px;
        }

        .chip-format-btn {
            background: var(--bg);
            border: 1.5px solid var(--border);
            color: var(--text);
            padding: 6px 14px;
            border-radius: var(--radius-sm);
            font-size: 0.76rem;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            gap: 5px;
        }

        .chip-format-btn:hover {
            border-color: #00897B;
            color: #00897B;
        }

        .chip-format-btn.is-active {
            background: linear-gradient(135deg, #00897B, #00695C);
            color: #ffffff;
            border-color: #00897B;
            box-shadow: 0 2px 6px rgba(0, 137, 123, 0.35);
        }

        .filters-grid-row {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
            margin-top: 8px;
        }

        /* Responsive */
        @media (max-width: 960px) {
            .workspace-grid {
                grid-template-columns: 1fr;
                gap: 18px;
            }

            .form-row {
                grid-template-columns: 1fr;
            }

            .editor-container,
            textarea,
            .result-box {
                min-height: 260px;
            }
        }

        @media (max-width: 580px) {
            body {
                padding: 10px 8px 30px;
            }

            .app-header {
                flex-direction: column;
                align-items: stretch;
                gap: 12px;
            }

            .header-controls {
                justify-content: space-between;
            }

            .nav-tabs {
                flex: 1;
            }

            .tab-btn {
                flex: 1;
                justify-content: center;
                padding: 7px 6px;
                font-size: 0.75rem;
            }

            .tool-card {
                padding: 1.15rem 0.9rem;
            }

            .card-topbar {
                flex-direction: column;
                align-items: flex-start;
            }

            .action-bar {
                flex-direction: column;
                align-items: stretch;
            }

            .btn-action-primary,
            .btn-action-secondary {
                width: 100%;
            }
        }
    
        /* --- BOTÓN HAMBURGUESA Y DRAWER LATERAL --- */
        .btn-hamburger {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            background: var(--card);
            color: var(--text);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-sm);
            transition: all 0.2s ease;
            margin-right: 6px;
            flex-shrink: 0;
        }

        .btn-hamburger:hover {
            border-color: var(--ee-rojo);
            color: var(--ee-rojo);
            transform: scale(1.04);
            box-shadow: 0 2px 10px rgba(207, 10, 44, 0.18);
        }

        .btn-hamburger svg {
            width: 22px;
            height: 22px;
            stroke-width: 2.2;
        }

        /* Indicador de Herramienta Activa en Header */
        .active-tool-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 14px;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 999px;
            font-size: 0.82rem;
            font-weight: 700;
            color: var(--text);
            box-shadow: var(--shadow-sm);
            transition: all 0.25s ease;
        }

        .active-tool-pill .live-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #10B981;
            box-shadow: 0 0 8px #10B981;
            display: inline-block;
            animation: pulse-dot 2s infinite ease-in-out;
        }

        @keyframes pulse-dot {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.45; transform: scale(0.85); }
        }

        .btn-shortcuts-header {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0 12px;
            height: 38px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            background: var(--card);
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            transition: all 0.2s ease;
        }

        .btn-shortcuts-header:hover {
            border-color: var(--ee-azul);
            color: var(--ee-azul);
            transform: translateY(-1px);
        }

        /* OVERLAY Y DRAWER DE NAVEGACIÓN */
        .drawer-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 9998;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
        }

        .drawer-overlay.is-open {
            opacity: 1;
            visibility: visible;
        }

        .app-drawer {
            position: fixed;
            top: 0;
            left: 0;
            width: 340px;
            max-width: 88vw;
            height: 100vh;
            background: var(--bg);
            border-right: 1px solid var(--border);
            box-shadow: 10px 0 35px rgba(0, 0, 0, 0.35);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            transform: translateX(-100%);
            transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
            overflow-y: auto;
        }

        .drawer-overlay.is-open .app-drawer {
            transform: translateX(0);
        }

        .drawer-header {
            padding: 1.25rem 1.25rem 1rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--card);
        }

        .drawer-brand {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .drawer-close-btn {
            width: 34px;
            height: 34px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            line-height: 1;
            transition: all 0.2s ease;
        }

        .drawer-close-btn:hover {
            color: var(--ee-rojo);
            border-color: var(--ee-rojo);
            background: rgba(207, 10, 44, 0.08);
        }

        .drawer-body {
            padding: 1rem;
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            overflow-y: auto;
        }

        .drawer-section-title {
            font-size: 0.7rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: var(--muted);
            margin-bottom: 0.5rem;
            padding-left: 4px;
        }

        .drawer-nav-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .drawer-nav-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 10px 12px;
            border-radius: var(--radius-md);
            border: 1px solid transparent;
            background: transparent;
            color: var(--text);
            text-align: left;
            cursor: pointer;
            width: 100%;
            transition: all 0.2s ease;
            position: relative;
        }

        .drawer-nav-item:hover {
            background: var(--card);
            border-color: var(--border);
            transform: translateX(3px);
        }

        .drawer-nav-item.is-active {
            background: var(--card);
            border-color: var(--ee-rojo);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        }

        .drawer-nav-item.is-active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 10%;
            height: 80%;
            width: 4px;
            background: var(--ee-rojo);
            border-radius: 0 3px 3px 0;
        }

        .drawer-nav-icon {
            font-size: 1.4rem;
            line-height: 1;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .drawer-nav-text {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .drawer-nav-name {
            font-size: 0.88rem;
            font-weight: 800;
            color: var(--text);
            line-height: 1.2;
        }

        .drawer-nav-desc {
            font-size: 0.72rem;
            color: var(--muted);
            line-height: 1.3;
        }

        .drawer-nav-kbd {
            font-size: 0.65rem;
            font-family: monospace;
            padding: 2px 6px;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 4px;
            color: var(--muted);
            align-self: flex-start;
            margin-top: 4px;
        }

        .drawer-footer {
            padding: 1rem 1.25rem;
            border-top: 1px solid var(--border);
            background: var(--card);
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .drawer-quick-actions {
            display: flex;
            gap: 8px;
        }

        .drawer-btn-secondary {
            flex: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 10px;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 0.78rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .drawer-btn-secondary:hover {
            color: var(--text);
            border-color: var(--ee-rojo);
        }

        .drawer-legal {
            font-size: 0.68rem;
            color: var(--muted);
            text-align: center;
            line-height: 1.35;
        }

        /* MODAL DE ATAJOS DE TECLADO */
        .modal-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.25s ease, visibility 0.25s ease;
        }

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

        .modal-card {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 540px;
            box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
            overflow: hidden;
            transform: scale(0.94);
            transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .modal-backdrop.is-open .modal-card {
            transform: scale(1);
        }

        .modal-header {
            padding: 1.1rem 1.4rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-title-group {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .modal-title-group h3 {
            margin: 0;
            font-size: 1.05rem;
            font-weight: 800;
            color: var(--text);
        }

        .modal-body {
            padding: 1.25rem 1.4rem;
            max-height: 70vh;
            overflow-y: auto;
        }

        .shortcut-table {
            width: 100%;
            border-collapse: collapse;
        }

        .shortcut-table tr {
            border-bottom: 1px solid var(--border);
        }

        .shortcut-table tr:last-child {
            border-bottom: none;
        }

        .shortcut-table td {
            padding: 9px 4px;
            font-size: 0.82rem;
            vertical-align: middle;
        }

        .shortcut-table td:first-child {
            color: var(--text);
            font-weight: 600;
        }

        .shortcut-table td:last-child {
            text-align: right;
        }

        .kbd-key {
            display: inline-block;
            padding: 3px 7px;
            font-family: inherit;
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--text);
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 4px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
            margin-left: 2px;
        }

        .modal-footer {
            padding: 0.9rem 1.4rem;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: flex-end;
            background: var(--bg);
        }

    
        /* --- ESTILOS DE PASOS VISUALES (STEPPER WIZARD) --- */
        .tool-stepper-header {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            margin-bottom: 1.15rem;
            padding: 8px 12px;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            overflow-x: auto;
            white-space: nowrap;
        }

        .stepper-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.74rem;
            font-weight: 700;
            color: var(--muted);
            padding: 4px 10px;
            border-radius: 999px;
            background: transparent;
            transition: all 0.2s ease;
        }

        .stepper-chip.is-active {
            color: var(--text);
            background: var(--card);
            box-shadow: 0 1px 4px rgba(0,0,0,0.08);
            border: 1px solid var(--border);
        }

        .stepper-chip .step-dot {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--border);
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            font-weight: 800;
        }

        .stepper-chip.is-active .step-dot {
            background: var(--ee-rojo);
            color: white;
        }

        .stepper-divider {
            color: var(--muted);
            font-size: 0.7rem;
            opacity: 0.6;
        }

        /* Botón de Pantalla Completa */
        

        .btn-fullscreen:hover {
            border-color: var(--ee-azul);
            color: var(--ee-azul);
            transform: scale(1.05);
        }

        /* Buscador dentro del Drawer */
        .drawer-search-wrapper {
            margin-bottom: 0.75rem;
            padding: 0 4px;
        }

        .drawer-search-input {
            width: 100%;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--card);
            color: var(--text);
            font-size: 0.8rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s ease;
        }

        .drawer-search-input:focus {
            border-color: var(--ee-rojo);
        }

        /* Dropdown selector de plantillas militares */
        .template-selector-box {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .template-dropdown {
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 700;
            padding: 6px 10px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--card);
            color: var(--text);
            cursor: pointer;
            outline: none;
            transition: border-color 0.2s ease;
        }

        .template-dropdown:hover, .template-dropdown:focus {
            border-color: var(--ee-rojo);
        }

    
        /* --- ESTILOS DE ICONOS VECTORIALES PROFESIONALES (LUCIDE) --- */
        .tab-ico, .drawer-ico, .btn-ico, .title-ico, .badge-ico, .toast-ico {
            display: inline-block;
            vertical-align: middle;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            fill: none;
            stroke: currentColor;
            flex-shrink: 0;
            transition: transform 0.2s ease, stroke 0.2s ease;
        }

        .tab-ico {
            width: 17px;
            height: 17px;
        }

        .drawer-ico {
            width: 22px;
            height: 22px;
            color: var(--text-secondary);
        }

        .drawer-nav-item.is-active .drawer-ico {
            color: var(--ee-rojo);
        }

        .btn-ico {
            width: 15px;
            height: 15px;
            margin-right: 4px;
        }

        .title-ico {
            width: 24px;
            height: 24px;
            margin-right: 8px;
            display: inline-block;
            vertical-align: -3px;
        }

        .badge-ico {
            width: 13px;
            height: 13px;
            margin-right: 4px;
            vertical-align: -1px;
        }

        .toast-ico {
            width: 20px;
            height: 20px;
        }

    
        /* --- ESTILOS DE ALTO CONTRASTE PARA REDIMENSIONADOR PRO (.crop-card) --- */
        .crop-card .card-title-group h2 {
            color: #00897B;
        }

        [data-theme="dark"] .crop-card .card-title-group h2 {
            color: #2dd4bf !important;
        }

        /* Badges de columnas en Redimensionador Pro */
        .crop-card .workspace-column:first-child .column-badge {
            background: rgba(0, 137, 123, 0.12) !important;
            color: #00796B !important;
            border: 1px solid rgba(0, 137, 123, 0.35) !important;
            font-weight: 800;
        }

        [data-theme="dark"] .crop-card .workspace-column:first-child .column-badge {
            background: rgba(45, 212, 191, 0.18) !important;
            color: #2dd4bf !important;
            border: 1px solid rgba(45, 212, 191, 0.45) !important;
            font-weight: 800;
            text-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
        }

        .crop-card .workspace-column:last-child .column-badge {
            background: rgba(0, 104, 173, 0.12) !important;
            color: var(--ee-azul) !important;
            border: 1px solid rgba(0, 104, 173, 0.35) !important;
            font-weight: 800;
        }

        [data-theme="dark"] .crop-card .workspace-column:last-child .column-badge {
            background: rgba(33, 142, 214, 0.2) !important;
            color: #38bdf8 !important;
            border: 1px solid rgba(56, 189, 248, 0.45) !important;
            font-weight: 800;
            text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
        }

        /* Corrección de contraste en títulos y tarjetas de pasos */
        .step-number-badge {
            color: #ffffff !important;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .step-title-text h3 {
            color: var(--text) !important;
        }

        [data-theme="dark"] .step-title-text h3 {
            color: #f8fafc !important;
        }

        [data-theme="dark"] .step-subtitle {
            color: #94a3b8 !important;
        }

        /* Contraste en controles de píxeles y sliders */
        [data-theme="dark"] .crop-slider-label {
            color: #f1f5f9 !important;
        }

        [data-theme="dark"] .crop-slider-val {
            color: #38bdf8 !important;
        }

        [data-theme="dark"] .drop-zone-title {
            color: #f1f5f9 !important;
        }

        [data-theme="dark"] .drop-zone-desc {
            color: #94a3b8 !important;
        }

        [data-theme="dark"] .btn-dim-preset {
            background: #1c232c;
            color: #cbd5e1;
            border-color: #2e3a4b;
        }

        [data-theme="dark"] .btn-dim-preset:hover {
            color: #ffffff;
            border-color: #2dd4bf;
            background: #232d39;
        }

        [data-theme="dark"] .btn-dim-preset.is-active {
            background: rgba(45, 212, 191, 0.2) !important;
            color: #2dd4bf !important;
            border-color: #2dd4bf !important;
            box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
        }

        [data-theme="dark"] .btn-crop-pos {
            background: #1c232c;
            color: #cbd5e1;
            border-color: #2e3a4b;
        }

        [data-theme="dark"] .btn-crop-pos:hover {
            color: #ffffff;
            border-color: #38bdf8;
        }

        [data-theme="dark"] .btn-crop-pos.is-active {
            background: rgba(33, 142, 214, 0.25) !important;
            color: #38bdf8 !important;
            border-color: #38bdf8 !important;
        }

        [data-theme="dark"] .crop-badge-dim {
            background: rgba(15, 23, 42, 0.92) !important;
            color: #2dd4bf !important;
            border: 1px solid rgba(45, 212, 191, 0.4) !important;
        }

        [data-theme="dark"] .crop-drag-hint {
            background: rgba(15, 23, 42, 0.9) !important;
            color: #cbd5e1 !important;
            border: 1px solid #334155 !important;
        }

        [data-theme="dark"] .fmt-radio-card {
            background: #1c232c;
            border-color: #2e3a4b;
            color: #f1f5f9;
        }

        [data-theme="dark"] .fmt-radio-card:hover {
            border-color: #38bdf8;
        }

        [data-theme="dark"] .fmt-radio-card input:checked + .fmt-radio-body {
            color: #38bdf8;
        }

    
        /* ==============================================================
           TEMA 3: NEGRO OLED MILITAR PURO (#000000)
           ============================================================== */
        :root[data-theme="oled"] {
            color-scheme: dark;
            --ee-rojo: #ff2a4b;
            --ee-rojo-hover: #e3183b;
            --ee-rojo-light: rgba(255, 42, 75, 0.18);
            --ee-rojo-border: rgba(255, 42, 75, 0.45);

            --ee-gris: #94a3b8;
            --ee-gris-dark: #cbd5e1;
            --ee-gris-light: rgba(148, 163, 184, 0.15);
            --ee-gris-border: rgba(148, 163, 184, 0.35);

            --ee-azul: #38bdf8;
            --ee-azul-hover: #0284c7;
            --ee-azul-light: rgba(56, 189, 248, 0.2);
            --ee-azul-border: rgba(56, 189, 248, 0.5);

            --ee-verde: #4ade80;
            --ee-verde-hover: #22c55e;
            --ee-verde-light: rgba(74, 222, 128, 0.2);
            --ee-verde-border: rgba(74, 222, 128, 0.5);

            --bg: #000000;
            --card: #07090c;
            --card-subtle: #0e1217;
            --card-border: #1f2733;
            --card-border-hover: #384556;

            --text: #ffffff;
            --text-secondary: #e2e8f0;
            --muted: #94a3b8;
            --border: #1f2733;
            --border-hover: #384556;

            --syn-tag: #38bdf8;
            --syn-tagname: #ff4767;
            --syn-hashtag: #ff4767;
            --syn-bracket: #94a3b8;
            --syn-attr: #4ade80;

            --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.9);
            --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.98);
        }

        /* Resalte de tarjeta activa con resplandor suave */
        .tool-card:not(.is-hidden) {
            border-color: var(--card-border-hover);
            box-shadow: 0 0 0 1px var(--card-border), var(--shadow-md);
        }

        /* DOCK FLOTANTE INFERIOR DE ACCIONES RÁPIDAS */
        /* ========================================================================== */
/* AUDITOR DE REDACCIÓN MILITAR & PROVINCIAS (HERRAMIENTA 1)                  */
/* ========================================================================== */
.military-audit-box {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-left: 3px solid #f59e0b;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

[data-theme="light"] .military-audit-box {
    background: #f8fafc;
}

.audit-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.audit-ico {
    width: 14px;
    height: 14px;
    stroke: #f59e0b;
    fill: none;
    stroke-width: 2.2;
}

.audit-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.audit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    background: var(--card-subtle);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.audit-desc {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.audit-badge-warn {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.audit-badge-info {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-audit-fix {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-audit-fix:hover {
    border-color: var(--ee-verde);
    color: var(--ee-verde);
}

/* ========================================================================== */
/* CARROUSEL / LOTE MULTI-FOTO (HERRAMIENTA 5)                                */
/* ========================================================================== */
.batch-thumbnails-bar {
    margin-top: 10px;
    padding: 10px;
    background: var(--card-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.batch-thumbnails-list {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.batch-thumb-item {
    position: relative;
    width: 64px;
    height: 48px;
    border-radius: 4px;
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}

.batch-thumb-item.is-active {
    border-color: #00897B;
    box-shadow: 0 0 0 2px rgba(0, 137, 123, 0.4);
}

.batch-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.batch-thumb-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
}


/* ========================================================================== */
/* CARROUSEL / LOTE MULTI-VIDEO (HERRAMIENTA 4)                               */
/* ========================================================================== */
.batch-video-list {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.batch-video-item {
    position: relative;
    min-width: 140px;
    max-width: 175px;
    padding: 8px 10px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}

.batch-video-item:hover {
    border-color: #FF7043;
}

.batch-video-item.is-active {
    border-color: #FF7043;
    background: rgba(255, 112, 67, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 112, 67, 0.35);
}

.batch-video-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-video-meta {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-video-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.batch-video-badge.is-done {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.batch-video-badge.is-busy {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}


/* ==============================================================
   HERRAMIENTA 6: DESCARGADOR UNIVERSAL DE VIDEO & AUDIO
   ============================================================== */
.download-card {
    border-top: 3px solid #7c3aed;
}

.media-url-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.media-url-input {
    width: 100%;
    height: 48px;
    padding: 10px 88px 10px 42px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.media-url-input:focus {
    border-color: #7c3aed;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.media-input-icon {
    position: absolute;
    left: 14px;
    color: var(--muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.media-input-actions {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-input-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px;
    background: var(--card-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-input-action:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    background: var(--card);
}

.media-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-top: 8px;
    border: 1px solid var(--border);
    background: var(--card-subtle);
    color: var(--muted);
    transition: all 0.2s ease;
}

.media-platform-badge.is-yt {
    background: rgba(227, 24, 59, 0.12);
    color: #e3183b;
    border-color: rgba(227, 24, 59, 0.35);
}

.media-platform-badge.is-fb {
    background: rgba(0, 104, 173, 0.12);
    color: #0068AD;
    border-color: rgba(0, 104, 173, 0.35);
}

.media-platform-badge.is-x {
    background: rgba(15, 23, 42, 0.12);
    color: var(--text);
    border-color: var(--border);
}

.media-platform-badge.is-tiktok {
    background: rgba(254, 44, 85, 0.12);
    color: #fe2c55;
    border-color: rgba(254, 44, 85, 0.35);
}

.media-platform-badge.is-insta {
    background: rgba(225, 48, 108, 0.12);
    color: #e1306c;
    border-color: rgba(225, 48, 108, 0.35);
}

.media-platform-badge.is-direct {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}

.media-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.media-setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.media-setting-item label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.media-setting-item select {
    height: 38px;
    padding: 0 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.15s ease;
}

.media-setting-item select:focus {
    border-color: #7c3aed;
}

.media-preview-container {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #090d13;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 240px;
}

.media-preview-video {
    width: 100%;
    max-height: 340px;
    display: block;
    background: #000;
}

.media-preview-audio {
    width: 90%;
    margin: 20px 0;
}

.media-bridges-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--card-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.media-bridges-box h4 {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-bridges-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-bridge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-bridge:hover {
    border-color: #7c3aed;
    color: #7c3aed;
    transform: translateY(-1px);
}
