.web-editor-shell {
    max-width: 1760px;
    padding: 8px 4px 32px;
    text-align: left;
}

.web-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.web-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.web-editor-toolbar kbd {
    margin-left: 5px;
    padding: 2px 5px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 0 !important;
    background: rgba(0, 0, 0, .14);
    color: inherit;
    font-size: .68rem;
    font-weight: 500;
}

.web-editor-save-status {
    min-height: 23px;
    margin: 0 2px 8px;
    color: var(--site-muted);
    font-size: .82rem;
}

.web-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.web-editor-pane {
    min-width: 0;
    padding: 12px;
    overflow: hidden;
    border: 1px solid var(--site-line);
    border-radius: 0 !important;
    background: var(--site-card);
}

.web-editor-pane-header {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.web-editor-pane-header > button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.web-editor-toolbar > button {
    display: inline-flex;
    width: auto;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 9px;
    white-space: nowrap;
}

.web-editor-toolbar > button .bi {
    padding-right: 0;
}

.web-editor-toolbar > button:not(#run-button) {
    width: 34px;
    flex: 0 0 34px;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.web-editor-pane-header > button .bi {
    padding-right: 0;
}

.web-editor-pane-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--site-ink);
    font-size: .98rem;
    font-weight: 700;
}

.web-editor-pane-header h2 > i {
    color: var(--site-blue);
}

.web-editor-pane-header h2 > .code-language-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    font-size: 1.7rem;
    line-height: 1;
}

.html-language-icon { color: #e34f26 !important; }
.css-language-icon { color: #1572b6 !important; }
.js-language-icon { color: #a98200 !important; }

.dark .js-language-icon { color: #f0c330 !important; }

.web-editor-pane .CodeMirror {
    width: 100%;
    height: 360px;
    border: 1px solid var(--site-line) !important;
    border-radius: 0 !important;
    font-size: .88rem;
    line-height: 1.5;
}

.web-editor-preview-pane {
    display: flex;
    min-height: 410px;
    flex-direction: column;
}

.web-editor-preview-pane .web-editor-pane-header {
    justify-content: flex-start;
}

.preview-status {
    min-height: 20px;
    margin: 0 0 7px;
    color: var(--site-muted);
    font-size: .8rem;
}

.preview-errors {
    max-height: 105px;
    margin: 0 0 8px;
    padding: 8px 10px;
    overflow: auto;
    border: 1px solid #efb4b1;
    border-radius: 0 !important;
    background: #fff3f2;
    color: #8f2420;
    font: .8rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
}

.dark .preview-errors {
    border-color: #703e43;
    background: #321f25;
    color: #ffb5af;
}

#code-result {
    width: 100%;
    min-height: 0;
    flex: 1;
    border: 1px solid var(--site-line);
    border-radius: 0 !important;
    background: #fff;
}

@media (max-width: 991.98px) {
    .web-editor-header {
        align-items: center;
    }

    .web-editor-toolbar {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .web-editor-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .web-editor-shell {
        padding-right: 0;
        padding-left: 0;
    }

    .web-editor-toolbar {
        width: 100%;
    }

    .web-editor-pane .CodeMirror {
        height: 300px;
    }

    .web-editor-preview-pane {
        min-height: 350px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .web-editor-shell * {
        scroll-behavior: auto !important;
    }
}
