/* ShiftOrbit on phones and small tablets. Loaded last so it can adjust every screen. */
@media (max-width:760px){
  html{-webkit-text-size-adjust:100%}
  body{font-size:15px}
  /* Top bar: logo row, then one scrollable row of buttons */
  .topbar{position:sticky;top:0;z-index:40;padding:8px 12px;gap:8px;min-height:0}
  .topbar .brand-name small{display:none}
  .topbar .prototype{display:none}
  #theme-toggle{padding:6px 10px;font-size:12px}
  .account-tools{order:3;flex:1 1 100%;margin-left:0;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none;padding-bottom:2px}
  .account-tools::-webkit-scrollbar{display:none}
  .account-tools>button,.account-tools .nav-menu-trigger,.bell-button{flex:0 0 auto;white-space:nowrap;min-height:40px}
  /* Dropdown menus open as a sheet across the screen */
  .nav-menu-list{position:fixed!important;left:8px!important;right:8px!important;top:auto!important;width:auto!important;max-height:70vh;overflow:auto;z-index:80}
  .nav-menu-list button{min-height:44px;font-size:15px}
  .bell-panel{position:fixed;left:8px!important;right:8px;top:110px;width:auto}
  /* Main area */
  main,#schedule-main{padding-left:12px;padding-right:12px}
  .display-time-controls{flex-wrap:wrap;gap:6px}
  .workspace-tabs,.calendar-tabs{overflow-x:auto;flex-wrap:nowrap!important;scrollbar-width:none}
  .workspace-tabs::-webkit-scrollbar,.calendar-tabs::-webkit-scrollbar{display:none}
  .workspace-tabs button,.calendar-tabs button{flex:0 0 auto!important;white-space:nowrap;min-height:42px}
  .heading{flex-direction:column;align-items:stretch;gap:10px}
  .heading h1{font-size:24px}
  .heading .primary{width:100%;min-height:44px}
  .calendar-navigation{flex-direction:column;align-items:stretch;gap:6px}
  .summary{grid-template-columns:repeat(3,1fr)!important;gap:8px}
  .summary .local-note{display:none}
  .summary span{font-size:22px}
  .view-bar,.toolbar{flex-direction:column;align-items:stretch;gap:8px}
  .view-switch{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .view-switch::-webkit-scrollbar{display:none}
  .view-switch button{flex:0 0 auto;min-height:40px}
  .week-nav{justify-content:space-between}
  .toolbar input[type=search],#search{width:100%}
  /* Calendar grid: scroll sideways with the names column pinned */
  .schedule-panel{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .schedule-panel table{min-width:640px}
  .schedule-panel th[scope=row]{position:sticky;left:0;z-index:2;background:var(--surface)}
  .schedule-panel .person-name small{display:none}
  .schedule-panel .person-name .person-position{display:block}
  /* Lists and tables */
  table:not(.coverage-table):not(.permissions-table){font-size:13px}
  #oncall-view table,.oncall-table{display:block;overflow-x:auto}
  .team-grid{grid-template-columns:1fr!important}
  .user-detail .user-controls{grid-template-columns:1fr}
  .team-actions,.dialog-actions{flex-wrap:wrap}
  .team-actions button,.dialog-actions button{flex:1 1 auto;min-height:44px}
  .mgr-week{grid-template-columns:1fr}
  .mgr-day{padding-bottom:28px;font-size:11.5px}
  /* Dialogs become full-screen sheets */
  dialog,dialog.as-modal{width:100vw!important;max-width:100vw!important;height:100dvh;max-height:100dvh!important;margin:0!important;inset:0;border-radius:0!important;padding:16px!important}
  dialog .dialog-heading{position:sticky;top:-16px;z-index:3;background:inherit;padding-top:4px}
  input,select,textarea,button{font-size:16px}  /* stops iPhone zooming into fields */
  .passkey-nudge{left:8px;right:8px;bottom:8px;max-width:none}
  #toast{bottom:12px}
  /* Sign-in page: form first, marketing panel shorter */
  .auth-screen{padding:12px}
  .auth-preview .feature-list li:nth-child(n+3){display:none}
}
@media (max-width:380px){.summary{grid-template-columns:repeat(2,1fr)!important}.summary div:nth-child(3){display:none}}
