.carried-model {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: block;
  margin: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}
.gear-tile, .bench-slot, .unit-hit {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.gear-tile img {
  pointer-events: none;
  -webkit-user-drag: none;
}
.unit-hit {
  height: 12.25%;
  transform: translate(-50%, -88%);
}
.app-shell[data-dragging], .app-shell[data-dragging] button { cursor: grabbing !important; }
.bench-slot.drag-origin > :not(.reserve-pad, .reserve-caption),
.bench-slot.drag-origin .reserve-name { visibility: hidden !important; }
.bench-slot.drag-origin .reserve-pad { opacity: .3; }
.gear-tile.drag-origin { opacity: .32; }
.bench-slot[data-drop-state='allowed'] .reserve-pad {
  outline: 2px solid #c9fff5;
  box-shadow: 0 0 0 3px #237e76ac;
}
.bench-slot[data-drop-state='blocked'] .reserve-pad { outline: 2px dashed #ff9d8d; }
.reserve-actions .trash-target[data-drop-state='allowed'] {
  background: #b5423eb8;
  border-color: #fff3de;
  color: #fff;
}
.warehouse { --gear-size: clamp(27px, 2.3vw, 34px); }
.left-column .warehouse .warehouse-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: auto;
  min-height: var(--gear-size);
}
.warehouse-tools { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.warehouse .gear-pile {
  display: grid;
  flex: 1;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, var(--gear-size)));
  align-items: center;
  gap: 3px;
  padding: 0;
  margin: 0;
}
.warehouse .gear-tile, .warehouse .gear-tile:hover, .warehouse .gear-tile:active {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 100%;
  max-width: var(--gear-size);
  height: var(--gear-size);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.warehouse .gear-tile:not(:disabled), .bench-slot.filled:not(:disabled), .unit-hit { cursor: grab; }
.warehouse .gear-tile img { width: 94%; height: 94%; object-fit: contain; }
.warehouse .gear-tile b { right: 0; bottom: 0; }
@media (max-width: 1100px) and (orientation: portrait), (max-width: 1000px) and (max-height: 560px) and (orientation: landscape) {
  .warehouse { --gear-size: 28px; }
}
@media (max-width: 550px) and (orientation: portrait) {
  .warehouse-tools .mobile-tools .btn { gap: 3px; padding-inline: 4px; }
}
@media (max-width: 1100px) and (orientation: portrait) {
  #announce { top: calc(env(safe-area-inset-top) + 10dvh); bottom: auto; }
}
@media (max-width: 360px) and (orientation: portrait) {
  .warehouse-tools .mobile-tools { gap: 2px; }
  .warehouse-tools .mobile-tools .btn { gap: 2px; padding-inline: 3px; }
}
.gear-loadout {
  display: grid;
  row-gap: 3px;
  padding-block: 4px;
  border-block: 1px solid #4b73712b;
}
.gear-loadout .piece-gear {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  min-height: 30px;
}
.gear-loadout .piece-gear > b { font-size: 11px; }
.gear-choices { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.gear-loadout .worn-gear, .gear-loadout .spare-gear {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.gear-loadout .worn-gear::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .38;
  background: transparent url('../assets/interface/gear-slot-empty.webp') center / contain no-repeat;
}
.gear-loadout .worn-gear img { position: relative; width: 92%; height: 92%; }
.gear-loadout .spare-gear img { width: 91%; height: 91%; }
.gear-loadout .spare-gear:disabled { opacity: .38; }
.spare-gear small {
  position: absolute;
  bottom: -1px;
  right: -2px;
  border-radius: 4px;
  background: #344953;
  color: white;
  padding-inline: 2px;
  font: 11px/13px Lilita, sans-serif;
}
.shop-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  line-height: 1.15;
  white-space: nowrap;
}
.shop-head h2 .icon { width: 16px; height: 16px; }

.piece-traits {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.piece-traits button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px 5px;
  color: #47645e;
  background: #e8efde;
  border: 1px solid #bbcbb8;
  border-radius: 6px;
  cursor: pointer;
}
.piece-traits button[data-active='true'] { background: #ffe6a5; border-color: #bf974b; color: #5f471c; }
.piece-traits button:focus-visible { outline: 2px solid #397d89; }
.piece-traits button > img { width: 20px; height: 20px; object-fit: contain; }
.piece-traits small { font: 12px/1 Lilita, var(--font); }
.piece-traits .trait-faces { width: 24px; height: 20px; }
.piece-traits .trait-faces img { width: 15px; height: 15px; }
.piece-traits .trait-faces img + img { left: 8px; top: 4px; }

/* The button fills its logical tile. Only its ground marker is painted. */
.deploy-grid .drop-cell,
.field.moving .deploy-grid .drop-cell:hover,
.deploy-grid .drop-cell:is(:hover, :focus-visible) {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
}
/* The canvas draws allowed positions in the terrain pass at the actor's real foot point. */
.deploy-grid .drop-cell[data-drop-state='blocked'] { visibility: visible; }
.deploy-grid .drop-cell[data-drop-state='blocked']::before,
.deploy-grid .drop-cell[data-full]:focus-visible::before,
.unit-hit[data-drop-state='blocked']::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 61%;
  height: 42%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px dashed #ffbaab;
  background: linear-gradient(45deg, transparent 46%, #ffb1a5 47% 53%, transparent 54%);
  pointer-events: none;
}
.unit-hit:is(:focus-visible, [data-drop-state]) { outline: 0; box-shadow: none; }
.unit-hit[data-drop-state='blocked']::before { top: 88%; height: 28%; }
.bench-slot[data-landed]::after {
  content: '';
  position: absolute;
  pointer-events: none;
  left: 50%;
  top: 76%;
  width: 67%;
  height: 19%;
  border-radius: 50%;
  border: 2px solid #faffd7;
  animation: placement-arrived 380ms ease-out both;
}
@keyframes placement-arrived {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.8); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.36); }
}
@media (prefers-reduced-motion: reduce) {
  .bench-slot[data-landed]::after { transform: translate(-50%,-50%); animation-name: placement-confirmed; }
  @keyframes placement-confirmed { from { opacity: 1; } to { opacity: 0; } }
}
.no-spare-gear { margin-left: 10px; width: 10px; height: 2px; border-radius: 2px; background: #8bada6; }
@media (max-width: 680px), (max-height: 570px) {
  .gear-loadout .piece-gear { min-height: 26px; }
  .gear-loadout .worn-gear, .gear-loadout .spare-gear { width: 27px; height: 27px; }
}
