/* Mobile containment and touch-layout fixes */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 900px) {
  .dashboard-grid,
  .thanks-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-grid > *,
  .thanks-layout > *,
  .dashboard-grid .content-card,
  .thanks-layout .content-card {
    min-width: 0;
    max-width: 100%;
  }

  .table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 650px) {
  .main-content,
  .page-wrap,
  .dashboard-grid,
  .content-card,
  .moment-grid,
  .moment-card {
    min-width: 0;
    max-width: 100%;
  }

  .topbar {
    gap: 8px;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-panel {
    width: 100%;
  }

  .section-heading,
  .section-actions {
    min-width: 0;
    max-width: 100%;
  }

  .section-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-actions > button {
    width: 100%;
    min-height: 44px;
  }

  .moment-grid {
    width: 100%;
  }

  .gift-table-card {
    overflow: hidden;
  }

  .gift-table-card .table-scroll {
    overflow-x: auto;
  }

  .primary-button,
  .secondary-button,
  .icon-button {
    min-height: 44px;
  }

  .icon-button {
    min-width: 44px;
  }
}

@media (max-width: 420px) {
  .page-wrap {
    padding-inline: 12px;
  }

  .hero-panel {
    padding: 28px 20px;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 11vw, 42px);
  }

  .stats-grid {
    gap: 9px;
  }

  .stat-card {
    padding: 14px;
  }
}
