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

.stage-sub-panel-header
{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding: 8px 10px 0 5px;       /* 위 오른쪽 아래 왼쪽 */
    background: #f6faf9;
}

.stage-sub-panel-tabs
{
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.stage-sub-panel-tab
{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--border);
    border-bottom-color: transparent;
    border-radius: 7px 7px 0 0;
    padding: 9px 5px 8px 9px;       /* 위 오른쪽 아래 왼쪽 */
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 15px;
    color: var(--text-dim);
    background: #edf5f3;
    cursor: pointer;
}

.stage-sub-panel-tab[hidden]
{
    display: none;
}

.stage-sub-panel-tab-icon
{
    display: block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
    transform: translateY(1px);
}

.stage-sub-panel-tab-close
{
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #78908b;
    font-size: 15px;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
}

.stage-sub-panel-tab.active .stage-sub-panel-tab-close,
.stage-sub-panel-tab:hover .stage-sub-panel-tab-close
{
    opacity: 1;
    visibility: visible;
}

.stage-sub-panel-tab.active .stage-sub-panel-tab-close:hover
{
    color: #0f5f56;
    background: #e7f3f0;
}

.stage-sub-panel-tab:hover,
.stage-sub-panel-tab:focus
{
    border-color: #8bcfc6;
    border-bottom-color: transparent;
    color: var(--accent-hover);
    background: #eef8f6;
    outline: none;
}

.stage-sub-panel-tab.active
{
    border-color: var(--border);
    border-bottom-color: #ffffff;
    color: #0f5f56;
    background: #ffffff;
    box-shadow: 0 -1px 0 rgba(18, 131, 116, 0.08);
}

.stage-panel-close
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-bottom: 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-dim);
    background: transparent;
    cursor: pointer;
}

.stage-panel-close:hover,
.stage-panel-close:focus
{
    border-color: var(--border);
    color: var(--text);
    background: var(--panel-muted);
    outline: none;
}

.stage-panel-close svg
{
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

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

.stage-draft-options-panel
{
    display: grid;
    grid-template-rows: none;
    align-content: start;
    justify-items: stretch;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    border-right: 1px solid var(--border);
    padding: 14px;
    background: var(--panel);
}

.stage-synopsis-panel[hidden],
.stage-memo-panel[hidden],
.stage-draft-options-panel[hidden]
{
    display: none;
}

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

.stage-synopsis-editor
{
    font-size: 14px;
    line-height: 1.7;
    background: #fbfdfc;
}

.stage-memo-editor
{
    font-size: 14px;
    line-height: 1.7;
    background: #fffdf7;
}

.stage-draft-option-field
{
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    font-size: 13px;
    color: var(--text);
}

.stage-draft-option-field input,
.stage-draft-option-field select
{
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    color: var(--text);
    background: var(--panel-soft);
}

.stage-draft-option-field input:focus,
.stage-draft-option-field select:focus
{
    border-color: #8bcfc6;
    box-shadow: 0 0 0 3px #d7f3ec;
    outline: none;
}

.stage-draft-option-check
{
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--text);
}
