html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }                 


.mobile-tabs { display: none; }


@media (max-width: 860px) {
  .mm-hero { grid-template-columns: 80px minmax(0, 1fr); }
  .mm-avatar { width: 80px !important; height: 80px !important; font-size: 1.5rem !important; }
  .mm-strip img { width: 54px; height: 42px; }
}


@media (max-width: 760px) {
  :root { --rm-tabbar: 62px; }
  body { padding-bottom: var(--rm-tabbar); }

  
  .app-nav { display: none !important; }
  .app-header { padding: .55rem .7rem; gap: .5rem; }
  .header-actions { gap: .35rem; }
  .user-chip { padding: .15rem .15rem .15rem .4rem; }

  
  body.authed .mobile-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    height: var(--rm-tabbar); padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--surface, #0f1620); border-top: 1px solid var(--border, #23303d);
    justify-content: space-around; align-items: stretch;
  }
  .mobile-tabs .nav-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .12rem;
    flex: 1; background: none; border: 0; color: var(--text-muted, #8a98a8);
    font: 600 .66rem var(--font-mono, monospace); cursor: pointer; min-height: 44px;
  }
  .mobile-tabs .nav-link span { font-size: 1.25rem; line-height: 1; }
  .mobile-tabs .nav-link.active { color: var(--primary, #f5b547); }

  
  .pf-savebar, .thread-input { z-index: 110; bottom: var(--rm-tabbar) !important; }
  .toast-root { bottom: calc(var(--rm-tabbar) + 12px); }

  
  .auth-grid { grid-template-columns: 1fr; }
  .match-mock, .float-chips { display: none; }
  .auth-panel { padding: 1.4rem 1.1rem .4rem; }
  .auth-card { padding: 1.2rem 1.1rem; }

  
  .path-grid { grid-template-columns: 1fr; }
  .wizard-shell { grid-template-columns: 1fr; }
  .wizard-rail { display: none; }

  
  .matches-head { flex-direction: column; align-items: stretch; gap: .6rem; }
  .matches-tools { display: flex; align-items: center; gap: .5rem; }
  .matches-tools .select { flex: 1; }

  
  .pf-grid { grid-template-columns: 1fr; }
  .pf-span { grid-column: auto; }
  .pf-hero { flex-wrap: wrap; gap: .8rem; }
  .pf-hero .avatar-xl { width: 64px; height: 64px; font-size: 1.3rem; }
  .pf-savebar { flex-direction: column; gap: .5rem; }
  .pf-savebar > div { display: flex; gap: .5rem; width: 100%; }
  .pf-savebar .btn { flex: 1; }

  
  .conn-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .conn-tab { flex: none; }
  .req-actions { flex-wrap: wrap; }
  .req-actions .btn { flex: 1 1 44%; }
  .thread-head { flex-wrap: wrap; }
  .th-actions { width: 100%; justify-content: flex-end; margin-top: .2rem; }

  
  .ib-modal { width: 92vw !important; max-width: 420px; }
  .ib-chip { width: 100%; text-align: left; }

  
  .modal { width: 100vw !important; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: 0; }
  .modal-body { padding: .85rem !important; }
  .mm-hero { grid-template-columns: 80px minmax(0, 1fr); gap: .8rem; }
  
  .modal-body > div:nth-of-type(1) { grid-template-columns: 1fr !important; }   
  .modal-body > div:nth-of-type(3) { grid-template-columns: 1fr !important; }   
  .modal-body > div:nth-of-type(4) { flex-direction: column !important; }        
  .modal-body > div:nth-of-type(4) > * { width: 100% !important; }

  
  .lb-arrow { width: 48px; height: 48px; font-size: 1.6rem; }
  .lb-close { width: 44px; height: 44px; }
  .lightbox img { max-width: 96vw; max-height: 78vh; }

  
  .input, textarea, select { font-size: 16px !important; }
}


@media (max-width: 480px) {
  .user-name { display: none; }                  
  .mm-hero { grid-template-columns: 62px minmax(0, 1fr) !important; }
  .mm-avatar { width: 62px !important; height: 62px !important; font-size: 1.25rem !important; }
  .mm-strip img { width: 48px; height: 38px; }
  .mm-ring svg { width: 104px; height: 104px; }  
  .display-lg, .display-xl { font-size: 1.7rem; }
}