/* Final destination layer. Desktop values and handlers remain untouched. */
.mobile-page-hint, .mobile-report-values { display: none; }
@media (max-width: 980px) {
  .mobile-page { min-width: 0; overflow-wrap: anywhere; }
  .mobile-page :is(.panel, .content-grid, .section-head, form, label, article, fieldset) { min-width: 0; max-width: 100%; }
  .mobile-page :is(.section-head, .table-actions, .form-actions, .hover-tabs, .database-export-actions) { flex-wrap: wrap; gap: 8px; }
  .mobile-page :is(.content-grid, .directory-grid, .database-grid, .sms-grid, .form-grid, .data-form, .plan-kanban-board) { grid-template-columns: minmax(0, 1fr); }
  #app .mobile-page :is(button, select, summary, input:not([type="checkbox"]):not([type="radio"])), .mobile-detail-backdrop .mobile-general-detail :is(button, select, summary) { min-height: 44px; min-width: 44px; }
  .mobile-page label:has(input[type="checkbox"]) { min-height: 44px; }
  .mobile-page .audit-filters { grid-template-columns: minmax(0, 1fr); }
  .mobile-general-detail { height: var(--mobile-dialog-height, 100dvh) !important; max-height: var(--mobile-dialog-height, 100dvh) !important; }
  .mobile-report-values { display: grid; gap: 10px; }
  .mobile-report-values :is(select, output) { display: block; width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .import-sheet-wrap { min-width: 0; max-width: 100%; overflow: auto; overscroll-behavior-x: contain; }
  .mobile-page :is(input, select, textarea), .mobile-general-detail :is(input, select, textarea) { max-width: 100%; min-width: 0; font-size: 16px; }
  .mobile-page :is(pre, code), .mobile-general-detail pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .mobile-page .table-wrap, .mobile-page .campaign-report-heatmap-scroll { max-width: 100%; overflow: auto; overscroll-behavior-x: contain; }
  .mobile-page-hint { display: block; color: var(--muted); font-size: 12px; line-height: 1.8; }
  .mobile-page .plan-kanban-board { display: grid; overflow: visible; }
  .mobile-page .plan-kanban-column { min-width: 0; max-height: none; }
  .mobile-page .plan-kanban-stack { max-height: none; overflow: visible; }
  .mobile-page .plan-kanban-actions { opacity: 1; visibility: visible; flex-wrap: wrap; }
  .mobile-page .mobile-page-records { display: block; min-width: 0; width: 100%; }
  .mobile-page-records thead { display: none; }
  .mobile-page-records tbody { display: grid; gap: 12px; }
  .mobile-page-records tr { display: grid; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
  .mobile-page-records td { display: block; white-space: normal; overflow-wrap: anywhere; }
  .mobile-page-records td::before { content: attr(data-page-label); display: block; color: var(--muted); font-size: 12px; }
  .mobile-page-records td[colspan]::before { content: none; }
  .mobile-general-detail :is(.profile-settings-form, .ticket-detail-grid, .data-form, .form-grid, .campaign-report-detail-filters) { grid-template-columns: minmax(0, 1fr); }
  .mobile-general-detail :is(.section-head, .form-actions, .profile-settings-head) { flex-wrap: wrap; gap: 10px; }
  .mobile-general-detail :is(.modal-body, form, label, fieldset, section) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .mobile-detail-backdrop .mobile-general-detail.campaign-report-real-modal .modal-body { height: auto; max-height: none; overflow: visible; padding: 0; }
  .mobile-general-detail .table-wrap { overflow: auto; max-width: 100%; }
  .mobile-general-detail .campaign-report-detail-modal table { min-width: 700px; }
  .mobile-general-detail .campaign-report-detail-modal .table-wrap::before { content: 'جدول مقایسه — پیمایش افقی؛ بررسی هم‌زمان ستون‌های زیاد در صفحه بزرگ‌تر آسان‌تر است.'; display: block; white-space: normal; padding: 10px; }
  .mobile-general-detail :is(.campaign-report-controls, .campaign-report-device-total-grid, .campaign-report-daily-grid, .campaign-report-rate-grid) { grid-template-columns: minmax(0, 1fr); }
  .mobile-general-detail .campaign-report-heatmap-scroll { overflow: auto; max-width: 100%; }
  .mobile-general-detail .campaign-report-heatmap-scroll::before { content: 'مقایسه تاریخ و ساعت — پیمایش افقی'; display: block; }
  :is(.mobile-page, .mobile-general-detail) :focus-visible { outline: 2px solid var(--accent, #168f85); outline-offset: 3px; }
}