.overlay-modal {
    --overlay-modal-duration: 0.32s;
    --overlay-modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.overlay-modal.hidden {
    display: none;
}

.overlay-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity var(--overlay-modal-duration) var(--overlay-modal-ease);
}

.overlay-modal--open .overlay-modal__backdrop {
    opacity: 1;
}

.overlay-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 480px);
    max-height: min(85vh, 600px);
    overflow: hidden;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition:
        opacity var(--overlay-modal-duration) var(--overlay-modal-ease),
        transform var(--overlay-modal-duration) var(--overlay-modal-ease);
}

.overlay-modal--open .overlay-modal__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.overlay-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e2e8f0;
}

.overlay-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.overlay-modal__close {
    border: 0;
    background: transparent;
    padding: 0.35rem 0.5rem;
    font-size: 1rem;
    color: #64748b;
    cursor: pointer;
    border-radius: 0.5rem;
}

.overlay-modal__close:hover {
    background: #f1f5f9;
}

.overlay-modal__search {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
}

.overlay-modal__search-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    color: #0f172a;
    outline: none;
}

.overlay-modal__search-input:focus {
    border-color: var(--overlay-modal-accent, #0b285b);
}

.overlay-modal__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.overlay-modal__option-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    overflow: auto;
    max-height: min(55vh, 420px);
}

.overlay-modal__option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    border-radius: 0.65rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.overlay-modal__option:hover {
    background: #f8fafc;
}

.overlay-modal__option input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--overlay-modal-accent, #0b285b);
    flex-shrink: 0;
}

.overlay-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.15rem;
    border-top: 1px solid #e2e8f0;
}

.overlay-modal__btn {
    border: 0;
    border-radius: 0.75rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.overlay-modal__btn--ghost {
    background: #f1f5f9;
    color: #475569;
}

.overlay-modal__btn--primary {
    background: var(--overlay-modal-accent, #0b285b);
    color: #fff;
}

.overlay-modal__btn--primary:hover {
    background: var(--overlay-modal-accent-hover, #091938);
}

@media (prefers-reduced-motion: reduce) {
    .overlay-modal__backdrop,
    .overlay-modal__panel {
        transition: none;
    }
}
