/* Panels section toolbar styling */
.panels-shell-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.panels-shell-header h2 {
    margin: 0;
    width: 334px;
    min-width: 334px;
    text-align: left;
    gap: 8px;
}

.panels-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 220px;
}

.panels-toolbar.panels-toolbar-right {
    margin-left: auto;
    justify-content: flex-end;
}

#char-prompts-btn {
    position: relative;
    overflow: hidden;
    --calibration-progress: 0%;
}

#char-prompts-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #8ebbffa0, #8ebbffa0);
    transform: translateX(calc(-100% + var(--calibration-progress, 0%)));
    transition: transform .15s ease, opacity .15s ease;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
}

#char-prompts-btn.is-busy::before {
    opacity: 1;
}

#char-prompts-btn > * {
    position: relative;
    z-index: 1;
}

#char-prompts-btn.is-busy {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}

#char-prompts-btn.is-busy .script-toolbar-icon {
    filter: brightness(0) invert(1);
}
.toolbar-spacer {
    flex: 1 1 auto;
}

.panels-toolbar .panels-toolbar-btn {
    border: 1px solid #cbd5f5;
    background: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: .9rem;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.panels-toolbar .panels-toolbar-btn.is-disabled,
.panels-toolbar .panels-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.panels-toolbar .panels-toolbar-btn:hover,
.panels-toolbar .panels-toolbar-btn:focus-visible {
    background: #f8fafc;
    outline: none;
    box-shadow: 0 12px 30px rgba(15,23,42,.12);
}

#char-prompts-btn {
    position: relative;
    overflow: hidden;
    --calibration-progress: 0%;
}

#char-prompts-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #8ebbffa0, #8ebbffa0);
    transform: translateX(calc(-100% + var(--calibration-progress, 0%)));
    transition: transform .15s ease, opacity .15s ease;
    opacity: 0;
    z-index: 0;
    pointer-events: none;
}

#char-prompts-btn.is-busy::before {
    opacity: 1;
}

#char-prompts-btn > * {
    position: relative;
    z-index: 1;
}

#char-prompts-btn.is-busy {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}

#char-prompts-btn.is-busy .script-toolbar-icon {
    filter: brightness(0) invert(1);
}

#char-add-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-header-background);
    color: var(--color-header-background);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

#char-add-btn .script-toolbar-icon {
    filter: none;
    width: 18px;
    height: 18px;
}

#char-add-btn:hover,
#char-add-btn:focus-visible {
    background: #f8fafc;
    border-color: #1b2336;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

#char-add-btn.is-disabled,
#char-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: #fff;
    border-color: #cbd5f5;
    color: #94a3b8;
}

#char-add-btn span {
    display: none;
}

.panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.char-remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #1b2336;
    background: #fff;
    color: #1f2937;
    font-weight: 100;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.char-remove-icon {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.char-remove-btn:hover,
.char-remove-btn:focus-visible {
    background: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
    outline: none;
}

.char-remove-btn.is-disabled,
.char-remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #fff;
    border-color: #e5e7eb;
    color: #9ca3af;
    box-shadow: none;
}
