.stage-directing-board
{
    position: fixed;
    z-index: 80;
    display: grid;
    gap: 12px;
    max-height: min(800px, 70vh);
    overflow-y: auto;
    border: 1px solid rgba(18, 131, 116, 0.22);
    border-radius: 12px;
    padding: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
}

.stage-directing-board[hidden]
{
    display: none;
}

.stage-directing-board-header
{
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-bottom: 1px solid #dce9e6;
    padding-bottom: 10px;
}

.stage-directing-board-header > div:first-child
{
    flex: 1;
    min-width: 0;
}

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

.stage-directing-board-header p
{
    margin: 4px 0 0;
    font-size: 12px;
    color: #64746f;
}

.stage-directing-board-section
{
    display: grid;
    gap: 8px;
}

.stage-directing-board-content
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
}

.stage-directing-board-area
{
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.stage-directing-board-section h4
{
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #2e403c;
}

.stage-directing-board-list
{
    display: grid;
    gap: 6px;
}

.stage-directing-board-item,
.stage-directing-board-recent
{
    border: 1px solid #d7e6e2;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text);
    background: #fbfdfc;
}

.stage-directing-board-item
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.stage-directing-board-item:hover,
.stage-directing-board-item:focus,
.stage-directing-board-recent:hover,
.stage-directing-board-recent:focus
{
    border-color: #9ed7cf;
    background: #f3fbf9;
    outline: none;
}

.stage-directing-board-item.selected,
.stage-directing-board-recent.selected
{
    border-color: #63bdb3;
    background: #e9f7f4;
    box-shadow: inset 3px 0 0 #43a79c, 0 0 0 1px rgba(49, 148, 137, 0.08);
}

.stage-directing-board-item-content
{
    min-width: 0;
    transition: padding-left 0.15s ease;
}

.stage-directing-board-item.selected .stage-directing-board-item-content,
.stage-directing-board-recent.selected p
{
    padding-left: 6px;
}

.stage-directing-board-recent.just-added
{
    animation: stage-directing-just-added 1.25s ease-out;
}

.stage-directing-board-recent.removing
{
    pointer-events: none;
    animation: stage-directing-removing 0.42s ease-in forwards;
}

@keyframes stage-directing-just-added
{
    0%
    {
        border-color: #f2c46d;
        background: #fff8e5;
        box-shadow: inset 3px 0 0 #e4a83a, 0 0 0 0 rgba(228, 168, 58, 0.42);
    }

    45%
    {
        border-color: #f2c46d;
        background: #fff4d3;
        box-shadow: inset 3px 0 0 #e4a83a, 0 0 0 6px rgba(228, 168, 58, 0.16);
    }

    100%
    {
        border-color: #63bdb3;
        background: #e9f7f4;
        box-shadow: inset 3px 0 0 #43a79c, 0 0 0 1px rgba(49, 148, 137, 0.08);
    }
}

@keyframes stage-directing-removing
{
    0%
    {
        border-color: #b8c4c0;
        background: #f4f6f5;
        opacity: 1;
        transform: translateX(0);
        box-shadow: inset 3px 0 0 #8d9a96, 0 0 0 1px rgba(100, 116, 111, 0.08);
    }

    45%
    {
        border-color: #c7a6a6;
        background: #f8eeee;
        opacity: 0.82;
        transform: translateX(2px);
        box-shadow: inset 3px 0 0 #a77b7b, 0 0 0 5px rgba(167, 123, 123, 0.11);
    }

    100%
    {
        border-color: #d7e6e2;
        background: #fbfdfc;
        opacity: 0;
        transform: translateX(8px);
        box-shadow: none;
    }
}

.stage-directing-board-recent
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.stage-directing-board-recent p
{
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stage-directing-board-recent-actions
{
    display: flex;
    align-items: center;
    gap: 6px;
}

.stage-directing-board-empty
{
    border: 1px dashed #d7e6e2;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 12px;
    color: #7a8a86;
    background: #fbfdfc;
}

.stage-directing-board-icon,
.stage-directing-board-btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfe0dc;
    border-radius: 12px;
    color: #42625c;
    background: #ffffff;
    cursor: pointer;
}

.stage-directing-board-btn
{
    position: absolute;
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
}

.stage-directing-board-icon
{
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.stage-directing-board-icon.add
{
    color: #0f5f56;
    background: #eef8f6;
}

.stage-directing-board-icon.delete
{
    color: #7a6868;
    background: #faf8f7;
}

.stage-directing-board-icon.remove-from-set
{
    width: 26px;
    height: 26px;
}

.stage-directing-board-icon:hover,
.stage-directing-board-icon:focus,
.stage-directing-board-btn:hover,
.stage-directing-board-btn:focus
{
    border-color: #8bcfc6;
    color: #0f5f56;
    background: #eef8f6;
    outline: none;
}

.stage-directing-board-icon:disabled
{
    cursor: not-allowed;
    opacity: 0.45;
}

.stage-directing-board-icon svg,
.stage-directing-board-btn svg
{
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

#stageDirectingBoardBtn:disabled:hover,
#stageRefiningBoardBtn:disabled:hover
{
    border-color: #cfe0dc;
    color: #42625c;
    background: #ffffff;
}

@media (max-width: 900px)
{
    .stage-directing-board-content
    {
        grid-template-columns: 1fr;
    }
}
