/* Стили самой песочницы (не превью). Тема — по системным настройкам */

:root {
    color-scheme: light dark;
    --bg: #fff;
    --text: #222;
    --muted: #666;
    --panel: #f4f4f4;
    --border: #ccc;
    --button: #e8e8e8;
    --button-hover: #ddd;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1e1e1e;
        --text: #ddd;
        --muted: #999;
        --panel: #2a2a2a;
        --border: #444;
        --button: #333;
        --button-hover: #3d3d3d;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    font-family: sans-serif;
    background: var(--bg);
    color: var(--text);
}

.code {
    width: 50%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.code label {
    padding: 6px 8px;
    font-size: 13px;
    color: var(--muted);
    background: var(--panel);
}

.code textarea {
    flex: 1;
    border: 0;
    padding: 8px;
    font: 13px/1.5 monospace;
    resize: none;
    tab-size: 4;
    background: var(--bg);
    color: var(--text);
}

.code button {
    padding: 8px;
    font-size: 14px;
    border: 0;
    border-top: 1px solid var(--border);
    background: var(--button);
    color: var(--text);
    cursor: pointer;
}

.code button:hover {
    background: var(--button-hover);
}

/* превью всегда светлое: виджет темную тему не поддерживает */
iframe {
    width: 50%;
    border: 0;
    background: #fff;
    color-scheme: light;
}
