/* Phone caravan: Pokémon GO–style vertical offer list + pinned Leave.
   Must beat stops-system / popup-stops specificity on .modal-shop:has([data-stop-shop]). */

.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]){
  display:flex;
  flex-direction:column;
  width:min(640px,100%);
  height:auto;
  max-height:min(720px,calc(100dvh - max(16px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom))));
  overflow:hidden;
  grid-template-rows:none;
  grid-template-columns:none;
}
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-location-art{
  flex:0 0 auto;
  max-height:56px;
  height:auto;
  min-height:0;
}
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-dialog-body[data-caravan-sheet]{
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1 1 auto;
  min-height:0;
  height:auto;
  max-height:none;
  overflow:hidden;
  padding:10px 12px 4px;
}
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-dialog-body[data-caravan-sheet] > *{
  min-width:0;
}
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-dialog-body[data-caravan-sheet] > .caravan-list,
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-dialog-body[data-caravan-sheet] > .caravan-catalog{
  flex:1 1 auto;
  flex-shrink:1;
  min-height:0;
}
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-dialog-body[data-caravan-sheet] > :not(.caravan-list):not(.caravan-catalog){
  flex-shrink:0;
}
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .journey-shop-footer{
  flex:0 0 auto;
  display:flex;
  justify-content:center;
  gap:10px;
  margin:0;
  padding:10px 12px max(10px,env(safe-area-inset-bottom));
  border-top:1px solid var(--gui-edge,#ffffff18);
  background:var(--gui-sheet,#152028);
}
.shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .journey-shop-footer .exp-button{
  position:static;
  left:auto;right:auto;top:auto;bottom:auto;
  min-height:44px;min-width:min(100%,220px)
}

.caravan-list,
.caravan-catalog{
  display:flex;
  flex-direction:column;
  gap:0;
  flex:1 1 auto;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding:0;
  max-height:none;
  align-content:flex-start;
}
/* Critical: do not let flex shrink rows to ~25px (that caused all offers to overlap). */
.shell .exp-modal:has([data-stop-shop]) .caravan-list > .caravan-row,
.shell .exp-modal:has([data-stop-shop]) .caravan-catalog > .caravan-row{
  flex:0 0 auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  align-self:stretch!important;
}

/* Beat stops-system / popup-stops .exp-shop-item grids that stack every child full-width. */
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row,
.shell .exp-modal.modal-shop:has([data-stop-shop]) .exp-shop-item.caravan-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:auto auto!important;
  grid-template-areas:
    "focus buy"
    "extra extra"!important;
  grid-auto-rows:auto!important;
  align-items:center!important;
  column-gap:10px!important;
  row-gap:6px!important;
  gap:6px 10px!important;
  position:relative;
  margin:0!important;
  padding:12px 4px!important;
  border:0!important;
  border-bottom:1px solid color-mix(in srgb,var(--pm-ui-line,#fff) 28%,transparent)!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  min-width:0!important;
  min-height:0!important;
  text-align:left!important;
  overflow:hidden!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row.selected{
  background:color-mix(in srgb,var(--pm-ui-accent,#aee7d5) 10%,transparent)!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row.sold{opacity:.62}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > *{
  grid-column:auto!important;
  grid-row:auto!important;
  max-width:100%!important;
  width:auto!important;
  min-width:0!important;
  position:static!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > .caravan-row-focus{
  grid-area:focus!important;
  display:grid!important;
  grid-template-columns:56px minmax(0,1fr)!important;
  gap:10px!important;
  align-items:center!important;
  align-self:center!important;
  min-height:56px;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:inherit!important;
  text-align:left!important;
  cursor:pointer;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .caravan-row-art,
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .shop-item-art{
  display:grid!important;
  place-items:center!important;
  grid-column:auto!important;
  grid-row:auto!important;
  width:56px!important;
  height:56px!important;
  min-height:56px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:12px!important;
  background:var(--pm-ui-surface-soft,#1c232c)!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .caravan-row-art :is(img,svg,.exp-icon,.art,.foil-art),
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .shop-item-art :is(img,svg,.exp-icon,.art,.foil-art){
  max-width:50px!important;max-height:50px!important;width:auto!important;height:auto!important;object-fit:contain!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .caravan-row-copy{
  display:flex!important;
  flex-direction:column!important;
  gap:2px!important;
  min-width:0!important;
  grid-column:auto!important;
  grid-row:auto!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .caravan-row-copy .journey-offer-kind{
  position:static!important;
  width:auto!important;height:auto!important;
  overflow:visible!important;clip-path:none!important;
  white-space:normal!important;
  font-size:11px!important;
  letter-spacing:.03em;
  line-height:1.2!important;
  margin:0!important;
  align-self:start!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .caravan-row-copy h3{
  margin:0!important;
  font-size:15px!important;
  line-height:1.2!important;
  font-weight:700;
  grid-column:auto!important;
  grid-row:auto!important;
  align-self:start!important;
  text-align:left!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .caravan-row-copy p{
  margin:0!important;
  font-size:12px!important;
  line-height:1.35!important;
  opacity:.82;
  display:-webkit-box!important;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  grid-column:auto!important;
  grid-row:auto!important;
  text-align:left!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > .caravan-buy{
  grid-area:buy!important;
  align-self:center!important;
  justify-self:end!important;
  min-width:72px!important;
  max-width:110px!important;
  width:auto!important;
  min-height:44px!important;
  margin:0!important;
  padding:8px 10px!important;
  border-radius:999px!important;
  font-size:13px!important;
  gap:4px;
  justify-content:center!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > .caravan-buy .exp-money{gap:4px}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > .caravan-buy .currency-icon{
  width:20px!important;height:20px!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > .caravan-row-extra{
  grid-area:extra!important;
  display:flex!important;
  flex-direction:column!important;
  gap:6px!important;
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  padding-top:2px;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > .caravan-row-extra:empty{display:none!important}
/* Hide fluff-only extras (balance + available status). Keep blockers / kits / packs / heal pickers. */
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row > .caravan-row-extra:not(:has(.journey-unavailable)):not(:has(details)):not(:has(.journey-shop-target)):not(:has(.combo-kit-cards)):not(:has(.kit-tribe-pair)){
  display:none!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .journey-offer-status{
  font-size:11px!important;
  line-height:1.3!important;
  margin:0!important;
  min-height:0!important;
  grid-column:auto!important;
  grid-row:auto!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .shop-balance-preview{
  display:none!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row :is(details,.regional-box-preview,.combo-kit-cards,.kit-tribe-pair,.journey-shop-target){
  grid-column:auto!important;
  grid-row:auto!important;
  width:100%!important;
  max-width:100%!important;
}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .combo-kit-cards{gap:4px}
.shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .journey-shop-target{gap:4px;padding:4px 0}
.shell .exp-modal.modal-shop:has([data-stop-shop]) .gui-shop-tools{
  flex:0 0 auto;
  flex-shrink:0;
  margin:0;
  position:relative;
  z-index:2;
  background:var(--gui-sheet,#152028);
  border-top:1px solid color-mix(in srgb,var(--pm-ui-line,#fff) 22%,transparent);
  padding-top:2px;
}
.shell .exp-modal.modal-shop:has([data-stop-shop]) .caravan-list{
  isolation:isolate;
}

@media(max-width:600px){
  .shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-location-art{
    max-height:44px;height:44px;
  }
  .shell .exp-modal.modal-shop:has([data-stop-shop]) .gui-stop-heading[data-stop-shop]{
    flex:0 0 auto;flex-shrink:0;
    padding:8px 10px;gap:8px;border-radius:14px;
  }
  .shell .exp-modal.modal-shop:has([data-stop-shop]) .gui-stop-heading[data-stop-shop] .exp-space-icon{
    display:grid;width:36px;height:36px;border-radius:11px;
  }
  .shell .exp-modal.modal-shop:has([data-stop-shop]) .gui-stop-heading[data-stop-shop] h2,
  .shell .exp-modal.modal-shop:has([data-stop-shop]) [data-stop-shop]>h2{
    font-size:16px;line-height:1.15;margin:0;
  }
  .shell .exp-modal.modal-shop:has([data-stop-shop]) .gui-stop-heading[data-stop-shop] small{
    display:block;font-size:11px;opacity:.78;margin-top:2px;
  }
  /* Phone portrait: drop tools chrome so the offer list never sits under a pinned bar. */
  .shell .exp-modal.modal-shop:has([data-stop-shop]) .gui-shop-tools{display:none}
  .shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row{padding:12px 2px!important}
}

/* Short landscape: keep list scrollable, Leave pinned. */
@media(max-height:420px) and (min-width:600px){
  .shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]){
    display:flex;flex-direction:column;
    width:min(860px,100%);
    height:100%;
    max-height:calc(100dvh - 24px);
    grid-template-columns:none;grid-template-rows:none;
  }
  .shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-location-art{display:none}
  .shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .exp-dialog-body[data-caravan-sheet]{
    display:flex;flex-direction:column;
    flex:1 1 auto;min-height:0;gap:4px;padding:6px 12px 2px;overflow:hidden;
  }
  .shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .journey-shop-footer{
    flex:0 0 auto;justify-content:center;
    padding:4px 12px max(4px,env(safe-area-inset-bottom));
  }
  .shell .exp-modal.modal-shop:has([data-stop-shop]) .gui-shop-tools{display:none}
  .shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row{padding:8px 2px!important}
  .shell .exp-modal:has([data-stop-shop]) .exp-shop-item.caravan-row .caravan-row-copy p{-webkit-line-clamp:2}
  .shell .exp-modal.exp-illustrated.modal-shop:has([data-stop-shop]) > .journey-shop-footer .exp-button{
    position:static;min-height:44px
  }
}

@media(prefers-reduced-motion:reduce){
  .caravan-row{transition:none}
}

/* Late-cascade support drop targets (aura / trap / reflex): keep ≥44px taps. */
.game-battle .support-slot.target-zone{min-height:44px}
.game-battle .support-row,
.game-battle .enemy-support{min-height:44px}
@media(max-height:500px) and (min-width:600px){
  .game-battle .support-slot.target-zone{min-height:40px}
  .game-battle .support-row,
  .game-battle .enemy-support{min-height:40px}
}
