/* ── Modal dialogs ── */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 10001;
    background: var(--modal-backdrop);
    display: flex; align-items: center; justify-content: center;
    animation: modal-fade-in 0.15s ease-out;
}
.modal-backdrop.modal-out {
    animation: modal-fade-out 0.12s ease-in forwards;
}
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-fade-out { from { opacity: 1; } to { opacity: 0; } }

.modal-box {
    background: var(--modal-box-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--modal-shadow), inset 0 1px 0 var(--panel-emboss);
    padding: 20px 24px;
    min-width: 280px;
    max-width: 400px;
    width: 90vw;
    animation: modal-box-in 0.15s ease-out;
}
@keyframes modal-box-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-message {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    word-break: break-word;
}
.modal-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--control-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: border-color 0.15s;
    box-shadow: inset 0 1px 0 var(--panel-emboss);
}
.modal-input:focus {
    border-color: var(--accent);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.modal-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--control-bg);
    color: var(--text-primary);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    min-height: 32px;
    box-shadow: inset 0 1px 0 var(--panel-emboss);
}
.modal-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--control-hover-bg);
}
.modal-btn-primary {
    background: var(--control-active-bg);
    color: #fff;
    border-color: var(--accent);
}
.modal-btn-primary:hover {
    filter: brightness(1.1);
    color: #fff;
}
