/* Cashback Pro V36.8.26 — compact select dialog and full-width Admin configuration layouts. */

/* Ordinary select menus only: landscape date-time pickers keep their calendar/clock grid. */
html body .cp-picker-overlay[data-kind="select"] .cp-picker-panel {
  width: min(92vw, 600px) !important;
  max-width: 600px !important;
  min-width: 0 !important;
}
html body .cp-picker-overlay[data-kind="select"] .cp-picker-content {
  display: block !important;
  grid-template-columns: none !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: 100% !important;
}
html body .cp-picker-overlay[data-kind="select"] .cp-picker-options,
html body .cp-picker-overlay[data-kind="select"] .cp-picker-search {
  width: 100% !important;
  max-width: none !important;
}
@media (max-width: 560px) {
  html body .cp-picker-overlay[data-kind="select"] .cp-picker-panel {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Use the same available workspace width for the AI and Theme panes. */
html body #tab-admin > .admin-card > #admin-pane-themes.admin-pane,
html body #tab-admin > .admin-card > #admin-pane-ai-settings.admin-pane {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
html body #admin-pane-themes > .admin-section-heading,
html body #admin-pane-themes > p,
html body #admin-pane-ai-settings > .admin-section-heading,
html body #admin-pane-ai-settings > p {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  text-align: left !important;
}

/* Theme installer, prompt library and theme inventory all fill the same outer frame. */
html body #admin-pane-themes .theme-patch-upload-card,
html body #admin-pane-themes .theme-prompt-library,
html body #admin-pane-themes > div[style*="overflow-x:auto"] {
  width: 100% !important;
  max-width: none !important;
  margin-inline: 0 !important;
  box-sizing: border-box !important;
}
html body #admin-pane-themes > div[style*="overflow-x:auto"] > .custom-table {
  width: 100% !important;
  min-width: 760px;
}

/* AI: paired form fields on the left, suggested models on the right, Telegram URL across the full row. */
html body #admin-pane-ai-settings .ai-settings-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr) !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: none !important;
  align-items: stretch !important;
}
html body #admin-pane-ai-settings .ai-settings-config {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
  box-sizing: border-box;
}
html body #admin-pane-ai-settings .ai-settings-fields {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}
html body #admin-pane-ai-settings .ai-settings-field {
  display: grid !important;
  gap: 8px !important;
  min-width: 0 !important;
  font-weight: 650;
}
html body #admin-pane-ai-settings .ai-settings-field .form-control {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}
html body #admin-pane-ai-settings .ai-settings-form-meta {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
html body #admin-pane-ai-settings .ai-settings-form-meta .btn-convert {
  width: 100%;
}
html body #admin-pane-ai-settings .ai-model-suggestions {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}
html body #admin-pane-ai-settings #telegram-app-url-card {
  grid-column: 1 / -1;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
}
html body #admin-pane-ai-settings #telegram-app-url-card .form-control {
  width: 100%;
  max-width: none;
}

@media (max-width: 760px) {
  html body #admin-pane-ai-settings .ai-settings-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body #admin-pane-ai-settings #telegram-app-url-card {
    grid-column: auto;
  }
}
@media (max-width: 520px) {
  html body #admin-pane-ai-settings .ai-settings-fields {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  html body #admin-pane-ai-settings .ai-settings-config {
    padding: 12px;
  }
}
