:root {
    --vh: 100vh;
    --bg: #f8f9fa;
    --panel: #fff;
    --text: #212529;
    --muted: #6c757d;
    --border: #dee2e6;
    --editor-bg: #fff;
    --preview-bg: #fff;
}

.dark {
    --bg: #0d1117;
    --panel: #0b1220;
    --text: #e6edf3;
    --muted: #9aa4b2;
    --border: #23303b;
    --editor-bg: #071018;
    --preview-bg: #071018;
}

html, body {
    color: #333;
    overflow-x: hidden;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-size: 1em;
    line-height: 1.5em;
    background-color: #fff;
    overscroll-behavior-y: none;
    background: var(--bg);
    color: var(--text);
    font-family: Helvetica, arial, freesans, clean, sans-serif;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: .375rem;
    padding: .75rem;
}

.editor, .preview {
    height: calc(var(--vh) - 120px);
    overflow: auto;
    background: var(--editor-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: .25rem;
}

.preview {
    padding: 1rem;
    background: var(--preview-bg);
}

.editor:focus, .preview:focus {
    box-shadow: none;
}

pre code {
    white-space: pre-wrap;
    background: transparent;
    color: inherit;
}

a {
    color: #4ea8ff;
}

.toolbar .btn {
    margin-right: .25rem;
}

.wordcount {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

@media (max-width: 767px) {
    .editor, .preview {
        height: calc(var(--vh) - 260px);
    }
}

/* Print friendly (respects dark mode toggle) */
@media print {
    body {
        background: #fff;
        color: #000;
    }

    .dark body {
        background: #fff;
        color: #000;
    }
}

.fs-13 {
    font-size: 13px;
}