/* ─── MEDIA QUERIES ──────────────────────────────────────── */
/* Tablet (iPad portrait & landscape) */
@media (max-width: 1024px) {
  body { padding: 24px 28px; }
  .grid-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 28px;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .day { padding: 0 !important; border-left: none !important; }
  .day-col {
    border-bottom: 1px solid var(--divider);
    padding-bottom: 24px;
  }
  .day-col:nth-last-child(-n+2):not(.this-week-day) {
    border-bottom: none;
  }
  .this-week-day {
    grid-column: 1 / -1;
    border-bottom: none;
  }
  .this-week-content {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  .this-week-content .week-stat { flex: 1 1 calc(33% - 10px); }
  .this-week-content .week-divider { display: none; }
  .week-quote { flex: 1 1 100%; }
}

/* Mobile (iPhone / Android) */
@media (max-width: 600px) {
  body { padding: 16px 18px; }
  #modalOverlay,
  #paywallOverlay,
  #wrappedOverlay,
  #goalOverlay,
  #exportOverlay,
  #categoriesOverlay,
  #currencyOverlay,
  #bnplOverlay,
  #wishlistOverlay,
  #scenarioOverlay,
  #graveyardOverlay,
  #budgetTargetsOverlay,
  #weeklyDigestOverlay,
  #recurringDeleteConfirm {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    will-change: auto;
  }
  .header { font-size: 26px; }
  .top-bar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .grid-row { grid-template-columns: 1fr; }
  .day-col {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 16px !important;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider) !important;
  }
  .this-week-day { grid-column: 1; }
  .this-week-content {
    flex-direction: row; 
    flex-wrap: wrap;
    gap: 8px;
  }
  .this-week-content .week-stat { flex: 1 1 calc(50% - 8px); min-width: 120px; }
  .this-week-content .week-divider { display: none; }
  .m-hero { flex-direction: column; gap: 20px; }
  .m-hero-safe { border-right: none; border-bottom: 1px solid var(--divider); padding-right: 0; padding-bottom: 20px; width: 100%; }
  .m-hero-secondaries { flex-direction: row; padding-left: 0; width: 100%; justify-content: space-between; }
  .y-hero { flex-direction: column; gap: 20px; }
  .y-hero-primary { border-right: none; border-bottom: 1px solid var(--divider); padding-right: 0; padding-bottom: 20px; width: 100%; }
  .y-hero-secondaries { flex-direction: row; padding-left: 0; width: 100%; justify-content: space-between; }
  .y-highlights { grid-template-columns: 1fr; }
  .cat-bar-row { grid-template-columns: 90px 1fr 56px; }
  .modal {
    padding-bottom: max(36px, env(safe-area-inset-bottom, 24px));
    border-radius: 24px 24px 0 0;
  }
  .modal input,
  .modal select { padding: 16px; font-size: 16px; }
  .usage-bar-wrapper { flex-wrap: nowrap; }
  .usage-track { max-width: 120px; }
  .icon-btn-label { display: none; }
  .top-actions .icon-btn.mobile-collapsed { display: none; }
  .settings-item[data-mobile-overflow] { display: flex; }
  .more-menu {
    right: -8px;
    min-width: 200px;
  }
  .onboarding-inner {
    padding: 40px 24px 36px;
  }
  .onboarding-title {
    font-size: 22px;
  }
  #proWelcomeToast {
    bottom: 20px;
    left: 16px;
    right: 16px;
    transform: translateY(20px);
    min-width: unset;
    max-width: unset;
  }
  #proWelcomeToast.visible {
    transform: translateY(0);
  }
  .drag-coach-toast {
    bottom: 16px;
    left: 12px;
    right: 12px;
    transform: translateY(16px);
    max-width: unset;
    min-width: unset;
  }
  .drag-coach-toast.visible {
    transform: translateY(0);
  }
  .mobile-only { display: block; }
  .settings-item[data-mobile-overflow] { display: flex; }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .modal,
  #modalOverlay,
  #paywallOverlay,
  .paywall-modal,
  .settings-menu {
    animation: none !important;
  }
  .txn-chip.dragging {
    transform: none;
  }
  .txn-chip.dropped {
    animation: none !important;
  }
  .txn-pending {
    animation: none !important;
  }
  .no-spend-day::after {
    animation: none !important;
  }
  .usage-fill {
    transition: none !important;
  }
  .cat-bar-fill,
  .goal-progress-fill {
    transition: none !important;
  }
  .row-nudge {
    animation: none !important;
    opacity: 1;
  }
