@media (max-width: 700px) {
    .try-studio[data-try-studio],
    .try-studio[data-try-studio] > * {
        min-width: 0;
    }

    .try-studio[data-try-studio] .try-upload input[type="file"] {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .try-studio[data-try-studio] .try-view-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .try-studio[data-try-studio] .try-view-options .btn {
        min-width: 0;
        padding-inline: 4px;
    }

    .try-studio[data-try-studio] .try-canvas-toolbar > span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .try-studio[data-try-studio] .try-canvas-toolbar > button {
        flex: 0 0 auto;
    }
}

.try-canvas model-viewer[data-try-model]{width:100%;height:min(68vh,720px);min-height:420px;background:radial-gradient(circle at 50% 42%,#173c25,#082015 70%);--poster-color:transparent}
.try-mode-switch{position:absolute;z-index:8;top:78px;left:50%;transform:translateX(-50%);display:flex;gap:6px;padding:5px;border:1px solid #34563e;background:rgba(3,20,12,.88);border-radius:999px}
.try-mode-switch button{border:0;border-radius:999px;background:transparent;color:#b7c9bc;padding:8px 12px;font-size:11px;font-weight:800;cursor:pointer}
.try-mode-switch button.is-active{background:#64ad2d;color:#fff}.try-mode-switch button:disabled{opacity:.35;cursor:not-allowed}
.try-model-note{position:absolute;z-index:7;bottom:22px;left:50%;transform:translateX(-50%);padding:7px 11px;border-radius:999px;background:rgba(2,15,9,.72);color:#d8eadb;font-size:11px;pointer-events:none}
@media(max-width:700px){.try-canvas model-viewer[data-try-model]{height:54vh;min-height:360px}.try-mode-switch{top:68px;width:max-content;max-width:calc(100% - 24px)}.try-mode-switch button{padding:7px 9px;font-size:10px}}


/* Compact, readable mobile try-on stage. */
@media (max-width:700px){
  .try-studio[data-try-studio] .try-canvas{min-height:0!important;height:auto!important;padding-bottom:18px!important}
  .try-studio[data-try-studio] .try-canvas-toolbar{position:relative!important;top:auto!important;left:auto!important;right:auto!important;margin:12px 12px 0;min-height:64px}
  .try-studio[data-try-studio] .try-mode-switch{position:relative;top:auto;left:auto;transform:none;margin:10px auto 6px}
  .try-studio[data-try-studio] .try-empty{position:relative!important;inset:auto!important;transform:none!important;display:flex;align-items:center;justify-content:center;text-align:center;min-height:150px;padding:24px 18px}
  .try-studio[data-try-studio] .try-asset-missing{position:relative!important;inset:auto!important;transform:none!important;margin:0 12px 12px;padding:14px 12px;text-align:center}
  .try-studio[data-try-studio] img[data-face-preview]{position:relative!important;inset:auto!important;width:100%!important;height:auto!important;max-height:56vh;object-fit:contain}
  .try-studio[data-try-studio] img[data-hat-overlay]{max-width:100%}
  .try-studio[data-try-studio] .try-style-picker{padding-top:22px}
  .try-studio[data-try-studio] .try-style-picker h2{margin-top:0}
  .try-canvas model-viewer[data-try-model]{height:48vh;min-height:300px}
}

.try-camera-actions{display:grid;grid-template-columns:1fr;gap:8px;margin:0 0 12px}
.try-vision-status{margin-top:10px;padding:9px 10px;border:1px solid #34563e;border-radius:7px;background:#0a1d12;color:#b9c9be;font-size:12px;line-height:1.4}
.try-vision-status[data-state="ok"]{border-color:#64ad2d;color:#d9f4c7}
.try-vision-status[data-state="warn"]{border-color:#9b7937;color:#f1d79d}
.try-canvas video[data-camera-preview]{display:block;width:100%;height:auto;max-height:68vh;object-fit:contain;background:#07130c}
.try-canvas video[data-camera-preview][hidden]{display:none}
.try-canvas img[data-hat-overlay]{z-index:6;pointer-events:none;transform-origin:center center;will-change:left,top,width,transform}
@media(max-width:700px){.try-canvas video[data-camera-preview]{max-height:56vh}.try-camera-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.try-camera-actions .btn{min-width:0;padding-inline:7px}}

.try-result-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start;margin:14px 0;padding:14px;border:1px solid #34563e;border-radius:10px;background:#0a1d12}.try-result-actions[hidden]{display:none}.try-result-actions form{margin:0}.try-result-actions .btn{width:100%;min-height:44px}.try-result-actions .form-hint{grid-column:1/-1;margin:0;color:#b9c9be}@media(max-width:700px){.try-result-actions{grid-template-columns:1fr;margin:12px}.try-result-actions .form-hint{grid-column:1}}


/* Keep the customer image/camera and fitted product in the same coordinate space. */
.try-media-stage{position:relative;width:100%;min-height:420px;overflow:hidden;background:#07130c}
.try-media-stage video[data-camera-preview],
.try-media-stage img[data-face-preview]{position:relative!important;inset:auto!important;display:block;width:100%!important;height:auto!important;max-height:68vh;object-fit:contain;margin:0 auto}
.try-media-stage video[data-camera-preview][hidden],
.try-media-stage img[data-face-preview][hidden]{display:none!important}
.try-media-stage img[data-hat-overlay]{position:absolute!important;z-index:6;max-width:none;pointer-events:none;transform-origin:center center}
.try-media-stage .try-empty{z-index:2}
.try-media-stage .try-asset-missing{z-index:7}
.try-camera-actions [hidden]{display:none!important}
@media(max-width:700px){
  .try-media-stage{min-height:280px}
  .try-media-stage video[data-camera-preview],
  .try-media-stage img[data-face-preview]{max-height:62vh}
  .try-studio[data-try-studio] .try-empty{min-height:280px}
  .try-studio[data-try-studio] .try-asset-missing{position:absolute!important;left:12px!important;right:12px!important;bottom:12px!important;top:auto!important;margin:0!important}
}

/* Reference-style visual product selector: the customer face remains the main stage. */
.try-style-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;margin:10px 0 12px;border:1px solid #34563e;border-radius:8px;padding:4px}
.try-style-tabs button{min-width:0;border:0;border-bottom:2px solid transparent;background:transparent;color:#c8d5cc;padding:9px 3px;font-size:10px;font-weight:800;cursor:pointer}
.try-style-tabs button.is-active{border-bottom-color:#75bd32;color:#9ddd55}
.try-product-select-fallback{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.try-product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-height:54vh;overflow:auto;padding:2px}
.try-product-card{position:relative;min-width:0;min-height:126px;border:1px solid #49604f;border-radius:9px;background:#07130c;color:#f2f5f2;padding:7px;display:grid;grid-template-rows:88px auto;align-items:center;gap:5px;cursor:pointer}
.try-product-card img{display:block;width:100%;height:88px;object-fit:contain}
.try-product-card>span:last-of-type{font-size:11px;line-height:1.25;overflow-wrap:anywhere}
.try-product-card i{display:none;position:absolute;right:6px;top:6px;width:20px;height:20px;border-radius:50%;background:#75bd32;color:#fff;font-style:normal;line-height:20px;text-align:center;font-weight:900}
.try-product-card.is-selected{border:2px solid #75bd32;box-shadow:0 0 0 1px rgba(117,189,50,.25)}
.try-product-card.is-selected i{display:block}
.try-product-card:disabled{opacity:.42;cursor:not-allowed}
.try-product-card[hidden]{display:none}
.try-product-noasset{display:grid;place-items:center;height:88px;border:1px dashed #49604f;border-radius:6px;color:#9caf9f;font-size:10px;line-height:1.3}
.try-selected-product{margin:12px 0 6px;font-weight:800;color:#dce8df}
@media(max-width:1050px){.try-style-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}.try-product-grid{max-height:none}}
@media(max-width:700px){.try-style-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.try-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none}.try-product-card{min-height:118px}}

.try-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.try-section-reset{border:0;background:transparent;color:#7fca36;font:inherit;font-size:11px;cursor:pointer}
.try-toolbar-actions{display:flex;align-items:center;gap:4px}.try-toolbar-actions button{white-space:nowrap}
.try-stage-bottom{position:absolute;z-index:9;left:50%;right:18px;bottom:18px;transform:translateX(-50%);width:calc(100% - 36px);display:flex;align-items:center;justify-content:center;pointer-events:none}
.try-view-angle{display:grid;grid-template-columns:repeat(4,minmax(64px,1fr));min-width:360px;border:1px solid #49604f;border-radius:8px;overflow:hidden;background:rgba(3,20,12,.9);pointer-events:auto}
.try-view-angle button{border:0;border-bottom:2px solid transparent;background:transparent;color:#e8eee9;padding:11px 15px;font-size:11px;cursor:pointer}.try-view-angle button.is-active{border-bottom-color:#75bd32}
.try-compare{position:absolute;right:0;border:1px solid #49604f;border-radius:8px;background:rgba(3,20,12,.9);color:#fff;padding:11px 16px;cursor:pointer;pointer-events:auto}
@media(max-width:700px){.try-stage-bottom{position:relative;left:auto;right:auto;bottom:auto;transform:none;width:auto;margin:10px 12px;display:grid;gap:8px}.try-view-angle{min-width:0;width:100%;grid-template-columns:repeat(4,minmax(0,1fr))}.try-view-angle button{padding:9px 3px;font-size:10px}.try-compare{position:relative;right:auto;width:100%}}
