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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1e1e1e;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #1e1e1e;
    position: relative;
    overflow: hidden;
    padding-bottom: 30px; /* Espacio para el footer fijo */
}

.header {
    background: #2d2d30;
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.3em;
    font-weight: 500;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-controls span {
    color: #cccccc;
    font-size: 14px;
}

.btn-dashboard,
.btn-logout {
    background: #0e639c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-dashboard:hover,
.btn-logout:hover {
    background: #1177bb;
}

.btn-logout {
    background: #c33;
}

.btn-logout:hover {
    background: #d44;
}

/* Barra de herramientas */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    gap: 15px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-select {
    padding: 6px 12px;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    font-size: 13px;
    background: #1e1e1e;
    color: #cccccc;
    cursor: pointer;
}

.toolbar-select:focus {
    outline: none;
    border-color: #007acc;
}

.toolbar-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cccccc;
    font-size: 13px;
    cursor: pointer;
}

.toolbar-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-save,
.btn-history {
    background: #4caf50;
    color: white;
}

.btn-save:hover,
.btn-history:hover {
    background: #45a049;
}

.btn-history {
    background: #ff9800;
}

.btn-history:hover {
    background: #f57c00;
}

.toolbar-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-share {
    background: #667eea;
    color: white;
}

.btn-share:hover {
    background: #764ba2;
}

.btn-compile {
    background: #0e639c;
    color: white;
}

.btn-compile:hover {
    background: #1177bb;
}

.btn-debug {
    background: #ff9800;
    color: white;
}

.btn-debug:hover {
    background: #ffa726;
}

.btn-recompile {
    background: #9c27b0;
    color: white;
}

.btn-recompile:hover {
    background: #ab47bc;
}

.btn-clear {
    background: #d32f2f;
    color: white;
}

.btn-clear:hover {
    background: #f44336;
}

/* Controles de debug */
.debug-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
}

.debug-buttons {
    display: flex;
    gap: 8px;
}

.btn-debug-action {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: #0e639c;
    color: white;
    transition: all 0.2s;
}

.btn-debug-action:hover {
    background: #1177bb;
}

.btn-debug-action.btn-run {
    background: #28a745;
    font-weight: 600;
}

.btn-debug-action.btn-run:hover {
    background: #218838;
}

.debug-help {
    font-size: 11px;
    color: #858585;
}

/* Editor de código */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #1e1e1e;
}

/* Panel de Historial de Versiones (lateral derecho) */
.version-history-panel {
    width: 350px;
    background: #252526;
    border-left: 1px solid #3e3e42;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    order: 3; /* Asegurar que esté al final (derecha) */
}

.version-history-header {
    padding: 12px 16px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.version-history-header h3 {
    margin: 0;
    color: #cccccc;
    font-size: 14px;
    font-weight: 500;
}

.btn-refresh-history {
    background: transparent;
    border: none;
    color: #cccccc;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-refresh-history:hover {
    background: #3e3e42;
}

.version-history-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.version-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.version-item {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    padding: 12px;
    transition: border-color 0.2s;
    cursor: pointer;
}

.version-item:hover {
    border-color: #0e639c;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.version-info {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.version-number {
    font-weight: 600;
    color: #4ec9b0;
    font-size: 13px;
}

.version-date {
    color: #858585;
    font-size: 11px;
}

.version-language {
    background: #0e639c;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.version-title {
    color: #cccccc;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 500;
}

.version-preview {
    color: #858585;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    background: #252526;
    padding: 6px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 60px;
    overflow: hidden;
    margin-bottom: 8px;
}

.btn-restore {
    background: #0e639c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
    width: 100%;
    margin-top: 8px;
}

.btn-restore:hover {
    background: #1177bb;
}

.btn-execute {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.2s;
    width: 100%;
    margin-top: 8px;
}

.btn-execute:hover {
    background: #218838;
}

.empty-state {
    text-align: center;
    color: #858585;
    padding: 40px 20px;
    font-style: italic;
}

.error-message {
    text-align: center;
    color: #f44336;
    padding: 20px;
}

.loading {
    text-align: center;
    color: #858585;
    padding: 40px 20px;
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1e1e1e;
    border-right: 1px solid #3e3e42;
    order: 1; /* Editor primero (izquierda) */
}


.editor-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.CodeMirror {
    height: 100%;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
}

.CodeMirror-gutters {
    background: #1e1e1e;
    border-right: 1px solid #3e3e42;
}

.CodeMirror-linenumber {
    color: #858585;
    padding: 0 8px;
}

.CodeMirror-cursor {
    border-left: 2px solid #aeafad;
}


/* Terminal Resizer */
.terminal-resizer {
    height: 4px;
    background: #3e3e42;
    cursor: ns-resize;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    transition: background 0.2s;
}

.terminal-resizer:hover {
    background: #0e639c;
}

.terminal-resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 2px;
    background: #858585;
    border-radius: 2px;
}

