.instagram-prompt {
    --ink: #f8f5ff;
    --mint: #7fffe0;
    --violet: #ba9cff;
    color-scheme: dark;
    width: min(830px, calc(100% - 28px));
    max-width: none;
    max-height: calc(100dvh - 24px);
    padding: clamp(17px, 4vw, 30px);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #5f528a;
    border-radius: 24px;
    background: radial-gradient(ellipse at 85% 0, #362853, transparent 62%), #181631;
    color: var(--ink);
    box-shadow: 0 26px 86px #070513c9;
    scrollbar-width: thin;
    scrollbar-color: #65577e transparent;
    scrollbar-gutter: stable both-edges;
}

.instagram-prompt::backdrop {
    background:
        radial-gradient(circle, #fff 0 1px, transparent 1.8px) 18px 32px / 173px 191px,
        radial-gradient(circle, #c8adff 0 1.3px, transparent 2.2px) 81px 17px / 281px 263px,
        radial-gradient(circle, #7fffe0b3 0 .8px, transparent 1.7px) 37px 103px / 137px 223px,
        radial-gradient(ellipse at 18% 30%, #49317066, transparent 48%),
        radial-gradient(ellipse at 85% 75%, #13444855, transparent 45%),
        #09081bf2;
    backdrop-filter: blur(4px);
}

body:has(.instagram-prompt[open]) { overflow: hidden; }

.instagram-prompt__dismiss { position: absolute; z-index: 2; top: 15px; right: 15px; margin: 0; }
.instagram-prompt__header { padding-inline-end: 56px; }
.instagram-prompt__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 13px;
    color: var(--mint);
    font-size: .83rem;
    font-weight: 700;
}
.instagram-prompt__brand .brand-mark { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #66518d; border-radius: 9px; background: #2a2147; color: var(--mint); font-size: .9rem; }
.instagram-prompt h2 {
    margin: 0;
    font-size: clamp(1.45rem, 4.6vw, 2.75rem);
    font-weight: 770;
    line-height: 1.06;
    letter-spacing: -.045em;
    text-wrap: balance;
}
/* The heading receives focus on open but isn't a Tab stop. */
.instagram-prompt #instagram-title:focus { outline: none; }
.instagram-prompt h2 span { display: block; color: #d8c3ff; }
.instagram-prompt #instagram-description {
    margin: 12px 0 0;
    color: #ddd3ee;
    font-size: clamp(.88rem, 1.7vw, 1rem);
    line-height: 1.45;
}

.instagram-prompt__icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid #62567f;
    border-radius: 50%;
    background: #24203d;
    color: var(--ink);
    font-size: 1.2rem;
    line-height: 1;
}
.instagram-prompt__icon:not([aria-disabled="true"]):hover { background: #443661; }
.instagram-prompt__icon[aria-disabled="true"] { opacity: .55; cursor: default; }

.instagram-prompt__dismiss .instagram-prompt__icon {
    width: 48px;
    height: 48px;
    border: 1px solid #c9b3ff;
    border-radius: 15px;
    background: linear-gradient(145deg, #655086, #322344);
    color: #fff;
    box-shadow: 0 4px 16px #09051c80, inset 0 1px 0 #ffffff26;
    font-size: 2rem;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.instagram-prompt__dismiss .instagram-prompt__icon:hover {
    border-color: #ffd0e3;
    background: linear-gradient(145deg, #a44475, #602d60);
    box-shadow: 0 4px 22px #d9609e40;
}
.instagram-prompt__dismiss .instagram-prompt__icon:active { background: #602d60; }
.instagram-prompt__dismiss .instagram-prompt__icon svg { display: block; flex-shrink: 0; }

.reel-carousel { margin-block-start: clamp(16px, 2.9vh, 22px); }
.reel-carousel__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reel-carousel__header h3 { margin: 0; font-size: .95rem; font-weight: 680; }
.reel-carousel__arrows { display: flex; gap: 8px; }
.reel-carousel__track {
    --reel-gap: 12px;
    display: flex;
    justify-content: safe center;
    gap: var(--reel-gap);
    margin: 7px -3px 0;
    padding: 4px 3px 7px;
    overflow-x: auto;
    list-style: none;
    scroll-padding-inline: 3px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #65577e transparent;
    overscroll-behavior-x: contain;
}
.reel-carousel__track:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; border-radius: 11px; }
.reel-carousel__item { flex: 0 0 min(200px, calc((100% - 2 * var(--reel-gap)) / 3)); min-width: 0; scroll-snap-align: start; }
.reel-carousel__item:only-child { flex-basis: min(100%, 264px); }
.reel-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid #554a72;
    border-radius: 14px;
    background: #26213e;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease;
}
.reel-card:focus-visible { outline-offset: -2px; }
.reel-card__media {
    position: relative;
    inline-size: 100%;
    aspect-ratio: 420 / 746;
    overflow: hidden;
    background: #181631;
}
.reel-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.reel-card__play {
    position: absolute;
    right: 9px;
    bottom: 9px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #ffffff8c;
    border-radius: 50%;
    background: #18132ae6;
}
.reel-card__play i {
    width: 0;
    height: 0;
    margin-left: 2px;
    border-block: 5px solid transparent;
    border-left: 8px solid #fff;
}
.reel-card p { margin: 0; padding: 10px 11px 12px; font-size: .88rem; font-weight: 690; line-height: 1.32; }

.instagram-prompt__actions {
    display: grid;
    width: min(100%, 440px);
    gap: 14px;
    margin: 24px auto 0;
}
.instagram-prompt__actions .primary-button {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    min-height: 68px;
    padding: 18px 24px;
    border: 2px solid #b7ffed;
    border-radius: 14px;
    background: linear-gradient(120deg, #7fffe0, #45e9be);
    color: #092c25;
    box-shadow: 0 8px 28px #45e9be40;
    text-decoration: none;
    font-size: clamp(1.05rem, 3vw, 1.2rem);
    font-weight: 800;
}
.instagram-prompt__actions .primary-button:hover { background: #a4ffe9; box-shadow: 0 10px 32px #45e9be66; }
.instagram-prompt__actions .console-button {
    color: var(--ink);
    min-height: 60px;
    padding: 16px 24px;
    border: 2px solid #9580bd;
    border-radius: 14px;
    background: #393050;
    font-size: 1.05rem;
    font-weight: 700;
}
.instagram-prompt__actions .console-button:hover { background: #51416f; border-color: var(--violet); }

@media (hover: hover) {
    .reel-card:hover { border-color: var(--violet); background: #32294d; }
}

@media (max-width: 600px) {
    .instagram-prompt { border-radius: 18px; }
    .instagram-prompt__dismiss { top: 10px; right: 10px; }
    .reel-carousel__item { flex-basis: min(220px, 64%); }
}

@media (prefers-reduced-motion: reduce) {
    .reel-carousel__track { scroll-behavior: auto; }
    .reel-card, .instagram-prompt__dismiss .instagram-prompt__icon { transition: none; }
}
