.app-settings-card{margin-top:22px}
.app-settings-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.app-settings-heading>span{color:var(--faint);font:10px var(--mono)}
.app-settings-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:16px}
.app-settings-actions #apply-app-update[hidden]{display:none}
.app-settings-card #app-update-status{margin:12px 0 0;color:var(--muted);font-size:11px}
.app-settings-card #app-update-status:empty{display:none}
#dialog-version-label[hidden],#version-input[hidden],.glide-select[hidden]{display:none!important}
.inventory-touch-actions{display:none}
.add-account-short{display:none}

@media(min-width:701px) and (max-width:900px){
  .topbar .nav-link,.account-toolbar .glide-trigger,.account-toolbar .orbit-pill{min-height:44px}
  .account-switch{min-height:64px}
  .workbench-actions .primary-button,.workbench-actions .icon-button{min-height:44px}
  .workbench-actions .icon-button{width:44px}
  .connection-panel>#server-input,.connection-panel>.glide-select .glide-trigger{min-height:44px;font-size:14px}
  .workbench .console-output{font-size:11px;line-height:1.6}
  .flight-composer input{font-size:14px}
  .flight-composer button{min-width:44px;min-height:44px}
  .bot-gear{width:40px;height:40px}
}

@media(max-width:700px){
  html,body{max-width:100%;overflow-x:hidden}
  body{min-width:320px}
  .shell,.main-shell{min-width:0}
  .topbar{min-height:64px;height:auto;padding:max(8px,env(safe-area-inset-top)) 12px 8px;overflow:hidden}
  .topbar nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;width:100%;overflow:visible}
  .topbar .nav-link{min-width:0;min-height:46px;justify-content:center;gap:6px;padding:8px 5px;font-size:11px}
  .topbar .nav-link svg{width:17px;height:17px}
  main,main.accounts-page{padding:18px 14px calc(26px + env(safe-area-inset-bottom))}
  .page-heading{margin-bottom:17px}
  .page-heading h1{font-size:clamp(19px,5vw,24px);overflow-wrap:anywhere}
  .eyebrow{font-size:9px}
  .section-heading h2{font-size:13px}
  .account-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:stretch;justify-content:stretch}
  .account-toolbar .section-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;justify-self:stretch}
  .account-toolbar .glide-select{width:100%}
  .account-toolbar .glide-trigger,.account-toolbar .orbit-pill{min-height:46px;width:100%;font-size:10px}
  .account-toolbar .orbit-pill{justify-content:center;padding:6px 8px;white-space:normal;line-height:1.2;text-align:center}
  .account-toolbar .add-account-label{display:none}
  .account-toolbar .add-account-short{display:inline;font-size:11px}
  .account-rail{gap:8px;margin-bottom:14px}
  .account-switch{height:auto;min-height:64px;padding:11px 14px}
  .account-switch-name{font-size:13px}
  .account-switch-server{font-size:10px}
  .account-switch-indicator{width:9px;height:9px}
  .workbench-header{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:14px}
  .selected-identity h2{font-size:13px}
  .workbench-actions{width:100%;justify-content:flex-end;gap:8px}
  .workbench-actions .state-label{margin-right:auto;font-size:10px}
  .workbench-actions .primary-button,.workbench-actions .icon-button{min-height:44px}
  .workbench-actions .icon-button{width:44px}
  .workbench-body{display:grid;grid-template-columns:minmax(0,1fr)}
  .connection-panel{padding:14px;border-right:0;border-bottom:1px solid var(--line)}
  .connection-panel .panel-title{margin-bottom:10px}
  .connection-panel>#server-input,.connection-panel>.glide-select .glide-trigger{min-height:44px;font-size:16px}
  .connection-panel>#server-input{margin-bottom:10px}
  .connection-panel>.glide-select{margin-bottom:8px}
  .connection-panel .setting-line{min-height:44px}
  .connection-panel .setting-line strong{font-size:12px}
  .console-panel{min-width:0;padding:14px}
  .console-panel .panel-title{min-height:40px;margin-bottom:6px}
  .console-tools .quiet-button,.console-tools .icon-button{min-width:40px;min-height:40px;justify-content:center}
  .workbench .console-output{height:clamp(260px,42dvh,420px);min-height:260px;max-height:none;font-size:11px;line-height:1.6}
  .log-row{grid-template-columns:42px 31px minmax(0,1fr);gap:6px}
  .composer-row{margin-top:8px}
  .flight-composer{min-height:48px}
  .flight-composer input,.live-command input{font-size:16px}
  .flight-composer button{min-width:44px;min-height:44px}
  .composer-key{display:none}
  .command-suggestions{width:100%;max-height:min(280px,45dvh)}
  .command-suggestion{min-height:42px;font-size:12px}
  .inventory-toolbar{margin-bottom:12px}
  .inventory-toolbar label,.inventory-toolbar .glide-select{width:100%}
  .inventory-toolbar .glide-trigger{min-height:46px;font-size:12px}
  .inventory-main{padding:14px}
  .inventory-title-row{align-items:center;gap:8px}
  .inventory-title-row h2{font-size:14px;line-height:1.35;overflow-wrap:anywhere}
  .inventory-title-row .secondary-button{min-height:44px;white-space:normal}
  .inventory-touch-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:100%;margin-bottom:15px}
  .inventory-touch-actions button{min-height:44px;border:1px solid var(--control-line);border-radius:6px;background:var(--control-surface);font:10px var(--mono)}
  .inventory-touch-actions button[aria-pressed=true]{border-color:#aaa;background:#303030;color:#fff}
  .inventory-touch-actions>span{grid-column:1/-1;color:var(--muted);font:10px var(--mono)}
  .inventory-content{width:100%}
  .inventory-section{width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
  .slot-grid{grid-template-columns:repeat(var(--columns,9),44px);width:max-content;max-width:none;gap:4px}
  .inventory-slot{width:44px;height:44px;aspect-ratio:auto;padding:3px}
  .slot-pixel{font-size:11px}
  .item-tooltip{max-height:60dvh;overflow:auto;font-size:12px}
  .settings-card{padding:16px}
  .settings-card h2{font-size:14px}
  .settings-account-picker,.settings-account-picker .glide-select{width:100%}
  .settings-account-picker .glide-trigger{min-height:46px;font-size:12px}
  .feature-switch{min-height:54px;display:flex;align-items:center}
  .feature-switch .setting-line{width:100%}
  .feature-switch strong{font-size:12px}
  .bot-settings-header{gap:10px}
  .bot-row{min-height:58px;padding:9px 10px}
  .bot-row-info strong{font-size:12px}
  .bot-row-info span{font-size:10px}
  .bot-gear{width:44px;height:44px}
  .bot-row .compact-switch,.feature-switch .compact-switch{width:44px;height:44px;justify-content:center}
  .bot-row .compact-switch .switch-track,.feature-switch .compact-switch .switch-track{margin:0}
  .glide-option{min-height:44px;font-size:12px}
  .app-settings-actions{display:grid;grid-template-columns:1fr}
  .app-settings-actions button{min-height:44px}
  dialog,#login-dialog,#bot-dialog{width:100%;max-width:none;max-height:min(92dvh,900px);margin:auto 0 0;padding:18px 18px max(18px,env(safe-area-inset-bottom));border-radius:16px 16px 0 0}
  dialog label input,dialog label select,.bot-field input,.bot-field select,.bot-field textarea{min-height:44px;font-size:16px}
  .dialog-footer{position:sticky;bottom:0;background:#1b1b1b;z-index:1;padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .dialog-footer>button{min-height:44px}
  .toast{bottom:calc(14px + env(safe-area-inset-bottom));width:calc(100vw - 28px);text-align:center}
}

@media(max-width:370px){
  .topbar .nav-link{gap:4px;font-size:10px}
  .topbar .nav-link svg{width:15px;height:15px}
  .account-toolbar .orbit-pill{font-size:9px}
  .account-toolbar .orbit-pill .icon-disc{width:25px;height:25px}
}