.terminal-resizer:hover::before {
    background: #0e639c;
}

/* Terminal */
.terminal-container {
    display: flex;
    flex-direction: column;
    height: 350px;
    min-height: 150px;
    max-height: calc(100vh - 200px);
    background: #1e1e1e;
    border-top: 1px solid #3e3e42;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    resize: none;
}

.terminal-header {
    padding: 8px 15px;
    background: #2d2d30;
    color: #cccccc;
    font-size: 12px;
    font-weight: 500;
    border-bottom: 1px solid #3e3e42;
    flex-shrink: 0;
    z-index: 1;
}

#terminal {
    flex: 1;
    padding: 10px;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

.xterm {
    height: 100% !important;
    width: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.xterm-viewport {
    background-color: #1e1e1e !important;
    overflow-y: scroll !important;
    overflow-x: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #424242 #1e1e1e;
}

.xterm-viewport::-webkit-scrollbar {
    width: 12px;
}

.xterm-viewport::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.xterm-viewport::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 6px;
}

.xterm-viewport::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

.xterm-screen {
    width: 100% !important;
}

.xterm-scroll-area {
    overflow: visible !important;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #cccccc;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #3e3e42;
    border-top: 4px solid #0e639c;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

/* Pie de página */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: #2d2d30;
    border-top: 1px solid #3e3e42;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #858585;
    font-size: 11px;
}

.footer-separator {
    color: #3e3e42;
}


