/* Shared mobile shell. Page-specific layouts below retain the desktop design at larger widths. */
.gm-mobile-tabs,.gm-mobile-menu-btn,.gm-mobile-start,.gm-panel-toggle { display:none; }
.gm-nav-dialog { position:fixed; inset:0 0 0 auto; margin:0; width:min(380px,100vw); max-width:100vw; height:100%; height:100dvh; max-height:100dvh; box-sizing:border-box; padding:max(12px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom)); border:0; border-left:1px solid #365369; color:#e4eef7; background:#07121c; z-index:2000; overflow:auto; overscroll-behavior:contain; }
.gm-nav-dialog::backdrop { background:#0009; }
.gm-nav-dialog header { display:flex; align-items:center; justify-content:space-between; gap:12px; position:sticky; top:0; z-index:2; background:#07121c; }
.gm-nav-dialog h2 { font-size:22px; margin:12px 0; }
.gm-nav-close { min-width:44px; min-height:44px; background:#142b3d; color:#e4eef7; border:1px solid #365369; font-size:24px; cursor:pointer; }
.gm-nav-links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:16px 0; }
.gm-nav-links a,.gm-nav-language summary,.gm-nav-language a,.gm-nav-logout { display:flex; align-items:center; min-height:48px; padding:10px; color:#e4eef7; border:1px solid #2b475b; border-radius:6px; background:#102331; font-size:15px; line-height:1.4; touch-action:manipulation; }
.gm-nav-links a[aria-current=page] { border-color:#67d8ff; color:#9fe5ff; }
.gm-nav-links .gm-nav-play { color:#fff; background:#1c5068; border-color:#67d8ff; }
.gm-nav-language summary { cursor:pointer; }
.gm-nav-language ul { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:0; }
.gm-nav-logout { margin-top:16px; background:#241e29; }
.gm-table-scroll { max-width:100%; overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.gm-nav-dialog button:focus-visible,.gm-nav-dialog a:focus-visible,.gm-mobile-tabs :focus-visible { outline:2px solid #67d8ff; outline-offset:2px; }

@media(max-width:900px),(max-width:1100px) and (pointer:coarse) {
  html { scroll-padding-top:70px; }
  body { min-width:0; padding-bottom:calc(70px + env(safe-area-inset-bottom)); overflow-wrap:break-word; }
  body > #app { min-width:0; }
  body .container { width:calc(100% - 24px); max-width:100%; }
  body nav:not(.gm-mobile-tabs) { position:sticky; top:0; min-height:60px; height:auto; padding-top:env(safe-area-inset-top); }
  body nav .nav-wrapper > .container { flex-wrap:nowrap; gap:8px; width:calc(100% - 20px); }
  body nav .brand-logo { flex:1; min-width:0; margin:0; gap:6px; height:60px; float:none; }
  body nav .brand-logo .brand-word { font-size:18px; letter-spacing:.06em; }
  body nav .brand-logo .brand-alpha { font-size:12px; margin:0; }
  body nav .brand-logo .brand-faction { width:22px; height:26px; }
  body nav ul.right { display:none; }
  body .gm-mobile-menu-btn { display:block; min-width:44px; min-height:44px; padding:6px; color:#e4eef7; background:#142b3d; border:1px solid #365369; font-size:22px; cursor:pointer; }
  body .gm-mobile-start { display:flex; align-items:center; justify-content:center; min-height:44px; padding:0 12px; font-size:13px; line-height:1.3; background:#1c5068; border:1px solid #67d8ff; }
  body .gm-mobile-tabs { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:1000; padding:6px max(6px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left)); gap:4px; background:#07121cf7; border-top:1px solid #365369; box-shadow:0 -4px 20px #0005; }
  .gm-mobile-tabs a,.gm-mobile-tabs button { flex:1; min-width:0; min-height:48px; display:flex; align-items:center; justify-content:center; padding:6px 3px; color:#a9c0d0; font-size:13px; font-family:inherit; line-height:1.3; text-align:center; background:transparent; border:0; border-radius:6px; cursor:pointer; touch-action:manipulation; }
  .gm-mobile-tabs a[aria-current=page] { color:#e3f5ff; background:#1c5068; }
  body input:not([type=checkbox]):not([type=radio]):not([type=range]),body select,body textarea { font-size:16px!important; max-width:100%; }
  body input:not([type=checkbox]):not([type=radio]):not([type=range]),body select { min-height:44px; box-sizing:border-box; }
  body button,body .btn,body .btn-a,body .btn-h { touch-action:manipulation; }
  body .btn,body .btn-a,body .btn-h { min-height:44px; height:auto; line-height:1.4; display:inline-flex; align-items:center; justify-content:center; white-space:normal; }
  body dialog:not(.gm-nav-dialog),body .modal { max-width:calc(100% - 24px)!important; max-height:calc(100dvh - 24px)!important; overflow:auto; }
  body .dropdown-content { max-width:calc(100vw - 16px); }
  body .gm-panel-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:48px; padding:12px; text-align:left; color:#e4eef7; background:#102331; border:0; font-weight:600; font-size:15px; font-family:inherit; line-height:1.4; cursor:pointer; }
  .gm-panel-toggle::after { content:'+'; font-size:22px; }.gm-panel-toggle[aria-expanded=true]::after { content:'−'; }
  .gr-panel[data-mobile-collapsed=true] > :not(.gm-panel-toggle) { display:none!important; }
  body .gr-home .gr-layout { display:flex; flex-direction:column; width:calc(100% - 20px); gap:12px; }
  body .gr-home .gr-center { order:0; width:100%; min-width:0; }
  body .gr-home .gr-left { order:1; width:100%; min-width:0; }
  body .gr-home .gr-right { order:2; width:100%; min-width:0; }
  body .gr-home .gr-stage { height:clamp(280px,48svh,430px); }
  body .gr-home .gr-shipname h2 { font-size:28px; }
  body .gr-home .gr-specs { flex-wrap:wrap; gap:8px; }
  body .gx[data-view=hangar] .gr-stage { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:clamp(240px,38svh,360px) auto auto; height:auto; gap:12px; padding:0; }
  body .gx[data-view=hangar] .hud-ship { height:auto; padding:14px; }
  body .gx[data-view=hangar] .hud-loadout { height:auto; min-height:600px; padding:12px; grid-template-rows:auto auto minmax(100px,auto) auto minmax(160px,auto) auto auto; }
  body .gx[data-view=hangar] .hud-ship .block { min-height:0; }
  body .gx[data-view=hangar] .hg-top { top:8px; padding:0 4px; font-size:12px; }
  body .gx[data-view=hangar] .hg-caption { bottom:8px; font-size:11px; }
  body .hg .storage-head { display:flex; flex-wrap:wrap; gap:8px; }
  body .hg .storage-head input { width:100%; flex:1 1 100%; }
  body .hg .inventory { min-height:180px; }
  body .hg .grid { grid-template-columns:repeat(auto-fill,minmax(46px,1fr)); gap:6px; }
  body .hg .tile { min-width:44px; min-height:48px; width:100%; }
  body .hg .hg-tabs button,body .hg .panes-nav button,body .hg .seg a { min-height:44px; }
  body .hg .info { font-size:13px; white-space:normal; }
  body .hg .savebar { position:sticky; bottom:calc(70px + env(safe-area-inset-bottom)); z-index:10; background:#07121cf7; padding:10px; display:flex; flex-wrap:wrap; gap:8px; }
  body .hg .savebar .save-text { flex:1 1 100%; }
  body .local-shop .container { width:calc(100% - 20px); }
  body .local-shop .shop-layout { grid-template-columns:minmax(0,1fr); }
  body .local-shop .shop-bar { position:relative; top:auto; padding:10px; gap:8px; }
  body .local-shop .shop-toolbar { position:static; flex-direction:row; flex-wrap:nowrap; overflow:auto; gap:6px; padding:6px; scrollbar-width:thin; }
  body .local-shop .shop-toolbar button { flex:0 0 auto; width:auto; min-height:44px; white-space:nowrap; }
  body .local-shop #shop-search { min-width:0; flex:1 1 100%; width:100%; }
  body .local-shop .wallet { flex-wrap:wrap; margin-left:0; }
  body .local-shop .shop-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  body .local-shop .shop-card { min-width:0; }
  body .local-shop .shop-art { height:130px; }
  body .local-shop .card-info { padding:10px; }
  body .local-shop .card-desc { display:none; }
  body .local-shop .card-stats { display:none; }
  body .local-shop .card-buy { min-height:44px; }
  body .local-shop .card-buy:not(.has-qty) { flex-direction:column; align-items:stretch; gap:8px; padding:10px; }
  body .local-shop .card-buy .price-tag { width:100%; font-size:14px; white-space:normal; overflow:visible; text-overflow:clip; }
  body .local-shop .card-buy .local-buy { width:100%; min-height:44px; }
  body .local-shop .card-buy.has-qty { grid-template-columns:minmax(0,1fr) auto; padding:10px; }
  body .local-shop .card-buy.has-qty .price-tag { grid-column:1/-1; grid-row:1; }
  body .local-shop .card-buy.has-qty .cur-switch { grid-column:2; grid-row:2; }
  body .local-shop .card-buy.has-qty input.shop-quantity { grid-column:1; grid-row:2; }
  body .local-shop .card-buy.has-qty .local-buy { grid-column:1/-1; grid-row:3; }
  body .local-shop .shop-detail { width:100%; max-width:100%; inset:0; height:100%; height:100dvh; padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom); border:0; }
  body .local-shop .shop-detail .detail-hero { height:clamp(190px,34svh,300px); flex:none; }
  body .local-shop .shop-detail .detail-brief { padding:14px; }
  body .local-shop .detail-section { padding:14px; }
  body .local-shop .shop-detail .detail-buybox { padding:12px; }
  body .local-shop .detail-checkout { gap:10px; flex-wrap:wrap; }
  body .local-shop .shop-detail .detail-buy { min-width:120px; min-height:48px; flex:1; }
  body .local-shop .detail-price .detail-total { font-size:18px; }
  body .local-shop .detail-close { min-width:44px; min-height:44px; }
  body .local-shop .confirm-box { width:calc(100% - 24px); max-width:420px; max-height:calc(100dvh - 24px); overflow:auto; padding:16px; }
  body .local-shop .confirm-actions button { min-height:44px; }
  body .iv-shell { width:calc(100% - 20px); }
  body .iv-shell .iv-layout { grid-template-columns:minmax(0,1fr); }
  body .iv-shell .iv-rows { max-height:50svh; min-height:180px; }
  body .iv-shell .iv-tabs { overflow-x:auto; flex-wrap:nowrap; }
  body .iv-shell .iv-tabs button { min-height:44px; flex-shrink:0; }
  body .iv-shell .iv-list header { flex-wrap:wrap; padding:12px; }
  body .iv-shell #iv-search { width:100%; min-width:0; }
  body .cg .grid2 { grid-template-columns:minmax(0,1fr); }
  body .lp-hero { padding-top:70px; }.lp-desktop { display:none; }
  body .landing .container,body .landing .form { max-width:100%; }
  body .lp-word { font-size:clamp(30px,9vw,48px); letter-spacing:.06em; }
  body .lp-lead { font-size:15px; }
  body .card .card-content { padding:16px; }
  body .tabs { overflow-x:auto; }
  body .gm-table-scroll { padding-bottom:4px; }
  body .lc-fab { bottom:calc(82px + env(safe-area-inset-bottom)); right:12px; }
  body .lc-panel { inset:max(8px,env(safe-area-inset-top)) 12px calc(76px + env(safe-area-inset-bottom)); width:auto; height:auto; max-height:none; max-width:none; z-index:1100; }
  body .lc-close,body .lc-tabs button,body .lc-send { min-width:44px; min-height:44px; }
}
@media(max-width:600px) {
  body .row > .col { width:100%!important; margin-left:0!important; }
  body nav .brand-logo .brand-faction { display:none; }
  body .local-shop .shop-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body .local-shop .card-info h3,body .local-shop .card-info h5 { font-size:15px; }
  body .hg .stat { grid-template-columns:50px minmax(0,1fr) 85px; font-size:12px; gap:5px; }
  body .gr-home .gr-actions { flex-wrap:wrap; }
}
@media(max-width:380px) {
  body nav .brand-logo .brand-word { font-size:14px; }
  body nav .brand-logo .brand-alpha { font-size:10px; }
  body .gm-mobile-start { padding:0 8px; font-size:12px; }
}
@media(max-width:1100px) and (orientation:landscape) {
  body .local-shop .shop-grid { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
  body .local-shop .shop-art { height:120px; }
}
@media(pointer:coarse) {
  body::before { filter:brightness(.65); inset:0; }
  body nav .nav-wrapper,body .gr-panel,body .hg .hud,body .local-shop .shop-bar,body .local-shop .shop-toolbar { -webkit-backdrop-filter:none!important; backdrop-filter:none!important; }
}
