/* ─── Marketplace trade card (pair page rail) ─── */
.mk-trade-rail,
.mk-mkt-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(calc(100vh - 4rem), 960px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--mk-panel-border, rgba(255, 255, 255, 0.07));
  border-radius: 10px;
  background: rgba(10, 9, 8, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 32px rgba(0, 0, 0, 0.28);
}

.mk-mkt-shell::before,
.mk-mkt-shell::after {
  display: none !important;
}

.mk-mkt-card {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 680px;
  transition: opacity 0.2s ease;
}

.mk-mkt-card.is-refreshing,
.mk-mkt-card.is-tick-switching {
  opacity: 0.88;
}

.mk-mkt-card.is-tick-switching #mk-mkt-kpis-wrap,
.mk-mkt-card.is-tick-switching #mk-mkt-book-zone {
  opacity: 0.55;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mk-mkt-switch-badge {
  margin-left: 0.4rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--orange-bright);
  animation: mk-pulse 1.4s ease-in-out infinite;
  opacity: 0.85;
}

.mk-mkt-book-scroll.is-refreshing {
  opacity: 0.92;
  transition: opacity 0.15s ease;
}

/* Header */
.mk-mkt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mk-mkt-card-title {
  font-family: var(--syne, 'Syne', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cream);
}

.mk-mkt-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mk-mkt-refresh {
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
}

.mk-mkt-refresh.is-spinning {
  animation: mk-mkt-spin 0.8s linear infinite;
  color: var(--orange-bright);
}

@keyframes mk-mkt-spin {
  to { transform: rotate(360deg); }
}

.mk-mkt-wallet-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.75rem 0.45rem;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.mk-mkt-connect {
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
  border: 1px solid rgba(232, 93, 4, 0.45);
  background: rgba(232, 93, 4, 0.1);
  color: var(--orange-bright);
  font-weight: 600;
  font-size: 0.62rem;
  cursor: pointer;
}

.mk-mkt-disconnect {
  padding: 0.15rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.58rem;
  cursor: pointer;
}

.mk-mkt-addr { color: rgba(255, 255, 255, 0.7); }

.mk-mkt-chart-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.58rem;
  cursor: pointer;
}

/* KPI strip */
.mk-mkt-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mk-mkt-kpi {
  min-width: 0;
  padding: 0.35rem 0.4rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
}

.mk-mkt-kpi-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  margin-bottom: 0.15rem;
}

