/* Mobile controls use reserved rails, so both compact and expanded toggles fit. */
#backupToolsToggle{display:none}
.backup-actions{display:flex;align-items:center;gap:8px}
.backup-actions[hidden]{display:none!important}
.collection-filter-reset{margin-left:auto;font-size:12px}
#toggleCollectionFilters{position:relative}
#toggleCollectionFilters[data-active-count]::after{content:attr(data-active-count);position:absolute;right:-5px;top:-5px;display:flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:#dfc67d;color:#181b26;font:600 11px system-ui,sans-serif;box-shadow:0 0 0 2px #1a1d2b;pointer-events:none}
@media(max-width:760px){
  header{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"tools brand" "pages pages";gap:8px 14px;padding:8px 12px 10px}
  header .brand{justify-self:end;min-width:0}
  header .brand .brand-logo{width:min(220px,57vw);max-width:100%;height:auto}
  header .brand .app-version{display:none}
  header .tools{position:relative;top:auto;right:auto;bottom:auto;left:auto;display:flex;flex-direction:row;align-items:center;justify-self:start;width:auto}
  #backupToolsToggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:8px 11px;font-size:12px;background:#ffffff06;border-color:#ffffff25}
  #backupToolsToggle .ui-icon{width:17px;height:17px}
  .backup-actions{position:absolute;left:0;top:calc(100% + 8px);z-index:45;display:none;flex-direction:column;align-items:stretch;gap:5px;min-width:180px;padding:8px;border:1px solid #ffffff28;border-radius:12px;background:#1a2030;box-shadow:0 12px 32px #0008}
  header .tools.backup-open .backup-actions{display:flex}
  header .tools .backup-actions button{justify-content:flex-start;min-height:42px;font-size:13px;padding:9px 11px;gap:9px}
  header .tools .backup-actions .ui-icon{width:18px;height:18px}
  header nav{width:100%;display:flex;flex-wrap:nowrap;gap:4px;justify-content:center;min-width:0}
  header nav .tab{flex:1;min-width:0;min-height:42px;font-size:13px;padding:8px 10px;white-space:nowrap}
  .teams-workspace{padding-left:52px;padding-right:52px;padding-bottom:110px}
  .teams-workspace .team>.team-size-toggle,.teams-workspace .team.compact>.team-size-toggle{right:-40px;width:32px;height:40px;border-radius:8px;border:1px solid #d8e5fa55;padding:7px}
  .teams-workspace .team>.team-size-toggle::before{display:none}
  .teams-workspace .team>.team-drag-handle{left:-40px;width:32px;height:40px}
  .teams-workspace .team>.team-move-step{left:-36px;width:24px;min-height:28px}
  .teams-workspace .team>.team-delete-check{left:-40px;width:32px;height:32px}
  .teams-workspace .team.compact{padding:10px 8px!important}
  .teams-workspace .compact-portrait{width:100%;max-width:124px}
  .teams-workspace .compact-nameplate{position:static}
  .teams-workspace .compact-nameplate .constellation-badge{left:4px;top:4px;bottom:auto}
  .teams-workspace .team-toolbar{margin-left:-40px;margin-right:-40px;width:calc(100% + 80px);min-width:0}
  .teams-workspace .team-toolbar .team-search-wrap{min-width:0}
  .teams-workspace .team-toolbar #teamSearch,#cSearch,#rosterSearch,#search{font-size:16px!important}
  .teams-workspace .team-head input,.custom-form input,.custom-form select{font-size:16px}
  .teams-workspace .team-search-wrap #teamSummary{font-size:11px;padding:0 8px 0 4px}
  .teams-workspace .addwrap{margin-left:-40px;margin-right:-40px;padding:0}
  .team-action-dock{gap:8px;max-width:calc(100vw - 24px)}
  .team-action-dock.is-floating{bottom:max(12px,env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .team.themed,.p,.team[data-sheen] .fx::after{animation:none!important}
}
