@media (max-width: 640px) {
  html, body { min-height: 100%; }
  body { background: #f6f8fb; }
  .shell { width: min(100% - 22px, 1120px); }
  .site-header { position: sticky; top: 0; }
  .header-inner { min-height: 68px; gap: 10px; }
  .brand-logo { width: 48px; height: 48px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 11px; max-width: 165px; line-height: 1.2; }
  .account-area { gap: 6px; }
  .account-area .button { min-height: 42px; padding: 9px 11px; }

  .auth-layout { min-height: auto; padding: 26px 0 38px; gap: 24px; }
  .hero-copy h1 { font-size: 36px; line-height: 1.02; margin: 8px 0 16px; }
  .lead { font-size: 17px; line-height: 1.5; }
  .trust-row { margin-top: 18px; gap: 7px; }
  .trust-row span { font-size: 11px; padding: 7px 9px; }
  .login-card { padding: 20px; border-radius: 15px; }

  .portal-hero-inner { padding: 24px 0; gap: 16px; }
  .portal-hero h1 { font-size: 32px; margin: 5px 0 6px; }
  .portal-hero p:not(.eyebrow) { font-size: 14px; line-height: 1.45; }
  #add-player-button { width: 100%; min-height: 48px; }
  .portal-body { padding: 18px 0 42px; }
  .players-grid { gap: 12px; }
  .player-card { padding: 17px; border-radius: 15px; box-shadow: 0 7px 20px rgba(12,30,57,.07); }
  .player-name { font-size: 21px; }
  .player-meta { line-height: 1.45; margin-top: 9px; }
  .player-stats { margin: 14px 0; gap: 8px; }
  .stat { padding: 11px; }
  .player-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .player-actions .button { width: 100%; min-height: 48px; padding: 10px; }

  input, select, textarea { font-size: 16px; min-height: 48px; }
  textarea { min-height: 100px; }
  label { margin-top: 16px; }
  input[type="file"] { min-height: 0; padding: 9px; background: #fff; }
  input[type="file"]::file-selector-button {
    border: 0;
    border-radius: 9px;
    background: #003883;
    color: #fff;
    min-height: 44px;
    padding: 10px 13px;
    margin-right: 10px;
    font-weight: 800;
  }

  .modal {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
  }
  .modal form, .modal > div:not(.modal-head) { padding: 16px 17px 108px; }
  .modal-wide { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; padding: 16px 17px 90px; border-radius: 0; overflow-y: auto; }
  .modal-head {
    position: sticky;
    top: 0;
    z-index: 8;
    background: #fff;
    padding: 10px 0 12px;
    border-bottom: 1px solid #edf1f5;
  }
  .modal h2 { font-size: 24px; margin-top: 4px; }
  .modal-actions {
    position: sticky;
    bottom: -1px;
    z-index: 9;
    background: rgba(255,255,255,.97);
    border-top: 1px solid #e5eaf0;
    margin: 24px -17px -108px;
    padding: 12px 17px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 22px rgba(12,30,57,.08);
  }
  .modal-actions .button { min-height: 48px; flex: 1; }

  .recording-guide { padding: 14px; margin-top: 16px; }
  .consent-check { padding: 12px; }
  .consent-note { font-size: 11.5px; }
  #analysis-upload-progress { height: 13px; margin-top: 16px; accent-color: #003883; }
  #analysis-message { font-size: 13px; line-height: 1.45; }

  .rg-mobile-analysis-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 12px 0 4px;
  }
  .rg-mobile-analysis-steps span {
    border-radius: 9px;
    padding: 8px 6px;
    text-align: center;
    background: #f1f5f9;
    color: #667085;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.25;
  }
  .rg-mobile-video-help {
    margin: 7px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef6ff;
    color: #344054;
    font-size: 12px;
    line-height: 1.45;
  }
  .rg-mobile-video-help strong { color: #003883; }
  .rg-upload-banner {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 1000;
    background: #003883;
    color: #fff;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
  }
  .rg-upload-banner strong { color: #fed700; }

  .profile-summary { gap: 10px; }
  .profile-summary > div { padding: 10px 0; border-bottom: 1px solid #edf1f5; }
  .timeline-item { padding: 12px 13px; }
}
