.product-preview {
    position: relative;
    width: min(1100px, calc(100% - 40px));
}

.product-preview .app-window {
    width: min(900px, 100%);
    margin-inline: auto;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 0 88px rgba(177, 215, 255, .055), 0 0 260px rgba(177, 215, 255, .028), 0 30px 100px rgba(0, 0, 0, .35);
}

.overlay-preview-stage {
    --preview-scale: 1;
    position: absolute;
    z-index: 2;
    top: clamp(65px, calc(14% + 5px), 145px);
    right: -12px;
    width: 338px;
    height: 125px;
}

.overlay-preview-stage::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: calc(338px * var(--preview-scale));
    height: calc(55px * var(--preview-scale));
    border-radius: calc(8px * var(--preview-scale));
    box-shadow: 0 0 24px rgba(177, 215, 255, .08), 0 30px 100px rgba(0, 0, 0, .35);
    pointer-events: none;
    transition: height 560ms cubic-bezier(.22, 1, .36, 1);
}

.overlay-preview-stage.is-expanded::before {
    height: calc(125px * var(--preview-scale));
}

.overlay-preview {
    --preview-surface: #0b0b0c;
    position: absolute;
    top: 0;
    right: 0;
    width: 338px;
    height: 55px;
    box-sizing: border-box;
    padding: 2px 0 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: var(--preview-surface);
    color: #f4f4f5;
    box-shadow: none;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 16px;
    line-height: normal;
    transform: scale(var(--preview-scale));
    transform-origin: top right;
    user-select: none;
    pointer-events: none;
    transition: height 560ms cubic-bezier(.22, 1, .36, 1),
        background-color 560ms cubic-bezier(.22, 1, .36, 1),
        backdrop-filter 560ms cubic-bezier(.22, 1, .36, 1);
}

.overlay-preview.is-expanded {
    height: 125px;
}

.overlay-preview.is-translucent {
    background: rgba(11, 11, 12, .46);
    backdrop-filter: blur(4px) saturate(118%);
    -webkit-backdrop-filter: blur(4px) saturate(118%);
}

.overlay-preview-top {
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.overlay-preview-brand {
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .25px;
}

.overlay-preview-switch {
    position: relative;
    display: block;
    width: 38px;
    height: 20px;
}

.overlay-preview-switch-track {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 20px;
    background: #3ecf8e;
    transition: background 300ms ease;
}

.overlay-preview-switch-track::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transform: translateX(18px);
    transition: transform 300ms ease, background 300ms ease;
}

.overlay-preview-switch-track::after {
    content: "ON";
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 20px;
    height: 100%;
    color: #07150f;
    font-size: 8.5px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.3px;
    transform: translateY(.5px);
    opacity: 1;
    transition: opacity 160ms ease;
}

.overlay-preview-hotkey,
.overlay-preview-listen {
    display: grid;
    place-items: center;
    height: 26px;
    border-radius: 13px !important;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.overlay-preview-hotkey {
    width: 80px;
    padding: 0 7px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(255, 255, 255, .05);
    text-overflow: ellipsis;
}

.overlay-preview-listen {
    padding: 0 7px;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
}

.overlay-preview-close {
    display: grid;
    place-items: center;
    width: 20px;
    height: 24px;
    padding: 0;
    background: none;
    color: #a1a1aa;
    font-size: 16px;
    line-height: 1;
}

.overlay-preview-target {
    position: relative;
    height: 18px;
    color: #a1a1aa;
    font-size: 10px;
    line-height: 1;
}

.overlay-preview-target-content {
    position: absolute;
    inset: 0 auto 1px var(--target-inset, 9px);
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: calc(50% - 42px);
}

.overlay-preview-target-check {
    display: inline-grid;
    place-items: center;
    width: 13px;
    height: 13px;
    color: #3ecf8e;
}

.overlay-preview-target-check svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.overlay-preview-target-name {
    overflow: hidden;
    color: #d4d4d8;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overlay-preview-expand {
    position: absolute;
    top: 0;
    left: 50%;
    display: inline-grid;
    place-items: center;
    width: 84px;
    height: 18px;
    min-width: 84px;
    padding: 0;
    transform: translateX(-50%);
    color: #c7c7cf;
    background: none;
}

.overlay-preview-expand svg {
    position: relative;
    z-index: 1;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: transform 180ms ease, opacity 120ms ease;
}

.overlay-preview.is-expanded .overlay-preview-expand svg {
    opacity: 1;
}

.overlay-preview.is-expanded .overlay-preview-expand svg {
    transform: rotate(180deg);
}

.overlay-preview-mini-bars {
    position: absolute;
    inset: 4px 3px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, 1px);
    gap: 1px 2px;
    align-content: center;
    opacity: .8;
}

