/* Cashback Pro V36.8.25 — responsive claim width, centered Admin settings, sticky-flow footer. */

/* 1) Manual order claim: match the full-width converter row while retaining
   the button as a fixed, readable action at the right. */
html body #tab-orders .claim-order-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 164px !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
html body #tab-orders .claim-order-form > #claim-order-id-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* 2) Center the Admin appearance editor in its available workspace. Keep the
   contents readable and left-aligned inside a centered, bounded column. */
html body #tab-admin > .admin-card > #admin-pane-themes.admin-pane,
html body #tab-admin > .admin-card > #admin-pane-ai-settings.admin-pane {
  width: min(100%, 1180px) !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}
html body #admin-pane-themes > .admin-section-heading,
html body #admin-pane-themes > p {
  text-align: center !important;
  max-width: 1080px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
html body #admin-pane-themes .theme-patch-upload-card {
  width: min(100%, 760px) !important;
  max-width: 760px !important;
  margin: 12px auto !important;
  box-sizing: border-box !important;
}
html body #admin-pane-themes .theme-prompt-library {
  width: 100% !important;
  max-width: 1120px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* AI configuration uses the same centered column, including the narrower
   provider form and the optional Super Admin URL card. */
html body #admin-pane-ai-settings > .admin-section-heading,
html body #admin-pane-ai-settings > p {
  text-align: center !important;
}
html body #admin-pane-ai-settings > div[style*="display:grid"] {
  width: min(100%, 560px) !important;
  max-width: 560px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
html body #admin-pane-ai-settings > .admin-card {
  width: min(100%, 980px) !important;
  max-width: 980px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
html body #admin-pane-ai-settings #telegram-app-url-card {
  width: min(100%, 650px) !important;
  max-width: 650px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 3) Footer sits at the viewport bottom when a page has little content, but
   remains in normal document flow and moves below long content. */
html body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
html body > main.main-container {
  flex: 1 0 auto;
  min-height: 0;
}
html body > footer.app-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

/* V36.7.120 temporarily switches short landscape viewports to block flow for
   scrolling. Restore flex growth without fixing the footer over page content. */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 850px) {
  html body {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
  }
  html body > main.main-container {
    display: block !important;
    flex: 1 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  html body > footer.app-footer {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    margin-top: auto !important;
    transform: none !important;
  }
}

@media (max-width: 520px) {
  html body #tab-orders .claim-order-form {
    grid-template-columns: minmax(0, 1fr) 126px !important;
    gap: 8px !important;
  }
}
