/*
 * Saved accounts popup, shared by the homepage quick buy (home-v2.js builds it)
 * and the product page (web.layouts.modals.saved-accounts renders it).
 * Appended to <body>, where the --tw-* tokens live.
 */
.hv2-qb-pop {
    position: fixed;
    inset: 0;
    z-index: 3333333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    font-family: var(--tw-font);
    animation: hv2-qb-pop-fade 0.2s ease-out;
}

.hv2-qb-pop__panel {
    width: min(400px, 100%);
    max-height: min(560px, calc(100dvh - 32px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: var(--tw-surface);
    border: 1px solid var(--tw-line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    color: var(--tw-ink);
    animation: hv2-qb-pop-in 0.22s ease-out;
}

.hv2-qb-pop__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hv2-qb-pop__title {
    font-size: 15px;
    font-weight: 800;
}

.hv2-qb-pop__close {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--tw-line);
    background: transparent;
    color: var(--tw-ink2);
    font-size: 12px;
    cursor: pointer;
}

.hv2-qb-pop__close:hover {
    color: var(--tw-brand);
    border-color: var(--tw-brand);
}

.hv2-qb-pop__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 0;
}

.hv2-qb-pop__list:empty {
    display: none;
}

.hv2-qb-pop__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--tw-line);
    background: var(--tw-surface2);
    color: var(--tw-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: start;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.hv2-qb-pop__item:hover,
.hv2-qb-pop__item.is-selected {
    border-color: var(--tw-brand);
    background: var(--tw-brand-soft);
}

.hv2-qb-pop__item.is-stale {
    opacity: 0.6;
}

.hv2-qb-pop__item img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.hv2-qb-pop__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv2-qb-pop__tag {
    font-size: 10.5px;
    color: var(--tw-brand);
    white-space: nowrap;
}

.hv2-qb-pop__check {
    color: var(--tw-brand);
    font-weight: 800;
}

.hv2-qb-pop__manage {
    align-self: center;
    color: var(--tw-ink2);
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: underline;
}

.hv2-qb-pop__manage:hover {
    color: var(--tw-brand);
}

@keyframes hv2-qb-pop-fade {
    from { opacity: 0; }
}

@keyframes hv2-qb-pop-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
}

@media (prefers-reduced-motion: reduce) {
    .hv2-qb-pop,
    .hv2-qb-pop__panel {
        animation: none;
    }
}

.hv2-qb-pop__msg {
    font-size: 11px;
    font-weight: 600;
    color: var(--tw-brand);
}

.hv2-qb-pop__empty {
    font-size: 11.5px;
    color: var(--tw-ink2);
    text-align: center;
    padding: 12px 4px;
}

/* The product page renders the popup up front and toggles [hidden]. */
.hv2-qb-pop[hidden] {
    display: none;
}
