/* 
  =============================================================================
  PROYECTO: Dicy Editor (Versión 3.2.1)
  ARCHIVO: styles.css
  AUTOR / DUEÑO: Felix — Autor humano y Arquitecto de Software con IA
  MARCO METODOLÓGICO: CCG-IA v1.0.0
  PROPÓSITO: Estilos del editor.
  DIRECTRICES PARA IA: No eliminar cabecera, mantener comentarios, registrar
                       cambios en CHANGELOG.md.
  =============================================================================
  BITÁCORA EMBEBIDA (resumen):
  - v1.0–v2.6 · Layout base, modales, toast, footer, barra de estado.
  - v2.7–v2.9 · Buscador modal multi-línea, footer compacto.
  - v2.10–v2.11 · Candado, linter, capa de resaltado, colores por fila,
                  fila activa, 3 estilos de vista.
  - v3.0.0    · Reforma: cabecera compacta. Historial detallado → CHANGELOG.md.
  - v3.1.0    · --editor-pad unificada. .hl-active-line sin dependencia de
                orden. :focus-visible global. Contraste AA.
                prefers-reduced-motion. Estado .status-reserved.
  - v3.1.1-r2 · .editor-area sin padding-bottom: el código llega al fondo
                del viewport. Aire inferior como padding-bottom interno del
                textarea/highlight/line-numbers. Status bar semitransparente.
                Footer 55 → 50 px.
  - v3.1.1-r3 · --overlay-reserve: 74 → 110px. .status-bar mucho más
                transparente (rgba 0.55). Borde superior más sutil.
  - v3.2.1    · Menú Crear: se anula el borde superior del primer
                .custom-item (el "Otro" duplicado arriba).
  =============================================================================
*/

/* =============================================================================
   TOKENS GLOBALES
   =============================================================================
   --editor-pad: padding interno del editor.
   --overlay-reserve: espacio reservado al fondo del editor para que la
   última línea del código NO quede tapada por la status-bar ni el footer.
   Se aplica como padding-bottom interno del textarea, del highlight layer
   y de la columna de números.
*/
:root {
    --editor-pad: 12px;
    --editor-line-height: 1.5;
    --editor-font-size: 14px;
    --editor-font-size-mobile: 13px;
    --editor-font-size-wide: 16px;
    --editor-line-height-mobile: 1.25;
    --editor-line-height-wide: 1.9;
    --focus-ring-color: #0e639c;
    --focus-ring-shadow: 0 0 0 2px rgba(14, 99, 156, 0.35);
    --overlay-reserve: 110px; /* status-bar + footer + aire extra */
    --footer-height: 50px;
    --status-bar-height: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: monospace; 
    background: #1e1e1e; 
    color: #d4d4d4; 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    height: 100dvh; 
    overflow: hidden; 
    -webkit-tap-highlight-color: transparent;
}

