/* Central Orbit v5.50.33 — Mobile Fitness hero + AI composer + Settings recovery
   Mobile-only polish. Desktop remains unchanged. */
@media (max-width: 820px) {
  /* ---------- Fitness: use the same successful mobile hero composition as Relationship ---------- */
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 58px 10px 10px !important;
    gap: 10px !important;
    overflow: hidden !important;
    background: #04151b !important;
    border-radius: 16px !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference > .fitness-shared-hero-media {
    position: absolute !important;
    inset: 48px 0 auto 0 !important;
    width: 100% !important;
    height: 224px !important;
    object-fit: cover !important;
    object-position: center 50% !important;
    opacity: .78 !important;
    filter: brightness(.86) saturate(.98) contrast(1.04) !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    pointer-events: none !important;
    background:
      linear-gradient(180deg,rgba(2,14,18,.12) 48px,rgba(2,14,18,.16) 112px,rgba(2,14,18,.52) 188px,rgba(2,14,18,.97) 275px,rgba(2,14,18,.995) 100%),
      linear-gradient(90deg,rgba(2,14,18,.38),transparent 40%,rgba(2,14,18,.20)) !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference .fitness-cc-hero-tabs {
    position: absolute !important;
    inset: 7px 7px auto 7px !important;
    z-index: 5 !important;
    overflow: visible !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-cc-tabs-v2 {
    background: rgba(3,20,26,.84) !important;
    border: 1px solid rgba(79,180,176,.13) !important;
    border-radius: 13px !important;
    backdrop-filter: blur(13px) !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference .fitness-cc-hero-copy {
    position: relative !important;
    z-index: 3 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 169px 3px 0 !important;
    margin: 0 !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero .fitness-cc-hero-copy .dashboard-section-label {
    display: block !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    letter-spacing: .18em !important;
    color: #71c8be !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero .fitness-cc-hero-copy h2 {
    display: block !important;
    margin: 6px 0 7px !important;
    font-size: clamp(32px,9.4vw,39px) !important;
    line-height: .98 !important;
    letter-spacing: -.035em !important;
    color: #f2fbfb !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero .fitness-cc-hero-copy p {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.46 !important;
    color: #b9d2d4 !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference .fitness-shared-hero-kpis {
    position: relative !important;
    inset: auto !important;
    z-index: 3 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-template-rows: none !important;
    gap: 6px !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference .fitness-shared-hero-kpi {
    display: grid !important;
    grid-template-columns: 30px minmax(0,1fr) auto !important;
    min-width: 0 !important;
    min-height: 64px !important;
    padding: 8px !important;
    gap: 7px !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg,rgba(7,32,39,.92),rgba(4,24,30,.94)) !important;
    border-color: rgba(76,184,178,.13) !important;
    backdrop-filter: blur(12px) !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero-kpi .fitness-cc-hero-header-icon {
    width: 30px !important;
    height: 30px !important;
    border-radius: 9px !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero-kpi .fitness-cc-hero-header-copy small {
    font-size: 8px !important;
    line-height: 1.1 !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero-kpi .fitness-cc-hero-header-copy strong {
    margin-top: 2px !important;
    font-size: 14px !important;
    line-height: 1.12 !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero-kpi .fitness-cc-hero-header-copy em {
    margin-top: 2px !important;
    font-size: 8.5px !important;
    line-height: 1.15 !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero-badge {
    min-width: 34px !important;
    min-height: 22px !important;
    padding: 0 5px !important;
    font-size: 8px !important;
  }

  /* ---------- AI: composer gets a deliberate phone layout ---------- */
  html body.co-module-runtime .ai-agent-panel { padding: 10px !important; }
  html body.co-module-runtime .ai-chat-column { min-width: 0 !important; }
  html body.co-module-runtime .ai-chat-compose {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 8 !important;
    margin: 0 -2px -2px !important;
    padding: 9px 2px calc(2px + env(safe-area-inset-bottom)) !important;
    background: linear-gradient(180deg,rgba(3,18,24,.18),rgba(3,18,24,.96) 22%,#031218 100%) !important;
  }
  html body.co-module-runtime .ai-chat-input-row {
    display: grid !important;
    grid-template-columns: 44px 44px minmax(0,1fr) 44px !important;
    grid-template-rows: auto auto !important;
    gap: 6px !important;
    align-items: end !important;
    width: 100% !important;
  }
  html body.co-module-runtime .ai-chat-input-row .ai-prompt-plus { grid-column: 1 !important; grid-row: 1 !important; }
  html body.co-module-runtime .ai-chat-input-row .ai-voice-button { grid-column: 2 !important; grid-row: 1 !important; }
  html body.co-module-runtime .ai-chat-input-row textarea {
    grid-column: 3 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    max-height: 132px !important;
    padding: 11px 12px !important;
    border-radius: 13px !important;
    resize: none !important;
  }
  html body.co-module-runtime .ai-chat-input-row .ai-attachment-picker {
    grid-column: 4 !important;
    grid-row: 1 !important;
    width: 44px !important;
    min-width: 44px !important;
    position: relative !important;
  }
  html body.co-module-runtime .ai-chat-input-row .ai-attachment-picker > summary {
    width: 44px !important;
    height: 46px !important;
    min-width: 44px !important;
    min-height: 46px !important;
    display: grid !important;
    place-items: center !important;
    border-radius: 12px !important;
  }
  html body.co-module-runtime .ai-chat-input-row .ai-attachment-menu {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    bottom: 52px !important;
    width: min(280px,calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
  }
  html body.co-module-runtime .ai-chat-input-row .primary-button {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-height: 46px !important;
    height: 46px !important;
    margin: 0 !important;
  }
  html body.co-module-runtime .ai-image-button,
  html body.co-module-runtime .ai-prompt-plus,
  html body.co-module-runtime .ai-voice-button {
    width: 44px !important;
    height: 46px !important;
    min-width: 44px !important;
    min-height: 46px !important;
    border-radius: 12px !important;
  }
  html body.co-module-runtime .ai-chat-stream {
    height: min(52dvh,470px) !important;
    padding-bottom: 14px !important;
  }

  /* ---------- Settings/System: always reachable and phone-safe ---------- */
  body .mobile-sheet-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 4 !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    background: linear-gradient(180deg,rgba(4,20,25,.20),#041419 24%) !important;
  }
  body .mobile-sheet-actions > a,
  body .mobile-sheet-actions > button {
    min-height: 58px !important;
  }
  html body.co-module-runtime .settings-v2-shell {
    display: grid !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  html body.co-module-runtime .settings-v2-sidebar,
  html body.co-module-runtime .settings-v2-main,
  html body.co-module-runtime .settings-v2-section-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  html body.co-module-runtime .settings-v2-navigation {
    width: 100% !important;
    max-width: 100vw !important;
    touch-action: pan-x pan-y !important;
    -webkit-overflow-scrolling: touch !important;
  }
  html body.co-module-runtime .settings-v2-heading h1 {
    font-size: 27px !important;
    line-height: 1.08 !important;
  }
  html body.co-module-runtime .settings-v2-heading p { font-size: 13px !important; line-height: 1.45 !important; }
  html body.co-module-runtime .settings-v2-panel,
  html body.co-module-runtime .settings-v2-card { min-width: 0 !important; max-width: 100% !important; }
}

@media (max-width: 430px) {
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference > .fitness-shared-hero-media {
    height: 205px !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero.fitness-cc-hero-reference .fitness-cc-hero-copy {
    padding-top: 151px !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero .fitness-cc-hero-copy h2 {
    font-size: clamp(30px,9.2vw,36px) !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero .fitness-cc-hero-copy p { font-size: 12.5px !important; }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero-kpi {
    grid-template-columns: 28px minmax(0,1fr) !important;
  }
  html body.co-module-runtime #fitnessControlCenterV2 .fitness-shared-hero-badge { display: none !important; }
  html body.co-module-runtime .ai-chat-input-row {
    grid-template-columns: 42px 42px minmax(0,1fr) 42px !important;
    gap: 5px !important;
  }
  html body.co-module-runtime .ai-chat-input-row .ai-prompt-plus,
  html body.co-module-runtime .ai-chat-input-row .ai-voice-button,
  html body.co-module-runtime .ai-chat-input-row .ai-attachment-picker,
  html body.co-module-runtime .ai-chat-input-row .ai-attachment-picker > summary {
    width: 42px !important;
    min-width: 42px !important;
  }
}
