/* Complete phone previews fit inside the original product frame. */
.mobile-workshop *,
.mobile-workshop *::before,
.mobile-workshop *::after,
.mobile-preview,
.mobile-preview * {
    box-sizing: border-box;
}

.mobile-workshop__screens {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 4%;
    padding: 6px 8px;
    background: linear-gradient(145deg, #f5faff, #eaf6fd 60%, #f7fbfe);
}

.mobile-workshop__screen {
    display: flex;
    justify-content: center;
    flex: 0 0 32%;
    min-width: 0;
    min-height: 0;
    margin: 0;
}

.mobile-workshop__phone {
    position: relative;
    display: block;
    flex-shrink: 0;
    width: auto;
    height: 100%;
    min-height: 0;
    aspect-ratio: 1170 / 2532;
    overflow: hidden;
    padding: 4px;
    border: 1px solid #d9e6ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 22px -14px rgba(32, 66, 93, .28);
    cursor: zoom-in;
    appearance: none;
}

.mobile-workshop__viewport {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 100%;
    border-radius: 11px;
    background: #f6f6f8;
}

.mobile-workshop__phone:hover {
    border-color: #9dc4dc;
}

.mobile-workshop__phone:focus-visible,
.mobile-preview__close:focus-visible {
    outline: 2px solid #168dc0;
    outline-offset: -3px;
}

.mobile-workshop__zoom-hint {
    margin-left: auto;
    color: #70869a;
    font-size: 11px;
    white-space: nowrap;
}

.mobile-workshop__viewport img {
    display: block;
    width: 100%;
    height: auto;
}

/* Crop the intact center phone from the existing 4096 × 2177 montage.
   Screen bounds: x=1594, y=106, width=910, height=1964. */
.mobile-workshop__viewport--personal img {
    position: absolute;
    width: 450.10989%;
    max-width: none;
    left: -175.164835%;
    top: -5.397149%;
}

.mobile-preview {
    position: fixed;
    inset: 0;
    width: min(calc(100vw - 32px), max(260px, calc((100dvh - 108px) * 910 / 1964 + 26px)));
    height: min(900px, calc(100dvh - 48px));
    max-width: 420px;
    max-height: calc(100dvh - 48px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d9e6ef;
    border-radius: 16px;
    color: #26384b;
    background: #fff;
    box-shadow: 0 12px 48px rgba(32, 66, 93, .2);
}

.mobile-preview[open] {
    display: flex;
    flex-direction: column;
}

.mobile-preview::backdrop {
    background: transparent;
}

.mobile-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 44px;
    padding: 6px 12px;
}

.mobile-preview__header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.mobile-preview__close {
    flex: 0 0 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #607385;
    background: #f2f6fa;
    font-size: 24px;
    cursor: pointer;
}

.mobile-preview__content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0 12px 12px;
    overflow: hidden;
    container-type: size;
}

.mobile-preview__content .mobile-workshop__viewport {
    width: min(100cqw, calc(100cqh * 1170 / 2532));
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1170 / 2532;
    border-radius: 8px;
}

.mobile-preview__content .mobile-workshop__viewport--personal {
    width: min(100cqw, calc(100cqh * 910 / 1964));
    aspect-ratio: 910 / 1964;
}

@media (max-width: 640px) {
    .mobile-workshop__showcase .hero-window__bar {
        gap: 8px;
        padding-inline: 10px;
    }
    .mobile-workshop__zoom-hint {
        font-size: 9px;
    }
    .mobile-workshop__phone {
        padding: 2px;
        border-radius: 9px;
    }
    .mobile-workshop__viewport {
        border-radius: 6px;
    }
}
