.market-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.market-subtitle {
  margin-top: 6px;
  color: #c0d4f4;
  font-size: 0.95rem;
  max-width: 700px;
}

.market-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(119, 212, 255, 0.22);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(8, 27, 54, 0.88), rgba(10, 33, 62, 0.7));
}

.market-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.market-asset-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(119, 212, 255, 0.22);
  background: rgba(0, 165, 239, 0.08);
  font-weight: 800;
  color: #f3f8ff;
}

.market-summary {
  margin: 18px 0 14px;
  color: #cfe1ff;
  font-size: 0.95rem;
}

.offer-cards {
  display: grid;
  gap: 12px;
}

.offer-empty {
  padding: 18px;
  border: 1px dashed rgba(119, 212, 255, 0.28);
  border-radius: 20px;
  background: rgba(6, 23, 43, 0.55);
  color: #cfe1ff;
}

.offer-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(119, 212, 255, 0.22);
  background: linear-gradient(160deg, rgba(10, 28, 56, 0.94), rgba(9, 20, 39, 0.92));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.offer-card-top,
.offer-card-price-row,
.offer-card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.offer-card-user {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.offer-card-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1fa9ff, #0b6fb8);
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 14px rgba(14, 126, 201, 0.32);
}

.offer-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.offer-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.offer-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(55, 211, 153, 0.14);
  border: 1px solid rgba(94, 233, 181, 0.28);
  color: #9ef3cc;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.offer-card-meta {
  margin-top: 4px;
  color: #9db4d8;
  font-size: 0.82rem;
}

.offer-card .action-btn {
  cursor: pointer;
  border-radius: 14px;
  border: 0;
  background: #ff6a7c;
  padding: 11px 18px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 16px rgba(255, 106, 124, 0.22);
  min-width: 114px;
}

.offer-card .action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.offer-card-price-row {
  margin-top: 12px;
}

.offer-card-price {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.offer-card-price small {
  font-size: 0.82rem;
  font-weight: 700;
  color: #a8bedf;
}

.offer-card-price-sub {
  margin-top: 5px;
  color: #a9c0e0;
  font-size: 0.86rem;
}

.offer-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.offer-card-stat {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(119, 212, 255, 0.18);
  background: rgba(8, 27, 52, 0.55);
}

.offer-card-stat span {
  display: block;
  color: #80a5d1;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.offer-card-stat strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 0.96rem;
}

.offer-card-methods,
.payment-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-card-methods {
  margin-top: 12px;
}

.payment-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(119, 212, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #e5f0ff;
  font-size: 0.78rem;
}

.payment-tag-muted {
  border-style: dashed;
  color: #a7bddc;
}

.offer-card-footer {
  margin-top: 12px;
}

.offer-card-note {
  color: #9cb3d6;
  font-size: 0.84rem;
  max-width: 60ch;
}

.trade-intent-modal-content {
  max-width: 500px;
  padding: 18px;
}

.trade-intent-head {
  margin-bottom: 10px;
}

.trade-intent-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(119, 212, 255, 0.2);
  background: linear-gradient(145deg, rgba(9, 31, 59, 0.92), rgba(9, 19, 37, 0.92));
}

.trade-intent-price-box {
  min-width: 138px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(119, 212, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  text-align: right;
}

.trade-intent-price-box span {
  display: block;
  color: #89a8d1;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trade-intent-price-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
  color: #72ffc7;
}

.trade-intent-meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trade-meta-item {
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(119, 212, 255, 0.18);
  background: rgba(8, 27, 52, 0.55);
}

.trade-meta-item span {
  display: block;
  color: #80a5d1;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trade-meta-item strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 0.98rem;
}

.trade-intent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.trade-intent-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(119, 212, 255, 0.18);
  background: rgba(8, 27, 52, 0.55);
}

.trade-intent-field.trade-intent-primary {
  order: 0;
  border-color: rgba(94, 233, 181, 0.35);
  background: linear-gradient(160deg, rgba(7, 35, 47, 0.78), rgba(8, 27, 52, 0.55));
}

.trade-intent-field.trade-intent-secondary {
  order: 1;
  opacity: 0.96;
}

.trade-intent-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(119, 212, 255, 0.22);
  background: rgba(2, 10, 24, 0.55);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

.trade-intent-output {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(119, 212, 255, 0.22);
  background: rgba(2, 10, 24, 0.55);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.trade-intent-field.trade-intent-secondary input {
  font-size: 1.2rem;
}

.trade-intent-field.trade-intent-secondary .trade-intent-output {
  font-size: 1.2rem;
}

.trade-intent-field input[readonly] {
  cursor: default;
}

.trade-intent-methods-block {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(119, 212, 255, 0.18);
  background: rgba(8, 27, 52, 0.55);
}

.trade-intent-methods-title {
  display: block;
  color: #89a8d1;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.trade-intent-methods-note {
  display: block;
  margin-top: 6px;
  color: #9eb8dc;
  font-size: 0.84rem;
}

.trade-intent-methods-block .payment-tag-list {
  gap: 6px;
  margin-top: 8px;
}

.trade-intent-methods-block .payment-tag {
  padding: 6px 9px;
  font-size: 0.78rem;
}

.intent-error {
  margin-top: 8px;
  color: #ff9ca7;
  font-weight: 700;
}

.trade-intent-modal-content > .offer-field-hint {
  margin-top: 10px;
}

.trade-intent-modal-content > .primary-btn.full {
  margin-top: 10px;
  min-height: 48px;
}

.action-btn:focus-visible,
.payment-tag:focus-visible {
  outline: 2px solid rgba(111, 198, 255, 0.88);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .market-header,
  .market-toolbar,
  .offer-card-top,
  .offer-card-price-row,
  .offer-card-footer,
  .trade-intent-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .market-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .offer-card-grid,
  .trade-intent-meta {
    grid-template-columns: 1fr;
  }

  .offer-card .action-btn {
    width: 100%;
  }
}

#view-market .panel {
  background: #f5f7fb;
  border-color: rgba(16, 24, 40, 0.08);
  color: #111827;
}

