#mobileStudioPreview, #mobileStudioActions { display: none; }
#mobilePhoneLightbox { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 30px; background: rgb(14 17 23 / .94); }
#mobilePhoneLightbox img { width: 100%; height: 100%; max-height: calc(100dvh - 60px); object-fit: contain; }
#mobilePhoneLightboxClose { position: absolute; top: 12px; right: 12px; z-index: 1; width: 42px; height: 42px; border-radius: 50%; background: var(--bg2); color: var(--tx); font-size: 28px; }
@media(max-width:1023px) {
  body.studio #studio { --mobile-footer: 82px; --mobile-tabs: 52px; }
  body.studio #studio[data-view][data-result] { display: flex; height: auto; min-height: calc(100dvh - var(--hdr)); padding: 0 0 calc(var(--mobile-footer) + env(safe-area-inset-bottom)); }
  body.studio .studio-head { display: none; }
  body.studio #studio[data-view][data-result] > .studio-mobile-tabs { display: flex; align-self: stretch; justify-content: flex-start; gap: 24px; min-height: 52px; margin: 0; padding: 0 var(--mobile-gutter); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--bg2); }
  body.studio .studio-mobile-tabs button { position: relative; min-width: 0; min-height: 52px; padding: 0 3px; border-radius: 0; background: none; font-size: 15px; }
  body.studio .studio-mobile-tabs [aria-selected=true] { background: none; color: var(--tx); }
  body.studio .studio-mobile-tabs [aria-selected=true]::after { content:''; position: absolute; bottom: 0; left: 3px; right: 3px; height: 2px; background: var(--ac); }
  body.studio #studio .st-app { width: 100%; flex: 1; padding: 18px var(--mobile-gutter); }
  body.studio #studio[data-view][data-result].phone-preview-active .st-app { flex: none; height: calc(100dvh - var(--hdr) - var(--mobile-tabs) - var(--mobile-footer)); min-height: 0; padding: 16px var(--mobile-gutter); }
  body.studio #studio[data-view][data-result].phone-preview-active #studioPreview { min-height: 0; border: 0; border-radius: 0; background: none; box-shadow: none; padding: 0; }
  body.studio #studioPreview { min-height: 400px; border: 0; border-radius: 0; box-shadow: none; background: none; }
  body.studio #studio.phone-preview-active #studioPreview { overflow: visible; }
  body.studio #studio.phone-preview-active #studioPreview > :not(#mobileStudioPreview) { display: none; }
  #studio.phone-preview-active #mobileStudioPreview { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; padding: 12px 0; }
  .mobile-phone { display: flex; flex-direction: column; width: min(100%,calc((100dvh - 240px) * .49)); height: max(360px,calc(100dvh - 240px)); max-height: 1220px; min-width: 210px; padding: 9px; border: 1px solid var(--line); border-radius: 37px; background: var(--bg2); box-shadow: 0 0 4px rgb(30 36 48 / .05),0 4px 15px rgb(30 36 48 / .09); }
  .mobile-phone > header { position: relative; display: flex; align-items: center; justify-content: space-between; flex: none; height: 44px; padding: 0 2px; }
  .mobile-phone > header b { font-size: 16px; }
  .mobile-phone > header > button { width: 34px; height: 38px; padding: 0; background: none; color: var(--tx); font-size: 29px; }
  #mobilePhoneMenu summary { display: grid; place-items: center; width: 34px; height: 38px; color: var(--tx); cursor: pointer; list-style: none; font-size: 22px; }
  #mobilePhoneMenu summary::-webkit-details-marker { display: none; }
  #mobilePhoneMenu > div { position: absolute; z-index: 5; top: 100%; right: 0; width: 140px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); box-shadow: var(--sh2); }
  #mobilePhoneMenu button { width: 100%; min-height: 40px; background: none; color: var(--tx); }
  .mobile-phone-photo { position: relative; flex: 1; min-height: 0; background: var(--sf); overflow: hidden; }
  #mobilePhoneImage { display: block; width: 100%; height: 100%; object-fit: cover; }
  #mobileStudioPreview[data-type=result] #mobilePhoneImage { object-fit: contain; }
  #mobileStudioPreview:is([data-type=pose],[data-type=depth]) #mobilePhoneImage { object-fit: contain; }
  #mobilePhoneCount { position: absolute; top: 10px; right: 9px; display: grid; place-items: center; min-width: 31px; height: 31px; padding: 4px; border-radius: 50%; background: rgb(24 28 34 / .45); color: #fff; font-size: 12px; }
  #mobilePhoneExpand { position: absolute; bottom: 10px; right: 9px; display: grid; place-items: center; width: 31px; height: 31px; padding: 7px; border-radius: 50%; background: rgb(24 28 34 / .45); color: #fff; }
  #mobilePhoneExpand svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  #mobilePhoneError { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: var(--sf); color: var(--tx2); text-align: center; }
  #mobilePhoneError p { margin: 0; font-size: 13px; white-space: normal; }
  #mobilePhoneRetry { min-height: 40px; padding: 8px 16px; background: var(--bg2); color: var(--tx); }
  .mobile-phone > footer { position: relative; flex: none; margin-top: -4px; padding: 9px 3px 5px; border-radius: 14px; background: var(--bg2); }
  .mobile-phone-title { display: flex; align-items: center; gap: 4px; }
  #mobilePhoneTitle { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 24px; }
  .mobile-phone-title button { display: grid; place-items: center; flex: none; width: 28px; height: 32px; padding: 5px; background: none; color: var(--mu); }
  .mobile-phone-title svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
  #mobilePhoneFavorite[aria-pressed=true] { color: var(--ac); }
  #mobilePhoneFavorite[aria-pressed=true] svg { fill: var(--acs); }
  #mobilePhoneDescription { margin: 3px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mu); font-size: 11px; line-height: 20px; }
  #mobilePhoneThumbnails { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
  #mobilePhoneThumbnails button { flex: none; width: 42px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 7px; overflow: hidden; background: var(--sf); }
  #mobilePhoneThumbnails [aria-pressed=true] { border-color: var(--ac); }
  #mobilePhoneThumbnails img { width: 100%; height: 100%; object-fit: cover; }
  body.studio #mobileStudioActions:not([hidden]) { position: fixed; display: flex; align-items: center; z-index: 15; left: 0; right: 0; bottom: 0; gap: 12px; height: calc(var(--mobile-footer) + env(safe-area-inset-bottom)); padding: 14px var(--mobile-gutter) calc(14px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--bg2); }
  #mobileStudioActions label { display: flex; align-items: center; flex: 0 1 145px; min-width: 0; padding: 0 9px; border-radius: 28px; background: var(--sf); }
  #mobileStudioActions label svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
  #mobilePreviewMode { width: 100%; min-width: 0; min-height: 46px; padding: 8px 20px 8px 5px; border: 0; background-color: transparent; box-shadow: none; color: var(--tx); font-size: 12px; }
  #mobileGenerate { flex: 1; min-height: 46px; border-radius: 28px; font-size: 17px; }
  body.studio #studio[data-view=preview][data-result] #studioEditor { display: none; }
  #studio[data-view=editor] #mobileStudioActions { display: none; }
  body.studio #studioEditor { margin: 0; }
}
@media(min-width:768px) and (max-width:1023px) {
  body.studio #studio { --mobile-footer: 144px; --mobile-tabs: 80px; }
  body.studio #studio[data-view][data-result] > .studio-mobile-tabs { min-height: 80px; gap: 80px; }
  body.studio .studio-mobile-tabs button { min-height: 80px; font-size: 22px; }
  body.studio #studio .st-app { padding-block: 70px; }
  body.studio #studio[data-view][data-result].phone-preview-active .st-app { padding-block: 65px; }
  .mobile-phone { width: min(64vw,590px); height: min(1220px,calc(100dvh - 440px)); padding: 18px; border-radius: 75px; }
  .mobile-phone > header { height: 72px; }
  .mobile-phone > header b { font-size: 24px; }
  .mobile-phone > footer { padding: 18px 6px 15px; }
  #mobilePhoneTitle { font-size: 24px; line-height: 36px; }
  #mobilePhoneDescription { margin-bottom: 20px; font-size: 18px; line-height: 28px; }
  #mobilePhoneThumbnails { gap: 14px; }
  #mobilePhoneThumbnails button { width: 76px; height: 80px; border-radius: 12px; }
  #mobilePhoneCount, #mobilePhoneExpand { width: 46px; height: 46px; font-size: 18px; }
  #mobileStudioActions label { flex-basis: 265px; padding-inline: 20px; }
  #mobileStudioActions label svg { width: 25px; height: 25px; }
  #mobilePreviewMode, #mobileGenerate { min-height: 80px; font-size: 22px; }
}
@media(max-height:600px) and (max-width:1023px) {
  .mobile-phone { height: 430px; width: 235px; }
}
