.panel-center {
    flex: 1;
    min-width: 220px;
    min-height: 0;
    height: 100%;
}

#centerNotes {
    height: 190px;
}

.notes-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.video-link-btn {
    text-decoration: none;
}

.video-link-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

#editorPanel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.editor-header {
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.fragment-select-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-soft);
}

.fragment-select {
    min-width: 240px;
    max-width: 360px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(36, 87, 255, 0.16);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.fragment-select:focus {
    border-color: rgba(36, 87, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(36, 87, 255, 0.12);
}

.fragment-meta {
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--text-soft);
}

.editor-main {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.line-numbers,
#codeEditor,
.editor-area {
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 20px;
}

.line-numbers {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    padding: 10px 8px 10px 8px;
    background: linear-gradient(180deg, #edf3ff, #e8f0ff);
    color: #5e6f94;
    border-right: 1px solid rgba(23, 32, 51, 0.08);
    text-align: right;
    overflow-y: hidden;
    overflow-x: hidden;
    white-space: normal;
    flex: 0 0 auto;
    user-select: none;
    box-sizing: border-box;
}

.line-numbers span {
    display: block;
    height: 20px;
    line-height: 20px;
    padding-right: 4px;
    border-radius: 6px;
}

.line-numbers span.error {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
}

.line-numbers span.current {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px #f59e0b;
}

#codeEditor,
.editor-area {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    padding: 10px 12px;
    background:
        linear-gradient(transparent 19px, rgba(36, 87, 255, 0.04) 20px),
        linear-gradient(90deg, rgba(36, 87, 255, 0.03), rgba(36, 87, 255, 0.01));
    background-size: 100% 20px, 100% 100%;
    color: var(--text);
    border: 0;
    outline: none;
    resize: none;
    overflow-y: auto;
    overflow-x: auto;
    box-sizing: border-box;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
    tab-size: 4;
}

.editor-buttons {
    min-height: 50px;
    padding: 10px 12px;
    background: #f7faff;
    border-top: 1px solid rgba(23, 32, 51, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .editor-toolbar-right {
        margin-left: 0;
        width: 100%;
    }

    .fragment-select {
        min-width: 180px;
        max-width: 100%;
    }
}