/* ApnaImage Studio mobile layout */



@media (max-width: 800px) {

  html,

  body {

    width: 100%;

    max-width: 100%;

    overflow-x: hidden;

  }



  * {

    box-sizing: border-box;

  }



  .main,

  .content,

  .studio-layout,

  .controls-card,

  .result-card {

    width: 100%;

    min-width: 0;

  }



  .topbar {

    min-height: 64px;

    height: auto;

    padding: 12px 14px;

    gap: 10px;

    flex-wrap: wrap;

  }



  .page-title h1 {

    font-size: 20px;

    line-height: 1.25;

  }



  .content {

    padding: 12px;

  }



  .studio-layout {

    display: grid;

    grid-template-columns: minmax(0, 1fr);

    gap: 14px;

  }



  .card {

    padding: 16px;

    border-radius: 14px;

  }



  .section-heading {

    margin-bottom: 16px;

  }



  .section-heading h2 {

    font-size: 19px;

  }



  .section-heading p {

    font-size: 13px;

    line-height: 1.55;

  }



  .upload-zone {

    min-height: 250px;

    padding: 22px 14px;

    border-radius: 14px;

  }



  #uploadPlaceholder {

    width: 100%;

  }



  #uploadPlaceholder .browse-button {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    min-height: 46px;

    margin: 10px 0 0 !important;

    padding: 11px 14px;

    border: 0;

    border-radius: 10px;

    text-align: center;

    cursor: pointer;

  }



  #captureImageButton {

    background: #ffffff;

    color: var(--primary);

    border: 1px solid var(--primary) !important;

  }



  .upload-preview {

    width: 100%;

    max-height: 360px;

    object-fit: contain;

  }



  #previewContainer {

    position: relative;

  }



  .replace-image,

  #editJewellerySelectionButton {

    min-height: 42px;

    padding: 9px 12px;

  }



  .form-grid {

    grid-template-columns: minmax(0, 1fr) !important;

    gap: 14px;

    margin-top: 18px;

  }



  .field {

    width: 100%;

    min-width: 0;

  }



  .field select,

  .field input,

  .field textarea {

    width: 100%;

    max-width: 100%;

    min-height: 48px;

    font-size: 16px;

  }



  .field textarea {

    min-height: 110px;

  }



  #modelSelectionPreview {

    width: 100%;

  }



  #outputModeField {

    width: 100%;

  }



  .generate-button {

    width: 100%;

    min-height: 52px;

    margin-top: 12px;

    font-size: 16px;

  }



  .generation-controls {

    display: grid;

    grid-template-columns: 1fr;

    gap: 10px;

  }



  .generation-controls button {

    width: 100%;

    min-height: 44px;

  }



  .status-message {

    width: 100%;

    line-height: 1.45;

    overflow-wrap: anywhere;

  }



  .result-header {

    display: flex;

    flex-direction: column;

    align-items: stretch;

    gap: 12px;

    padding: 15px 16px;

  }



  .result-header h2 {

    font-size: 18px;

  }



  .result-actions {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    width: 100%;

    gap: 8px;

  }



  .result-actions .action-button {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    min-width: 0;

    min-height: 42px;

    padding: 9px 10px;

  }



  .result-card {

    min-height: 0 !important;

  }



  .result-body {

    min-height: 360px !important;

    overflow: hidden;

  }



  .empty-result,

  .loading-result {

    min-height: 330px;

    padding: 24px 16px;

  }



  .comparison-container,

  .comparison-original-image,

  .comparison-generated-image {

    max-width: 100%;

  }



  #angleSetGallery {

    grid-template-columns:

      minmax(0, 1fr) !important;

    gap: 12px !important;

    padding: 12px !important;

  }



  #angleSetGallery article {

    width: 100%;

    min-width: 0;

  }



  #angleSetGallery article > div {

    flex-wrap: wrap;

  }



  #angleSetGallery a,

  #angleSetGallery button {

    min-height: 42px;

  }



  #angleSetGallery > div:last-child {

    width: 100%;

    padding: 4px 0 !important;

  }



  #angleSetGallery > div:last-child button {

    width: 100%;

    min-width: 0 !important;

  }

}





@media (max-width: 520px) {

  .content {

    padding: 8px;

  }



  .card {

    padding: 13px;

    border-radius: 12px;

  }



  .upload-zone {

    min-height: 230px;

    padding: 18px 11px;

  }



  .upload-icon {

    width: 48px;

    height: 48px;

  }



  .result-actions {

    grid-template-columns: 1fr;

  }



  .result-body {

    min-height: 300px !important;

  }



  .empty-result,

  .loading-result {

    min-height: 280px;

  }



  .background-library {

    padding: 12px;

  }

}





/* Critical mobile width and overlay correction */

@media (max-width: 800px) {

  .app {

    display: block !important;

    width: 100% !important;

    max-width: 100% !important;

  }



  .sidebar {

    display: none !important;

  }



  .main {

    display: block !important;

    width: 100% !important;

    max-width: none !important;

    min-width: 0 !important;

    margin: 0 !important;

    margin-left: 0 !important;

    padding: 0 !important;

  }



  .topbar,

  .content {

    width: 100% !important;

    max-width: none !important;

    min-width: 0 !important;

    margin: 0 !important;

    margin-left: 0 !important;

  }



  .studio-layout {

    display: grid !important;

    width: 100% !important;

    max-width: none !important;

    min-width: 0 !important;

    margin: 0 !important;

    grid-template-columns:

      minmax(0, 1fr) !important;

  }



  .controls-card,

  .result-card {

    display: block !important;

    width: 100% !important;

    max-width: 100% !important;

    min-width: 0 !important;

    margin: 0 !important;

  }



  .topbar {

    display: flex !important;

    justify-content: space-between;

    align-items: center;

  }



  .topbar .page-title {

    min-width: 0;

    flex: 1;

  }



  .topbar .page-title h1 {

    margin: 0;

    white-space: normal;

  }



  #apnaImageBrandKitPanel {

    display: none !important;

  }

}