#view-market .market-title,
#view-market h3 {
  color: #111827;
}

#view-market .market-subtitle,
#view-market .market-summary {
  color: #667085;
}

.market-toolbar {
  border-radius: 8px;
  border-color: rgba(16, 24, 40, 0.08);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.market-asset-pill {
  min-height: 40px;
  border-radius: 6px;
  border-color: rgba(12, 190, 151, 0.24);
  background: rgba(12, 190, 151, 0.08);
  color: #087961;
}

.market-filters input,
.market-filters select,
#tradeIntentReceiveMethod {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  background: #ffffff;
  color: #111827;
}

.market-filters input {
  width: 154px;
  padding: 0 12px;
}

.market-filters select {
  min-width: 150px;
}

.offer-cards {
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.offer-empty {
  border-radius: 8px;
  border-color: rgba(16, 24, 40, 0.16);
  background: #ffffff;
  color: #475467;
}

.offer-card {
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) 160px minmax(190px, 0.9fr) minmax(170px, 1fr) 116px;
  grid-template-areas: "merchant price stats methods action" "note note note note note";
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.offer-card:last-child {
  border-bottom: 0;
}

.offer-card-top {
  display: contents;
}

.offer-card-user {
  grid-area: merchant;
}

.offer-card-avatar {
  border-radius: 50%;
  background: #344054;
  box-shadow: none;
}

.offer-card-name,
.offer-card-price,
.offer-card-stat strong {
  color: #111827;
}

.offer-card-meta,
.offer-card-price-sub,
.offer-card-note {
  color: #667085;
}

.offer-card-price-row {
  grid-area: price;
  margin: 0;
}

.offer-card-price {
  font-size: 1.45rem;
}

.offer-card-grid {
  grid-area: stats;
  grid-template-columns: 1fr;
  margin: 0;
}

.offer-card-stat {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.offer-card-stat span {
  color: #98a2b3;
}

.offer-card-methods {
  grid-area: methods;
  margin: 0;
}

.payment-tag {
  border-radius: 999px;
  border-color: rgba(12, 190, 151, 0.18);
  background: rgba(12, 190, 151, 0.08);
  color: #087961;
}

.payment-tag-muted {
  border-color: rgba(102, 112, 133, 0.22);
  background: #f2f4f7;
  color: #667085;
}

.offer-card-footer {
  grid-area: note;
  margin-top: 0;
  padding-top: 4px;
}

.offer-card .action-btn {
  grid-area: action;
  justify-self: end;
  min-height: 40px;
  border-radius: 6px;
  background: #12b76a;
  box-shadow: none;
}

#tabSell.active ~ * .action-btn,
body:has(#tabSell.active) .offer-card .action-btn {
  background: #f04438;
}

.offer-card-badge {
  border-radius: 999px;
  border-color: rgba(12, 190, 151, 0.24);
  background: rgba(12, 190, 151, 0.08);
  color: #087961;
}

.trade-intent-methods-block select {
  width: 100%;
  margin-top: 8px;
  padding: 0 12px;
}

.trade-stepper {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.trade-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(119, 212, 255, 0.16);
  background: rgba(8, 27, 52, 0.42);
}

.trade-step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 800;
}

.trade-step strong {
  color: #f8fbff;
}

.trade-step p {
  margin-top: 2px;
  color: #9eb8dc;
  font-size: 0.82rem;
}

.trade-step.complete .trade-step-dot,
.trade-step.active .trade-step-dot {
  background: #12b76a;
  color: #06281a;
}

.trade-step.active {
  border-color: rgba(18, 183, 106, 0.38);
}

.trade-step.warning .trade-step-dot {
  background: #fdb022;
  color: #2d1c00;
}

.trade-step.danger .trade-step-dot {
  background: #f04438;
  color: #ffffff;
}

.trade-step.muted {
  opacity: 0.62;
}

@media (max-width: 1180px) {
  .offer-card {
    grid-template-columns: minmax(220px, 1fr) 150px minmax(180px, 1fr) 112px;
    grid-template-areas: "merchant price stats action" "methods methods methods methods" "note note note note";
  }
}

@media (max-width: 860px) {
  .market-filters input,
  .market-filters select {
    width: 100%;
    min-width: 0;
  }

  .offer-card {
    grid-template-columns: 1fr;
    grid-template-areas: "merchant" "price" "stats" "methods" "action" "note";
    border-radius: 0;
  }

  .offer-card .action-btn {
    justify-self: stretch;
  }
}
