@font-face {
    font-family: "Sevka";
    src: url("fonts/AbrarSevka-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

:root {
    --bg: #fafaf8;
    --field: #f1f1ee;
    --text: #222;
    --muted: #888;
    --line: #e2e2de;
    --font: "Sevka", Consolas, monospace;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161616;
        --field: #1e1e1e;
        --text: #ddd;
        --muted: #777;
        --line: #2a2a2a;
    }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 var(--font);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
}

button {
    padding: 4px 14px;
    border: 1px solid var(--text);
    border-radius: 3px;
    background: none;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
button:hover { background: var(--text); color: var(--bg); }

main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "editor terminal";
}

.editor   { grid-area: editor; }
.terminal { grid-area: terminal; border-left: 1px solid var(--line); }

section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 20px 16px;
}

label {
    padding: 12px 0 6px;
    font-size: 12px;
    color: var(--muted);
}

textarea, pre, input {
    border: 1px solid transparent;
    border-radius: 3px;
    outline: 0;
    color: inherit;
    font: inherit;
}

textarea, pre {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 12px 14px;
    resize: none;
    tab-size: 4;
    overflow: auto;
}

textarea, input { background: var(--field); }
textarea:focus, input:focus { border-color: var(--muted); }
textarea::placeholder, input::placeholder { color: var(--muted); }

pre {
    background: none;
    white-space: pre-wrap;
    word-break: break-word;
}

input {
    margin-top: 8px;
    padding: 8px 14px;
}
input:disabled { opacity: .4; }

footer {
    padding: 0.5rem 1rem;
    text-align: right;
    font-size: 0.8rem;
    opacity: 0.6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 800px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        grid-template-areas: "editor" "terminal";
    }
    .terminal { border-left: 0; border-top: 1px solid var(--line); }
}

