@media (max-width: 600px) {
  html,body { width:100%; overflow-x:hidden; }
  .app { display:block; min-height:100dvh; }
  .app main { width:100%; min-width:0; padding:20px 16px calc(98px + env(safe-area-inset-bottom)); }
  .sidebar { position:fixed; inset:auto 0 0; width:100%; height:auto; padding:7px 8px calc(7px + env(safe-area-inset-bottom)); border-right:0; border-top:1px solid #433657; background:rgba(14,11,22,.97); z-index:40; }
  .sidebar .brand,.sidebar .session,.sidebar nav span { display:none!important; }
  .sidebar nav { display:flex; align-items:stretch; gap:4px; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  .sidebar nav::-webkit-scrollbar { display:none; }
  .sidebar nav #ownerNav,.sidebar nav #resellerNav { display:contents; }
  .sidebar nav button { flex:0 0 auto; width:auto; min-width:74px; min-height:52px; margin:0; padding:8px 10px; text-align:center; white-space:nowrap; font-size:11px!important; line-height:1.2; border-radius:11px; }
  .sidebar nav button:first-letter { font-size:inherit; }
  .sidebar nav button.active { box-shadow:inset 0 0 0 1px #8d57e6; }
  .sidebar nav button em { display:none; }
  header { display:flex; flex-wrap:wrap; align-items:flex-start; gap:12px; margin-bottom:20px; }
  header > div:first-child { min-width:0; flex:1 1 100%; }
  header h2 { font-size:clamp(26px,8vw,34px); line-height:1.1; overflow-wrap:anywhere; }
  .header-actions { width:100%; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .header-actions > * { flex:0 0 auto; }
  .user-chip { max-width:100%; }
  #topUser { max-width:108px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #topRole { display:none; }
  .profile-menu,.notification-panel { position:fixed!important; top:auto!important; bottom:calc(72px + env(safe-area-inset-bottom)); left:12px!important; right:12px!important; width:auto!important; max-height:65dvh; overflow-y:auto; z-index:60; }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .stats article { min-width:0; min-height:116px; padding:15px; }
  .stats b { font-size:clamp(23px,7vw,32px); margin-top:8px; overflow-wrap:anywhere; }
  .stats span,.stats small { font-size:12px; line-height:1.25; }
  .section-head { align-items:flex-start; gap:12px; flex-wrap:wrap; }
  .quick,.project-actions { flex-wrap:wrap; }
  .quick button,.project-actions button { min-height:44px; }
  .grid,.dashboard-grid,.plan-grid,.account-layout { grid-template-columns:minmax(0,1fr)!important; }
  .panel { padding:17px; }
  .table-wrap { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  dialog { width:calc(100vw - 20px); max-width:none; max-height:calc(100dvh - 24px); overflow-y:auto; }
  dialog form { padding:18px; }
  .auth-shell { width:100%; border-radius:20px; }
  .login { min-height:100dvh; padding:16px; }
  .auth-shell aside { min-height:180px; padding:26px; }
  .auth-shell form { padding:28px 24px; }
  .toast { left:12px; right:12px; top:max(12px,env(safe-area-inset-top)); }
}