.editor-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.editor-feature-gate-banner {
    margin: 0 var(--page-gutter);
    margin-top: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--banner-warning-bg);
    box-shadow: inset 0 0 0 1px var(--banner-warning-border);
    color: var(--banner-warning-text);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.editor-feature-gate-banner.hidden {
    display: none;
}

.editor-feature-gate-link {
    margin-left: 0.5rem;
    color: var(--banner-warning-link);
    text-decoration: underline;
    font-weight: 600;
}

.editor-feature-gate-link:hover {
    color: var(--banner-warning-link-hover);
}

.editor-header {
    padding: 1rem var(--page-gutter);
    background: var(--bg-glass);
    border-bottom: none;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.editor-file-info {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    min-width: 0;
}

.editor-file-name {
    font-weight: 600;
    font-size: var(--text-md);
    color: var(--text-primary);
    word-break: break-all;
}

.editor-dirty-mark {
    font-size: var(--text-xs);
    color: var(--warning);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.15s var(--ease);
}

.editor-dirty-mark.editor-dirty-mark--on {
    opacity: 1;
}

.editor-toolbar--code {
    padding: 0.5rem var(--page-gutter);
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    flex-shrink: 0;
}

.editor-status-text {
    font-family: ui-monospace, monospace;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.editor-toolbar-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: right;
}

.editor-code-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 var(--page-gutter) var(--space-md);
    box-sizing: border-box;
}

.editor-code-area {
    flex: 1;
    min-height: 12rem;
    width: 100%;
    box-sizing: border-box;
    resize: none;
    margin: 0;
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px var(--border-glass);
    background: var(--code-block-bg);
    color: var(--code-block-fg);
    font-family: ui-monospace, 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.55;
    tab-size: 2;
    -moz-tab-size: 2;
    outline: none;
    overflow: auto;
    white-space: pre;
    overflow-wrap: normal;
}

.editor-code-area::placeholder {
    color: var(--text-muted);
    white-space: pre-wrap;
}

.editor-code-area:focus {
    box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.editor-code-area:read-only {
    opacity: 0.85;
    cursor: not-allowed;
}

.editor-header-titles {
    min-width: 0;
}

.editor-page-title {
    font-size: var(--text-lg);
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 0.35rem 0;
    letter-spacing: -0.02em;
}

.editor-actions {
    gap: var(--space-sm);
}

.editor-after-save-bar {
    margin: 0 var(--page-gutter);
    padding: 0.65rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    background: rgba(var(--accent-rgb), 0.08);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.15);
    font-size: var(--text-sm);
}

.editor-after-save-bar.hidden {
    display: none;
}

.editor-after-save-msg {
    color: var(--text-muted);
    flex: 1 1 12rem;
}

.editor-after-save-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.editor-after-save-actions .btn-sm {
    font-size: var(--text-xs);
    padding: 0.35rem 0.65rem;
}
