/* CrateMarket Step 19 R9 production — Market Alert result flow and native keyboard/zoom safety. */

/* Native app displays use a fixed responsive scale. Browser accessibility remains unchanged. */
html.crate-market-android,
html.crate-market-ios {
  max-width: 100% !important;
  overflow-x: hidden !important;
  touch-action: pan-y !important;
}
html.crate-market-android body,
html.crate-market-ios body {
  max-width: 100% !important;
  overflow-x: hidden !important;
  touch-action: pan-y !important;
}
html.crate-market-android input,
html.crate-market-android textarea,
html.crate-market-android select,
html.crate-market-android .cm-chat-input,
html.crate-market-ios input,
html.crate-market-ios textarea,
html.crate-market-ios select,
html.crate-market-ios .cm-chat-input {
  font-size: 16px !important;
}

/* Global Chat follows the actual visual viewport above native keyboards. */
html.crate-market-android .cm-global-chat-shell.mobile,
html.crate-market-ios .cm-global-chat-shell.mobile {
  top: var(--cm-native-visible-top, 0px) !important;
  left: var(--cm-native-visible-left, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  width: var(--cm-native-visible-width, 100vw) !important;
  height: var(--cm-native-visible-height, 100dvh) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100vw !important;
  max-height: var(--cm-native-visible-height, 100dvh) !important;
  overflow: hidden !important;
}
html.crate-market-android .cm-chat-compose-row,
html.crate-market-ios .cm-chat-compose-row {
  min-width: 0 !important;
  width: 100% !important;
}
html.crate-market-android .cm-chat-input,
html.crate-market-ios .cm-chat-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  touch-action: pan-y !important;
}
html.crate-market-android .cm-chat-send,
html.crate-market-ios .cm-chat-send {
  flex: 0 0 auto !important;
}
html.crate-market-android .cm-chat-messages,
html.crate-market-ios .cm-chat-messages {
  min-height: 0 !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

/* Market Alert footer actions. */
.market-alert-dialog-foot {
  gap: 12px !important;
}
.market-alert-footer-actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 9px;
  min-width: min(100%, 330px);
}
.market-alert-footer-actions .btn {
  min-height: 42px;
  white-space: normal;
  line-height: 1.2;
}
.market-alert-footer-actions [data-disable-market-alert] {
  flex: 1 1 170px;
  border-color: rgba(244,199,111,.45) !important;
  background: rgba(244,199,111,.10) !important;
  color: #f4d992 !important;
}
.market-alert-footer-actions [data-close-market-alert] {
  flex: 0 1 120px;
}

/* The nested action layer sits above Market Alert without rebuilding or closing it. */
.market-alert-action-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5,4,10,.78);
  backdrop-filter: blur(7px);
}
.market-alert-action-layer[hidden] { display: none !important; }
.market-alert-action-card {
  width: min(480px, 100%);
  max-height: min(88dvh, 720px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(168,132,255,.48);
  border-radius: 19px;
  background: linear-gradient(145deg,#1b1428,#0f0c18);
  color: #fff;
  box-shadow: 0 24px 72px rgba(0,0,0,.58);
}
.market-alert-action-card.success {
  border-color: rgba(86,218,165,.52);
  box-shadow: 0 24px 72px rgba(0,0,0,.58), inset 0 3px 0 rgba(86,218,165,.72);
}
.market-alert-action-card.error {
  border-color: rgba(255,112,139,.52);
}
.market-alert-action-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 17px;
  background: rgba(255,255,255,.07);
  font-size: 31px;
}
.market-alert-action-card h3 { margin: 0 0 8px; font-size: 1.25rem; }
.market-alert-action-card > p { margin: 0; color: #c9c0d8; line-height: 1.55; }
.market-alert-sale-item {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid rgba(168,132,255,.20);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}
.market-alert-sale-item .icon { font-size: 30px; }
.market-alert-sale-item strong,
.market-alert-sale-item span { display: block; }
.market-alert-sale-item span { margin-top: 3px; color: #b8aec8; font-size: .78rem; text-transform: capitalize; }
.market-alert-sale-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
  margin-top: 14px;
}
.market-alert-sale-fact {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
}
.market-alert-sale-fact span { display: block; color: #a99eb8; font-size: .69rem; }
.market-alert-sale-fact strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.market-alert-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
.market-alert-action-buttons .btn { min-height: 42px; min-width: 106px; }
.market-alert-item.processing [data-market-sell-all],
.market-alert-item.processing [data-market-list-online] { cursor: wait; }

@media (max-width: 560px) {
  .market-alert-dialog-foot { align-items: stretch !important; }
  .market-alert-footer-actions { width: 100%; min-width: 0; }
  .market-alert-footer-actions .btn { padding-inline: 9px !important; font-size: .73rem !important; }
  .market-alert-sale-grid { grid-template-columns: 1fr; }
}
@media (max-width: 350px) {
  .market-alert-footer-actions { flex-direction: column; }
  .market-alert-footer-actions .btn { width: 100%; flex: none; }
  .market-alert-action-buttons { flex-direction: column-reverse; }
  .market-alert-action-buttons .btn { width: 100%; }
}