button { 
    background: #333; 
    color: #fff; 
    border: none; 
    padding: 6px 10px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 13px; 
    user-select: none;
    font-family: monospace;
}
button:active { background: #0e639c; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--focus-ring-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =============================================================================
   BARRA 1: ACCIONES
   ============================================================================= */
.bar-1 {
    background: #252526;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid #333;
    height: 42px;
    flex-shrink: 0;
    z-index: 20;
    gap: 8px;
}
.bar-1-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-create {
    background: #0e639c;
    color: #fff;
    font-weight: bold;
    padding: 7px 12px;
    font-size: 13px;
}
.btn-preview {
    background: #2d8a4e;
    color: #fff;
    padding: 7px 12px;
    font-size: 15px;
    line-height: 1;
}
.btn-preview:active { background: #236b3d; }

.view-style-select {
    background: #3a3a3a;
    color: #9cdcfe;
    border: 1px solid #454545;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    padding: 5px 6px;
    line-height: 1;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    max-width: 140px;
    flex-shrink: 0;
}
.view-style-select:focus { border-color: var(--focus-ring-color); box-shadow: var(--focus-ring-shadow); }
.view-style-select option { background: #252526; color: #d4d4d4; }

.btn-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: #3a3a3a;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    line-height: 1;
    cursor: pointer;
    min-width: 42px;
    justify-content: center;
    transition: background 0.15s;
}
.btn-status:active { background: #094771; }
.btn-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #6a737d;
    transition: background 0.2s, box-shadow 0.2s;
}
.btn-status .status-count {
    color: #9a9a9a;
    font-weight: bold;
    font-size: 11px;
    min-width: 10px;
    text-align: center;
}
.btn-status.status-reserved .status-dot {
    background: #6a737d;
    box-shadow: none;
}
.btn-status.status-reserved .status-count { color: #9a9a9a; }
.btn-status.status-ok .status-dot { background: #2d8a4e; box-shadow: 0 0 6px rgba(45,138,78,0.7); }
.btn-status.status-ok .status-count { color: #4ec9b0; }
.btn-status.status-warn .status-dot { background: #e3b341; box-shadow: 0 0 6px rgba(227,179,65,0.7); }
.btn-status.status-warn .status-count { color: #e3b341; }
.btn-status.status-err .status-dot { background: #f14c4c; box-shadow: 0 0 6px rgba(241,76,76,0.8); }
.btn-status.status-err .status-count { color: #ff7b72; }

.btn-lock {
    background: #3a3a3a;
    padding: 5px 8px;
    font-size: 15px;
    line-height: 1;
    border-radius: 4px;
    min-width: 34px;
    text-align: center;
}
.btn-lock:active { background: #094771; }
.btn-lock.locked {
    color: #e3b341;
    border: 1px solid rgba(227, 179, 65, 0.45);
    background: rgba(227, 179, 65, 0.08);
}
.btn-lock.unlocked {
    color: #7ee787;
    border: 1px solid rgba(126, 231, 135, 0.35);
    background: rgba(126, 231, 135, 0.06);
}
.btn-lock .lock-icon {
    display: inline-block;
    font-size: 15px;
    line-height: 1;
}

/* =============================================================================
   BARRA 2: CONTEXTO
   ============================================================================= */
.bar-2 {
    background: #2d2d2d;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-bottom: 1px solid #333;
    height: 34px;
    flex-shrink: 0;
    gap: 6px;
    z-index: 19;
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #9a9a9a;
    overflow-x: auto;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.breadcrumb::-webkit-scrollbar { display: none; }

.bc-segment {
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 3px;
    color: #9cdcfe;
    flex-shrink: 0;
    transition: background 0.12s;
}
.bc-segment:hover, .bc-segment:active { background: #333; color: #fff; }
.bc-separator { color: #666; padding: 0 1px; flex-shrink: 0; user-select: none; }
.bc-empty { color: #9a9a9a; font-size: 11px; }

.active-file-btn {
    background: #2d8a4e;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 4px;
    flex-shrink: 0;
    max-width: 45vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: none;
    font-family: monospace;
}
.active-file-btn:active { background: #236b3d; }
.active-file-btn.dirty::after {
    content: ' ●';
    color: #ffeb3b;
}

.btn-home {
    background: #3a3a3a;
    color: #4ec9b0;
    padding: 5px 9px;
    font-size: 13px;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
}
.btn-home:active { background: #094771; }

/* =============================================================================
   DROPDOWN MENÚ
   ============================================================================= */
.dropdown-container { position: relative; display: inline-block; }

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #252526;
    border: 1px solid #454545;
    z-index: 1000;
    min-width: 240px;
    max-height: 72vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-radius: 6px;
    margin-top: 4px;
}

.menu-section-title {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #4ec9b0;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    border-top: 1px solid #333;
}
.menu-section-title:first-child { border-top: none; }

.dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #d4d4d4;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.15s;
}
.dropdown-item:hover { background: #094771; color: #fff; }
.dropdown-item.custom-item {
    color: #4ec9b0;
    border-top: 1px solid #333;
}

/* =============================================================================
   LAYOUT PRINCIPAL
   ============================================================================= */
.main-container { 
    display: flex; 
    flex: 1; 
    overflow: hidden; 
    position: relative; 
    min-height: 0;
}

aside { 
    width: 280px; 
    background: #252526; 
    border-right: 1px solid #333; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s ease; 
    position: absolute; 
    height: 100%; 
    z-index: 10; 
    left: 0; 
    transform: translateX(-100%); 
}
aside.open { transform: translateX(0); }
@media(min-width: 768px) { aside { position: relative; transform: translateX(0); } }

.sidebar-header { 
    padding: 10px; 
    font-weight: bold; 
    border-bottom: 1px solid #333; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 12px; 
    color: #9cdcfe; 
    gap: 6px;
}

.sidebar-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.sidebar-header-btn {
    background: #3a3a3a;
    color: #9cdcfe;
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 4px;
    line-height: 1;
}
.sidebar-header-btn:active { background: #094771; color: #fff; }
.sidebar-header-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sidebar-close {
    cursor: pointer;
    padding: 5px 7px;
    font-size: 13px;
    color: #9a9a9a;
    border-radius: 4px;
    user-select: none;
    line-height: 1;
}
.sidebar-close:hover { background: #333; color: #f14c4c; }

.file-tree { overflow-y: auto; flex: 1; padding: 8px; font-size: 13px; }

.tree-item { 
    padding: 6px 8px; 
    cursor: pointer; 
    border-radius: 3px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    transition: background 0.12s;
}
.tree-item:hover { background: #2a2d2e; }
.tree-folder { color: #dcdcaa; font-weight: bold; margin-top: 4px; }
.tree-file { color: #9cdcfe; padding-left: 15px; }

.tree-folder.active-folder { background: #094771; color: #ffffff; }
.tree-folder.active-folder::before {
    content: '▶ ';
    color: #4ec9b0;
    font-size: 10px;
    margin-right: 2px;
}
.tree-file.active-file {
    background: #2d4a3e;
    color: #4ec9b0 !important;
    font-weight: bold;
    border-left: 3px solid #4ec9b0;
    padding-left: 12px;
}

/* =============================================================================
   DRAWER
   ============================================================================= */
.drawer-overlay { 
    position: fixed; 
    top: 0; left: 0;
    width: 100vw; height: 100vh; 
    background: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(2px);
    z-index: 999; 
    display: none; 
    opacity: 0;
    transition: opacity 0.3s ease;
}
.drawer-overlay.open { display: block; opacity: 1; }

.hamburger-drawer { 
    position: fixed; 
    bottom: calc(78px + var(--kb-offset, 0px)); 
    left: 10px; 
    right: 10px; 
    max-width: 400px;
    margin: 0 auto;
    max-height: 50vh; 
    background: #252526; 
    border: 1px solid #3c3c3c;
    border-radius: 12px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000; 
    transform: translateY(20px) scale(0.95); 
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, bottom 0.1s ease-out; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
}
.hamburger-drawer.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

.drawer-header { 
    padding: 14px 16px; 
    border-bottom: 1px solid #333; 
    font-size: 12px; 
    font-weight: bold; 
    color: #4ec9b0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-shrink: 0;
}
.drawer-content { overflow-y: auto; padding: 10px; flex: 1; min-height: 0; }

.drawer-tools {
    padding: 10px;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    background: #1e1e1e;
}
.drawer-tool-btn {
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    background: #2d2d2d;
    color: #d4d4d4;
    border: 1px solid #3c3c3c;
    border-radius: 6px;
    font-size: 13px;
}
.drawer-tool-btn:active { background: #094771; color: #fff; }

.workspace-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px; 
    margin-bottom: 6px;
    background: #2d2d2d;
    border: 1px solid transparent;
    cursor: pointer; 
    border-radius: 6px; 
}
.workspace-item:hover { background: #383838; }
.workspace-item.active { background: #1e1e1e; border-color: #4ec9b0; }

/* =============================================================================
   MENÚ CONTEXTUAL
   ============================================================================= */
.context-menu {
    position: fixed;
    background: #252526;
    border: 1px solid #454545;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 2000;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 160px;
}
.context-menu div {
    padding: 10px 14px;
    font-size: 12px;
    color: #cccccc;
    cursor: pointer;
}
.context-menu div:hover { background: #094771; color: #ffffff; }

/* =============================================================================
   EDITOR + PREVIEW
   =============================================================================
   .editor-area sin padding-bottom: el código llega al fondo del viewport.
   El espacio de reserva va como padding-bottom interno del textarea,
   del highlight layer y de la columna de números.
*/
.editor-area { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: #1e1e1e; 
    overflow: hidden; 
    min-width: 0;
    padding-bottom: 0;
}

.tabs-bar { 
    display: flex; 
    background: #2d2d2d; 
    overflow-x: auto; 
    border-bottom: 1px solid #333; 
    height: 35px; 
    align-items: stretch; 
    flex-shrink: 0; 
}
.tab { 
    padding: 0 14px; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 12px; 
    border-right: 1px solid #333; 
    cursor: pointer; 
    background: #2d2d2d; 
    color: #9a9a9a; 
    white-space: nowrap;
    font-family: monospace;
}
.tab.active { 
    background: #2d8a4e;
    color: #ffffff;
    font-weight: bold;
}
.tab.active .close-tab:hover { background: rgba(0,0,0,0.3); }
.tab .close-tab { font-size: 10px; padding: 2px 5px; border-radius: 50%; }
.tab .close-tab:hover { background: #444; }

.workspace-split {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #1e1e1e;
    position: relative;
    min-height: 0;
}

.line-numbers {
    width: 45px;
    background: #1e1e1e;
    color: #9a9a9a;
    padding-top: var(--editor-pad);
    padding-right: 6px;
    padding-bottom: calc(var(--overlay-reserve) + var(--kb-offset, 0px));
    font-family: monospace;
    font-size: var(--editor-font-size);
    line-height: var(--editor-line-height);
    text-align: right;
    user-select: none;
    overflow: hidden;
    border-right: 1px solid #333;
    flex-shrink: 0;
}
.line-numbers .ln-line {
    display: block;
    min-height: var(--editor-line-height)em;
    line-height: var(--editor-line-height);
}
.line-numbers .ln-comment { color: #9a9a9a; }
.line-numbers .ln-code-a  { color: #79c0ff; }
.line-numbers .ln-code-b  { color: #d2a8ff; }
.line-numbers .ln-err {
    color: #ff7b72;
    font-weight: bold;
    background: rgba(241, 76, 76, 0.20);
    border-radius: 2px;
    padding: 0 2px;
}

.editor-stack {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #1e1e1e;
    min-height: 0;
    min-width: 0;
}

.editor-highlight-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    background: #1e1e1e;
}

.editor-highlight-content {
    padding: var(--editor-pad);
    padding-bottom: calc(var(--overlay-reserve) + var(--kb-offset, 0px));
    font-family: monospace;
    font-size: var(--editor-font-size);
    line-height: var(--editor-line-height);
    white-space: pre;
    tab-size: 4;
    color: #d4d4d4;
    min-width: max-content;
    will-change: transform;
}

.editor-highlight-content .hl-line {
    display: block;
    min-height: var(--editor-line-height)em;
    line-height: var(--editor-line-height);
    white-space: pre;
    margin-left: calc(-1 * var(--editor-pad));
    margin-right: calc(-1 * var(--editor-pad));
    padding-left: var(--editor-pad);
    padding-right: var(--editor-pad);
    border-radius: 0;
    background-color: transparent;
}
.editor-highlight-content .hl-comment {
    color: #e6edf3;
    background-color: rgba(139, 148, 158, 0.07);
}
.editor-highlight-content .hl-code-a {
    color: #d4d4d4;
    background-color: rgba(121, 192, 255, 0.045);
}
.editor-highlight-content .hl-code-b {
    color: #d4d4d4;
    background-color: rgba(210, 168, 255, 0.045);
}
.editor-highlight-content .hl-err {
    color: #ff7b72;
    font-weight: bold;
    background-color: rgba(241, 76, 76, 0.18);
}

.editor-highlight-content .hl-active-line {
    background-image: linear-gradient(rgba(78, 201, 176, 0.07), rgba(78, 201, 176, 0.07));
    box-shadow: inset 3px 0 0 #4ec9b0;
}
@media (prefers-reduced-motion: reduce) {
    .editor-highlight-content .hl-active-line {
        transition: none;
    }
}

#codeEditor { 
    flex: 1;
    width: 100%;
    height: 100%;
    background: transparent;
    color: #d4d4d4; 
    border: none; 
    padding: var(--editor-pad);
    padding-bottom: calc(var(--overlay-reserve) + var(--kb-offset, 0px));
    font-family: monospace; 
    font-size: var(--editor-font-size);
    resize: none; 
    outline: none; 
    line-height: var(--editor-line-height);
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    tab-size: 4;
    position: relative;
    z-index: 1;
    caret-color: #ffffff;
    -webkit-text-fill-color: #d4d4d4;
}

#codeEditor.editor-locked {
    caret-color: transparent;
    cursor: default;
}

#codeEditor[readonly] {
    caret-color: transparent;
    background: transparent;
}

#previewPanel { display: none; background: #ffffff; border: none; flex: 1; }
#previewFrame { width: 100%; height: 100%; border: none; background: #ffffff; }

/* =============================================================================
   ESTILOS DE VISTA
   ============================================================================= */
body.view-standard .editor-highlight-content,
body.view-standard #codeEditor {
    font-size: var(--editor-font-size);
    line-height: var(--editor-line-height);
    white-space: pre;
    overflow-wrap: normal;
}
body.view-standard .line-numbers {
    font-size: var(--editor-font-size);
    line-height: var(--editor-line-height);
}

body.view-mobile .editor-highlight-content,
body.view-mobile #codeEditor {
    font-size: var(--editor-font-size-mobile);
    line-height: var(--editor-line-height-mobile);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-x: hidden;
}
body.view-mobile .line-numbers {
    font-size: var(--editor-font-size-mobile);
    line-height: var(--editor-line-height-mobile);
}
body.view-mobile .editor-highlight-content .hl-line {
    min-height: var(--editor-line-height-mobile)em;
    line-height: var(--editor-line-height-mobile);
    white-space: pre-wrap;
    word-break: break-word;
}

body.view-wide .editor-highlight-content,
body.view-wide #codeEditor {
    font-size: var(--editor-font-size-wide);
    line-height: var(--editor-line-height-wide);
    white-space: pre;
}
body.view-wide .line-numbers {
    font-size: var(--editor-font-size-wide);
    line-height: var(--editor-line-height-wide);
}
body.view-wide .editor-highlight-content .hl-line {
    min-height: var(--editor-line-height-wide)em;
    line-height: var(--editor-line-height-wide);
}

/* =============================================================================
   BARRA DE ESTADO
   =============================================================================
   v3.1.1-r3: mucho más transparente (rgba 0.55) + backdrop-filter. El código
   que pasa por debajo se entrevé con claridad.
*/
.status-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--footer-height) + var(--kb-offset, 0px));
    height: var(--status-bar-height);
    flex-shrink: 0;
    background: rgba(37, 37, 38, 0.55);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    border-top: 1px solid rgba(51, 51, 51, 0.4);
    color: #9a9a9a;
    font-size: 11px;
    font-family: monospace;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    gap: 8px;
    user-select: none;
    overflow: hidden;
    white-space: nowrap;
    z-index: 99;
    transition: bottom 0.08s linear;
}
.status-bar .sb-lines {
    color: #4ec9b0;
    font-weight: bold;
    flex-shrink: 0;
}
.status-bar .sb-sep {
    color: #666;
    flex-shrink: 0;
}
.status-bar .sb-last {
    color: #dcdcaa;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* =============================================================================
   MODO PREVIEW
   ============================================================================= */
body.preview-mode .bar-1 { display: none !important; }
body.preview-mode .bar-2 { display: none !important; }
body.preview-mode #tabsBar { display: none !important; }
body.preview-mode #editorPanel { display: none !important; }
body.preview-mode .status-bar { display: none !important; }
body.preview-mode .workspace-split { height: 100% !important; }
body.preview-mode #previewPanel {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
    border-left: none !important;
}
body.preview-mode footer { display: none !important; }

/* =============================================================================
   BOTÓN FLOTANTE DE SALIDA DE PREVIEW
   ============================================================================= */
.preview-exit-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(45, 138, 78, 0.65);
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 5000;
    cursor: pointer;
    padding: 0;
    opacity: 0.85;
    transition: opacity 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.preview-exit-btn:active {
    opacity: 1;
    background: rgba(35, 107, 61, 0.95);
    transform: scale(0.94);
}
body.preview-mode .preview-exit-btn { display: flex; }
body.preview-mode.preview-hide-exit-icon .preview-exit-btn { display: none; }
body.preview-mode.preview-welcome-open .preview-exit-btn { display: none; }

/* =============================================================================
   OVERLAY DE BIENVENIDA AL PREVIEW
   ============================================================================= */
.preview-welcome-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 5100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.preview-welcome-modal.open { display: flex; }

.preview-welcome-card {
    background: #252526;
    border: 1px solid #454545;
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    padding: 24px 22px 20px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.7);
    animation: editSelectionSlideIn 0.22s ease-out;
    text-align: center;
}
.preview-welcome-icon { font-size: 44px; margin-bottom: 8px; }
.preview-welcome-card h2 { color: #4ec9b0; font-size: 20px; margin-bottom: 10px; }
.preview-welcome-card > p {
    color: #d4d4d4;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
    text-align: left;
}
.preview-welcome-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    text-align: left;
}
.preview-welcome-option {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
}
.preview-welcome-badge { font-size: 22px; flex-shrink: 0; line-height: 1; }
.preview-welcome-option strong { color: #9cdcfe; font-size: 13px; display: block; margin-bottom: 2px; }
.preview-welcome-option p { color: #b5b5b5; font-size: 12px; line-height: 1.4; margin: 0; }
.preview-welcome-option p strong { color: #ffffff; }
.preview-welcome-note {
    font-size: 11px;
    color: #9a9a9a !important;
    text-align: center !important;
    margin-bottom: 14px !important;
}
.preview-welcome-note strong { color: #9cdcfe; }
.preview-welcome-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #d4d4d4;
    cursor: pointer;
    user-select: none;
    margin-bottom: 16px;
}
.preview-welcome-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4ec9b0;
    cursor: pointer;
}
.preview-welcome-ok {
    width: 100%;
    background: #2d8a4e;
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    font-family: monospace;
}
.preview-welcome-ok:active { background: #236b3d; }

/* =============================================================================
   TOAST
   ============================================================================= */
.dicy-toast {
    position: fixed;
    bottom: calc(80px + var(--kb-offset, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(45, 138, 78, 0.95);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-family: monospace;
    font-weight: bold;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 6000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    max-width: calc(100vw - 40px);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dicy-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =============================================================================
   FOOTER — 8 botones
   ============================================================================= */
footer { 
    background: #252526; 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    padding: 4px 4px; 
    border-top: 1px solid #333; 
    height: var(--footer-height); 
    flex-shrink: 0;
    position: fixed; 
    bottom: var(--kb-offset, 0px);
    left: 0;
    width: 100%;
    z-index: 100; 
    padding-bottom: env(safe-area-inset-bottom, 5px);
    transition: bottom 0.08s linear;
}

footer button { 
    background: transparent; 
    padding: 4px 2px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 2px; 
    font-size: 9px; 
    color: #bbb; 
    min-width: 38px;
    flex: 1;
    max-width: 70px;
}
footer button span.icon { font-size: 16px; }
footer button:hover { background: #333; color: #fff; }

#btnMenu {
    background: rgba(78, 201, 176, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(78, 201, 176, 0.2);
    color: #4ec9b0;
}
#btnEditByLines {
    background: rgba(156, 220, 254, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(156, 220, 254, 0.2);
    color: #9cdcfe;
}
#btnUndo {
    background: rgba(227, 179, 65, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(227, 179, 65, 0.25);
    color: #e3b341;
}
#btnUndo:disabled,
#btnUndo.undo-empty {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================================================
   BOTÓN FLOTANTE: EDITAR SELECCIÓN
   ============================================================================= */
.floating-edit-btn {
    position: fixed;
    bottom: calc(80px + var(--kb-offset, 0px));
    right: 16px;
    background: #2d8a4e;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-family: monospace;
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
    z-index: 90;
    display: none;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    opacity: 0;
    transform: translateY(8px);
}
.floating-edit-btn.visible { display: flex; opacity: 1; transform: translateY(0); }
.floating-edit-btn:active { transform: scale(0.96); }

/* =============================================================================
   BANNER CLICK-LINE
   ============================================================================= */
.click-line-banner {
    position: fixed;
    top: 130px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #2d8a4e;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    z-index: 2500;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: calc(100vw - 32px);
}
.click-line-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.click-line-banner button {
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    flex-shrink: 0;
}
.click-line-banner button:active { background: rgba(0,0,0,0.5); }

/* =============================================================================
   MODALES (base compartida)
   ============================================================================= */
.edit-selection-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + var(--kb-offset, 0px));
}
.edit-selection-modal.open { display: flex; }

.edit-selection-card {
    background: #252526;
    border: 1px solid #454545;
    border-radius: 10px;
    width: 100%;
    max-width: 640px;
    height: 70vh;
    max-height: 640px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    overflow: hidden;
    animation: editSelectionSlideIn 0.18s ease-out;
}
@keyframes editSelectionSlideIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.edit-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #2d2d2d;
    border-bottom: 1px solid #333;
    font-size: 13px;
    font-weight: bold;
    color: #4ec9b0;
    flex-shrink: 0;
}
.edit-selection-header #closeEditSelection:hover,
.edit-selection-header #closeEditLines:hover,
.edit-selection-header #closeStructure:hover,
.edit-selection-header #closePrompts:hover,
.edit-selection-header #closeInfo:hover,
.edit-selection-header #closeFind:hover,
.edit-selection-header #closeGithub:hover,
.edit-selection-header #closeStatus:hover { color: #f14c4c; }

#editSelectionTextarea {
    flex: 1;
    min-height: 0;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    padding: 12px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
}

.edit-selection-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px;
    background: #2d2d2d;
    border-top: 1px solid #333;
    flex-shrink: 0;
}
.edit-selection-actions button { padding: 8px 16px; font-size: 13px; border-radius: 6px; }
.edit-selection-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

.edit-selection-actions-multi {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}
.edit-selection-actions-left,
.edit-selection-actions-right { display: flex; gap: 6px; flex-wrap: wrap; }
.edit-selection-actions-left button {
    background: #3a3a3a;
    font-size: 12px;
    padding: 8px 10px;
}
.edit-selection-actions-left button:active { background: #4a4a4a; }

@media (max-width: 480px) {
    .edit-selection-actions-left button,
    .edit-selection-actions-right button {
        padding: 7px 9px;
        font-size: 11.5px;
    }
}

/* =============================================================================
   MODAL EDITAR POR LÍNEAS
   ============================================================================= */
.edit-lines-card { height: auto; max-height: 82vh; }

.edit-lines-tabs {
    display: flex;
    gap: 0;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    overflow-x: auto;
}
.edit-lines-tab {
    flex: 1;
    background: transparent;
    color: #9a9a9a;
    border: none;
    padding: 10px 8px;
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    min-width: 100px;
    border-radius: 0;
}
.edit-lines-tab:hover { background: #252526; color: #d4d4d4; }
.edit-lines-tab.active { color: #4ec9b0; border-bottom-color: #4ec9b0; background: #252526; }

.edit-lines-tab-content { display: none; flex-direction: column; gap: 8px; }
.edit-lines-tab-content.active { display: flex; }

.edit-lines-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.edit-lines-label {
    font-size: 12px;
    color: #9cdcfe;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.edit-lines-input {
    width: 100%;
    padding: 12px 14px;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #454545;
    border-radius: 6px;
    font-family: monospace;
    font-size: 16px;
    outline: none;
    transition: border-color 0.15s ease;
}
.edit-lines-input:focus { border-color: var(--focus-ring-color); box-shadow: var(--focus-ring-shadow); }
.edit-lines-input.invalid { border-color: #f14c4c; box-shadow: 0 0 0 2px rgba(241, 76, 76, 0.3); }

.edit-lines-hint { font-size: 11px; color: #9a9a9a; line-height: 1.5; }
.edit-lines-hint code { background: #1e1e1e; color: #4ec9b0; padding: 1px 5px; border-radius: 3px; font-size: 11px; }

.edit-lines-info { font-size: 12px; color: #4ec9b0; min-height: 18px; line-height: 1.4; }
.edit-lines-info.error { color: #f14c4c; }

.edit-lines-preview-wrap { margin-top: 6px; display: none; }
.edit-lines-preview-wrap.visible { display: block; }
.edit-lines-preview-title { font-size: 11px; color: #9a9a9a; margin-bottom: 6px; letter-spacing: 0.5px; }
.edit-lines-content {
    padding: 10px 12px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    max-height: 160px;
    overflow: auto;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.45;
    color: #d4d4d4;
    white-space: pre;
    tab-size: 4;
}

.edit-lines-dual-inputs { display: flex; gap: 10px; }
.edit-lines-dual-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.edit-lines-dual-prefix { font-size: 11px; color: #9cdcfe; font-weight: bold; letter-spacing: 0.5px; }
.edit-lines-dual-field .edit-lines-input { width: 100%; }

.edit-lines-click-help {
    font-size: 12px;
    color: #d4d4d4;
    line-height: 1.6;
    padding: 12px;
    background: #1e1e1e;
    border-radius: 6px;
    border: 1px solid #333;
}
.edit-lines-click-help strong { color: #4ec9b0; }
.edit-lines-click-start {
    background: #2d8a4e;
    color: #fff;
    padding: 12px 16px;
    font-size: 13px;
    border-radius: 6px;
    margin-top: 4px;
    font-family: monospace;
    width: 100%;
}
.edit-lines-click-start:active { background: #236b3d; }

/* =============================================================================
   MODAL ESTRUCTURA
   ============================================================================= */
.structure-card { max-width: 720px; height: auto; max-height: 85vh; }
.structure-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.structure-msg-input {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #454545;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
}
.structure-msg-input:focus { border-color: var(--focus-ring-color); box-shadow: var(--focus-ring-shadow); }
.structure-tree {
    padding: 12px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #d4d4d4;
    white-space: pre;
    overflow: auto;
    max-height: 40vh;
    min-height: 100px;
}

/* =============================================================================
   MODAL PROMPTS
   ============================================================================= */
.prompts-card {
    max-width: 820px;
    height: 92vh;
    max-height: 92vh;
}

.prompts-tabs {
    display: flex;
    overflow-x: auto;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.prompts-tabs::-webkit-scrollbar { display: none; }

.prompts-tab {
    background: transparent;
    color: #9a9a9a;
    border: none;
    padding: 11px 14px;
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    border-radius: 0;
    flex-shrink: 0;
}
.prompts-tab:hover { background: #252526; color: #d4d4d4; }
.prompts-tab.active { color: #4ec9b0; border-bottom-color: #4ec9b0; background: #252526; }

.prompts-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

#promptsTabContents {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.prompts-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 8px;
    min-height: 0;
    overflow: hidden;
}

.prompt-desc {
    font-size: 12px;
    color: #9a9a9a;
    line-height: 1.5;
    flex-shrink: 0;
}

.prompt-textarea-full {
    flex: 1;
    min-height: 0;
    padding: 12px 14px;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #454545;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    white-space: pre-wrap;
    overflow-y: auto;
    tab-size: 2;
}
.prompt-textarea-full:focus { border-color: var(--focus-ring-color); box-shadow: var(--focus-ring-shadow); }

.prompt-copy-btn {
    background: #2d8a4e;
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 6px;
    flex-shrink: 0;
    font-weight: bold;
}
.prompt-copy-btn:active { background: #236b3d; }

.prompts-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #333;
    background: #1e1e1e;
    flex-shrink: 0;
}
.prompts-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #d4d4d4;
    cursor: pointer;
    user-select: none;
}
.prompts-opt input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4ec9b0;
    cursor: pointer;
    flex-shrink: 0;
}

/* =============================================================================
   MODAL INFO
   ============================================================================= */
.info-card { max-width: 720px; height: auto; max-height: 88vh; }
.info-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.info-body h2 {
    color: #4ec9b0;
    font-size: 18px;
    margin: 20px 0 8px;
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
}
.info-body h2:first-child { margin-top: 0; }
.info-body h3 { color: #9cdcfe; font-size: 15px; margin: 16px 0 6px; }
.info-body p { margin: 8px 0; }
.info-body ul, .info-body ol { margin: 8px 0; padding-left: 22px; }
.info-body li { margin: 4px 0; }
.info-body code {
    background: #1e1e1e;
    color: #4ec9b0;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}
.info-body kbd {
    background: #1e1e1e;
    border: 1px solid #454545;
    border-bottom-width: 2px;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 11px;
    font-family: monospace;
    color: #dcdcaa;
    margin: 0 1px;
}
.info-body strong { color: #ffffff; }
.info-body em { color: #9cdcfe; }

.info-settings-note {
    font-size: 12px;
    color: #9a9a9a !important;
    margin: 4px 0 10px 0 !important;
    line-height: 1.5;
}
.info-settings-note em { color: #4ec9b0; font-style: normal; font-weight: bold; }

.info-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 8px;
}
.info-setting {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #d4d4d4;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}
.info-setting input[type="checkbox"],
.info-setting input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #4ec9b0;
    cursor: pointer;
    flex-shrink: 0;
}
.info-setting em { color: #4ec9b0; font-style: normal; font-weight: bold; }
.info-settings-reset {
    background: #3a3a3a;
    color: #d4d4d4;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    align-self: flex-start;
    margin-top: 4px;
}
.info-settings-reset:active { background: #4a4a4a; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 600px) {
    .breadcrumb { font-size: 10px; }
    .bc-segment { padding: 3px 4px; }
    .active-file-btn { font-size: 10px; padding: 4px 8px; max-width: 40vw; }
    .prompt-textarea-full { font-size: 12px; padding: 10px; }
    .prompts-card { height: 95vh; max-height: 95vh; }
    .preview-exit-btn { width: 42px; height: 42px; font-size: 20px; }
    .status-bar { font-size: 10px; padding: 0 8px; }
    .btn-lock { padding: 4px 7px; font-size: 14px; min-width: 30px; }
    .btn-status { padding: 5px 6px; min-width: 38px; }
    .btn-status .status-dot { width: 9px; height: 9px; }
    .view-style-select { max-width: 110px; font-size: 11px; padding: 4px 5px; }
}

@media (max-width: 400px) {
    footer button { min-width: 32px; font-size: 8px; }
    footer button span.icon { font-size: 14px; }
    .edit-lines-tab { min-width: 80px; font-size: 11px; padding: 8px 6px; }
    .bar-1 { padding: 5px 6px; height: 40px; gap: 4px; }
    .bar-1-right { gap: 3px; }
    .btn-create { padding: 6px 8px; font-size: 12px; }
    .btn-preview { padding: 6px 8px; font-size: 14px; }
    .btn-find { padding: 6px 7px; font-size: 14px; }
    .btn-status { padding: 5px 5px; min-width: 34px; }
    .btn-status .status-count { font-size: 10px; }
    .btn-lock { padding: 4px 5px; font-size: 13px; min-width: 26px; }
    .view-style-select { max-width: 84px; font-size: 10px; padding: 3px 4px; }
    .prompts-tab { padding: 10px 10px; font-size: 11px; }
    .preview-welcome-card { padding: 20px 16px 16px; }
    .preview-welcome-card h2 { font-size: 18px; }
}

/* =============================================================================
   MODAL GITHUB
   ============================================================================= */
.github-card { max-width: 640px; height: auto; max-height: 90vh; }
.github-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.github-note {
    font-size: 12px;
    color: #9a9a9a;
    line-height: 1.5;
    padding: 10px 12px;
    background: #1e1e1e;
    border-left: 3px solid #4ec9b0;
    border-radius: 4px;
    margin-bottom: 8px;
}
.github-note code {
    background: #2a2a2a;
    color: #e3b341;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
}
.github-check {
    margin-top: 10px;
    padding: 10px;
    background: #1e1e1e;
    border-radius: 6px;
}
.github-body .edit-lines-input { margin-bottom: 4px; }
.github-body .edit-lines-hint { margin-bottom: 10px; }
#githubInfo.ok { color: #4ec9b0; }
#githubInfo.err { color: #f14c4c; }

/* =============================================================================
   BOTÓN BUSCAR + MODAL BUSCAR Y REEMPLAZAR
   ============================================================================= */
.btn-find {
    background: #3a3a3a;
    color: #9cdcfe;
    padding: 7px 11px;
    font-size: 15px;
    line-height: 1;
    border-radius: 4px;
}
.btn-find:active { background: #094771; color: #fff; }

.find-card {
    max-width: 520px;
    height: auto;
    max-height: 85vh;
}

.find-body {
    padding: 18px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.find-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.find-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #d4d4d4;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}
.find-opt input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #4ec9b0;
    cursor: pointer;
    flex-shrink: 0;
}

.find-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 10px 16px 14px;
    background: #2d2d2d;
    border-top: 1px solid #333;
    flex-shrink: 0;
}
.find-actions button {
    background: transparent;
    color: #4ec9b0;
    font-weight: bold;
    letter-spacing: 0.6px;
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 6px;
    min-width: 170px;
    text-align: right;
    font-family: monospace;
}
.find-actions button:hover { background: #333; }
.find-actions button:active { background: #094771; color: #fff; }
#findBtnFind { color: #7ee787; }
#findBtnReplaceAll { color: #9cdcfe; }

.find-textarea {
    width: 100%;
    min-height: 44px;
    max-height: 140px;
    padding: 12px 14px;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #454545;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    resize: none;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre;
    transition: border-color 0.15s ease;
    tab-size: 4;
}
.find-textarea:focus {
    border-color: var(--focus-ring-color);
    box-shadow: var(--focus-ring-shadow);
}

.find-hint {
    font-size: 11px;
    color: #9a9a9a;
    line-height: 1.4;
    margin-top: -2px;
    margin-bottom: 4px;
}

/* =============================================================================
   MODAL ESTADO DEL CÓDIGO (LINTER — RESERVADO PARA IA)
   ============================================================================= */
.status-card {
    max-width: 640px;
    height: auto;
    max-height: 85vh;
}
.status-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.status-summary {
    padding: 12px 14px;
    background: #1e1e1e;
    border-radius: 8px;
    font-size: 13px;
    color: #d4d4d4;
    line-height: 1.5;
    border-left: 3px solid #4ec9b0;
}
.status-summary.ok { border-left-color: #2d8a4e; }
.status-summary.warn { border-left-color: #e3b341; }
.status-summary.err { border-left-color: #f14c4c; }
.status-summary strong { color: #ffffff; }
.status-summary .status-emoji { font-size: 16px; margin-right: 4px; }

.status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.status-item {
    padding: 10px 12px 10px 14px;
    background: #1e1e1e;
    border-left: 3px solid #f14c4c;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.status-item:hover { background: #2a2a2a; }
.status-item:active { transform: scale(0.99); }
.status-item.warn { border-left-color: #e3b341; }
.status-item.err  { border-left-color: #f14c4c; }
.status-item .status-line {
    color: #9cdcfe;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 0.4px;
}
.status-item .status-msg {
    color: #d4d4d4;
    margin-top: 4px;
}
.status-item .status-go {
    display: block;
    margin-top: 6px;
    color: #4ec9b0;
    font-size: 11px;
    font-weight: bold;
}
.status-item.empty {
    cursor: default;
    border-left-color: #2d8a4e;
    color: #9a9a9a;
    text-align: center;
    font-style: italic;
}
.status-item.empty:hover { background: #1e1e1e; transform: none; }

/* =============================================================================
   MENÚ CREAR — "Otro" duplicado (v3.2.1)
   =============================================================================
   El bloque .custom-item pone un borde superior como separador cuando va al
   final del menú. Al duplicarlo arriba, ese borde sobra. Lo anulamos solo
   para el primero del contenedor.
*/
.dropdown-menu > .custom-item:first-child {
    border-top: none;
}

/* ===== FIN DEL ARCHIVO styles.css ===== */