/* Panel de Logs */
.logs-panel {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 600px;
    max-height: 400px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.logs-header {
    padding: 12px 16px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.logs-header h3 {
    margin: 0;
    font-size: 14px;
    color: #cccccc;
    font-weight: 600;
}

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

.btn-logs-clear,
.btn-logs-download,
.btn-logs-toggle {
    padding: 6px 12px;
    background: #0e639c;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-logs-clear:hover,
.btn-logs-download:hover,
.btn-logs-toggle:hover {
    background: #1177bb;
}

.btn-logs-toggle {
    background: #3e3e42;
    font-size: 11px;
    padding: 4px 8px;
}

.btn-logs-toggle:hover {
    background: #4e4e52;
}

.logs-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #cccccc;
    background: #1e1e1e;
    max-height: 350px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.logs-empty {
    color: #858585;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Estilos del historial ya están en .version-history-panel arriba */

.empty-state {
    text-align: center;
    color: #858585;
    padding: 40px 20px;
    font-style: italic;
}

.error-message {
    text-align: center;
    color: #f44336;
    padding: 20px;
}

.loading {
    text-align: center;
    color: #858585;
    padding: 40px 20px;
}

/* Notificaciones */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.notification-success {
    background: #4caf50;
    color: white;
}

.notification-error {
    background: #f44336;
    color: white;
}

.notification-info {
    background: #2196F3;
    color: white;
}

.notification-warning {
    background: #ff9800;
    color: white;
    opacity: 1;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px;
    background: #252526;
    border-left: 3px solid #0e639c;
    border-radius: 4px;
}

.log-entry-info {
    border-left-color: #0e639c;
}

.log-entry-warn {
    border-left-color: #ffa500;
}

.log-entry-error {
    border-left-color: #f48771;
}

.log-timestamp {
    color: #858585;
    font-size: 10px;
}

.log-level {
    font-weight: 600;
    margin-left: 8px;
}

.log-message {
    margin-top: 4px;
    color: #cccccc;
}

.log-data {
    margin-top: 8px;
    padding: 8px;
    background: #1e1e1e;
    border-radius: 4px;
    font-size: 10px;
    color: #858585;
    overflow-x: auto;
}

/* Estilos para modal de calificación */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: #252526;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #3e3e42;
}

.modal-header h2 {
    color: #cccccc;
    font-size: 18px;
    margin: 0;
}

.btn-close-modal {
    background: none;
    border: none;
    color: #cccccc;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-close-modal:hover {
    background: #3e3e42;
}

.form-group {
    margin-bottom: 20px;
    padding: 0 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cccccc;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0e639c;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #3e3e42;
}

.btn-cancel,
.btn-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-cancel {
    background: #3e3e42;
    color: #cccccc;
}

.btn-cancel:hover {
    background: #4a4a4a;
}

.btn-submit {
    background: #0e639c;
    color: white;
}

.btn-submit:hover {
    background: #1177bb;
}

.modal-body {
    padding: 20px;
}

.btn-copy-link {
    background: #0e639c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-copy-link:hover {
    background: #1177bb;
}

.btn-grade {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-grade:hover {
    background: #45a049;
}

/* Panel de calificación */
.grade-display-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.grade-display-header {
    padding: 12px 16px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    border-radius: 8px 8px 0 0;
}

.grade-display-header h3 {
    margin: 0;
    color: #cccccc;
    font-size: 14px;
    font-weight: 500;
}

.grade-display-content {
    padding: 16px;
}

.grade-number {
    font-size: 32px;
    font-weight: 700;
    color: #4caf50;
    margin-bottom: 12px;
    text-align: center;
}

.grade-bar {
    width: 100%;
    height: 8px;
    background: #3e3e42;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.grade-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    transition: width 0.3s ease;
}

.grade-comments-label {
    font-size: 12px;
    color: #858585;
    margin-bottom: 8px;
    font-weight: 500;
}

.grade-comments-text {
    color: #cccccc;
    font-size: 13px;
    line-height: 1.5;
    padding: 8px;
    background: #1e1e1e;
    border-radius: 4px;
    margin-bottom: 12px;
}

.grade-meta {
    font-size: 11px;
    color: #858585;
}

.grade-meta-item {
    margin-bottom: 4px;
}

/* Calificación en toolbar */
.grade-toolbar-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 10px;
    padding: 6px 12px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
}

.grade-toolbar-label {
    font-size: 13px;
    color: #cccccc;
    font-weight: 500;
}

.grade-toolbar-value {
    font-size: 16px;
    font-weight: 700;
    color: #4caf50;
}

.btn-delete-grade {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
    margin-left: 5px;
}

.btn-delete-grade:hover {
    background: #c82333;
}

/* Resizer para vista previa HTML (vertical, entre editor y preview) */
.html-preview-resizer {
    width: 4px;
    background: #3e3e42;
    cursor: ew-resize;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    transition: background 0.2s;
}

.html-preview-resizer:hover {
    background: #0e639c;
}

.html-preview-resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    background: #858585;
    border-radius: 2px;
}

.html-preview-resizer:hover::before {
    background: #0e639c;
}

/* Panel de vista previa HTML (lado derecho) */
.html-preview-panel {
    display: flex;
    flex-direction: column;
    width: 50%;
    min-width: 300px;
    max-width: 70%;
    background: #ffffff;
    border-left: 1px solid #3e3e42;
    flex-shrink: 0;
    order: 2; /* Después del editor */
}

.html-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
}

.html-preview-header h3 {
    margin: 0;
    color: #cccccc;
    font-size: 14px;
    font-weight: 500;
}

.html-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-open-new-window {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.btn-open-new-window:hover {
    background: #3e3e42;
    color: #0e639c;
}

.btn-close-preview {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-close-preview:hover {
    background: #3e3e42;
}

.html-preview-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

.btn-preview-html {
    background: #667eea;
    color: white;
}

.btn-preview-html:hover {
    background: #764ba2;
}

/* Ajustar layout cuando hay preview HTML */
.main-content:has(.html-preview-panel[style*="display: flex"]) {
    display: flex;
    flex-direction: row;
}

.main-content:has(.html-preview-panel[style*="display: flex"]) .editor-container {
    flex: 1;
    min-width: 300px;
    max-width: 70%;
    border-right: none;
}

/* Ocultar historial cuando hay preview HTML */
.main-content:has(.html-preview-panel[style*="display: flex"]) .version-history-panel {
    display: none;
}

/* Estilos para preview de Matplotlib */
.matplotlib-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #ffffff;
    overflow: auto;
}

.matplotlib-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Ajustar layout cuando hay preview de Matplotlib */
.main-content:has(#matplotlib-preview-panel[style*="display: flex"]) {
    display: flex;
    flex-direction: row;
}

.main-content:has(#matplotlib-preview-panel[style*="display: flex"]) .editor-container {
    flex: 1;
    min-width: 300px;
    max-width: 70%;
    border-right: none;
}

.main-content:has(#matplotlib-preview-panel[style*="display: flex"]) #matplotlib-preview-panel {
    flex: 1;
    min-width: 300px;
    max-width: 70%;
}

.main-content:has(#matplotlib-preview-panel[style*="display: flex"]) .version-history-panel {
    display: none;
}
