@media (max-width: 760px) {
  main, .screen, .card, .screen-heading > *, .section-heading > *, .card-heading > *, .today-workout-card > *, .profile-hero > *, .challenge-card > *, .challenge-public-layout > * { min-width: 0; }
  h1, h2, h3, p, strong, small { overflow-wrap: anywhere; }
  .screen-heading, .section-heading, .card-heading { max-width: 100%; }
  .card-heading { flex-wrap: wrap; }
  .primary-button, .secondary-button, .text-button { max-width: 100%; white-space: normal; }
  .recommendation-view { padding: 12px 14px 24px; }
  .recommendation-header { min-height: 64px; }
  .recommendation-header .success-chip { display: none; }
  .recommendation-intro { margin: 34px 4px 20px; }
  .recommendation-intro h1 { font-size: 38px; }
  .recommendation-cards { grid-template-columns: 1fr; }
  .recommendation-card > p { min-height: 0; }
  .recommendation-actions { position: sticky; bottom: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 19px; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
  :root { --nav-height: 72px; }
  body { background: var(--background); }
  .app-shell { padding-bottom: calc(var(--nav-height) + 26px + env(safe-area-inset-bottom)); }
  .topbar { width: calc(100% - 24px); height: 58px; margin-top: 8px; padding-left: 14px; top: 7px; border-radius: 19px; }
  .brand { font-size: 18px; }
  .brand-mark { transform: scale(.86); transform-origin: left center; margin-right: -3px; }
  .avatar-button { width: 40px; height: 40px; border-radius: 13px; }
  main { width: calc(100% - 28px); margin-top: 28px; }
  .screen-heading { margin-bottom: 21px; align-items: center; }
  .screen-heading h1 { font-size: 31px; }
  .screen-heading p:not(.eyebrow) { font-size: 12px; }
  .greeting-heading h1 { font-size: 28px; }
  .day-pill { min-width: 79px; height: 60px; padding-inline: 11px; border-radius: 17px; }
  .day-pill strong { font-size: 27px; }
  .bottom-nav { width: calc(100% - 20px); min-height: var(--nav-height); bottom: max(7px, env(safe-area-inset-bottom)); border-radius: 21px; }
  .bottom-nav button { border-radius: 15px; }
  .nav-icon { font-size: 20px; }

  .hero-card { padding: 23px 20px 19px; border-radius: 24px; }
  .hero-card::after { top: -12px; right: -3px; font-size: 150px; }
  .project-track { margin-bottom: 21px; }
  .hero-measures { width: 100%; grid-template-columns: 1fr 24px 1fr; }
  .hero-measures strong { font-size: 34px; }
  .hero-action { width: 100%; margin-top: 22px; position: relative; right: auto; bottom: auto; }
  .section-heading { margin-top: 28px; }
  .section-heading h2 { font-size: 21px; }
  .task-item { min-height: 65px; padding-inline: 14px; }
  .metric-grid { grid-template-columns: 1fr; }
  .score-card { min-height: 142px; }
  .streak-card { min-height: 150px; }
  .score-ring { width: 91px; }
  .coach-cta { min-height: 66px; }
  .level-card { grid-template-columns: 48px 1fr; padding: 16px; }
  .level-orb { width: 47px; height: 47px; border-radius: 15px; }
  .level-card .xp-chip { grid-column: 1 / -1; justify-self: start; }
  .today-workout-card { grid-template-columns: 68px 1fr; padding: 16px; gap: 13px; }
  .meal-day-grid{grid-template-columns:repeat(2,1fr)}.meal-card-heading{grid-template-columns:40px 1fr}.meal-card-heading .text-button{grid-column:1/-1;justify-self:start}
  .workout-visual { width: 66px; height: 66px; border-radius: 19px; }
  .today-workout-card .secondary-button { grid-column: 1 / -1; width: 100%; }

  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .stat-card { min-height: 120px; padding: 13px; border-radius: 18px; }
  .stat-card strong { font-size: 25px; }
  .stat-card em { font-size: 8px; }
  .card { padding: 19px; border-radius: 23px; }
  .card-heading { flex-direction: column; margin-bottom: 17px; }
  .card-heading h2 { font-size: 19px; }
  .chart-card .card-heading { align-items: stretch; }
  .filter-tabs { width: 100%; }
  .filter-tabs button { flex: 1; }
  .chart-wrap { height: 205px; }
  .progress-two-col { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .photo-placeholder { min-height: 130px; padding: 10px 3px; }
  .progress-discovery-grid { grid-template-columns: 1fr; gap: 9px; }
  .achievement-preview-grid { grid-template-columns: 1fr; }
  .achievement-preview-grid .achievement-card:nth-child(n+3) { display: none; }

  .coach-header h1 { font-size: 30px; }
  .coach-avatar { width: 58px; height: 58px; border-radius: 18px; }
  .chat-card { min-height: calc(100dvh - 315px); padding: 17px 14px; border-radius: 23px; }
  .message { max-width: 88%; }
  .message-bubble { font-size: 12px; }

  .profile-hero { grid-template-columns: auto 1fr; padding: 18px; }
  .profile-hero .secondary-button { grid-column: 1 / -1; width: 100%; }
  .profile-avatar { width: 64px; height: 64px; border-radius: 20px; }
  .profile-measures { gap: 7px; }
  .profile-measures article { min-height: 128px; padding: 13px 10px; border-radius: 18px; }
  .profile-measures .measure-icon { width: 26px; height: 26px; top: 10px; right: 9px; }
  .profile-measures strong { font-size: 20px; }

  .modal-layer { padding: 0; place-items: end center; }
  .bottom-sheet { width: 100%; max-height: calc(100dvh - 12px); padding: 25px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 27px 27px 0 0; }
  .modal-heading { min-width: 0; }
  .sheet-handle { display: block; }
  .option-card-grid { grid-template-columns: repeat(2, 1fr); }
  .week-options { grid-template-columns: repeat(4, 1fr); }
  .meal-time-grid { grid-template-columns: repeat(2, 1fr); }

  .onboarding-shell { width: 100%; min-height: 100dvh; margin: 0; padding: 15px 20px calc(22px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; box-shadow: none; }
  .onboarding-progress { margin: 14px 0 24px; }
  .onboarding-step > h1 { font-size: 36px; }
  .welcome-art { width: 190px; height: 170px; margin-bottom: 12px; }
  .welcome-mark { width: 108px; height: 108px; border-radius: 36px; }
  .orbit-one { width: 177px; height: 121px; }.orbit-two { width: 163px; height: 108px; }
  .step-intro { margin-bottom: 20px; font-size: 13px; }
  .onboarding-actions { position: sticky; bottom: 0; padding-top: 14px; background: linear-gradient(transparent, rgba(255,255,255,.96) 25%); grid-template-columns: auto 1fr; }
  .demo-button { grid-column: 1 / -1; grid-row: 1; }
  .onboarding-actions .text-button { grid-column: 1; grid-row: 2; }
  .onboarding-actions .primary-button { grid-column: 2; grid-row: 2; }
  .meal-fields { grid-template-columns: 1fr; }
  .meal-fields .full { grid-column: auto; }
  .selection-cards.four-col { grid-template-columns: repeat(2, 1fr); }

  .secondary-view-header { width: calc(100% - 20px); min-height: 66px; margin-top: 7px; top: 7px; grid-template-columns: 43px 1fr 43px; border-radius: 19px; }
  .secondary-view-header .icon-button, .secondary-view-header .avatar-button { width: 40px; height: 40px; border-radius: 13px; }
  .secondary-view-header h1 { font-size: 20px; }
  .secondary-view-content { width: calc(100% - 24px); margin-top: 21px; }
  .secondary-intro { align-items: flex-start; flex-direction: column; }
  .secondary-intro h2 { font-size: 24px; }
  .achievement-list, .exercise-grid { grid-template-columns: 1fr; }
  .achievement-card { min-height: 165px; }
  .exercise-card { grid-template-columns: 67px 1fr auto; }
  .exercise-thumb { width: 67px; height: 67px; }
  .journey-event { grid-template-columns: 47px 1fr; gap: 11px; }
  .journey-timeline::before { left: 23px; }
  .journey-marker span { width: 47px; height: 47px; border-radius: 16px; }
  .workout-hero { padding: 22px 19px; }
  .today-workout-actions { width: 100%; grid-column: 1 / -1; justify-content: stretch; }
  .today-workout-actions button { flex: 1; }
  .workout-exercise-row { grid-template-columns: 24px 45px 1fr 32px; padding-inline: 10px; gap: 8px; }
  .exercise-thumb.compact { width: 45px; height: 45px; }
  .player-card { padding: 19px 14px; }
  .player-card .exercise-media { min-height: 190px; }
  .set-display strong { font-size: 49px; }
  .summary-stats { grid-template-columns: repeat(2, 1fr); }
  .exercise-prescription { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .challenge-preview-card > div, .challenge-actions, .meal-history-actions, .notifications-toolbar { flex-wrap: wrap; }
  .challenge-card-copy, .challenge-feed-copy, .challenge-ranking > div > *, .notification-item > * { min-width: 0; }
  .app-update { bottom: calc(var(--nav-height) + 18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  main { width: calc(100% - 22px); }
  .topbar { width: calc(100% - 18px); }
  .hero-measures em { font-size: 9px; }
  .task-meta { display: none; }
  .profile-measures strong { font-size: 18px; }
  .profile-measures em { font-size: 8px; }
  .goal-visual { min-height: 180px; }
  .goal-visual strong, .goal-visual output { font-size: 39px; }
  .workout-exercise-row { grid-template-columns: 21px 1fr 30px; }
  .workout-exercise-row .exercise-thumb { display: none; }
  .preference-block { padding: 13px; }
  .option-card-grid.two-col, .meal-time-grid { grid-template-columns: 1fr; }
  .form-row, .form-grid, .recommendation-actions, .challenge-visibility { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full, .field.full { grid-column: auto; }
  .app-update { width: calc(100% - 24px); padding: 16px; }
  .app-update-actions { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
  .app-update-actions .primary-button, .app-update-actions .text-button { width: 100%; min-width: 0; padding-inline: 8px; }
  .challenge-card { grid-template-columns: 42px minmax(0, 1fr); }
  .challenge-card > :last-child { grid-column: 1 / -1; width: 100%; }
}

@media (min-width: 1180px) {
  .app-shell { max-width: 1240px; min-height: calc(100vh - 24px); margin: 12px auto; border: 1px solid rgba(227,223,237,.72); border-radius: 34px; background: rgba(255,255,255,.25); box-shadow: 0 28px 80px rgba(42,32,83,.07); }
  .topbar { margin-top: 12px; }
}