.mk-mkt-kpi-val {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mk-mkt-kpi-val--ask { color: #5a9a6e; }
.mk-mkt-kpi-val--spread { color: rgba(34, 211, 238, 0.85); font-size: 0.62rem; }

/* Tabs + segment */
.mk-mkt-rail-tabs {
  display: flex;
  gap: 0;
  padding: 0 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mk-mkt-rail-tab {
  flex: 1;
  padding: 0.45rem 0.25rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.mk-mkt-rail-tab.active {
  color: var(--orange-bright);
  border-bottom-color: var(--orange-bright);
}

.mk-mkt-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem 0;
}

.mk-mkt-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0.5rem;
  padding: 2px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mk-mkt-segment-btn {
  padding: 0.38rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mk-mkt-segment-btn.active.buy {
  background: rgba(90, 154, 110, 0.22);
  color: #7ec492;
}

.mk-mkt-segment-btn.active.sell {
  background: rgba(224, 85, 85, 0.18);
  color: #f08080;
}

/* Toolbar filter */
.mk-mkt-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.mk-mkt-filter-input {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.mk-mkt-filter-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

/* Order book scroll area */
.mk-mkt-book-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.mk-mkt-book-scroll::-webkit-scrollbar {
  width: 5px;
}

.mk-mkt-book-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.mk-mkt-book-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.mk-mkt-book-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.mk-mkt-book-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.3rem 0.25rem;
  text-align: right;
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  background: rgba(10, 9, 8, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mk-mkt-book-table thead th:first-child,
.mk-mkt-book-table thead th:nth-child(2) {
  text-align: left;
}

.mk-mkt-book-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.12s;
}

.mk-mkt-book-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.mk-mkt-book-table tbody tr.is-selected {
  background: rgba(90, 154, 110, 0.08);
}

.mk-mkt-book-table tbody tr.is-mine {
  background: rgba(232, 93, 4, 0.05);
}

.mk-mkt-book-table td {
  padding: 0.38rem 0.25rem;
  vertical-align: middle;
  text-align: right;
}

.mk-mkt-book-table td:first-child {
  width: 1.1rem;
  text-align: center;
}

.mk-mkt-book-table td:nth-child(2) {
  text-align: left;
}

.mk-mkt-lot-check {
  width: 0.75rem;
  height: 0.75rem;
  accent-color: #5a9a6e;
  cursor: pointer;
}

.mk-mkt-row-price {
  color: #7ec492;
  font-weight: 600;
  font-size: 0.64rem;
}

.mk-mkt-row-price sub {
  display: block;
  font-size: 0.48rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.28);
}

.mk-mkt-row-qty {
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
}

.mk-mkt-row-qty sub {
  display: block;
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.28);
}

.mk-mkt-row-total {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.6rem;
}

.mk-mkt-show-more {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0.15rem;
  padding: 0.35rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--mono);
  font-size: 0.58rem;
  cursor: pointer;
}

.mk-mkt-show-more:hover {
  border-color: rgba(232, 93, 4, 0.35);
  color: var(--orange-bright);
}

/* Selection slider */
.mk-mkt-select-wrap {
  flex-shrink: 0;
  margin: 0.45rem 0 0;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mk-mkt-select-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 0.3rem;
}

.mk-mkt-select-head strong { color: #7ec492; }

.mk-mkt-select-range {
  width: 100%;
  height: 3px;
  appearance: none;
  border-radius: 2px;
  background: linear-gradient(90deg, #5a9a6e var(--pct, 0%), rgba(255,255,255,0.1) var(--pct, 0%));
  outline: none;
  cursor: pointer;
}

.mk-mkt-select-range::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5a9a6e;
  border: 2px solid #0c0b0a;
  cursor: grab;
}

.mk-mkt-select-sum {
  margin: 0.3rem 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: #7ec492;
}

.mk-mkt-select-sum--muted { color: rgba(255, 255, 255, 0.28); }

/* Sticky footer */
.mk-mkt-card-foot {
  flex-shrink: 0;
  padding: 0.55rem 0.75rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 7, 6, 0.95);
}

.mk-mkt-bal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.mk-mkt-bal-pill {
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.38);
}

.mk-mkt-bal-pill strong {
  color: var(--cream);
  font-weight: 600;
}

.mk-mkt-submit {
  width: 100%;
  padding: 0.55rem;
  border: none;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mk-mkt-submit.buy {
  background: linear-gradient(180deg, #6aad7e, #4d8a5f);
  color: #0c0b0a;
}

.mk-mkt-submit.sell {
  background: linear-gradient(180deg, #e86868, #c94444);
  color: #fff;
}

.mk-mkt-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Sell form */
.mk-mkt-form { padding: 0.25rem 0 0.5rem; }

.mk-mkt-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.mk-mkt-type {
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--mono);
  font-size: 0.6rem;
  cursor: pointer;
}

.mk-mkt-type.active {
  border-color: rgba(232, 93, 4, 0.35);
  color: var(--orange-bright);
}

.mk-mkt-field {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.4);
}

.mk-mkt-input,
.mk-mkt-select {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.4rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.mk-mkt-stats-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 0.35rem;
}

.mk-mkt-stats-row strong { color: rgba(255, 255, 255, 0.75); }

.mk-mkt-hint {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0.25rem 0;
}

.mk-mkt-err { color: #e86868; font-size: 0.6rem; margin-top: 0.3rem; }
.mk-mkt-ok { color: #7ec492; font-size: 0.6rem; margin-top: 0.3rem; }
.mk-mkt-empty { font-size: 0.62rem; color: rgba(255, 255, 255, 0.35); padding: 1rem 0; text-align: center; }
.mk-mkt-empty--disabled { color: rgba(251, 191, 36, 0.75); }
.mk-mkt-disabled {
  padding: 1rem 0.85rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
}
.mk-mkt-disabled strong {
  display: block;
  color: rgba(251, 191, 36, 0.9);
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

/* Skeleton */
.mk-mkt-book-skel { padding: 0.25rem 0; }
.mk-mkt-skel-row {
  height: 1.6rem;
  margin-bottom: 0.3rem;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: mk-mkt-shimmer 1.4s ease-in-out infinite;
}

@keyframes mk-mkt-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Orders table in rail */
.mk-mkt-orders-table { font-size: 0.6rem; width: 100%; }
.mk-mkt-order-btn {
  padding: 0.15rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: transparent;
  color: var(--cream);
  font-size: 0.55rem;
  cursor: pointer;
}
.mk-mkt-order-btn.danger { color: #e86868; border-color: rgba(224, 85, 85, 0.3); }
.mk-mkt-order-actions { display: flex; gap: 0.25rem; flex-wrap: wrap; }

/* Market history tab pager */
.mk-mkt-history-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0 0.25rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.38);
}

.mk-mkt-history-more {
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 0.58rem;
  cursor: pointer;
}

.mk-mkt-history-more:hover:not(:disabled) {
  border-color: rgba(232, 93, 4, 0.35);
  color: var(--orange-bright);
}

.mk-mkt-history-more:disabled { opacity: 0.45; cursor: wait; }

/* Modal */
.mk-mkt-modal-root[hidden] {
  display: none !important;
  pointer-events: none;
  backdrop-filter: none;
}

body.mk-mkt-modal-open { overflow: hidden; }

.mk-mkt-modal-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);
}

.mk-mkt-modal {
  width: min(420px, 100%);
  max-height: min(90vh, 560px);
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 11, 10, 0.98);
}

.mk-mkt-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mk-mkt-modal-head h3 {
  margin: 0;
  font-size: 0.9rem;
  font-family: var(--syne, 'Syne', sans-serif);
}

.mk-mkt-modal-x {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.2rem;
  cursor: pointer;
}

.mk-mkt-modal-body { padding: 1rem; }
.mk-mkt-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mk-mkt-modal-cancel,
.mk-mkt-modal-confirm {
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.68rem;
  cursor: pointer;
}

.mk-mkt-modal-cancel {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
}

.mk-mkt-modal-confirm {
  border: none;
  background: #5a9a6e;
  color: #0c0b0a;
  font-weight: 600;
}

.mk-mkt-modal-confirm--danger { background: #e05555; color: #fff; }
.mk-mkt-modal-err { color: #e05555; font-size: 0.68rem; }
.mk-mkt-modal-list {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  font-family: var(--mono);
  font-size: 0.65rem;
}

.mk-mkt-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  pointer-events: none;
}

.mk-mkt-toast--ok { background: rgba(90, 154, 110, 0.95); color: #0c0b0a; }
.mk-mkt-toast--err { background: rgba(224, 85, 85, 0.95); color: #fff; }

/* Chart depth strip (unchanged, subtler) */
.mk-depth-strip { height: 44px; margin: 0.35rem 0; overflow: hidden; }
.mk-depth-strip-inner { display: flex; align-items: flex-end; height: 100%; gap: 2px; }
.mk-depth-bar {
  flex: 1;
  min-width: 4px;
  border: none;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.25), rgba(34, 211, 238, 0.06));
  cursor: pointer;
  padding: 0;
}
.mk-depth-bar-fill {
  display: block;
  width: 100%;
  height: var(--mk-depth-w, 20%);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.3), rgba(34, 211, 238, 0.06));
}
.mk-depth-strip-label {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  margin-bottom: 0.15rem;
}

