/* Hangar phone redesign. This file deliberately leaves desktop styling to the
   existing Hangar design system. */
@font-face {
  font-family: "Chakra Petch";
  src: url("../../unit_asset/fonts/chakra-petch/ChakraPetch-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

@media (pointer: coarse) and (orientation: landscape) and (max-width: 1000px) and (max-height: 550px) {
  body[data-app-state="HANGAR"] #hangar .hangar-body {
    gap: 6px;
    padding: 5px 8px;
  }

  body[data-app-state="HANGAR"] #hangar #main-menu-nav {
    position: relative;
    z-index: 2;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    display: grid;
    flex: none;
    grid-template-columns: repeat(4, minmax(72px, 90px));
    justify-content: start;
    width: auto;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body[data-app-state="HANGAR"] #hangar #main-menu-nav button {
    box-sizing: border-box;
    min-height: 44px;
    height: 44px;
    justify-content: center;
    gap: 0;
    padding: 0 12px;
    border: 1px solid var(--phone-line);
    border-radius: 9px;
    background: #0a1d26;
    color: var(--phone-muted);
    font: 600 13px/1.2 var(--phone-font);
  }

  body[data-app-state="HANGAR"] #hangar #main-menu-nav .main-menu-nav-icon {
    display: none;
  }

  body[data-app-state="HANGAR"] #hangar #main-menu-nav button[aria-current="page"] {
    border-color: var(--phone-cyan);
    background: #0f2a35;
    color: var(--phone-cyan);
    box-shadow: none;
  }

  body[data-app-state="HANGAR"] #hangar-materials-menu {
    position: absolute;
    z-index: 91;
    top: 5px;
    right: 60px;
    display: block;
    color: var(--phone-copy);
  }

  #hangar-materials-toggle {
    box-sizing: border-box;
    display: flex;
    min-width: 102px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--phone-line-strong);
    border-radius: 9px;
    background: #0a1d26;
    color: var(--phone-cyan);
    font: 600 12px/1.2 var(--phone-font);
    list-style: none;
    cursor: pointer;
  }

  #hangar-materials-toggle::-webkit-details-marker { display: none; }
  #hangar-materials-menu[open] #hangar-materials-toggle { border-color: var(--phone-cyan); }
  .hangar-materials-shared { display: none; }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: block !important;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel > :not(.workshop-layout) {
    display: none !important;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-layout {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-layout > :not(.workshop-sidebar) {
    display: none !important;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-sidebar {
    position: fixed;
    z-index: 121;
    top: 49px;
    right: auto !important;
    left: calc(100vw - 501px) !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    box-sizing: border-box;
    width: min(420px, calc(100vw - 92px)) !important;
    max-height: calc(100dvh - 58px);
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border: 1px solid var(--phone-line-strong);
    border-radius: 12px;
    background: #081820f5;
    box-shadow: 0 12px 35px #000d;
    pointer-events: auto;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-sidebar > section {
    position: relative;
    grid-area: auto !important;
    flex: none;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-panel-card {
    min-width: 0;
    margin: 0;
    padding: 7px;
    border-color: var(--phone-line);
    border-radius: 8px;
    background: #0a1820;
    box-shadow: none;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-pending-panel { display: grid !important; }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-panel-card > header {
    min-height: 24px;
    margin: 0 0 3px;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-panel-card > header > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-storage-title {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-panel-card :is(h4, h5, p, small) {
    font-size: 12px;
    line-height: 1.25;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-storage-kicker,
  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-glyph {
    display: none;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-storage-title + .hangar-materials-shared {
    display: inline;
    color: var(--phone-muted);
    font-size: 10px;
    font-weight: 400;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-materials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-material-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 4px;
    row-gap: 0;
    min-height: 30px;
    height: 30px;
    padding: 1px 3px;
    border: 0;
    border-radius: 5px;
    background: #0a1820;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-material-card img {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-material-card h5,
  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-material-card p {
    margin: 0;
    font-size: 10px;
    line-height: 1.15;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-material-card h5 {
    position: static;
    width: auto;
    height: auto;
    overflow: hidden;
    clip-path: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-material-card p {
    grid-column: 3;
    justify-self: end;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-materials,
  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-pending { max-height: none !important; overflow: visible !important; }
  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-pending {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-pending > .workshop-card {
    box-sizing: border-box;
    width: 100%;
    padding: 6px;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-character-info,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #workshop-panel {
    flex: 1 1 0;
    min-height: 0;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid {
    display: block !important;
    gap: 8px;
    min-height: 0;
    padding: 0;
    overflow: auto;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-status-sections {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 5px;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-status-sections button {
    min-width: 0;
    min-height: 40px;
    padding: 4px;
    font-size: 10px;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid > section { display: none !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid[data-status-phone-section="pilot"] > .hangar-dossier-profile { display: flex !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid[data-status-phone-section="frame"] > .hangar-dossier-center { display: flex !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid[data-status-phone-section="equipment"] > #hangar-dossier-weapons { display: block !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-profile {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    width: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-head {
    display: flex !important;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: auto;
    min-height: 52px;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-head > div { flex: 1 1 0; width: auto; min-width: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-head h3 { margin: 0; font-size: 12px; line-height: 1.2; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-head #hangar-dossier-identity { height: auto; max-height: none; margin: 2px 0 0; overflow: visible; font-size: 10px; line-height: 1.3; white-space: normal; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel {
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 8px;
    overflow: auto;
    border: 1px solid var(--phone-line);
    border-radius: 10px;
    background: #0a1820;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel > header {
    height: 36px;
    min-height: 36px;
    gap: 6px;
    margin: 0 0 4px;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel > header h4 { font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-points-remaining { font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel > header button { min-height: 44px; height: 44px; font-size: 10px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid { grid-template-rows: repeat(5, 44px); gap: 3px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article { grid-template-columns: minmax(0, 1fr) 44px 28px 44px; min-height: 44px; height: 44px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 18px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article b,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article strong { font-size: 12px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article small { font-size: 11px; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-center {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-stats {
    min-height: 0;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--phone-line);
    border-radius: 10px;
    background: #0a1820;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list > span { min-height: 30px; padding: 3px; font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list b { font-size: 12px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-center > [data-equipment-type="armor"] { min-height: 0; overflow: auto; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons { display: none; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns #inventory-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns {
    position: relative;
    display: grid;
    flex: 1 1 0;
    grid-template-columns: minmax(165px, 200px) minmax(0, 1fr);
    min-height: 0;
    margin: 0;
    overflow: hidden;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns > article { display: contents; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #stdoptions,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #advoptions { display: none !important; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: auto;
    border: 0;
    background: transparent;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment { grid-column: 1; grid-row: 1; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment > h3 {
    flex: none;
    margin: 0;
    color: var(--phone-muted);
    font-size: 11px;
    line-height: 1.2;
    text-transform: uppercase;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid .current-equipment-slot {
    box-sizing: border-box;
    min-height: 48px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 7px;
    padding: 5px 7px;
    text-align: left;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid .item-icon-frame,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid img { width: 32px; height: 32px; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel > .inventory-heading-row {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    display: block !important;
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-heading-row > div:first-child,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-sort { display: none !important; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools { display: block; width: 44px; margin: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label { display: block; width: 44px; min-width: 44px; font-size: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-tools label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search { box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 5px 8px; border: 1px solid var(--phone-line); border-radius: 9px; background: #0a1820 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386adbc' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center/16px no-repeat; color: var(--phone-copy); font-size: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search::placeholder { color: transparent; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search:focus { position: relative; z-index: 2; width: min(170px, 42vw); min-width: min(170px, 42vw); background-image: none; font-size: 12px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-search:focus::placeholder { color: var(--phone-muted); }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel > .inventory-workspace {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr);
    gap: 7px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel { grid-column: 2; grid-row: 1; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel > .inventory-workspace { grid-row: 1; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 44px;
    padding: 0 0 0 50px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    background: transparent;
    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: 44px;
    padding: 0 12px;
    border: 1px solid var(--phone-line);
    border-radius: 9px;
    background: #0a1d26;
    color: var(--phone-copy);
    font-size: 12px;
    white-space: nowrap;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters button[aria-selected="true"] {
    border-color: var(--phone-cyan);
    background: #0f2a35;
    color: var(--phone-cyan);
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .inventory-unrelated-toggle { display: none; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-list { min-width: 0; min-height: 0; padding: 0; overflow: auto; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-list { grid-column: 1; grid-row: 2; width: 100%; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items { min-height: 100%; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-group { margin: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-group > h4 { display: none; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 7px;
    padding: 0;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns:has(#inventory-items .inventory-grid:empty) #inventory-empty-state {
    position: absolute;
    z-index: 1;
    inset: 88px 0 0 210px;
    display: grid !important;
    align-content: center;
    justify-items: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 16px;
    border: 1px dashed var(--phone-line-strong);
    border-radius: 12px;
    background: #050c12;
    color: var(--phone-copy);
    text-align: center;
  }

  .inventory-empty-state[hidden] { display: none; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns:has(#inventory-items .inventory-grid:empty) #inventory-empty-state[hidden] { display: grid !important; }
  .inventory-empty-state h3,.inventory-empty-state p { margin: 0; }
  .inventory-empty-state h3 { font-size: 15px; }
  .inventory-empty-state p { max-width: 440px; color: var(--phone-muted); font-size: 12px; line-height: 1.3; }
  .inventory-empty-state button { min-height: 44px; padding: 0 14px; }
  .inventory-empty-icon { color: var(--phone-line-strong); font-size: 30px; line-height: 1; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 58px;
    padding: 7px;
    border: 1px solid var(--phone-line);
    border-radius: 9px;
    background: #0a1820;
    color: var(--phone-copy);
    text-align: left;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item.equipped { border-color: var(--phone-amber); }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > .item-icon-frame,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > .inventory-gear-badge,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > .inventory-quantity-badge,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > .inventory-item-actions { display: none; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > .item-icon-frame {
    display: grid;
    grid-column: 1;
    grid-row: 1;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #12303a;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > img {
    grid-column: 1;
    grid-row: 1;
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #12303a;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > .item-icon-frame img { width: 29px; height: 29px; object-fit: contain; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item-details {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item-details strong {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item-details { text-align: left; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item-details > span {
    overflow: hidden;
    color: var(--phone-muted);
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-empty-state {
    display: grid;
    min-height: 100%;
    align-content: center;
    justify-items: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 16px;
    border: 1px dashed var(--phone-line-strong);
    border-radius: 12px;
    color: var(--phone-copy);
    text-align: center;
  }

  #inventory-detail-dialog {
    box-sizing: border-box;
    width: min(560px, calc(100vw - 104px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 12px;
    border: 1px solid var(--phone-line-strong) !important;
    border-radius: 12px;
    background: #081820;
    color: var(--phone-copy);
  }

  #inventory-detail-dialog::backdrop { background: #030609c0; }
  #inventory-detail { display: grid; grid-template-columns: minmax(120px, .65fr) minmax(0, 1fr); gap: 8px 12px; max-height: calc(100dvh - 56px); overflow: auto; }
  #inventory-detail > header { grid-column: 1/-1; min-height: 44px; margin: 0; }
  #inventory-detail > header h2 { font-size: 17px; }
  #inventory-detail-close { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  #inventory-detail-content { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #inventory-detail-content .inventory-detail-content-card { min-width: 0; }
  .inventory-detail-actions { grid-column: 1/-1; display: flex; gap: 6px; align-items: end; }
  .inventory-detail-actions button { box-sizing: border-box; min-width: 0; min-height: 44px; flex: 1; padding: 4px 8px; font-size: 12px; }
  #inventory-detail-equip { min-height: 48px; border-color: var(--phone-amber); background: var(--phone-amber); color: #1b1005; font-weight: 700; }

  body[data-app-state="HANGAR"] #hangar[data-hangar-view="basic"] #basic-inventory-items .basic-empty-state {
    display: grid;
    min-height: 140px;
    align-content: center;
    justify-items: center;
    gap: 7px;
    box-sizing: border-box;
    padding: 12px;
    border: 1px dashed var(--phone-line-strong);
    border-radius: 10px;
    color: var(--phone-copy);
    text-align: center;
  }

  .basic-empty-state .basic-empty-icon { color: var(--phone-line-strong); font-size: 28px; line-height: 1; }
  .basic-empty-state h3,.basic-empty-state p { margin: 0; }
  .basic-empty-state h3 { font-size: 14px; }
  .basic-empty-state p { max-width: 420px; color: var(--phone-muted); font-size: 12px; line-height: 1.3; }
  .basic-empty-state button { min-height: 44px; padding: 0 14px; }
}

@media (pointer: coarse) and (orientation: landscape) and (max-width: 1000px) and (max-height: 550px) {
  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-pending {
    flex: none;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel .workshop-sidebar {
    top: -13px !important;
    transform: none !important;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-pending button {
    min-height: 44px;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-width: 1000px) and (max-height: 550px) {
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"],
  body[data-app-state="HANGAR"] #inventory-detail-dialog,
  body[data-app-state="HANGAR"] #hangar-materials-menu,
  body[data-app-state="HANGAR"] #hangar-materials-menu button {
    font-family: "Chakra Petch", sans-serif;
  }

  body[data-app-state="HANGAR"] #hangar .hangar-body { padding-top: 5px; }
  body[data-app-state="HANGAR"] #hangar #main-menu-nav {
    grid-template-columns: repeat(3, 82px);
  }
  body[data-app-state="HANGAR"] #hangar #main-menu-nav [data-main-menu-action="lobby"] { display: none; }
  /* Keep the compact Detail level switch reachable after Hangar actions moved
     into the shared nav shell. Place its menu beside the wallet, clear of Pilot. */
  body[data-app-state="HANGAR"] #nav-shell .nav-hangar-actions {
    right: 174px;
    display: block !important;
  }
  body[data-app-state="HANGAR"] #wallet-display {
    position: fixed;
    z-index: 117;
    top: 5px;
    right: 62px;
    display: flex;
    min-height: 36px;
    align-items: center;
    margin: 0;
    color: var(--phone-amber);
    font: 600 13px/1.2 "Chakra Petch", sans-serif;
    pointer-events: none;
  }
  body[data-app-state="HANGAR"] #wallet-display > span:last-child { display: none; }
  body[data-app-state="HANGAR"] #wallet-display b { color: var(--phone-amber); font-size: 14px; }
  body[data-app-state="HANGAR"] #wallet-display > span:first-child > span { display: none; }
  body[data-app-state="HANGAR"] #nav-profile {
    position: fixed;
    z-index: 117;
    top: 4px;
    right: 8px;
    display: block;
    pointer-events: auto;
  }
  body[data-app-state="HANGAR"] #nav-profile > summary {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
    border-color: var(--phone-line);
    border-radius: 50%;
    background: #0a1d26;
    color: var(--phone-cyan);
    font: 700 14px/1.2 "Chakra Petch", sans-serif;
  }
  body[data-app-state="HANGAR"] #nav-profile > summary > span:not(.nav-profile-mark) { display: none; }
  body[data-app-state="HANGAR"] #hangar-materials-menu {
    display: none;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #hangar-materials-menu {
    display: block;
    top: 5px;
    right: 62px;
  }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-character-info {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-status-sections { display: none !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid {
    display: grid !important;
    flex: 1 1 0;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .95fr);
    grid-template-rows: 46px minmax(0, 1fr);
    gap: 6px 10px;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-grid > section { display: flex !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-weapons { display: none !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-profile { display: contents !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-head {
    grid-column: 1;
    grid-row: 1;
    min-height: 44px;
    align-items: center;
    padding: 0;
    border: 0;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-portrait { display: none !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-head h3 { font-size: 16px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #hangar-dossier-head #hangar-dossier-identity { font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-center {
    grid-column: 1;
    grid-row: 2;
    display: block !important;
    min-height: 0;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--phone-line);
    border-radius: 10px;
    background: #0a1820;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-stats { padding: 0; border: 0; background: transparent; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-stats h4 { margin: 0 0 6px; font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list > span {
    min-height: 32px;
    padding: 5px 7px;
    border: 0;
    border-bottom: 3px solid var(--phone-cyan);
    border-radius: 4px;
    background: linear-gradient(90deg, #133c4a, #0b2029);
    font-size: 11px;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-stat-list b { font-size: 12px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-status-heading,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-weapon-status-list,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .hangar-dossier-center > [data-equipment-type="armor"] { display: none !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    padding: 8px 10px;
    overflow: auto;
    border: 1px solid var(--phone-line);
    border-radius: 10px;
    background: #0a1820;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel > header { flex: none; height: 38px; min-height: 38px; margin: 0 0 5px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel > header h4,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-points-remaining { font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-panel > header button { display: block; flex: 0 0 auto; width: auto; min-height: 44px; height: 44px; padding: 4px 9px; font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid { flex: none; grid-template-rows: repeat(5, 44px); grid-auto-rows: 44px; gap: 0; overflow: visible; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article { grid-template-columns: minmax(0, 1fr) 44px 32px 44px; min-height: 44px; height: 44px; gap: 4px; padding: 0; border: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article > div > small { display: none; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] .status-point-grid article button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 18px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="status"] #status-allocation-save-state { font-size: 11px; }

  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] .hangar-columns {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 10px;
  }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="basic"][data-menu-section="inventory"] #inventory-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment { gap: 6px; overflow: auto; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment > h3 { font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid [data-type="radar"] { display: none !important; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid .current-equipment-slot {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: 16px minmax(0, 1fr);
    width: 100%;
    height: 48px;
    min-height: 48px;
    gap: 1px 7px;
    padding: 4px 6px;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid .item-icon-frame { grid-row: 1 / 3; width: 38px; height: 38px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid img { width: 34px; height: 34px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid .current-equipment-slot > strong { font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid .current-equipment-slot > span:not(.item-icon-frame) { font-size: 12px; line-height: 1.2; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel { grid-column: 2; grid-row: 1; min-width: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel > .inventory-workspace { grid-template-rows: 44px minmax(0, 1fr); }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters { min-width: 0; overflow-x: auto; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-filters [data-filter] { flex: none; min-height: 44px; padding-inline: 10px; font-size: 11px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items { height: 100%; overflow: auto; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item {
    grid-template-rows: 34px minmax(0, 1fr);
    min-width: 0;
    min-height: 94px;
    height: 94px;
    padding: 5px;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item .item-icon-frame { width: 32px; height: 32px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item .item-icon-frame img { width: 30px; height: 30px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item .inventory-item-details { min-width: 0; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item .inventory-item-details strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item::after {
    content: attr(data-type);
    align-self: end;
    overflow: hidden;
    color: var(--phone-muted);
    font-size: 10px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-app-state="HANGAR"] #inventory-detail-dialog { width: min(600px, calc(100vw - 96px)); height: min(350px, calc(100dvh - 24px)); max-height: calc(100dvh - 24px); padding: 10px; }
  body[data-app-state="HANGAR"] #inventory-detail { height: 100%; max-height: none; grid-template-rows: 44px minmax(0, 1fr) auto; gap: 7px; overflow: hidden; }
  body[data-app-state="HANGAR"] #inventory-detail-content { min-height: 0; overflow: hidden; }
  body[data-app-state="HANGAR"] #inventory-detail-content .inventory-detail-content-card { max-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  body[data-app-state="HANGAR"] .inventory-detail-actions { position: relative; z-index: 1; min-height: 48px; padding-top: 3px; background: #081820; }
}

@media (orientation: landscape) and (max-width: 1000px) and (max-height: 550px) and (max-width: 870px) {
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel { grid-template-columns: minmax(145px, 175px) minmax(0, 1fr); gap: 7px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="basic"][data-menu-section="inventory"] #basic-inventory-items { min-height: 70px !important; }
}

@media (pointer: coarse) and (orientation: landscape) and (max-width: 870px) and (max-height: 550px) {
  body[data-app-state="HANGAR"] #hangar .hangar-columns {
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment,
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-panel {
    height: 100%;
    align-self: stretch;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid { align-content: start; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item { grid-template-rows: 48px minmax(0, 1fr) 16px; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item::before { display: none; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item-details > span { display: block; overflow: hidden; color: var(--phone-amber); font-size: 9px; line-height: 1.1; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item::after {
    content: attr(data-type);
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    min-width: 0;
    font-size: 10px;
    text-transform: uppercase;
    white-space: nowrap;
  }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #inventory-items .inventory-item > .item-hover-card { display: none !important; }
  body[data-app-state="HANGAR"]:has(#hangar[data-menu-section="workshop"]) #wallet-display,
  body[data-app-state="HANGAR"]:has(#hangar[data-menu-section="workshop"]) #nav-profile { display: none; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="workshop"] #hangar-materials-menu { right: 8px; z-index: 118; }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] .hangar-dossier-grid { position: relative; }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] .hangar-dossier-grid > .hangar-dossier-profile {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] #status-allocation-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    width: min(40%, 304px);
    grid-column: auto;
    grid-row: auto;
    padding: 7px 9px 58px;
    overflow: hidden;
  }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] #status-allocation-panel > header {
    height: 36px;
    min-height: 36px;
    justify-content: space-between;
  }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] #status-allocation-panel > header > div { display: flex; flex: 1 1 0; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] #status-allocation-panel > header h4 { flex: none; font-size: 11px; white-space: nowrap; }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] #status-points-remaining { max-width: 140px; overflow: visible; font-size: 11px; line-height: 1.1; text-align: right; white-space: normal; }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] #status-allocation-panel > header button {
    position: absolute;
    right: 9px;
    bottom: 7px;
    left: 9px;
    width: auto;
    min-height: 44px;
    height: 44px;
    font-size: 11px;
  }
  body[data-app-state="HANGAR"] #hangar[data-hangar-view="advanced"][data-menu-section="status"] .status-point-grid { flex: 1 1 0; height: auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid [data-type="std"] { order: 1; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid [data-type="adv"] { order: 2; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid [data-type="armor"] { order: 3; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid [data-type="engine"] { order: 4; }
  body[data-app-state="HANGAR"] #hangar[data-menu-section="inventory"] #current-equipment-grid .current-equipment-slot > span:not(.item-icon-frame) {
    overflow: hidden;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.05;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-width: 1000px) and (max-height: 550px) {
  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-materials {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-height: 108px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-materials .workshop-material-card {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    min-height: 36px;
    height: auto;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-materials .workshop-material-card h5 {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  body[data-app-state="HANGAR"] #hangar:has(#hangar-materials-menu[open]) #workshop-panel #workshop-pending {
    flex: none;
  }
}
