/* CodeMirror adapter. Keep vendor geometry isolated from app.css's global border-box reset. */

.CodeMirror,
.CodeMirror * {
    box-sizing: content-box;
}

.CodeMirror {
    box-sizing: border-box;
    width: 100%;
    min-height: 430px;
    height: 430px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    background: #ffffff;
    color: #222222;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.CodeMirror-lines {
    padding: 4px 0;
}

.CodeMirror-gutters {
    border-right: 1px solid #dddddd;
    background: #f7f7f7;
}

.CodeMirror-linenumber {
    color: #999999;
}

.CodeMirror-focused {
    border-color: #555555;
    outline: 2px solid #555555;
    outline-offset: 1px;
}

.cm-keyword {
    color: #444444;
    font-weight: 800;
}

.cm-def,
.cm-variable {
    color: #222222;
}

.cm-string {
    color: #7a3e3e;
}

.cm-number {
    color: #5c5c5c;
}

.cm-comment {
    color: #888888;
    font-style: italic;
}

.cm-operator {
    color: #333333;
}

.CodeMirror-activeline-background {
    background: #f1f1f1;
}

.CodeMirror-matchingbracket {
    color: #111111 !important;
    font-weight: 800;
    text-decoration: underline;
}

@media (max-width: 700px) {
    .CodeMirror {
        min-height: 320px;
        height: min(430px, 52dvh) !important;
        max-height: 430px;
        font-size: 16px;
    }

    .CodeMirror-scroll {
        overscroll-behavior: contain;
    }
}

@media (max-width: 700px) and (orientation: landscape) {
    .CodeMirror {
        min-height: 220px;
        height: 58dvh !important;
    }
}