.mk-layer-chip {
  padding: 0.2rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--mono);
  font-size: 0.58rem;
  cursor: pointer;
}
.mk-layer-chip.active {
  border-color: rgba(232, 93, 4, 0.35);
  color: var(--orange-bright);
}

.mk-market-empty {
  padding: 1.5rem 0.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.68rem;
}

@media (min-width: 900px) {
  .mk-pair-split--auction {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: var(--mk-space-md);
    min-height: min(78vh, 680px);
  }
  .mk-trade-rail, .mk-mkt-shell {
    position: sticky;
    top: 5rem;
  }
}

@media (max-width: 899px) {
  .mk-pair-page--cex .mk-trade-rail,
  .mk-pair-page--cex .mk-mkt-shell {
    max-height: none;
    border-radius: var(--mk-radius, 10px);
  }

  .mk-pair-page--cex .mk-mkt-card {
    min-height: 0;
  }

  .mk-pair-page--cex .mk-mkt-ladder-side--asks,
  .mk-pair-page--cex .mk-mkt-ladder-side--bids {
    max-height: 160px;
  }
}

/* CEX order book + limit form */
.mk-mkt-body--cex {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
}

.mk-mkt-cex-form {
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mk-mkt-order-type {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.mk-mkt-order-type-btn {
  flex: 1;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--mono);
  font-size: 0.58rem;
  cursor: pointer;
}

.mk-mkt-order-type-btn.active {
  border-color: rgba(232, 93, 4, 0.45);
  color: var(--cream);
  background: rgba(232, 93, 4, 0.08);
}

.mk-mkt-input--readonly {
  opacity: 0.75;
  cursor: default;
}

.mk-mkt-pct-row {
  display: flex;
  gap: 0.25rem;
  margin: 0.35rem 0 0.45rem;
}

.mk-mkt-pct-btn {
  flex: 1;
  padding: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--mono);
  font-size: 0.52rem;
  cursor: pointer;
}

.mk-mkt-pct-btn.active {
  border-color: rgba(90, 154, 110, 0.5);
  color: #7ec492;
}

.mk-mkt-kpi-val--bid { color: #7ec492; }

.mk-mkt-book-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 0.15rem;
}

.mk-mkt-book-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.48rem;
}

.mk-mkt-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.15rem;
}

