/* Mobile UI v22 — condense Rounds summary and stack Motion review actions. */
@media (max-width: 760px) {
  /* Rounds: reduce the oversized top area and restore comfortable side padding. */
  .rounds-ai-page {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .rounds-ai-page > .page-header-row,
  .rounds-ai-page > .page-heading-row {
    padding: 7px 0 5px !important;
  }

  .rounds-ai-page > .page-header-row h2,
  .rounds-ai-page > .page-heading-row h2 {
    margin: 0 !important;
    font-size: 20px !important;
  }

  .rounds-ai-page > .page-header-row p,
  .rounds-ai-page > .page-heading-row p {
    display: none !important;
  }

  .rounds-ai-page .page-header-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 6px 0 0 !important;
  }

  .rounds-ai-page .page-header-actions > button,
  .rounds-ai-page .page-header-actions > a {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 5px 8px !important;
    border-radius: 9px !important;
    font-size: 10.5px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .rounds-ai-page .page-header-actions > :nth-child(3) {
    grid-column: 1 / -1 !important;
  }

  /* Keep all five summary items in one compact strip; 14/14 now fills the fifth cell. */
  .rounds-ai-top-stats,
  .ai-summary-grid.rounds-ai-top-stats {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 1px !important;
    width: 100% !important;
    margin: 7px 0 9px !important;
    padding: 0 !important;
    border: 1px solid var(--occ-mobile-line) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: var(--occ-mobile-line) !important;
  }

  .rounds-ai-top-stats .chart-card {
    min-width: 0 !important;
    min-height: 58px !important;
    height: 58px !important;
    margin: 0 !important;
    padding: 6px 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    text-align: center !important;
  }

  .rounds-ai-top-stats .chart-card strong {
    display: block !important;
    font-size: 15px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .rounds-ai-top-stats .chart-card span {
    display: block !important;
    margin-top: 4px !important;
    font-size: 7.5px !important;
    line-height: 1.05 !important;
  }

  .rounds-ai-top-stats .chart-card small {
    display: none !important;
  }

  /* Make review-oriented cells read like alert buttons without adding more height. */
  .rounds-ai-top-stats .chart-card:nth-child(2),
  .rounds-ai-top-stats .chart-card:nth-child(4) {
    position: relative !important;
  }

  .rounds-ai-top-stats .chart-card:nth-child(2) strong,
  .rounds-ai-top-stats .chart-card:nth-child(4) strong {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 24px !important;
    height: 24px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: #fff4d8 !important;
    color: #8a5a08 !important;
  }

  /* Embedded reports and headings should not touch the viewport edge. */
  .rounds-ai-page .combined-ai-workspace,
  .rounds-ai-page .workflow-round-reports,
  .rounds-ai-page .report-browser-heading,
  .rounds-ai-page .approved-ai-reports,
  .rounds-ai-page .reference-review-schedule {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .rounds-ai-page .combined-ai-workspace > *,
  .rounds-ai-page .report-browser-heading,
  .rounds-ai-page .reference-review-schedule > summary {
    box-sizing: border-box !important;
  }

  /* Motion: one clean centered stack. Four decisions match AI width; AI is slightly thinner. */
  .motion-card:not(.reviewed) .motion-actions {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    width: auto !important;
    margin: 5px 8px 8px !important;
    padding: 7px 8px 8px !important;
    border-top: 1px solid #edf1f3 !important;
    background: #fff !important;
    box-sizing: border-box !important;
    justify-items: center !important;
  }

  .motion-card:not(.reviewed) .motion-review-action {
    width: min(100%, 240px) !important;
    min-width: 0 !important;
    margin: 0 auto !important;
  }

  .motion-card:not(.reviewed) .motion-review-action > button:first-child {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 31px !important;
    height: 31px !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
  }

  .motion-card:not(.reviewed) .motion-ai-start {
    grid-column: 1 !important;
    width: min(92%, 220px) !important;
    max-width: 220px !important;
    min-width: 0 !important;
    min-height: 28px !important;
    height: 28px !important;
    margin: 1px auto 0 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
    justify-self: center !important;
    box-sizing: border-box !important;
  }
}
