/* SweetAlert2: modales más pequeños y discretos */
.swal2-container { padding: 1rem; }
.swal2-container.swal2-backdrop-show { background: rgba(15, 23, 42, 0.28) !important; }
.swal2-popup.swal-compact {
    font-family: 'Segoe UI', system-ui, sans-serif;
    max-width: min(22rem, 92vw);
    padding: 0.65rem 0.85rem 0.85rem;
    font-size: 0.875rem;
    box-shadow: 0 0.125rem 1rem rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.swal2-popup.swal-compact .swal2-title {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.35rem 0 0;
    margin: 0 0 0.25rem;
    color: #212529;
}
.swal2-popup.swal-compact .swal2-html-container,
.swal2-popup.swal-compact #swal2-content {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #5c636a;
    margin: 0.25rem 0 0;
    padding: 0;
}
.swal2-popup.swal-compact .swal2-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0.4rem auto 0.4rem;
    border-width: 2px;
}
.swal2-popup.swal-compact .swal2-icon-content {
    font-size: 1.25rem;
}
.swal2-popup.swal-compact .swal2-actions {
    margin: 0.65rem 0 0;
    gap: 0.35rem;
}
.swal2-popup.swal-compact .swal2-styled {
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
}
.swal2-popup.swal-toast-compact {
    max-width: min(18rem, 92vw);
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8125rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08) !important;
}

:root {
    --editor-bg: #1e1e1e;
    --nav-h: 56px;
    --mobile-tabs-h: 52px;
}
body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', system-ui, sans-serif;
    height: 100vh;
    overflow: hidden;
}
.navbar-brand { font-size: 1.05rem; max-width: 42vw; }
@media (min-width: 768px) {
    .navbar-brand { max-width: none; }
}
.workbench {
    height: calc(100vh - var(--nav-h));
    display: flex;
    flex-direction: row;
    min-height: 0;
}
.panel-editor,
.panel-preview {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.editor-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px 0 0 12px;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}
#preview-container-right {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}
.panel-header {
    background: #2d2d2d;
    color: #fff;
    padding: 8px 15px;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.editor-tabs-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--editor-bg);
}
.editor-tabs-nav {
    flex-shrink: 0;
    border-bottom: 1px solid #333;
}
.editor-tabs-nav .nav-link {
    color: #adb5bd;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 0;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.editor-tabs-nav .nav-link:hover:not(.active) {
    color: #e9ecef;
    background: rgba(255, 255, 255, 0.04);
}
#tab-html.nav-link.active {
    color: #b6d4fe;
    background: rgba(13, 110, 253, 0.18);
    border-bottom-color: #0d6efd;
}
#tab-css.nav-link.active {
    color: #ffd8a8;
    background: rgba(253, 126, 20, 0.16);
    border-bottom-color: #fd7e14;
}
#tab-js.nav-link.active {
    color: #a3e9c1;
    background: rgba(25, 135, 84, 0.2);
    border-bottom-color: #198754;
}
.editor-tabs-wrap .tab-content {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.editor-tabs-wrap .tab-content > .tab-pane {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    margin-bottom: 0;
}
.editor-tabs-wrap .tab-content > .tab-pane.active.show {
    display: flex;
}
.editor-tabs-wrap .tab-content > .tab-pane.fade {
    opacity: 1;
    transition: none;
}
.editor-tab-textarea {
    flex: 1;
    min-height: 0;
    width: 100%;
    background: var(--editor-bg);
    color: #9cdcfe;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.875rem;
    padding: 12px 15px;
    border: none;
    resize: none;
    outline: none;
    line-height: 1.45;
    overflow: auto;
}
.editor-tab-textarea.editor-css { color: #d4b896; }
.editor-tab-textarea.editor-js { color: #dcdcaa; }
#preview-iframe {
    flex: 1;
    min-height: 0;
    border: none;
    background: #fff;
}
.shortcut-badge {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}
.offcanvas-body pre {
    background: #2d2d2d;
    color: #abb2bf;
    padding: 15px;
    border-radius: 8px;
    position: relative;
    font-size: 0.8rem;
    border: 1px solid #444;
}
.step-card {
    border: none;
    border-radius: 10px;
    border-left: 5px solid #0d6efd;
}
.btn-copy {
    position: absolute;
    top: 10px;
    right: 10px;
}
.mobile-tabs {
    height: var(--mobile-tabs-h);
    flex-shrink: 0;
}
@media (max-width: 767.98px) {
    .workbench {
        flex-direction: column;
        height: calc(100vh - var(--nav-h) - var(--mobile-tabs-h));
    }
    .workbench.mobile-editor .panel-preview {
        display: none !important;
    }
    .workbench.mobile-preview .panel-editor {
        display: none !important;
    }
    .editor-shell,
    #preview-container-right {
        border-radius: 12px !important;
    }
}