.mk-mkt-dot--ask { background: #e85d5d; }
.mk-mkt-dot--bid { background: #5a9a6e; }

.mk-mkt-book-scroll--cex { max-height: 240px; }

.mk-mkt-book-table--cex .mk-mkt-row-price--ask { color: #e88a8a; }
.mk-mkt-book-table--cex .mk-mkt-row-price--bid { color: #7ec492; }

.mk-mkt-book-row--ask.is-selected { background: rgba(232, 93, 93, 0.06); }
.mk-mkt-action-type {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.mk-mkt-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mk-mkt-action-btn.active {
  border-color: rgba(232, 93, 4, 0.45);
  background: rgba(232, 93, 4, 0.08);
}

.mk-mkt-action-title {
  font-family: var(--syne, 'Syne', sans-serif);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--cream);
}

.mk-mkt-action-sub {
  font-family: var(--mono);
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.3;
}

.mk-mkt-mode-desc {
  margin: 0 0 0.45rem;
  font-family: var(--mono);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.45;
}

.mk-mkt-step-list {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
  font-family: var(--mono);
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}

.mk-mkt-ins-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
}

.mk-mkt-ins-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.55rem;
  cursor: pointer;
}

.mk-mkt-ins-row.is-selected {
  border-color: rgba(90, 154, 110, 0.45);
  background: rgba(90, 154, 110, 0.08);
}

.mk-mkt-fill-preview {
  margin: 0.35rem 0 0.45rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  background: rgba(90, 154, 110, 0.06);
  border: 1px solid rgba(90, 154, 110, 0.15);
}

.mk-mkt-fill-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.45);
}

.mk-mkt-fill-preview-head strong {
  color: #7ec492;
  font-size: 0.62rem;
}

.mk-mkt-fill-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mk-mkt-fill-list li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.2rem 0;
  font-family: var(--mono);
  font-size: 0.52rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.mk-mkt-fill-arrow { color: rgba(255, 255, 255, 0.25); }
.mk-mkt-fill-payout { color: #7ec492; font-weight: 600; }

.mk-mkt-link-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--orange-bright);
  font-family: var(--mono);
  font-size: 0.52rem;
  cursor: pointer;
  text-decoration: underline;
}

.mk-mkt-hint--warn { color: #e8a85d; }
.mk-mkt-hint--muted { color: rgba(255, 255, 255, 0.28); }

.mk-mkt-book-row--bid.is-clickable { cursor: pointer; }
.mk-mkt-book-row--bid.is-clickable:hover { background: rgba(80, 200, 120, 0.08); }

.mk-mkt-ladder-hint {
  font-weight: 400;
  opacity: 0.55;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* CEX ladder — red sells on top, green buys below, spread pinned */
.mk-mkt-ladder {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.mk-mkt-ladder-side {
  min-height: 0;
}

.mk-mkt-ladder-side--asks {
  background: linear-gradient(180deg, rgba(232, 93, 93, 0.06) 0%, transparent 100%);
  max-height: 220px;
  overflow-y: auto;
}

.mk-mkt-ladder-side--bids {
  background: linear-gradient(0deg, rgba(90, 154, 110, 0.08) 0%, transparent 100%);
  max-height: 220px;
  overflow-y: auto;
}

.mk-mkt-ladder-label {
  padding: 0.3rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mk-mkt-ladder-label--ask { color: #e88a8a; background: rgba(232, 93, 93, 0.08); }
.mk-mkt-ladder-label--bid { color: #7ec492; background: rgba(90, 154, 110, 0.1); }

.mk-mkt-ladder-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.58rem;
}

.mk-mkt-ladder-table thead th {
  padding: 0.15rem 0.45rem;
  font-size: 0.48rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.28);
  text-align: left;
}

.mk-mkt-ladder-table tbody td {
  padding: 0.22rem 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.mk-mkt-ladder-chk { width: 1.4rem; }

.mk-mkt-ladder-price { width: 38%; }
.mk-mkt-ladder-qty { text-align: right; color: rgba(255, 255, 255, 0.55); }

.mk-mkt-ladder-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.52rem;
  padding: 0.5rem !important;
}

.mk-mkt-ladder-spread {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mk-mkt-ladder-spread-val {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cream);
}

.mk-mkt-ladder-spread-hint {
  font-family: var(--mono);
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.35);
}

.mk-mkt-action-type--simple .mk-mkt-action-btn {
  flex: 1;
  padding: 0.4rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  text-align: center;
}

.mk-mkt-select-wrap--compact {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: none;
}

.mk-mkt-toolbar--compact {
  margin-bottom: 0.35rem;
}

.mk-mkt-body--cex #mk-mkt-form-zone {
  margin-top: 0.35rem;
}

.mk-mkt-book-spread td {
  text-align: center !important;
  padding: 0.25rem;
  font-family: var(--mono);
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.28);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: default;
}

.mk-mkt-hint--bid { color: rgba(126, 196, 146, 0.75); }
.mk-mkt-order-row--bid td:first-child { color: #7ec492; }
