/* SaaS fiscal preview mobile fit. Screen only; print stays untouched. */
@media screen and (max-width: 720px) {
  .saas-issued-admin-clone .fixed.inset-0 {
    align-items: stretch !important;
    padding: 5px !important;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div {
    width: calc(100vw - 10px) !important;
    height: calc(100dvh - 10px) !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 9px !important;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div > div:first-child {
    position: relative !important;
    z-index: 3 !important;
    flex: 0 0 auto !important;
    padding: 9px 10px !important;
    gap: 7px !important;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div > div:first-child > div:first-child p {
    font-size: 8px !important;
    line-height: 1.1 !important;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div > div:first-child h3 {
    margin-top: 3px !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div > div:first-child > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div > div:first-child button {
    height: 33px !important;
    min-height: 33px !important;
    padding: 0 7px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div > div:last-child {
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 8px 6px 14px !important;
    -webkit-overflow-scrolling: touch;
  }

  .saas-issued-admin-clone .fixed.inset-0 > div > div:last-child > div {
    width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    overflow: visible !important;
  }

  /* Keep the fiscal paper at its desktop width, then scale the screen preview. */
  .saas-issued-admin-clone .saas-preview-shell {
    width: 860px !important;
    min-width: 860px !important;
    max-width: 860px !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
    transform-origin: top left !important;
  }

  .saas-issued-admin-clone .danfe-sheet {
    width: 860px !important;
    min-width: 860px !important;
    max-width: 860px !important;
    margin: 0 !important;
    box-shadow: 0 8px 22px rgba(23, 41, 58, .10) !important;
  }

  /* Receipt / NFC-e keeps its native 80mm-like width. */
  .saas-issued-admin-clone .receipt-sheet {
    width: 302px !important;
    min-width: 302px !important;
    max-width: 302px !important;
    margin: 0 auto !important;
    zoom: 1 !important;
  }
}

@media screen and (max-width: 390px) {
  .saas-issued-admin-clone .saas-preview-shell { zoom: .405 !important; }
  .saas-issued-admin-clone .receipt-sheet { zoom: 1 !important; }
}

@media screen and (min-width: 391px) and (max-width: 430px) {
  .saas-issued-admin-clone .saas-preview-shell { zoom: .445 !important; }
  .saas-issued-admin-clone .receipt-sheet { zoom: 1 !important; }
}

@media screen and (min-width: 431px) and (max-width: 480px) {
  .saas-issued-admin-clone .saas-preview-shell { zoom: .50 !important; }
  .saas-issued-admin-clone .receipt-sheet { zoom: 1 !important; }
}

@media screen and (min-width: 481px) and (max-width: 600px) {
  .saas-issued-admin-clone .saas-preview-shell { zoom: .62 !important; }
  .saas-issued-admin-clone .receipt-sheet { zoom: 1 !important; }
}

@media screen and (min-width: 601px) and (max-width: 720px) {
  .saas-issued-admin-clone .saas-preview-shell { zoom: .75 !important; }
  .saas-issued-admin-clone .receipt-sheet { zoom: 1 !important; }
}
