/* Phone menu layouts. Keep the live combat HUD and desktop shell unchanged. */
@media (max-width:760px) and (pointer:coarse) and (orientation:portrait){
 #phone-menu-rotate-prompt{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;box-sizing:border-box;width:100vw;height:100dvh;padding:24px;background:radial-gradient(ellipse at 50% 38%,#12344a 0%,#071521 66%,#040b11 100%);color:#eef8fb;text-align:center}
 #phone-menu-rotate-prompt[hidden]{display:none}
 .phone-menu-rotate-card{display:grid;justify-items:center;gap:12px;width:min(100%,340px);padding:28px 22px;border:1px solid #3ca9b866;border-radius:18px;background:#0b1b29eF;box-shadow:0 18px 56px #0008}
 .phone-menu-rotate-icon{display:grid;place-items:center;width:54px;height:54px;border:1px solid #49c5d980;border-radius:50%;color:#72e8ee;font-size:34px;line-height:1}
 #phone-menu-rotate-title{max-width:100%;margin:0;color:#f4fbff;font-size:22px;line-height:1.25;letter-spacing:.01em}
 .phone-menu-rotate-copy{max-width:100%;margin:0;color:#b6cbd5;font-size:15px;line-height:1.5}
}

@media (max-width:760px) and (orientation:portrait){
 html,body{width:100%;height:100%;overflow:hidden}
 #hangar [hidden],#room-browser [hidden],#room-lobby [hidden],#settings-menu[hidden],#control-guide[hidden],#gear-selection-menu[hidden]{display:none!important}
 body[data-app-state="HANGAR"] #hangar,
 body[data-app-state="ROOM_BROWSER"] #room-browser,
 body[data-app-state="ROOM_LOBBY"] #room-lobby{position:fixed;inset:0;display:block;width:100%;height:100dvh;min-height:0;padding:0;overflow:hidden}

 body[data-app-state="HANGAR"] #hangar .hangar-body,
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body,
 body[data-app-state="ROOM_LOBBY"] #room-lobby .screen-body{box-sizing:border-box;display:block;width:100%;height:100dvh;max-height:none;margin:0;padding:calc(env(safe-area-inset-top) + 10px) 12px calc(88px + env(safe-area-inset-bottom));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;border:0;border-radius:0}
 body[data-app-state="HANGAR"] #hangar .hangar-body{background:#07131deF}
 body[data-app-state="HANGAR"] #hangar .hangar-columns{grid-template-columns:minmax(0,1fr);min-width:0}
 body[data-app-state="HANGAR"] #hangar #inventory-panel{box-sizing:border-box;min-width:0;max-width:100%}
 body[data-app-state="HANGAR"] #hangar .frame-driver-shell-header,
 body[data-app-state="ROOM_BROWSER"] #room-browser .frame-driver-shell-header{display:flex;position:relative;align-items:center;justify-content:space-between;gap:8px;min-height:56px;margin:0 0 10px;padding:6px 8px;border:1px solid #17647d;background:#061722f5}
 body[data-app-state="HANGAR"] #hangar .main-menu-brand,
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand{display:block;min-width:0}
 body[data-app-state="HANGAR"] #hangar .main-menu-brand .screen-eyebrow,
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand .screen-eyebrow{margin:0 0 2px;font-size:10px;line-height:1.2;letter-spacing:.08em}
 body[data-app-state="HANGAR"] #hangar .main-menu-brand h2,
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand h2{margin:0;font-size:20px;line-height:1.15;letter-spacing:.08em}
 body[data-app-state="HANGAR"] #hangar .hangar-header-actions,
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-header-actions{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px;max-width:none}
 body[data-app-state="HANGAR"] #hangar #wallet-display,
 body[data-app-state="ROOM_BROWSER"] #room-browser #wallet-display{display:flex;flex-direction:column;align-items:flex-end;gap:2px;margin:0;padding:0;border:0;background:none;font-size:11px;line-height:1.3}
 .hangar-utility-menu{position:relative;display:block;flex:none}
 .hangar-utility-menu>summary{display:flex;min-width:56px;min-height:48px;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:3px;border:1px solid #1d91aa;background:#082532;color:#8deaff;list-style:none;font-size:11px;font-weight:700}
 .hangar-utility-menu>summary::-webkit-details-marker{display:none}
 .hangar-utility-menu>summary span:first-child{font-size:18px;line-height:1}
 .hangar-utility-items{display:none}
 .hangar-utility-menu[open]>.hangar-utility-items{position:fixed;z-index:80;top:calc(env(safe-area-inset-top) + 74px);right:10px;left:10px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:calc(100dvh - 92px - env(safe-area-inset-top));padding:10px;overflow-y:auto;overscroll-behavior:contain;border:1px solid #1683a1;background:#061622f8;box-shadow:0 12px 35px #000d}
 .hangar-utility-items>button{box-sizing:border-box;min-width:0;min-height:48px;padding:8px 7px;border:1px solid #23647a;background:#0a2531;color:#d5f5ff;font-size:13px;line-height:1.25;white-space:normal}
 .hangar-utility-items #open-leaderboard{border-color:#96702c;color:#f4d277}

 #main-menu-nav{position:fixed;z-index:70;right:max(8px,env(safe-area-inset-right));bottom:max(8px,env(safe-area-inset-bottom));left:max(8px,env(safe-area-inset-left));display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;height:64px;min-height:64px;margin:0;padding:5px;border:1px solid #1683a1;background:#041723f5;box-shadow:0 -4px 24px #0009;box-sizing:border-box}
 #main-menu-nav button{display:flex;min-width:0;min-height:52px;height:auto;align-items:center;justify-content:center;flex-direction:column;gap:2px;padding:4px 2px;border:1px solid #12546a;background:#061925;color:#76dcef;font-size:13px;font-weight:700;line-height:1.1;letter-spacing:.015em;white-space:normal}
 #main-menu-nav button i{font-size:17px;font-style:normal;line-height:1}
 #main-menu-nav button[aria-current="page"]{border-color:#e2b94c;background:linear-gradient(145deg,#ecc24f,#b98422);color:#10212a;box-shadow:inset 0 0 0 1px #ffeaa4}

 body[data-app-state="HANGAR"] #hangar #currentgear{margin:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #hangar-character-info,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #hangar-character-info{display:none}
 body[data-app-state="HANGAR"] #hangar #hangar-character-info{display:block;width:100%;height:auto;min-height:0;margin:0;overflow:visible}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-grid{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto;gap:10px;width:100%;height:auto;min-height:0;overflow:visible}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-grid>section{box-sizing:border-box;min-width:0;min-height:0;padding:12px;overflow:visible;border:1px solid #145a72;background:#061722eF}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-profile{display:grid;grid-template-rows:auto auto;gap:10px}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-head{min-height:72px;margin:0}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-portrait{width:72px;height:68px;min-width:72px}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-head h3{font-size:16px}
 body[data-app-state="HANGAR"] #hangar #status-allocation-panel{min-width:0;margin:0;padding:0;border:0;background:none}
 body[data-app-state="HANGAR"] #hangar #status-allocation-panel>header{align-items:center;gap:8px;margin:0 0 6px;padding:0}
 body[data-app-state="HANGAR"] #hangar #status-allocation-panel>header h4{font-size:14px}
 body[data-app-state="HANGAR"] #hangar #status-allocation-panel>header button{min-height:44px;padding:7px 9px;font-size:12px}
 body[data-app-state="HANGAR"] #hangar .status-point-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:5px}
 body[data-app-state="HANGAR"] #hangar .status-point-grid article{grid-template-columns:minmax(0,1fr) 44px 34px 44px;min-height:54px;padding:5px 7px}
 body[data-app-state="HANGAR"] #hangar .status-point-grid article button{width:44px;height:44px;min-width:44px;min-height:44px;font-size:20px}
 body[data-app-state="HANGAR"] #hangar .status-point-grid article b{font-size:14px}
 body[data-app-state="HANGAR"] #hangar .status-point-grid article small{font-size:12px;line-height:1.3}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-center{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-stats{min-height:0;padding:0;border:0;background:none}
 body[data-app-state="HANGAR"] #hangar .hangar-dossier-stats h4,
 body[data-app-state="HANGAR"] #hangar #hangar-dossier-weapons>h4{margin:0 0 8px;font-size:15px;line-height:1.35}
 body[data-app-state="HANGAR"] #hangar .hangar-stat-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 body[data-app-state="HANGAR"] #hangar .hangar-stat-list>span{min-height:42px;padding:7px;font-size:12px;line-height:1.25}
 body[data-app-state="HANGAR"] #hangar .hangar-stat-list b{font-size:13px}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-cards{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:auto;gap:8px}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-card{display:grid;grid-template-columns:52px minmax(0,1fr);grid-template-rows:auto auto;gap:6px;min-width:0;min-height:92px;padding:8px}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-card>img{grid-row:1/3;width:48px;height:54px;object-fit:contain}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-heading{min-width:0}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-heading small{font-size:11px}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-heading b{display:block;overflow:hidden;font-size:13px;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 8px;align-content:start;min-width:0}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-values span{min-width:0;font-size:11px;line-height:1.3}
 body[data-app-state="HANGAR"] #hangar .hangar-weapon-values b{display:block;font-size:12px;line-height:1.3}
 body[data-app-state="HANGAR"] #hangar #hangar-dossier-weapons{display:flex;flex-direction:column;min-height:0;overflow:visible}

 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment{margin:0 0 10px;padding:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment h3{margin:0 0 7px;font-size:15px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot:last-child{display:grid;grid-column:auto;grid-template-columns:40px minmax(0,1fr);grid-template-rows:18px minmax(0,1fr);gap:3px 6px;height:64px;min-height:64px;padding:5px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot .item-icon-frame{grid-row:1/3;width:38px;height:50px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot .item-icon-frame img{width:34px;height:42px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot>strong{font-size:11px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot>span:not(.item-icon-frame){font-size:12px;line-height:1.25}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel{display:flex;flex-direction:column;min-height:0;margin:0;padding:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin:0 0 10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row h3{margin:0;font-size:17px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-note{font-size:12px;line-height:1.4}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label{font-size:12px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label:last-child{width:auto}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort{box-sizing:border-box;width:100%;min-height:46px;height:46px;padding:8px 10px;font-size:15px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-workspace{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:9px;min-height:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;min-height:0;max-height:none;overflow:visible;padding:6px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters button{min-height:46px;padding:8px;font-size:13px;line-height:1.2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-unrelated-toggle{grid-column:1/-1;min-height:46px;padding:8px;font-size:12px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-list{display:block;min-width:0;min-height:0;height:auto;max-height:none;overflow:visible;padding:5px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items{display:block;min-width:0;max-height:none;overflow:visible;padding:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:156px;gap:7px}
 body[data-app-state="HANGAR"][data-match-menu="true"] #hangar[data-menu-section="inventory"] #inventory-list{box-sizing:border-box;display:block;min-height:220px;height:42dvh;max-height:48dvh;overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item{display:grid;grid-template-rows:54px minmax(0,1fr) 36px;gap:4px;width:100%;height:156px;min-height:156px;padding:6px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .item-icon-frame{width:50px;height:50px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .item-icon-frame img{width:46px;height:46px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item h4,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item strong{font-size:12px;line-height:1.2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .inventory-equip{height:36px;min-height:36px;padding:7px;font-size:12px;line-height:18px}

 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-panel{display:block;width:100%;min-height:0;margin:0;padding:10px;overflow:visible}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header{align-items:center;gap:8px;margin:0 0 10px;padding-bottom:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header .screen-eyebrow{font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header h3{font-size:20px!important}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header p:last-child{font-size:13px!important;line-height:1.35}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #refresh-workshop{min-width:48px;min-height:44px;padding:8px;font-size:12px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:8px 0 10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav button{display:flex;min-width:0;min-height:58px;align-items:center;justify-content:center;padding:7px 4px;text-align:center;font-size:13px;line-height:1.2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav button b{font-size:13px;line-height:1.2;letter-spacing:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav button small{display:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto;grid-template-areas:"mobile-materials" "mobile-bench" "mobile-inspector" "mobile-pending";gap:9px;min-height:0;overflow:visible}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-sidebar{display:contents}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-sidebar>section:first-child{grid-area:mobile-materials;padding:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-sidebar>.workshop-pending-panel{grid-area:mobile-pending;padding:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:none;overflow:visible;padding:4px 0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card{display:grid!important;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;gap:2px 6px;min-width:0;min-height:54px;padding:6px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card img{grid-column:1;grid-row:1/3;width:30px;height:34px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card h5,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card p{min-width:0;overflow-wrap:anywhere;font-size:12px;line-height:1.25;white-space:normal}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bench{grid-area:mobile-bench;min-width:0;min-height:0;overflow:visible;padding:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-view:not([hidden]){display:flex;flex-direction:column;gap:9px;height:auto;min-height:0;overflow:visible;padding:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading h4{font-size:17px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading p{font-size:13px;line-height:1.4}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading small{font-size:11px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-mode-toggle{min-width:104px;min-height:44px;font-size:12px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-selected-recipe{min-height:76px;padding:9px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(82px,auto);gap:7px;min-width:0;max-height:none;overflow:visible;margin:8px 0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes .workshop-card,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons .workshop-card{min-width:0;min-height:76px;padding:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes .workshop-card h5,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons .workshop-card h5{font-size:13px;line-height:1.3}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes .workshop-card p,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons .workshop-card p{font-size:12px;line-height:1.35}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-inspector{display:grid;grid-area:mobile-inspector;grid-template-columns:minmax(0,1fr);gap:8px;min-width:0;max-height:none;overflow:visible}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-inspector>.workshop-panel-card{min-width:0;padding:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card>p,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card dl>div,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-rules-card ul{font-size:12px;line-height:1.4}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-inspector .workshop-rules-card{display:block}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-refine-button,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .resonance-apply{min-height:48px;font-size:14px}
 #workshop-panel[data-workshop-bay="refinery"] .refinery-weapon-filters button{min-height:44px;font-size:12px}
 #workshop-panel[data-workshop-bay="refinery"] .refinery-weapon-search input{min-height:44px;font-size:14px}
 #workshop-panel[data-workshop-bay="refinery"] .refinery-weapon-choice{min-height:56px;height:auto;padding:8px}

 body[data-app-state="ROOM_BROWSER"] #room-browser{padding:0}
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body{gap:8px;padding:calc(env(safe-area-inset-top) + 10px) 12px calc(88px + env(safe-area-inset-bottom))}
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body>header:not(.frame-driver-shell-header){display:flex;min-height:52px;align-items:center;margin:0;padding:0 2px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body>header h1{margin:0;font-size:21px;line-height:1.2;letter-spacing:.08em}
 body[data-app-state="ROOM_BROWSER"] #rooms-hangar{min-width:92px;min-height:44px;padding:8px;font-size:13px}
 body[data-app-state="ROOM_BROWSER"] #main-menu-nav{margin:0}
 body[data-app-state="ROOM_BROWSER"] .saved-loadout{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;margin:0;padding:10px}
 body[data-app-state="ROOM_BROWSER"] .saved-loadout>span{font-size:13px}
 body[data-app-state="ROOM_BROWSER"] #browser-loadout-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body[data-app-state="ROOM_BROWSER"] #browser-loadout-items .saved-loadout-item{min-width:0;min-height:56px}
 body[data-app-state="ROOM_BROWSER"] #browser-loadout{margin:0;font-size:13px;line-height:1.4}
 body[data-app-state="ROOM_BROWSER"] .browser-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:0;padding:10px}
 body[data-app-state="ROOM_BROWSER"] #refresh-rooms{min-height:44px;font-size:13px}
 body[data-app-state="ROOM_BROWSER"] .browser-toolbar>p{margin:0;font-size:13px}
 body[data-app-state="ROOM_BROWSER"] .online-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;margin:0}
 body[data-app-state="ROOM_BROWSER"] .online-actions label{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;font-size:13px}
 body[data-app-state="ROOM_BROWSER"] #online-mode,
 body[data-app-state="ROOM_BROWSER"] #quick-play{box-sizing:border-box;width:100%;min-width:0;min-height:48px;font-size:15px}
 body[data-app-state="ROOM_BROWSER"] .room-browser-columns{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;min-height:0;overflow:visible}
 body[data-app-state="ROOM_BROWSER"] .room-browser-columns>section{min-height:0;padding:10px;overflow:visible}
 body[data-app-state="ROOM_BROWSER"] .room-browser-columns>section>h2,
 body[data-app-state="ROOM_BROWSER"] #room-create h2{margin:0 0 8px;font-size:16px}
 body[data-app-state="ROOM_BROWSER"] #room-list{display:grid;gap:7px;max-height:none;overflow:visible}
 body[data-app-state="ROOM_BROWSER"] #room-list>.room-card{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto auto;gap:4px 8px;width:100%;height:auto;min-height:106px;max-height:none;padding:10px}
 body[data-app-state="ROOM_BROWSER"] #room-list>.room-card>h3{grid-column:1/-1;margin:0;font-size:15px;line-height:1.3}
 body[data-app-state="ROOM_BROWSER"] #room-list>.room-card>button{grid-column:2;grid-row:2/5;min-width:76px;min-height:44px;padding:7px;font-size:13px}
 body[data-app-state="ROOM_BROWSER"] .room-card-mode,
 body[data-app-state="ROOM_BROWSER"] .room-card-map,
 body[data-app-state="ROOM_BROWSER"] .room-card-population,
 body[data-app-state="ROOM_BROWSER"] .room-card-ai-level,
 body[data-app-state="ROOM_BROWSER"] .room-card-status{font-size:12px;line-height:1.35}
 body[data-app-state="ROOM_BROWSER"] #room-create{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:"title" "name" "mode" "map" "duration" "ai" "difficulty" "balance" "submit";gap:7px;margin:0;padding:12px}
 body[data-app-state="ROOM_BROWSER"] #room-create h2{grid-area:title}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-name-field{grid-area:name}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-mode-field{grid-area:mode}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-map-field{grid-area:map}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-duration-field{grid-area:duration}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-ai-fill-field{grid-area:ai}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-ai-level-field{grid-area:difficulty}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-team-balance-field{grid-area:balance}
 body[data-app-state="ROOM_BROWSER"] #room-create>button{grid-area:submit}
 body[data-app-state="ROOM_BROWSER"] #room-create label{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;min-width:0;margin:0;font-size:13px;line-height:1.25}
 body[data-app-state="ROOM_BROWSER"] #room-create .room-ai-fill-field{grid-template-columns:24px minmax(0,1fr);align-items:center;min-height:44px}
 body[data-app-state="ROOM_BROWSER"] #room-create input:not([type="checkbox"]),
 body[data-app-state="ROOM_BROWSER"] #room-create select{box-sizing:border-box;width:100%;min-width:0;min-height:46px;height:46px;padding:8px;font-size:15px}
 body[data-app-state="ROOM_BROWSER"] #room-create input[type="checkbox"]{width:22px;height:22px}
 body[data-app-state="ROOM_BROWSER"] #room-create>button{min-height:50px;margin-top:2px;font-size:15px}

 body[data-app-state="ROOM_LOBBY"] #room-lobby .screen-body>header{position:sticky;top:0;z-index:3;min-height:60px;margin:0 0 10px;padding:8px;background:#061722f5}
 body[data-app-state="ROOM_LOBBY"] #room-lobby .screen-body>header h1{font-size:18px;line-height:1.2}
 body[data-app-state="ROOM_LOBBY"] #room-lobby .screen-body>header button,
 body[data-app-state="ROOM_LOBBY"] #lobby-hangar,
 body[data-app-state="ROOM_LOBBY"] #room-start{min-height:46px;font-size:13px}
 body[data-app-state="ROOM_LOBBY"] #room-roster{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
 body[data-app-state="ROOM_LOBBY"] #room-roster>*{min-width:0}

 #auth-screen{position:fixed;inset:0;display:block;width:100%;height:100dvh;padding:0;overflow-x:hidden;overflow-y:auto;place-items:initial}
 #auth-screen .auth-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;gap:10px;width:100%;min-height:100dvh;margin:0;padding:calc(env(safe-area-inset-top) + 12px) 14px calc(env(safe-area-inset-bottom) + 14px)}
 #auth-screen .auth-language{min-height:44px}
 #auth-screen .auth-brand .auth-logo{width:clamp(90px,26vw,124px);max-width:124px}
 #auth-screen .auth-brand>span{font-size:11px}
 #auth-screen .auth-main{gap:10px;padding:0}
 #auth-screen .auth-card{max-height:none;padding:20px 16px;overflow:visible}
 #auth-screen #auth-copy{font-size:14px;line-height:1.45}
 #auth-screen #google-oauth-sign-in{min-height:52px;font-size:16px}
 #auth-screen #play-as-guest{min-height:52px;font-size:15px}
 #auth-screen .auth-footer{min-height:36px;font-size:12px}
 #auth-screen input,#auth-screen #account-submit,#auth-screen #account-switch{min-height:46px;font-size:15px}

 #settings-menu{position:fixed;z-index:200;inset:0;box-sizing:border-box;width:100%;height:100dvh;padding:0;overflow:hidden;place-items:stretch}
 #settings-menu .settings-card{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%;max-height:none;min-height:0;margin:0;padding:8px 10px 10px;overflow:hidden;border:0}
 #settings-menu .settings-card>header{position:relative;top:auto;z-index:2;flex:none;min-height:50px;margin:-8px -10px 3px;padding:4px 10px;border-bottom:1px solid #1e5668;background:#081722f5}
 #settings-menu .settings-card>header>div:first-child{min-width:0}
 #settings-menu .settings-card>header .screen-eyebrow{display:none}
 #settings-menu .settings-card h2{font-size:18px;line-height:1.2}
 #settings-menu .settings-header-actions{flex:none;gap:5px}
 #settings-menu #close-settings{position:relative;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;overflow:hidden;font-size:0}
 #settings-menu #close-settings::before{content:'×';display:grid;place-items:center;font-size:27px;line-height:1}
 #settings-menu .settings-card h2{font-size:21px}
 #settings-menu .settings-card h3{margin:10px 0 6px;font-size:14px}
 #settings-menu .settings-auto-apply{flex:none;margin:0 0 3px;font-size:11px;line-height:1.3}
 #settings-menu .settings-workspace{display:grid;grid-template-columns:minmax(104px,22%) minmax(0,1fr);gap:9px;flex:1;min-height:0}
 #settings-menu .settings-workspace{display:block;flex:none}
 #settings-menu .settings-tabs{display:flex;flex-direction:row;gap:4px;min-height:0;margin:0 -2px 4px;padding:0;overflow-x:auto;overflow-y:hidden;border:0;border-bottom:1px solid #28444e}
 #settings-menu .settings-tabs [role="tab"]{flex:none;min-height:44px;padding:6px 7px;font-size:11px;line-height:1.15;text-align:left;white-space:normal;scroll-snap-align:start}
 #settings-menu .settings-panel{min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:0 3px 0 0}
 #settings-menu .settings-panel>section:first-child h3{margin-top:5px}
 #settings-menu #language-settings{min-height:44px;margin:0 0 6px;padding:3px 0;border-bottom:1px solid #28444e}
 #settings-menu #language-settings h3{margin:0;font-size:12px}
 #settings-menu #language-settings .language-picker{gap:4px}
 #settings-menu #language-picker button{width:44px;min-width:44px;height:44px;min-height:44px;padding:4px;font-size:12px}
 #settings-menu .settings-card p,#settings-menu .settings-card label{font-size:13px;line-height:1.45}
 #settings-menu button,#settings-menu select,#settings-menu input:not([type="range"]){min-height:44px;font-size:14px}
 #settings-menu .control-mode-option{min-height:56px;padding:10px}
 #settings-menu .audio-switches{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
 #settings-menu .audio-switches label{min-height:44px}
 #settings-menu .audio-volume{min-height:48px}
 #settings-menu .audio-volume input{min-width:45%;min-height:36px}
 #settings-menu #promo-form button{min-height:46px}

 #control-guide{position:fixed;inset:0;width:100%;height:100dvh;padding:8px;overflow:hidden}
 #control-guide .guide-card{box-sizing:border-box;width:100%;max-height:100%;padding:14px;overflow-y:auto}
 #control-guide .guide-card>header{position:sticky;top:-14px;z-index:2;align-items:center;flex-direction:row;min-height:58px;margin:-14px -14px 10px;padding:10px 14px;border-bottom:1px solid #1e5668;background:#081722f5}
 #control-guide .tutorial-actions{position:sticky;bottom:-14px;z-index:2;margin:8px -14px -14px;padding:10px 14px;border-top:1px solid #1e5668;background:#07131bf2}
 #control-guide .tutorial-actions button{min-height:46px}
 #control-guide .guide-card h2{font-size:20px}
 #control-guide .guide-card>header button{min-height:44px;padding:8px;font-size:12px}
 #control-guide .guide-card p,#control-guide .guide-card dd{font-size:13px;line-height:1.45}
 #control-guide .control-guide-mapping,#control-guide .control-guide-modes{grid-template-columns:minmax(0,1fr)}
 #control-guide .control-guide-mapping>div{min-height:48px}

 #gear-selection-menu{position:fixed;inset:0;width:100%;height:100dvh;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);overflow:hidden}
 #gear-selection-menu .gear-selection-dialog{width:100%;height:100%;max-height:100%;padding:10px;border:0}
 #gear-selection-menu .gear-selection-dialog>header{position:sticky;top:0;z-index:3;min-height:60px;background:#041522f5}
 #gear-selection-menu .gear-selection-dialog>header h2{font-size:18px}
 #gear-selection-menu .gear-selection-dialog>header>button{width:46px;height:46px;min-width:46px;min-height:46px}
 #gear-selection-menu .gear-menu-columns{display:flex;flex:1;flex-direction:column;gap:8px;padding-top:8px;overflow-y:auto;overscroll-behavior:contain}
 #gear-selection-menu .gear-class-panel{flex:none;min-height:0;max-height:none}
 #gear-selection-menu .gear-class-panel #gearlist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(72px,auto);gap:6px;padding:7px;overflow:visible}
 #gear-selection-menu .gear-equip-card{min-height:68px!important;padding:6px!important}
 #gear-selection-menu .gear-equip-card-name{font-size:12px}
 #gear-selection-menu .gear-skins-panel{flex:none;min-height:0}
 #gear-selection-menu .skin-browser-controls{gap:7px;padding:8px}
 #gear-selection-menu .skin-browser-search{font-size:10px}
 #gear-selection-menu .skin-browser-search input{min-height:44px;font-size:14px}
 #gear-selection-menu .skin-filter-tabs button{min-height:44px;font-size:12px}
 #gear-selection-menu .skin-browser-content{grid-template-columns:minmax(90px,.36fr) minmax(0,1fr);min-height:330px;padding:7px}
 #gear-selection-menu .skin-family-option{grid-template-columns:minmax(0,1fr);justify-items:center;gap:2px;min-height:76px;padding:5px 3px;text-align:center}
 #gear-selection-menu .skin-family-option img{width:40px;height:40px}
 #gear-selection-menu .skin-family-copy{justify-items:center;width:100%}
 #gear-selection-menu .skin-family-copy strong{max-width:100%;font-size:11px}
 #gear-selection-menu .skin-family-copy small{font-size:9px}
 #gear-selection-menu .gear-skins-panel #skin-list{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(120px,auto);gap:6px;padding:0 2px 2px 0;overflow-y:auto}
 #gear-selection-menu #skin-list>.skin-option{min-height:120px;padding:6px 4px}
 #gear-selection-menu #skin-list>.skin-option span{font-size:12px;line-height:1.25}
 #gear-selection-menu #skin-list>.skin-option small{font-size:10px}
 #gear-selection-menu .skin-purchase-option,#gear-selection-menu .skin-equip-preview{min-height:42px;font-size:12px}
 #gear-selection-menu .gear-preview-panel{flex:none;min-height:0}
 #gear-selection-menu .gear-preview-stage{height:150px;min-height:150px}
 #gear-selection-menu .gear-preview-identity h3{font-size:16px}
 #gear-selection-menu #geardescription{font-size:12px;line-height:1.45}
 #gear-selection-menu .gear-preview-stats{flex:none}
 #gear-selection-menu .gear-preview-stats h4{font-size:12px}
 #gear-selection-menu .gear-status-row-heading small{font-size:10px}
 #gear-selection-menu .gear-status-row-heading b{font-size:11px}

 #matchsetup{position:fixed;inset:0;width:100%;height:100dvh;padding:8px;overflow:hidden}
 #matchsetup .setup-body{box-sizing:border-box;width:100%;max-height:100%;padding:14px;overflow-y:auto}
 #matchsetup .setup-body h1{font-size:22px;letter-spacing:.08em}
 #matchsetup .setup-body h2{font-size:16px}
 #matchsetup .setup-body label{align-items:stretch;flex-direction:column;gap:5px;font-size:13px}
 #matchsetup .setup-body input,#matchsetup .setup-body select,#matchsetup .setup-body button{min-height:46px;font-size:14px}
 #matchsetup .setup-body .image-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
 #matchsetup .setup-body .image-card{min-height:110px}

 #overlay{position:fixed;inset:0;width:100%;height:100dvh;justify-content:flex-start;align-items:stretch;padding:12px;overflow-y:auto;overflow-x:hidden}
 #overlay h1{font-size:26px;letter-spacing:.08em;text-align:center}
 #results{width:100%;max-height:none;overflow-x:auto;overflow-y:visible}
 #overlay .match-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;width:100%;margin:12px 0}
 #overlay .match-actions button{min-height:48px;font-size:14px}

 dialog{box-sizing:border-box;width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin:auto;padding:14px;overflow:auto}
 dialog>header{position:sticky;top:-14px;z-index:2;min-height:54px;padding:8px 0;background:#081722f5}
 dialog>header h2{font-size:18px}
 dialog>header button{width:44px;height:44px;min-width:44px;min-height:44px;padding:4px;font-size:20px}
 .leaderboard-dialog .leaderboard-columns{grid-template-columns:minmax(0,1fr)}
 .leaderboard-dialog section{min-width:0}
 .leaderboard-dialog li{font-size:13px;line-height:1.4}
 .player-stats-dialog .history-toolbar select{min-height:44px;font-size:14px}
 .mobile-start-card{width:min(100%,440px);padding:20px}
 .mobile-start-card h2{font-size:22px}
 .mobile-start-card p,.mobile-start-card small{font-size:14px;line-height:1.45}
 .mobile-start-card button{min-height:48px;font-size:14px}
}

@media (max-width:1000px) and (max-height:560px) and (orientation:landscape){
 #gear-selection-menu{z-index:90;padding:5px}
 #gear-selection-menu .gear-selection-dialog{box-sizing:border-box;width:100%;height:calc(100dvh - 10px);max-height:calc(100dvh - 10px);padding:8px;overflow:hidden}
 #gear-selection-menu .gear-selection-dialog>header{min-height:43px;padding:0 0 5px}
 #gear-selection-menu .gear-selection-dialog>header .screen-eyebrow{display:none}
 #gear-selection-menu .gear-selection-dialog>header h2{font-size:15px}
 #gear-selection-menu .gear-selection-dialog>header>button{width:36px;height:36px;min-width:36px;min-height:36px}
 #gear-selection-menu .gear-menu-columns{display:grid;flex:1;grid-template-columns:minmax(145px,.72fr) minmax(290px,1.5fr) minmax(190px,1fr);grid-template-rows:minmax(0,1fr);gap:6px;min-height:0;padding-top:6px;overflow:hidden}
 #gear-selection-menu .gear-class-panel,#gear-selection-menu .gear-skins-panel,#gear-selection-menu .gear-preview-panel{min-width:0;min-height:0;max-height:none}
 #gear-selection-menu .gear-class-panel{display:flex;flex-direction:column}
 #gear-selection-menu .gear-class-panel>header,#gear-selection-menu .gear-skins-panel>header,#gear-selection-menu .gear-preview-panel>header{min-height:32px;gap:4px;padding:4px 5px}
 #gear-selection-menu .gear-class-panel>header small{display:none}
 #gear-selection-menu .gear-class-panel #gearlist{display:grid;flex:1;grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(0,1fr);gap:4px;min-height:0;padding:4px;overflow:auto}
 #gear-selection-menu .gear-equip-card{grid-template-columns:38px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;justify-items:start!important;gap:3px;padding:4px!important;text-align:left!important}
 #gear-selection-menu .gear-equip-card img{grid-row:1;width:34px;height:34px}
 #gear-selection-menu .gear-equip-card-name{align-self:center;font-size:10px;text-align:left}
 #gear-selection-menu .gear-equip-card-role,#gear-selection-menu .gear-equip-card-slots{display:none}
 #gear-selection-menu .gear-skins-panel{display:flex;flex-direction:column}
 #gear-selection-menu .skin-browser-controls{gap:4px;padding:5px}
 #gear-selection-menu .skin-browser-search{gap:2px;font-size:8px}
 #gear-selection-menu .skin-browser-search input{min-height:30px;padding:4px 7px;font-size:11px}
 #gear-selection-menu .skin-filter-tabs button{min-height:28px;font-size:8px}
 #gear-selection-menu .skin-browser-content{grid-template-columns:minmax(76px,.35fr) minmax(0,1fr);gap:4px;min-height:0;padding:4px}
 #gear-selection-menu .skin-family-list{gap:3px}
 #gear-selection-menu .skin-family-option{grid-template-columns:minmax(0,1fr);justify-items:center;gap:1px;min-height:57px;padding:3px;text-align:center}
 #gear-selection-menu .skin-family-option img{width:32px;height:32px}
 #gear-selection-menu .skin-family-copy{justify-items:center;width:100%;gap:1px}
 #gear-selection-menu .skin-family-copy strong{max-width:100%;font-size:8px}
 #gear-selection-menu .skin-family-copy small{font-size:7px}
 #gear-selection-menu .skin-variant-panel>header{min-height:24px;padding-bottom:2px}
 #gear-selection-menu .skin-variant-panel>header h4{font-size:9px}
 #gear-selection-menu .skin-variant-panel>header small{font-size:7px}
 #gear-selection-menu .gear-skins-panel #skin-list{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(74px,1fr);gap:4px}
 #gear-selection-menu #skin-list>.skin-option{min-height:74px;grid-template-rows:minmax(0,1fr) auto auto;gap:1px;padding:3px}
 #gear-selection-menu #skin-list>.skin-option img{width:34px;height:36px}
 #gear-selection-menu #skin-list>.skin-option span{font-size:8px}
 #gear-selection-menu #skin-list>.skin-option small{font-size:6px}
 #gear-selection-menu .gear-preview-panel{grid-column:auto;display:flex;flex-direction:column;gap:3px;overflow-y:auto;padding:5px}
 #gear-selection-menu .gear-preview-panel>header{flex:none}
 #gear-selection-menu .gear-preview-stage{width:100%;height:105px;min-height:105px;margin:0}
 #gear-selection-menu .gear-preview-identity{width:auto;padding:0}
 #gear-selection-menu .skin-preview-name{font-size:8px}
 #gear-selection-menu .gear-preview-identity h3{font-size:11px}
 #gear-selection-menu #geardescription{display:block}
 #gear-selection-menu .gear-preview-stats{display:none}
 #gear-selection-menu .gear-preview-actions{min-height:30px;gap:4px}
 #gear-selection-menu .skin-purchase-option,#gear-selection-menu .skin-equip-preview{min-height:30px;padding:4px 6px;font-size:8px}
}

/* Compact briefing layout: one lesson is shown at a time with fixed navigation. */
@media(max-width:700px){
 #control-guide{padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);}
 #control-guide .tutorial-card{height:100dvh;max-height:100dvh;padding:14px 16px 18px;overflow-y:auto;overscroll-behavior:contain;}
 #control-guide .tutorial-card>header{align-items:center;}
 #control-guide .tutorial-progress-wrap{top:48px;}
 #control-guide .tutorial-actions{position:sticky;bottom:-18px;z-index:3;min-height:64px;}
 #control-guide .tutorial-actions button{min-height:48px;}
}
@media(orientation:landscape) and (max-height:550px) and (max-width:1000px){
 #control-guide{padding:4px 8px;}
 #control-guide .tutorial-card{height:calc(100dvh - 8px);max-height:calc(100dvh - 8px);width:min(980px,100%);padding:9px 14px 12px;}
 #control-guide .tutorial-card>header{top:-9px;margin:-9px -14px 0;padding:5px 14px 6px;min-height:42px;}
 #control-guide .tutorial-card h2{font-size:16px;}
 #control-guide .tutorial-progress-wrap{top:37px;margin:0 -14px 6px;padding:5px 14px;}
 #control-guide .tutorial-lesson{padding:6px 8px;}
 #control-guide .tutorial-lesson>h3{font-size:18px;margin:3px 0;}
 #control-guide .tutorial-lesson>p{margin:3px 0;font-size:11px;}
 #control-guide .tutorial-diagram{margin:5px 0;padding:5px;}
 #control-guide .tutorial-actions{position:relative;bottom:auto;min-height:48px;margin:0 -14px;padding:1px 7px;}
 #control-guide .tutorial-actions button{min-height:46px;}
}

/* The shared utility actions stay inline on desktop; the details menu is mobile-only. */
@media (min-width:761px){
 .hangar-utility-menu{display:contents}
 .hangar-utility-menu>summary{display:none}
 .hangar-utility-items,.hangar-utility-menu[open]>.hangar-utility-items{display:contents}
 .hangar-utility-items>button{min-height:32px;padding:7px 10px;white-space:nowrap}
}

/* Shared shell and four reference-matched landscape workspaces. */
@media (orientation:landscape) and (max-height:550px) and (max-width:1000px){
 html,body{width:100%;height:100%;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar,
 body[data-app-state="ROOM_BROWSER"] #room-browser{position:fixed;inset:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:block;width:auto;height:auto;min-height:0;padding:4px;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar .hangar-body,
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body{box-sizing:border-box;display:flex;flex-direction:column;gap:5px;width:100%;height:100%;min-height:0;margin:0;padding:5px 8px;overflow:hidden;border:1px solid #10516a;border-radius:2px;background:linear-gradient(145deg,#061620f5,#04111af5)}
 body[data-app-state="HANGAR"] #hangar .frame-driver-shell-header,
 body[data-app-state="ROOM_BROWSER"] #room-browser .frame-driver-shell-header{box-sizing:border-box;display:flex;flex:none;align-items:center;justify-content:space-between;gap:8px;height:40px;min-height:40px;margin:0;padding:2px 6px;border:1px solid #17647d;background:linear-gradient(100deg,#061a27f5,#081b28f3)}
 body[data-app-state="HANGAR"] #hangar .main-menu-brand,
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand{display:flex;align-items:center;gap:7px;min-width:0}
 body[data-app-state="HANGAR"] #hangar .main-menu-brand .screen-eyebrow,
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand .screen-eyebrow{margin:0;color:#6fe4f7;font-size:9px;line-height:1;letter-spacing:.11em;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar .main-menu-brand h2,
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand h2{margin:0;font-size:14px;line-height:1;letter-spacing:.09em}
 body[data-app-state="HANGAR"] #hangar .hangar-header-actions,
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-header-actions{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:6px;min-width:0}
 body[data-app-state="HANGAR"] #hangar #wallet-display,
 body[data-app-state="ROOM_BROWSER"] #room-browser #wallet-display{display:flex;align-items:center;gap:8px;margin:0;padding:0;border:0;background:none;color:#f4cb58;font-size:9px;line-height:1;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar .hangar-utility-menu,
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-utility-menu{display:block;position:relative;flex:none}
 body[data-app-state="HANGAR"] #hangar .hangar-utility-menu>summary,
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-utility-menu>summary{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:4px;width:52px;height:36px;min-height:36px;padding:2px 5px;border:1px solid #1985a2;background:#082330;color:#7ceaff;font-size:10px;line-height:1;list-style:none}
 .hangar-utility-menu>summary::-webkit-details-marker{display:none}
 .hangar-utility-items{display:none}
 .hangar-utility-menu[open]>.hangar-utility-items{position:fixed;z-index:80;top:calc(env(safe-area-inset-top) + 48px);right:calc(env(safe-area-inset-right) + 8px);display:grid;grid-template-columns:repeat(3,minmax(96px,1fr));gap:5px;max-width:min(440px,calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)));max-height:calc(100dvh - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:7px;overflow:auto;border:1px solid #1683a1;background:#061622f8;box-shadow:0 12px 35px #000d}
 .hangar-utility-items>button{box-sizing:border-box;min-width:0;min-height:44px;padding:5px;font-size:11px;line-height:1.2;white-space:normal}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav,
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav{position:static;z-index:auto;display:grid;flex:none;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;width:100%;height:50px;min-height:50px;margin:0;padding:2px;border:1px solid #12647c;background:#041723f5;box-shadow:none;box-sizing:border-box}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav button,
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button{display:flex;box-sizing:border-box;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:44px;height:44px;padding:4px 5px;border:1px solid #13566d;background:#061925;color:#79dff0;font-size:12px;font-weight:800;line-height:1;letter-spacing:.035em;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav button i,
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button i{font-size:16px}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav button[aria-current="page"],
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button[aria-current="page"]{border-color:#efca58;background:linear-gradient(120deg,#f0c84e,#bd8524);color:#15202a;box-shadow:inset 0 0 0 1px #fff0a044}
 body[data-app-state="HANGAR"] #hangar #currentgear{display:none}
 body[data-app-state="HANGAR"] #hangar #hangar-character-info{margin:0}

 /* Status: pilot/allocation, computed frame stats, and a two-by-two equipment bank. */
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-character-info{display:flex;flex:1 1 0;min-width:0;min-height:0;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid{display:grid;flex:1;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,.75fr) minmax(0,.75fr);grid-template-rows:24px minmax(0,1fr) minmax(0,1fr);gap:6px;width:100%;height:100%;min-height:0;padding:0;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid>section{box-sizing:border-box;min-width:0;min-height:0;padding:6px;border:1px solid #17627a;background:linear-gradient(145deg,#071b27f2,#06131df7);overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-profile{grid-column:1;grid-row:1/4;display:flex;flex-direction:column;gap:3px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-head{box-sizing:border-box;display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:36px;align-content:start;align-items:center;flex:none;height:36px;min-height:36px;margin:0;padding:0!important;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-head>div{min-width:0;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-head h3{margin:0;font-size:10px;line-height:11px;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-head #hangar-dossier-identity{display:flex;align-items:center;gap:3px;max-height:18px;height:18px;margin:1px 0 0;overflow:hidden;font-size:8px;line-height:1;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-identity .rank-emblem{width:18px;height:18px;flex:0 0 18px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-identity .hangar-pilot-name{flex:none;font-size:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-identity>span:last-child{min-width:0;overflow:hidden;font-size:7px;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-portrait{width:36px;height:36px;min-width:36px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-head h3{overflow:hidden;font-size:10px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-head p{margin:3px 0 0;font-size:9px;line-height:1.2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel{box-sizing:border-box;display:flex;flex:1 1 0;flex-direction:column;min-width:0;min-height:0;margin:0;padding:4px 0 0;border:0;border-top:1px solid #164457;background:none;overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel>header{box-sizing:border-box;flex:none;align-items:center;gap:4px;height:27px;min-height:27px;margin:0 0 2px;padding:0;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel>header h4{margin:0;font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-points-remaining{margin:2px 0;font-size:9px;line-height:1.15}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel>header button{box-sizing:border-box;width:72px;min-width:72px;height:26px;min-height:26px;padding:2px 4px;font-size:7px;line-height:1.05;white-space:normal}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid{display:grid;flex:none;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(5,32px);grid-auto-rows:32px;gap:2px;margin:0;overflow:visible}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article{box-sizing:border-box;grid-template-columns:minmax(0,1fr) 32px 20px 32px;align-items:center;gap:2px;min-width:0;min-height:32px;height:32px;padding:1px 3px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article button{width:32px;height:32px;min-width:32px;min-height:32px;padding:0;font-size:16px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article b{font-size:9px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article small{font-size:7px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article strong{font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-save-state:empty{display:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-center{display:contents}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-stats{grid-column:2;grid-row:1/4;min-width:0;min-height:0;padding:6px;border:1px solid #17627a;background:linear-gradient(145deg,#071b27f2,#06131df7);overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid h4{margin:0 0 4px;padding:0 0 4px;border-bottom:1px solid #164b60;color:#68dcec;font-size:10px;line-height:1.15;letter-spacing:.1em}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list>span{display:flex;flex-direction:column;justify-content:center;gap:1px;min-width:0;min-height:24px;padding:2px 3px;border:1px solid #164b60;background:#071b27;font-size:8px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list b{font-size:10px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons{display:contents}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons>h4{grid-column:3/5;grid-row:1;align-self:center;min-height:0;margin:0;padding:0 0 3px;border-bottom:1px solid #17627a;font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons>h4 small{margin-left:4px;font-size:7px;letter-spacing:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-cards{display:contents}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-card{box-sizing:border-box;display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:3px;min-width:0;min-height:0;padding:4px;border:1px solid #17627a;background:linear-gradient(145deg,#09212e,#06131d);overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] [data-equipment-type="armor"]{grid-column:3;grid-row:2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] [data-weapon-type="std"]{grid-column:4;grid-row:2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] [data-weapon-type="adv"]{grid-column:3;grid-row:3}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons [data-equipment-type="engine"]{grid-column:4;grid-row:3}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-card>img{grid-column:1;grid-row:1/3;width:32px;height:36px;object-fit:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-heading{grid-column:2;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-heading small{font-size:7px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-heading b{display:block;overflow:hidden;font-size:8px;line-height:1.15;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons .hangar-weapon-values{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:2px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons .hangar-weapon-values>span{grid-column:auto;min-width:0;padding:2px;border-top:1px solid #143e51;font-size:7px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-values b{font-size:8px;line-height:1.1}

 /* Inventory: compact equipped strip, horizontal filters, and a scrollable item grid. */
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns{box-sizing:border-box;display:flex;flex:1 1 0;flex-direction:column;min-height:0;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns>article{box-sizing:border-box;display:flex;flex:1 1 0;flex-direction:column;min-width:0;min-height:0;padding:4px;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment{box-sizing:border-box;display:flex;flex:none;flex-direction:column;min-width:0;min-height:0;height:52px;margin:0;padding:4px 6px;border:1px solid #17627a;background:#071b27ed;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment h3{flex:none;margin:0 0 3px;font-size:9px;line-height:1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;min-height:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot:last-child{box-sizing:border-box;display:grid;grid-column:auto;grid-template-columns:28px minmax(0,1fr);grid-template-rows:12px minmax(0,1fr);gap:1px 4px;height:36px;min-height:36px;padding:2px 3px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot .item-icon-frame{grid-row:1/3;width:26px;height:30px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot .item-icon-frame img{width:24px;height:28px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot>strong{overflow:hidden;font-size:7px;line-height:1;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .current-equipment-slot>span:not(.item-icon-frame){overflow:hidden;font-size:8px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel{box-sizing:border-box;display:flex;flex:1 1 0;flex-direction:column;min-width:0;min-height:0;height:auto;max-height:none;margin:0;padding:5px;border:1px solid #17627a;background:#061722ed;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row{display:grid;flex:none;grid-template-columns:minmax(95px,.38fr) minmax(0,1.62fr);align-items:end;gap:6px;width:100%;margin:0 0 4px;padding-bottom:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row h3{margin:0 0 2px;font-size:12px;line-height:1.15}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-note{display:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools{display:grid;grid-template-columns:minmax(0,1fr) minmax(80px,.55fr);align-items:end;gap:5px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label{display:grid;gap:2px;min-width:0;font-size:9px;line-height:1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort{box-sizing:border-box;width:100%;min-width:0;height:36px;min-height:36px;padding:3px 5px;font-size:11px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-workspace{display:grid;flex:1;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:4px;min-width:0;min-height:0;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters{grid-column:1;grid-row:auto;display:flex;flex-direction:row;align-items:center;gap:4px;min-width:0;min-height:34px;overflow-x:auto;overflow-y:hidden;padding:2px;border:1px solid #164b60;background:#05141e;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#14718b #06141c}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters button{box-sizing:border-box;flex:0 0 auto;min-height:30px;padding:4px 9px;font-size:10px;line-height:1.1;text-align:center;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-unrelated-toggle{display:flex;flex:0 0 auto;align-items:center;gap:4px;width:132px;min-height:30px;margin:0;padding:2px 4px;font-size:8px;line-height:1.1;white-space:normal}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-list{box-sizing:border-box;display:block;grid-column:1;grid-row:auto;width:100%;min-width:0;min-height:0;height:100%;max-height:none;margin:0;padding:3px;border:1px solid #164b60;background:#04121b;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items{display:block;min-width:0;min-height:0;max-height:none;overflow:visible;padding:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:90px;gap:5px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item{box-sizing:border-box;display:grid;grid-template-rows:32px minmax(0,1fr) 24px;gap:2px;width:100%;height:90px;min-height:90px;padding:3px;border:1px solid #15566e;background:linear-gradient(145deg,#08202c,#06141d)}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item.selected,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item.equipped{border-color:#f0c84e;box-shadow:inset 0 0 0 1px #f0c84e66,0 0 10px #edbf3b30}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .item-icon-frame{grid-row:auto;width:34px;height:34px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .item-icon-frame img{width:30px;height:30px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item h4,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item strong{display:-webkit-box;min-height:0;overflow:hidden;font-size:11px;line-height:1.15;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .inventory-item-actions{inset:2px 2px auto auto}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .inventory-item-actions .inventory-item-flag{box-sizing:border-box;width:30px;height:30px;min-height:30px;padding:0;font-size:17px;pointer-events:auto}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item .inventory-equip{height:24px;min-height:24px;padding:2px 4px;font-size:9px;line-height:18px}

 /* Workshop: live material stock, selected Factory bench, requirements and actions. */
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-panel{box-sizing:border-box;display:flex;flex:1 1 0;flex-direction:column;min-width:0;min-height:0;margin:0;padding:5px;border:1px solid #17627a;background:#061722ed;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:6px;height:28px;min-height:28px;margin:0 0 4px;padding:0;border:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header>div{display:flex;align-items:center;gap:6px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header .screen-eyebrow,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-header-copy{display:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-header h3{margin:0;font-size:14px!important;line-height:1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #refresh-workshop{box-sizing:border-box;min-width:54px;min-height:36px;height:36px;padding:3px 7px;font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav{display:grid;flex:none;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;height:46px;min-height:46px;margin:0 0 5px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav button{display:grid;box-sizing:border-box;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:5px;min-width:0;min-height:44px;height:44px;padding:3px 6px;text-align:left}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav button>span{font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav button>b{font-size:11px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-nav button>small{display:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-layout{display:grid;flex:1 1 0;grid-template-columns:minmax(120px,.68fr) minmax(0,2.07fr) minmax(160px,.9fr);grid-template-rows:minmax(0,1fr);grid-template-areas:"mobile-materials mobile-bench mobile-inspector";gap:5px;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-sidebar{display:flex;flex-direction:column;grid-area:mobile-materials;gap:4px;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-sidebar>section{flex:none;min-height:0;padding:5px;overflow:visible}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-sidebar .workshop-panel-card>header{margin-bottom:3px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-sidebar .workshop-panel-card h4{font-size:11px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials{display:grid;grid-template-columns:minmax(0,1fr);gap:3px;max-height:none;overflow:visible}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card{display:grid!important;grid-template-columns:26px minmax(0,1fr) auto;gap:3px;min-width:0;min-height:38px;padding:3px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card img{width:24px;height:26px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card h5,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-materials .workshop-material-card p{margin:0;font-size:8px;line-height:1.15}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bench{grid-area:mobile-bench;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-bay-view:not([hidden]){box-sizing:border-box;display:flex;flex-direction:column;gap:5px;width:100%;height:100%;min-height:0;padding:6px;overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading{display:grid;flex:none;grid-template-columns:minmax(0,1fr);align-items:start;gap:5px;margin:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading>div{min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-fabrication-heading{grid-template-columns:minmax(0,1fr) 128px;align-items:center}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-fabrication-heading .workshop-mode-toggle{box-sizing:border-box;flex:0 0 128px;width:128px;min-width:0;max-width:100%;height:44px;min-height:44px;padding:3px;font-size:9px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-mode-toggle .workshop-mode-label{min-width:0;overflow:hidden;font-size:9px;letter-spacing:0;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading h4{font-size:13px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading p{margin:2px 0 0;font-size:9px;line-height:1.2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-section-heading small{font-size:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-mode-toggle{box-sizing:border-box;min-width:104px;min-height:44px;height:44px;padding:3px;font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-selected-recipe{flex:none;min-height:48px;padding:5px;overflow:auto}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-selected-card{box-sizing:border-box;display:grid;grid-template-columns:36px minmax(0,1fr) 72px;grid-template-rows:minmax(0,1fr) auto;gap:2px 4px;min-height:0;height:76px;margin:0;padding:4px;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-selected-card>img{grid-column:1;grid-row:1/3;width:34px;height:42px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-selected-details{grid-column:2/4;grid-row:1;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:9px minmax(0,1fr);gap:1px 4px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-selected-details>small{font-size:6px;line-height:1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-selected-details h5{min-width:0;overflow:hidden;font-size:9px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-selected-details>p{font-size:8px;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-requirements{grid-column:2;grid-row:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;min-width:0;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-requirements>span{grid-template-columns:24px minmax(0,1fr);gap:1px;min-width:0;padding:1px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-requirements img{grid-row:1/3;width:24px;height:24px;min-width:24px;min-height:24px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-requirements b{overflow:hidden;font-size:6px;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-requirements small{font-size:6px;line-height:1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-selected-recipe .workshop-craft-button{grid-column:3;grid-row:2;box-sizing:border-box;width:100%;min-width:0;min-height:36px!important;padding:2px;font-size:8px!important;letter-spacing:.04em}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(54px,auto);gap:4px;min-width:0;max-height:none;overflow:visible;margin:3px 0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes .workshop-card,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons .workshop-card{min-width:0;min-height:50px;padding:4px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes .workshop-card h5,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons .workshop-card h5{font-size:9px;line-height:1.1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-recipes .workshop-card p,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-weapons .workshop-card p{font-size:8px;line-height:1.15}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-inspector{display:flex;flex-direction:column;grid-area:mobile-inspector;gap:4px;min-width:0;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-inspector>.workshop-panel-card{flex:none;min-width:0;padding:6px;overflow:visible}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card h4{font-size:12px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card dl{grid-template-columns:minmax(0,1fr);gap:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card>p,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card dl>div,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-rules-card ul{font-size:9px;line-height:1.2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card dl>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:3px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card dt,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-operation-card dd{min-width:0;margin:0;overflow-wrap:anywhere;text-align:left}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #refinery-inventory-inspector,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #upgrade-inventory-inspector{max-height:100%;overflow:auto}

 /* Lobby: loadout and Quick Play share the top strip; directory and creation split below. */
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body{display:grid;grid-template-columns:minmax(0,1.48fr) minmax(290px,1fr);grid-template-rows:40px 50px 52px minmax(0,1fr);grid-template-areas:"shell shell" "nav nav" "loadout toolbar" "rooms rooms";gap:5px;position:relative}
 body[data-app-state="ROOM_BROWSER"] #room-browser .frame-driver-shell-header{grid-area:shell}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav{grid-area:nav}
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body>header:not(.frame-driver-shell-header){display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser .saved-loadout{box-sizing:border-box;grid-area:loadout;display:grid;grid-template-columns:70px minmax(0,1fr);grid-template-rows:minmax(0,1fr);align-items:center;gap:5px;min-width:0;min-height:0;margin:0;padding:3px 5px;border:1px solid #17627a;background:#071b27ed;overflow:hidden}
 body[data-app-state="ROOM_BROWSER"] #room-browser .saved-loadout>span{font-size:8px;line-height:1.15;letter-spacing:.1em}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-loadout-items{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;min-width:0;min-height:0;overflow:hidden}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-loadout-items .saved-loadout-item{box-sizing:border-box;display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;gap:2px;min-width:0;min-height:40px;height:40px;padding:2px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-loadout-items .saved-loadout-item img{width:20px;height:24px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-loadout-items .saved-loadout-item span{overflow:hidden;font-size:7px;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="ROOM_BROWSER"] #room-browser .saved-loadout>p{display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser .browser-toolbar{box-sizing:border-box;grid-area:toolbar;display:flex;align-items:center;justify-content:flex-end;min-width:0;min-height:0;margin:0;padding:2px 5px;border:1px solid #17627a;background:#071b27ed}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
 body[data-app-state="ROOM_BROWSER"] #room-browser .online-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;min-width:0;margin:0}
 body[data-app-state="ROOM_BROWSER"] #room-browser .online-actions label{display:flex;align-items:center;gap:4px;min-width:0;margin:0;font-size:9px;white-space:nowrap}
 body[data-app-state="ROOM_BROWSER"] #room-browser #online-mode{box-sizing:border-box;width:78px;min-width:78px;height:40px;min-height:40px;padding:3px;font-size:11px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #quick-play{box-sizing:border-box;width:130px;min-width:112px;height:44px;min-height:44px;padding:3px 6px;font-size:11px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-browser-columns{grid-area:rooms;display:grid;grid-template-columns:minmax(0,1.48fr) minmax(250px,1fr);gap:6px;min-width:0;min-height:0;margin:0;overflow:hidden}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-browser-columns>section,
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create{box-sizing:border-box;min-width:0;min-height:0;margin:0;padding:6px;border:1px solid #17627a;background:#061722ed;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-list-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;margin:0 0 4px;padding:0 0 4px;border-bottom:1px solid #164b60}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-list-heading h2,
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create h2{margin:0;font-size:10px;line-height:1.1;letter-spacing:.1em}
 body[data-app-state="ROOM_BROWSER"] #room-browser #refresh-rooms{box-sizing:border-box;min-height:36px;padding:3px 7px;font-size:9px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list{display:grid;align-content:start;gap:4px;min-height:0;max-height:none;margin:0;overflow-y:auto;overscroll-behavior:contain}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card{box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 68px;grid-template-rows:12px repeat(3,minmax(0,1fr));grid-template-areas:"name name join" "mode map join" "population ai join" "status status join";gap:2px 6px;width:100%;height:76px;min-height:76px;max-height:76px;margin:0;padding:5px;overflow:hidden;border-color:#15566e;background:linear-gradient(145deg,#08202c,#06141d)}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>h3{grid-area:name;min-width:0;margin:0;overflow:hidden;font-size:10px;line-height:12px;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>.room-card-mode{grid-area:mode}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>.room-card-map{grid-area:map}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>.room-card-population{grid-area:population}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>.room-card-ai-level{grid-area:ai}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>.room-card-status{grid-area:status}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>button{grid-area:join;align-self:center;min-width:0;min-height:42px;padding:4px;font-size:10px;overflow:hidden;text-overflow:ellipsis}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-mode,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-map,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-population,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-ai-level,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-status{font-size:8px;line-height:1.2}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"title title" "name name" "mode map" "duration ai" "difficulty balance" "submit submit";align-content:start;gap:4px 5px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create h2{grid-area:title;padding-bottom:4px;border-bottom:1px solid #164b60}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-name-field{grid-area:name}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-mode-field{grid-area:mode}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-map-field{grid-area:map}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-duration-field{grid-area:duration}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-ai-fill-field{grid-area:ai}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-ai-level-field{grid-area:difficulty}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-team-balance-field{grid-area:balance}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create>button{grid-area:submit}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create label{display:flex;flex-direction:column;gap:2px;min-width:0;margin:0;font-size:8px;line-height:1.1}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-ai-fill-field{display:flex;flex-direction:row;align-items:center;gap:5px;min-height:38px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create input:not([type="checkbox"]),
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create select{box-sizing:border-box;width:100%;min-width:0;height:36px;min-height:36px;padding:2px 4px;font-size:10px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create input[type="checkbox"]{width:20px;height:20px;min-width:20px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create>button{min-height:44px;margin:0;padding:4px;font-size:11px}
}

/* Phone landscape Settings uses the screen above the shared navigation shell. */
@media (orientation:landscape) and (max-height:550px) and (max-width:1000px) and (pointer:coarse){
 #settings-menu{position:fixed;z-index:200;inset:0;width:100%;height:100dvh;padding:0;overflow:hidden;place-items:stretch}
 #settings-menu .settings-card{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%;max-height:none;min-height:0;margin:0;padding:8px 10px 10px;overflow:hidden;border:0}
 #settings-menu .settings-card>header{position:relative;top:auto;z-index:2;flex:none;min-height:50px;margin:-8px -10px 3px;padding:4px 10px;border-bottom:1px solid #1e5668;background:#081722f5}
 #settings-menu .settings-card>header>div:first-child{min-width:0}
 #settings-menu .settings-card>header .screen-eyebrow{display:none}
 #settings-menu .settings-card h2{margin:0;font-size:18px;line-height:1.2}
 #settings-menu .settings-header-actions{flex:none;gap:5px}
 #settings-menu #close-settings{position:relative;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;overflow:hidden;font-size:0}
 #settings-menu #close-settings::before{content:'×';display:grid;place-items:center;font-size:27px;line-height:1}
 #settings-menu .settings-card h3{margin:8px 0 5px;font-size:14px}
 #settings-menu .settings-auto-apply{flex:none;margin:0 0 3px;font-size:11px;line-height:1.3}
 #settings-menu .settings-workspace{display:grid;grid-template-columns:minmax(112px,20%) minmax(0,1fr);gap:9px;flex:1;min-height:0}
 #settings-menu .settings-auto-apply{grid-column:1/-1;grid-row:1}
 #settings-menu .settings-tabs{grid-column:1;grid-row:2;display:flex;flex-direction:column;gap:3px;min-height:0;margin:0;padding-right:4px;overflow-x:hidden;overflow-y:auto;border:0;border-right:1px solid #28444e}
 #settings-menu .settings-tabs [role="tab"]{flex:none;min-height:44px;padding:6px 7px;font-size:11px;line-height:1.15;text-align:left;white-space:normal;scroll-snap-align:start}
 #settings-menu .settings-panel{grid-column:2;grid-row:2;min-width:0;min-height:0;padding:0 3px 0 0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 #settings-menu .settings-panel>section:first-child h3{margin-top:5px}
 #settings-menu .settings-card p,#settings-menu .settings-card label{font-size:12px;line-height:1.35}
 #settings-menu button,#settings-menu select,#settings-menu input:not([type="range"]){min-height:44px;font-size:12px}
 #settings-menu .control-mode-option{min-height:48px;padding:6px 8px}
 #settings-menu .audio-switches{display:flex;flex-wrap:wrap;gap:5px 12px}
 #settings-menu .audio-switches label{min-height:38px}
 #settings-menu .audio-volume{min-height:40px;margin:5px 0}
 #settings-menu .audio-volume input{min-width:38%;min-height:36px}
 #settings-menu #language-settings{display:none;grid-column:2;grid-row:2;align-items:center;justify-content:space-between;gap:8px;min-height:44px;margin:0 0 5px;padding:2px 0;border-bottom:1px solid #28444e}
 #settings-menu:has(#settings-tab-display[aria-selected="true"]) .settings-workspace{grid-template-rows:auto auto minmax(0,1fr)}
 #settings-menu:has(#settings-tab-display[aria-selected="true"]) #settings-tabs{grid-row:2/4}
 #settings-menu:has(#settings-tab-display[aria-selected="true"]) #language-settings{display:flex;grid-row:2}
 #settings-menu:has(#settings-tab-display[aria-selected="true"]) #settings-display-panel{grid-row:3}
 #settings-menu #language-settings h3{margin:0;font-size:12px}
 #settings-menu #language-settings .language-picker{gap:4px;margin:0}
 #settings-menu #language-picker button{width:44px;min-width:44px;height:44px;min-height:44px;padding:4px;font-size:12px}
}

/* In-match loadout overlay: keep the inventory and compact match navigation,
   without Hangar branding, wallet, or the rendered hangar backdrop. */
body[data-app-state="HANGAR"][data-match-menu="true"] #hangar-hub-scene,
body[data-app-state="HANGAR"][data-match-menu="true"] #wallet-display,
body[data-app-state="HANGAR"][data-match-menu="true"] .main-menu-brand .screen-eyebrow{display:none!important}
body[data-app-state="HANGAR"][data-match-menu="true"] .frame-driver-shell-header{gap:10px;min-height:46px;margin-bottom:8px}
body[data-app-state="HANGAR"][data-match-menu="true"] .main-menu-brand h2{margin:0;color:#d8f6ff;font-size:clamp(15px,2vw,22px);letter-spacing:.12em}
body[data-app-state="HANGAR"][data-match-menu="true"] .hangar-header-actions{display:flex;flex:none;align-items:center;gap:8px}
body[data-app-state="HANGAR"][data-match-menu="true"] #closehangar{display:inline-flex;min-height:38px;align-items:center;justify-content:center;padding:6px 12px;border:1px solid #f0ca58;background:linear-gradient(125deg,#edc851,#b78020);color:#15202a;font-size:11px;font-weight:900;letter-spacing:.045em;white-space:nowrap}
body[data-app-state="HANGAR"][data-match-menu="true"] #match-menu-nav{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:auto}
body[data-app-state="HANGAR"][data-match-menu="true"] #match-menu-nav [data-match-menu-action="return"]{grid-column:1/-1;min-height:48px;height:auto;border-color:#c77c19;background:#f2a93b;color:#19150e;font-size:14px;font-weight:900;text-shadow:none;box-shadow:inset 0 1px #ffe1a1,0 0 14px #f2a93b55}
body[data-app-state="HANGAR"][data-match-menu="true"] #match-menu-nav [data-match-menu-action="return"]>i{color:#19150e;text-shadow:none}
body[data-app-state="HANGAR"][data-match-menu="true"] #match-menu-return-note{grid-column:1/-1;margin:0;color:#a8c8d2;font:600 11px/1.3 var(--nd-font-body);text-align:center}

@media(max-width:520px){
 body[data-app-state="HANGAR"][data-match-menu="true"] .frame-driver-shell-header{min-height:38px;margin-bottom:5px}
 body[data-app-state="HANGAR"][data-match-menu="true"] .hangar-header-actions{gap:5px}
 body[data-app-state="HANGAR"][data-match-menu="true"] #closehangar{min-height:34px;padding:5px 7px;font-size:9px}
 body[data-app-state="HANGAR"][data-match-menu="true"] #match-menu-nav{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-app-state="HANGAR"][data-match-menu="true"] #match-menu-nav [data-match-menu-action="return"]{min-height:48px;font-size:12px}
 body[data-app-state="HANGAR"][data-match-menu="true"] #match-menu-return-note{font-size:10px}
}

/* Final overrides follow the shared compact-phone rules above. */
@media (max-width:760px) and (orientation:portrait){
 body[data-app-state="HANGAR"] #hangar .hangar-body{position:relative}
 body[data-app-state="HANGAR"] #hangar .frame-driver-shell-header{box-sizing:border-box;height:38px;min-height:38px;margin:0 0 8px;padding:2px 4px}
 body[data-app-state="HANGAR"] #hangar .main-menu-brand{display:none}
 body[data-app-state="HANGAR"] #hangar .hangar-header-actions{margin-left:auto}
 body[data-app-state="HANGAR"] #hangar .hangar-header-actions{gap:4px}
 body[data-app-state="HANGAR"] #hangar #wallet-display{flex-direction:row;align-items:center;gap:5px;font-size:9px;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar .hangar-utility-menu>summary{box-sizing:border-box;width:34px;min-width:34px;height:34px;min-height:34px}
 body[data-app-state="HANGAR"] #hangar .hangar-utility-menu>summary span:last-child{display:none}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav{right:185px}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav{position:absolute;z-index:72;top:calc(env(safe-area-inset-top) + 10px);bottom:auto;left:12px;width:auto;height:36px;min-height:36px;margin:0;padding:2px;gap:3px;box-shadow:none}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav button{box-sizing:border-box;min-height:30px;height:30px;flex-direction:row;gap:3px;padding:2px;font-size:8px;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav button span{display:none}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav button i{font-size:15px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:36px 34px auto;gap:4px;margin:0;padding:5px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-workspace{display:contents}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row>div:first-child{display:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools{grid-column:1;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(78px,.55fr);align-items:end;gap:5px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label{display:grid;gap:1px;min-width:0;font-size:8px;line-height:1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort{box-sizing:border-box;width:100%;min-width:0;height:30px;min-height:30px;padding:3px 5px;font-size:12px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters{grid-column:1;grid-row:2;display:flex;flex-direction:row;align-items:center;gap:4px;min-width:0;min-height:34px;overflow-x:auto;overflow-y:hidden;padding:2px;border:1px solid #164b60;background:#05141e;overscroll-behavior:contain;scrollbar-width:thin}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters button{box-sizing:border-box;flex:0 0 auto;min-height:28px;padding:4px 8px;font-size:9px;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-unrelated-toggle{box-sizing:border-box;display:flex;flex:0 0 112px;align-items:center;gap:3px;min-height:28px;margin:0;padding:2px;font-size:8px;line-height:1.05}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-list{grid-column:1;grid-row:3;min-height:0;height:auto;overflow:visible}
}

@media (orientation:landscape) and (max-height:550px) and (max-width:1000px){
 body[data-app-state="HANGAR"] #hangar .main-menu-brand{display:none}
 body[data-app-state="HANGAR"] #hangar .hangar-header-actions{margin-left:auto}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav{position:absolute;z-index:72;top:6px;right:212px;bottom:auto;left:10px;width:auto;height:36px;min-height:36px;margin:0;padding:2px;gap:3px;box-shadow:none}
 body[data-app-state="HANGAR"] #hangar #main-menu-nav button{min-height:30px;height:30px;padding:2px 4px;gap:4px;font-size:9px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel{display:grid;grid-template-columns:minmax(225px,.42fr) minmax(0,1fr);grid-template-rows:47px minmax(0,1fr);gap:4px;margin:0;padding:5px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-workspace{display:contents}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row>div:first-child{display:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools{grid-column:1;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(80px,.55fr);align-items:end;gap:5px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label{display:grid;gap:1px;min-width:0;font-size:8px;line-height:1}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label:last-child{width:100%;min-width:0;max-width:100%;overflow:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort{box-sizing:border-box;width:100%;min-width:0;height:30px;min-height:30px;padding:3px 5px;font-size:11px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort{max-width:100%;appearance:none}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters{grid-column:2;grid-row:1;display:flex;flex-direction:row;align-items:center;gap:3px;min-width:0;min-height:34px;overflow-x:auto;overflow-y:hidden;padding:2px;border:1px solid #164b60;background:#05141e;overscroll-behavior:contain;scrollbar-width:thin}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters button{box-sizing:border-box;flex:0 0 auto;min-height:28px;padding:4px 7px;font-size:8px;white-space:nowrap}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-list{grid-column:1/-1;grid-row:2;height:auto;max-height:100%;min-height:0}
}
@media (max-width:380px) and (orientation:portrait){body[data-app-state="HANGAR"] #hangar #main-menu-nav{right:167px}}
@media (max-width:760px) and (orientation:portrait){
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel{grid-template-rows:31px 28px auto}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label{font-size:7px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort{height:25px;min-height:25px;padding:2px 4px;font-size:11px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters{min-height:28px;padding:1px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters button{min-height:24px;padding:2px 7px;font-size:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-unrelated-toggle{min-height:24px;font-size:7px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-grid{grid-auto-rows:126px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item{box-sizing:border-box;grid-template-rows:50px minmax(0,1fr);height:126px;min-height:126px;padding:4px}
}
@media (orientation:landscape) and (max-height:550px) and (max-width:1000px){
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel{grid-template-rows:40px minmax(0,1fr)}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label{font-size:7px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search,
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort{height:24px;min-height:24px;padding:2px 4px;font-size:10px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters{min-height:36px;padding:1px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters button{min-height:36px;padding:2px 6px;font-size:8px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-unrelated-toggle{min-height:24px;font-size:7px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-grid{grid-auto-rows:90px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-item{grid-template-rows:34px minmax(0,1fr)}
}


/* Keep the room browser on the same compact HUD shell as the Hangar menus. */
@media (max-width:760px) and (orientation:portrait){
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body{position:relative;display:flex;flex-direction:column;gap:6px;padding:calc(env(safe-area-inset-top) + 10px) 12px calc(12px + env(safe-area-inset-bottom))}
 body[data-app-state="ROOM_BROWSER"] #room-browser .frame-driver-shell-header{box-sizing:border-box;height:38px;min-height:38px;margin:0 0 4px;padding:2px 4px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand{display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-header-actions{gap:4px;margin-left:auto}
 body[data-app-state="ROOM_BROWSER"] #room-browser #wallet-display{flex-direction:row;align-items:center;gap:5px;font-size:9px;white-space:nowrap}
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-utility-menu>summary{box-sizing:border-box;width:34px;min-width:34px;height:34px;min-height:34px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-utility-menu>summary span:last-child{display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav{position:absolute;z-index:72;top:calc(env(safe-area-inset-top) + 10px);right:185px;bottom:auto;left:12px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;width:auto;height:36px;min-height:36px;margin:0;padding:2px;border:1px solid #12647c;background:#041723f5;box-shadow:none;box-sizing:border-box}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button{display:flex;box-sizing:border-box;min-width:0;min-height:30px;height:30px;align-items:center;justify-content:center;flex-direction:row;gap:3px;padding:2px;border:1px solid #13566d;background:#061925;color:#79dff0;font-size:8px;font-weight:800;line-height:1;white-space:nowrap}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button span{display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button i{font-size:15px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button[aria-current="page"]{border-color:#efca58;background:linear-gradient(120deg,#f0c84e,#bd8524);color:#15202a;box-shadow:inset 0 0 0 1px #fff0a044}
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body>header:not(.frame-driver-shell-header){display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser .saved-loadout{box-sizing:border-box;display:block;flex:none;gap:6px;margin:0;padding:8px;border:1px solid #17627a;background:linear-gradient(145deg,#071b27f2,#06131df7)}
 body[data-app-state="ROOM_BROWSER"] #room-browser .saved-loadout>span{display:block;margin:0 0 5px;font-size:10px;letter-spacing:.1em}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-loadout-items{display:grid;height:auto;min-height:0;max-height:none;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:48px;gap:5px;overflow:visible;padding:0}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-loadout-items .saved-loadout-item{box-sizing:border-box;width:100%;height:48px;min-width:0;min-height:48px;padding:4px;border-color:#17627a;background:#081b27}
 body[data-app-state="ROOM_BROWSER"] #room-browser .browser-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin:0;padding:8px;border:1px solid #17627a;background:#061722eF}
 body[data-app-state="ROOM_BROWSER"] #room-browser .browser-toolbar>p{margin:0;font-size:11px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .online-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);align-items:end;gap:6px;margin:0}
 body[data-app-state="ROOM_BROWSER"] #room-browser .online-actions label{display:grid;grid-template-columns:minmax(0,1fr);gap:3px;font-size:10px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #online-mode,
 body[data-app-state="ROOM_BROWSER"] #room-browser #quick-play{box-sizing:border-box;width:100%;min-width:0;height:42px;min-height:42px;padding:5px 8px;font-size:12px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-browser-columns{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;min-height:0;overflow:visible}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-browser-columns>section,
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create{box-sizing:border-box;min-width:0;margin:0;padding:8px;border:1px solid #17627a;background:linear-gradient(145deg,#071b27f2,#06131df7)}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-browser-columns>section{min-height:148px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-list-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:0 0 6px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-list-heading h2,
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create h2{margin:0;font-size:13px;letter-spacing:.09em}
 body[data-app-state="ROOM_BROWSER"] #room-browser #refresh-rooms{min-height:34px;padding:4px 8px;font-size:10px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list{display:grid;gap:6px;max-height:none;overflow:visible}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card{box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto auto;gap:4px 8px;width:100%;height:auto;min-height:92px;max-height:none;padding:8px;border:1px solid #23647a;background:#091e2a}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>h3{grid-column:1/-1;margin:0;font-size:13px;line-height:1.25}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-list>.room-card>button{grid-column:2;grid-row:2/5;min-width:68px;min-height:40px;padding:5px;font-size:11px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-mode,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-map,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-population,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-ai-level,
 body[data-app-state="ROOM_BROWSER"] #room-browser .room-card-status{font-size:10px;line-height:1.3}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"title title" "name name" "mode map" "duration ai" "difficulty balance" "submit submit";gap:6px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create h2{grid-area:title;margin-bottom:1px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-name-field{grid-area:name}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-mode-field{grid-area:mode}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-map-field{grid-area:map}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-duration-field{grid-area:duration}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-ai-fill-field{grid-area:ai}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-ai-level-field{grid-area:difficulty}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-team-balance-field{grid-area:balance}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create label{display:flex;flex-direction:column;gap:3px;min-width:0;margin:0;font-size:10px;line-height:1.15}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-ai-fill-field{flex-direction:row;align-items:center;min-height:34px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create input:not([type="checkbox"]),
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create select{box-sizing:border-box;width:100%;min-width:0;height:38px;min-height:38px;padding:4px 6px;font-size:12px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create input[type="checkbox"]{width:20px;height:20px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create>button{grid-area:submit;min-height:44px;margin:0;font-size:12px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-fabrication-heading{display:grid;grid-template-columns:minmax(0,1fr) 110px;align-items:start;gap:7px}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-fabrication-heading>div{min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-fabrication-heading h4{font-size:15px;line-height:1.2}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] .workshop-fabrication-heading p{font-size:11px;line-height:1.3}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-mode-toggle{box-sizing:border-box;flex:none;width:110px;min-width:110px;min-height:40px;padding:3px;font-size:9px}
}

@media (orientation:landscape) and (max-height:550px) and (min-width:761px) and (max-width:1100px){
 #gear-selection-menu .gear-selection-dialog{box-sizing:border-box;width:calc(100vw - 20px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);padding:10px}
 #gear-selection-menu .gear-menu-columns{grid-template-columns:minmax(140px,.58fr) minmax(230px,1.15fr) minmax(220px,1.08fr);grid-template-rows:minmax(0,1fr);gap:6px;overflow:hidden}
 #gear-selection-menu .gear-class-panel,#gear-selection-menu .gear-skins-panel,#gear-selection-menu .gear-preview-panel{grid-column:auto;min-width:0;min-height:0;overflow:hidden}
 #gear-selection-menu .gear-class-panel #gearlist{min-height:0;overflow-y:auto}
 #gear-selection-menu .gear-preview-panel{display:flex}
 #gear-selection-menu .gear-preview-stage{box-sizing:border-box;flex:none;width:calc(100% - 12px);height:120px;min-height:120px;margin:6px}
 #gear-selection-menu .gear-preview-identity{padding:5px 8px 2px}
 #gear-selection-menu .gear-preview-identity h3{font-size:14px}
 #gear-selection-menu .gear-preview-stats{margin:3px 7px 5px;padding:5px}
 #gear-selection-menu .gear-preview-actions{display:none}
}

@media (orientation:landscape) and (max-height:550px) and (max-width:1000px){
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body{grid-template-rows:40px 52px minmax(0,1fr);grid-template-areas:"shell shell" "loadout toolbar" "rooms rooms";position:relative}
 body[data-app-state="ROOM_BROWSER"] #room-browser .main-menu-brand{display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser .hangar-header-actions{margin-left:auto}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav{position:absolute;z-index:72;top:6px;right:212px;bottom:auto;left:10px;width:auto;height:36px;min-height:36px;margin:0;padding:2px;gap:3px;box-shadow:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser #main-menu-nav button{min-height:30px;height:30px;padding:2px 4px;gap:4px;font-size:9px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .screen-body>header:not(.frame-driver-shell-header){display:none}
 body[data-app-state="ROOM_BROWSER"] #room-browser .saved-loadout{padding:5px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #browser-loadout-items .saved-loadout-item{height:36px;min-height:36px;padding:2px 4px}
 body[data-app-state="ROOM_BROWSER"] #room-browser .browser-toolbar{padding:4px 6px;gap:5px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create{gap:3px 5px;padding:5px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create label{gap:1px;font-size:8px;line-height:1}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create input:not([type="checkbox"]),
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create select{height:30px;min-height:30px;padding:2px 4px;font-size:10px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create .room-ai-fill-field{min-height:30px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create input[type="checkbox"]{width:17px;height:17px}
 body[data-app-state="ROOM_BROWSER"] #room-browser #room-create>button{min-height:34px;padding:2px;font-size:10px}
}

@media(max-width:760px),(pointer:coarse){
 body[data-app-state="HANGAR"][data-match-menu="true"] #hangar[data-menu-section="inventory"] #inventory-filters button{min-height:44px}
}

@media (orientation:landscape) and (max-height:550px) and (max-width:1000px){
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-panel[data-workshop-bay="fabrication"] .workshop-layout{overflow:clip}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-panel[data-workshop-bay="fabrication"] .workshop-recipes{flex:1 1 0;min-height:54px;max-height:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;align-content:start}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #factory-weapon-preview{box-sizing:border-box;min-width:0;max-width:100%;overflow-x:hidden}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #factory-weapon-preview .factory-preview-stats{box-sizing:border-box;width:100%;min-width:0;max-width:100%}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #factory-weapon-preview .factory-preview-stat{display:grid;grid-template-columns:minmax(0,1fr) max-content;gap:4px;min-width:0}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #factory-weapon-preview .factory-preview-stat dt{min-width:0;white-space:normal;overflow-wrap:anywhere}
 body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #factory-weapon-preview .factory-preview-stat dd{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}

}