.overlay-preview-mini-bars span {
    height: 1px;
    background: var(--bar-color);
    animation: previewMiniWave 8s ease-in-out infinite;
    animation-delay: calc(var(--bar-index) * -.4s);
}

.overlay-preview.is-expanded .overlay-preview-mini-bars {
    opacity: 0;
}

@keyframes previewMiniWave {
    0%, 100% { opacity: .16; transform: scaleX(.18); }
    50% { opacity: .9; transform: scaleX(1); }
}

.overlay-preview-capture {
    position: absolute;
    top: 0;
    left: calc(75% - 22.5px);
    width: 62px;
    height: 18px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #f4f4f5;
}

.overlay-preview-eye {
    width: 20px;
    height: 18px;
    flex: none;
}

.overlay-preview-eye svg {
    width: 20px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.overlay-preview-eye-open { display: none; }
.overlay-preview-capture.is-active .overlay-preview-eye-closed { display: none; }
.overlay-preview-capture.is-active .overlay-preview-eye-open {
    display: block;
    animation: previewEyeOpen 380ms cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes previewEyeOpen {
    from { clip-path: inset(40% 0 40% 0); }
    to { clip-path: inset(0); }
}
#preview-pupil-clip circle { fill: #fff; stroke: none; }
.overlay-preview-pupil { fill: url(#preview-pupil-glass); stroke: none; }
.overlay-preview-pupil-reflection {
    opacity: 0;
    filter: saturate(1.5);
    transition: opacity 1000ms linear;
}
.overlay-preview-pupil-reflection.is-visible { opacity: .72; }
.overlay-preview-pupil-glint { fill: #fff; stroke: none; }

.overlay-preview-capture-arrow {
    width: 10px;
    height: 14px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.overlay-preview-thumb {
    position: relative;
    width: 26px;
    height: 14.625px;
    flex: none;
    overflow: hidden;
    border-radius: 2px;
}

.overlay-preview-idle-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: #d8e7ef;
    transition: opacity 180ms ease;
}
.overlay-preview-idle-stars path:nth-child(1) { opacity: .9; }
.overlay-preview-idle-stars path:nth-child(2) { opacity: .65; }
.overlay-preview-idle-stars path:nth-child(3) { opacity: .4; }
.overlay-preview-capture.is-active .overlay-preview-idle-stars { opacity: 0; }

.overlay-preview-thumb-image {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    object-fit: fill;
    transition: opacity 180ms ease;
}
.overlay-preview-capture.is-active .overlay-preview-thumb-image { opacity: 1; }

.overlay-preview-glass {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    transform: translateY(-50%);
}

.overlay-preview-glass-lens {
    position: relative;
    display: block;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 50%;
    background:
        radial-gradient(circle at 29% 22%, rgba(255, 255, 255, .74), rgba(255, 255, 255, .13) 22%, transparent 43%),
        radial-gradient(circle at 73% 79%, rgba(17, 46, 63, .88), transparent 48%),
        radial-gradient(circle at 51% 45%, rgba(161, 215, 238, .36), rgba(45, 87, 110, .24) 56%, rgba(13, 30, 43, .8) 100%);
    box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .47), inset -2px -2px 3px rgba(5, 14, 23, .56), 0 2px 4px rgba(0, 0, 0, .45);
}

.overlay-preview-glass-lens::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 8px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .74);
    box-shadow: 0 0 3px rgba(255, 255, 255, .47);
    transform: rotate(-35deg);
    filter: blur(.3px);
}

.overlay-preview-blend {
    height: 66px;
    margin-top: 2px;
    padding: 2px 6px 0;
    opacity: 0;
    transition: opacity 240ms ease;
}

.overlay-preview.is-expanded .overlay-preview-blend {
    opacity: 1;
}

.overlay-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
}

.overlay-preview-blend-row {
    display: grid;
    grid-template-columns: 66px 1fr 27px;
    align-items: center;
    gap: 5px;
    height: 11px;
    min-width: 0;
    font-size: 7.3px;
}

.overlay-preview-blend-name {
    overflow: hidden;
    color: var(--bar-color);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overlay-preview-blend-track {
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, .07);
}

.overlay-preview-blend-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--bar-color);
    box-shadow: 0 0 4px color-mix(in srgb, var(--bar-color) 38%, transparent);
}

.overlay-preview-blend-percent {
    color: #a1a1aa;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

@media (prefers-reduced-motion: reduce) {
    .overlay-preview,
    .overlay-preview *,
    .overlay-preview *::before,
    .overlay-preview *::after {
        animation: none !important;
        transition: none !important;
    }
}
