.vto-modal {
    position: fixed;
    inset: 0;
    z-index: 280;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    isolation: isolate;
}
.vto-modal[hidden] { display: none !important; }
.vto-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
}
.vto-modal__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(520px, 100%);
    height: min(760px, calc(100dvh - 32px));
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 24px;
    padding: 20px 20px 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.vto-modal__head {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.vto-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
    padding-bottom: 8px;
}
.vto-modal__foot {
    flex: 0 0 auto;
    padding-top: 12px;
    background: #fff;
}
.vto-modal__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: #005366;
}
.vto-modal__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
}
.vto-modal__close:hover { background: #f7f7f7; color: #111827; }
.vto-banner {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: #f7f7f7;
}
.vto-banner__art {
    position: relative;
    width: 104px;
    height: 72px;
    flex-shrink: 0;
}
.vto-banner__shot {
    position: absolute;
    width: 56px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.vto-banner__shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.vto-banner__shot--product { left: 0; top: 8px; }
.vto-banner__shot--model { right: 0; top: 0; }
.vto-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.vto-steps li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.vto-steps__n {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 9999px;
    background: #111827;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.vto-steps strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}
.vto-steps p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #4b5563;
}
.vto-models {
    position: relative;
    margin-bottom: 20px;
}
.vto-models__track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 40px 8px 2px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior: contain;
}
.vto-models__track::-webkit-scrollbar { display: none; }
.vto-models__next {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #fff;
    color: #111827;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    z-index: 2;
}
.vto-models__next:hover { color: #005366; border-color: #005366; }
.vto-tile {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    scroll-snap-align: start;
    padding: 0;
}
.vto-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.vto-tile__mark {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    line-height: 18px;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.vto-tile.is-selected {
    border-color: #005366;
    box-shadow: 0 0 0 2px rgba(0, 83, 102, 0.2);
}
.vto-tile.is-selected .vto-tile__mark { display: block; }
.vto-tile--upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-style: dashed;
    border-color: #f26522;
    background: #fff;
    color: #f26522;
    font-size: 0.75rem;
    font-weight: 600;
}
.vto-tile--upload svg { width: 28px; height: 28px; color: #f26522; }
.vto-tile__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 9999px;
    background: rgba(17, 24, 39, 0.7);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}
.vto-section-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}
.vto-history {
    min-height: 72px;
    margin-bottom: 16px;
}
.vto-history__empty {
    margin: 0;
    font-size: 0.8125rem;
    color: #9ca3af;
}
.vto-history__row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.vto-history__row::-webkit-scrollbar { display: none; }
.vto-history__item {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
}
.vto-history__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.vto-tips-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}
.vto-tips-card {
    margin: 0;
}
.vto-tips-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    overflow: hidden;
    background: #f7f7f7;
    border: 1px solid #e5e7eb;
}
.vto-tips-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.vto-tips-card__badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.vto-tips-card__badge svg {
    width: 16px;
    height: 16px;
}
.vto-tips-card__badge--yes { background: #16a34a; }
.vto-tips-card__badge--no { background: #e2150c; }
.vto-tips-card figcaption {
    margin-top: 8px;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
}
.vto-modal__panel.is-result .vto-modal__body,
.vto-modal__panel.is-result #vto-setup-foot {
    display: none !important;
}
.vto-result-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
}
.vto-result-stage[hidden] { display: none !important; }
.vto-result-stage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
}
.vto-result-foot {
    display: flex;
    gap: 12px;
    padding-top: 16px;
}
.vto-result-foot[hidden] { display: none !important; }
.vto-result-back {
    flex: 1;
    min-height: 48px;
    border: 0;
    border-radius: 9999px;
    background: #9ca3af;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
}
.vto-result-back:hover { background: #4b5563; }
.vto-result-cart.btn-cta {
    flex: 1;
    min-height: 48px;
    gap: 8px;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.vto-result-cart svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.vto-view {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
}
.vto-view[hidden] { display: none !important; }
.vto-view label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
}
.vto-view label:has(input:checked) {
    border-color: #005366;
    background: rgba(0, 83, 102, 0.08);
    color: #005366;
}
.vto-view input { position: absolute; opacity: 0; pointer-events: none; }
.vto-generate.btn-cta {
    width: 100%;
    min-height: 48px;
    gap: 8px;
    letter-spacing: 0.08em;
    font-weight: 700;
    background: linear-gradient(90deg, #f26522 0%, #e2150c 100%);
}
.vto-generate.btn-cta:hover {
    background: linear-gradient(90deg, #e2150c 0%, #c0120a 100%);
}
.vto-generate svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.vto-generate:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.vto-offline {
    margin: 0 0 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2150c;
}
.vto-toast {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.vto-toast.is-success { display: block; background: #f0fdf4; color: #16a34a; }
.vto-toast.is-error { display: block; background: #fef2f2; color: #e2150c; }
.vto-modal .studio-ai-progress { z-index: 230; }
body.vto-open { overflow: hidden; }
body.vto-open .min-h-screen { overflow: visible !important; }
@media (max-width: 640px) {
    .vto-modal { padding: 0; align-items: flex-end; }
    .vto-modal__panel {
        width: 100%;
        height: min(92dvh, calc(100dvh - 8px));
        max-height: calc(100dvh - 8px);
        margin: 0;
        border-radius: 20px 20px 0 0;
        padding: 16px;
    }
    .vto-banner { grid-template-columns: 1fr; }
    .vto-banner__art { display: none; }
    .vto-tile,
    .vto-tile--upload {
        flex-basis: 80px;
        width: 80px;
        height: 80px;
    }
}
