:root {
    --bg: #ffffff;
    --panel-bg: rgb(245, 245, 245);
    --text: #3e3e3e;
    --plot-bg: #ffffff;
    --border: rgb(221, 221, 221);
    --header-color: #191C20;
    --run-button: #00895A;
    --run-button-hover: #007A50;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --panel-bg: #161b22;
        --text: #e6edf3;
        --plot-bg: #1f2428;
        --border: #30363d;
        --header-color: #191C20;
        --run-button: #007A50;
        --run-button-hover: #006D46;
    }
}

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

body {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    overflow: hidden;
    background-color: var(--bg);
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    background-color: var(--header-color);
    border-bottom: 1px solid #3e3e3e;
}

.title {
    font-size: 20px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.button {
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.button-enabled {
    background-color: var(--run-button);
    color: white;
}

.button-enabled:hover {
    background-color: var(--run-button-hover);
}

.button-disabled {
    background-color: #4b5563;
    color: #9ca3af;
    cursor: not-allowed;
}

.content {
    flex: 1 1 0%;
    display: grid;
    grid-auto-rows: minmax(300px, 1fr);
    min-height: 0px;
}

.editor-panel {
    min-width: 0;
    min-height: 0;
}

.output-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-bg);
    overflow: hidden;
    position: relative;
}

.output-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.output-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 8px;
    min-height: 0;
    position: relative;
    line-height: 1.4;
}

.output-content > * {
    max-width: 100%;
    width: 100%;
}

.output-text {
    font-size: 14px;
    color: var(--text);
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.plot-output {
    margin: 8px 0;
    padding: 8px;
    background: var(--plot-bg);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: rgba(37, 38, 39, 0.1) 0px 1px 2px -1px;
    border-radius: 4px;
}

.plot-output img {
    max-width: 100%;
    height: auto;
    display: block;
}

.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    transition: opacity 0.2s;
    z-index: 1;
    border-left: 1px solid var(--border);
    touch-action: none;
}

.resize-handle-vertical {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 8px;
    width: auto;
    cursor: row-resize;
    transition: opacity 0.2s;
    z-index: 1;
    border-top: 1px solid var(--border);
    touch-action: none;
}

.resize-handle:hover,
.resize-handle-vertical:hover {
    background-color: #3b82f6;
    opacity: 0.5;
}

.cm-content {
    padding: 8px 0px !important;
}
.cm-editor {
    height: 100%;
    font-size: 14px;
}
.cm-scroller {
    overflow: auto;
}


