/*
 * Mobile summary grids
 * Keep the existing dark CRM cards and tap targets while replacing the
 * phone-only one-card-per-row stacks with compact, readable two-up grids.
 */
@media (max-width: 760px) {
  /*
   * Dashboard Pipeline Snapshot
   * The panel and its children each carried desktop side padding, which
   * narrowed the phone cards twice. Keep the section border, but let the
   * two-up cards use the same near-edge-to-edge rhythm as the KPI grid.
   */
  .dashboard-v1 .dashboard-pipeline-panel {
    padding: 14px 6px !important;
  }

  .dashboard-v1 .dashboard-pipeline-panel .dashboard-section-head {
    padding: 18px 0 0 !important;
  }

  .dashboard-v1 .dashboard-pipeline-row {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 16px 0 0 !important;
  }

  .dashboard-v1 .dashboard-pipeline-card,
  .dashboard-v1 .pipeline-period-control {
    width: 100% !important;
    min-width: 0 !important;
  }

  .dashboard-v1 .pipeline-period-control {
    grid-column: 1 / -1 !important;
  }

  .command-center-modern .command-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .command-center-modern .command-kpi {
    min-width: 0 !important;
    min-height: 118px !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 9px !important;
    align-content: center !important;
    padding: 13px 11px !important;
  }

  .command-center-modern .command-kpi-copy {
    min-width: 0 !important;
    gap: 2px !important;
  }

  .command-center-modern .command-kpi-copy > span {
    font-size: 11px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere;
  }

  .command-center-modern .command-kpi-copy > strong {
    font-size: 25px !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere;
  }

  .command-center-modern .command-kpi-copy > small {
    font-size: 11px !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere;
  }

  .premium-app.lead-reference-shell .lead-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .premium-app.lead-reference-shell .lead-stat-card {
    min-width: 0 !important;
    min-height: 122px !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 13px 11px !important;
  }

  .premium-app.lead-reference-shell .lead-stat-copy {
    min-width: 0 !important;
    display: grid !important;
    align-content: center !important;
    gap: 2px !important;
  }

  .premium-app.lead-reference-shell .lead-stat-copy > span {
    font-size: 12px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere;
  }

  .premium-app.lead-reference-shell .lead-stat-copy > strong {
    font-size: 27px !important;
    line-height: 1.05 !important;
  }

  .premium-app.lead-reference-shell .lead-stat-copy > small {
    display: block !important;
    margin: 2px 0 0 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere;
  }

  .premium-app .invoice-reference-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .premium-app .invoice-reference-kpi {
    min-width: 0 !important;
    min-height: 112px !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 10px !important;
  }

  .premium-app .invoice-reference-kpi > .invoice-kpi-icon {
    width: 30px !important;
    height: 30px !important;
    padding: 6px !important;
  }

  .premium-app .invoice-reference-kpi > div {
    min-width: 0 !important;
  }

  .premium-app .invoice-reference-kpi span {
    font-size: 10px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
  }

  .premium-app .invoice-reference-kpi strong {
    font-size: 20px !important;
    line-height: 1.08 !important;
    overflow-wrap: anywhere !important;
  }

  .premium-app .invoice-reference-kpi small {
    font-size: 10px !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere !important;
  }

  .premium-app .invoice-action-kpi strong {
    font-size: 14px !important;
    line-height: 1.15 !important;
  }

  .premium-app .invoice-action-kpi.create {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
  }

  .premium-app .invoice-reference-kpis:has(> [data-core-ai-slot]) > .invoice-action-kpi.reminder {
    grid-column: 2 !important;
    grid-row: 3 !important;
    min-height: 126px !important;
    padding-bottom: 44px !important;
  }

  .premium-app .invoice-reference-kpis > [data-core-ai-slot] {
    z-index: 2;
    grid-column: 2 !important;
    grid-row: 3 !important;
    align-self: end !important;
    min-width: 0 !important;
    padding: 0 10px 10px !important;
  }

  .premium-app .invoice-reference-kpis > [data-core-ai-slot] > .core-ai-button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 30px !important;
    padding: 6px 7px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: normal !important;
  }
}
