.stage-draft-panel
{
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}

.stage-workspace.horizontal .stage-draft-panel
{
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stage-draft-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    background: var(--panel);
}

.stage-draft-header h3
{
    margin: 0;
    font-size: 15px;
}

.stage-draft-header p
{
    margin: 5px 0 0;
    font-size: 12px;
    color: var(--text-dim);
}

.stage-draft-editor
{
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    border: 0;
    padding: 18px;
    resize: none;
    font: inherit;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    background: #ffffff;
    outline: none;
}

.stage-draft-editor::placeholder
{
    color: #94a3b8;
}

.stage-draft-status
{
    border-top: 1px solid #d8e5e2;
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #64746f;
    background: #f3f8f6;
    text-align: right;
}

.stage-text-editor-control
{
    position: relative;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
}

.stage-text-editor-control > .stage-draft-editor
{
    position: absolute;
    inset: 0;
    z-index: 2;
    box-sizing: border-box;
    background: transparent;
}

.stage-text-editor-highlight
{
    position: absolute;
    inset: 0;
    z-index: 1;
    box-sizing: border-box;
    padding: 18px;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    font: inherit;
    font-size: 15px;
    line-height: 1.8;
    color: transparent;
    pointer-events: none;
}

.stage-text-editor-highlight-range
{
    background: rgba(34, 197, 169, 0.24);
    box-shadow: 0 0 0 2px rgba(18, 131, 116, 0.16);
    border-radius: 4px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.stage-draft-editor.refining-selection-active
{
    box-shadow: none;
}

.stage-draft-editor.refining-selection-active::selection
{
    color: #0f172a;
    background: #bfdbfe;
}

.stage-draft-panel.has-edit-selection .stage-draft-status
{
    color: #0f5f56;
    background: #eef8f6;
}
