/* ==========================================================================
   Avezz Marketplace — Unified Styles (Browser, Friends/Teams, Item, Flow, Orders)
   Layered on tokens.css -> base.css -> ui-kit.css -> nav.css
   ========================================================================== */

:root {
  --mk-price: #059669;
  --mk-price-bg: #ecfdf5;
  --mk-rose: #e11d48;
  --mk-rose-bg: rgba(225, 29, 72, 0.1);
  --mk-violet: #7c3aed;
  --mk-violet-bg: rgba(124, 58, 237, 0.1);
  --mk-stack-bg: #cdd3dc;
  --mk-stack-border: rgba(15, 23, 42, 0.08);
  --mk-stack-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
  --mk-bright-step: 0.022;
  --ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --mk-price: #34d399;
  --mk-price-bg: rgba(16, 185, 129, 0.14);
  --mk-rose: #fb7185;
  --mk-rose-bg: rgba(251, 113, 133, 0.14);
  --mk-violet: #a78bfa;
  --mk-violet-bg: rgba(167, 139, 250, 0.14);
  --mk-stack-bg: #363840;
  --mk-stack-border: rgba(255, 255, 255, 0.09);
  --mk-stack-shadow: 0 2px 8px rgba(0, 0, 0, 0.36);
  --mk-bright-step: -0.055;
}

.num { font-variant-numeric: tabular-nums; }

main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ---------- Shared Market Browser Shell (UI/market.html & UI/friends-market.html) ---------- */
.mk-stage {
  width: 100%;
  max-width: 1380px;
  min-width: 0;
  margin: 0 auto;
  padding: 16px 16px 60px;
  overflow-x: clip;
}

.mk-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}

.mk-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mk-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.mk-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mk-price);
  flex-shrink: 0;
}

.mk-brand-dot--people { background: var(--mk-rose); }

.mk-count-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}

.mk-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mk-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mk-search-wrap .icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.mk-search-input {
  width: 210px;
  height: 34px;
  padding: 0 11px 0 30px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mk-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.mk-select {
  height: 34px;
  padding: 0 26px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.mk-type-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 4px;
  min-width: 0;
  max-width: 100%;
}
.mk-type-bar::-webkit-scrollbar { display: none; }

.mk-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mk-type-pill:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.mk-type-pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  border-color: var(--pill-active-bg);
}

.mk-tags-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.mk-tags-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  flex: 1;
  min-width: 0;
}
.mk-tags-bar::-webkit-scrollbar { display: none; }

.mk-tags-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.mk-tag-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.mk-tag-pill:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.mk-tag-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 4-Column Market Grid (04 · Gallery Dock Trade Card) ---------- */
.market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 16px;
  min-width: 0;
  max-width: 100%;
}

[data-mk-card] {
  min-width: 0;
  max-width: 100%;
  display: flex;
}

.m-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: visible;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple);
}

.m-card.has-open-menu {
  position: relative;
  z-index: 40;
}

.m-card:hover {
  transform: translateY(-3px);
}

.m-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
  border-radius: 17px 17px 0 0;
  overflow: hidden;
}

.m-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 44%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.52), transparent);
  pointer-events: none;
}

.m-media-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.m-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s var(--ease-apple);
}

.m-card:hover .m-media img { transform: scale(1.04); }

.m-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-alt), var(--surface-hover));
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 700;
}

.m-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.m-body {
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.m-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  display: block;
}

.m-title:hover { color: var(--accent); }

.m-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.m-price {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 8px;
  background: var(--mk-price-bg);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -0.02em;
  color: var(--mk-price);
  white-space: nowrap;
}

.m-stock {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-eval-row {
  font-size: 12px;
  color: var(--text-secondary);
}

.m-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 650;
  color: var(--text);
}

.m-rating .icon {
  width: 13px;
  height: 13px;
  color: var(--star);
}

.m-rating-count {
  color: var(--text-tertiary);
  font-weight: 500;
}

.m-sold {
  color: var(--text-tertiary);
  font-weight: 550;
  white-space: nowrap;
}

.m-options {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.m-options::-webkit-scrollbar { display: none; }

.m-opt-chip {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--surface-muted);
}

.m-fund-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.m-fund-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.m-fund-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--mk-price);
}

.m-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  background: transparent;
  padding: 0;
}

.m-soc-acts {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  margin: 0;
  background: transparent;
}

.m-soc-btn {
  height: 24px;
  padding: 0 4px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.14s ease, opacity 0.14s ease;
}

.m-soc-btn--icon {
  padding: 0 3px;
}

.m-soc-btn:hover {
  background: transparent;
  color: var(--text);
}

.m-soc-btn.like.active {
  color: var(--accent);
  background: transparent;
}

.m-soc-btn.deslike.active {
  color: var(--mk-rose);
  background: transparent;
}

.m-soc-btn.share.active {
  color: var(--mk-rose);
  background: transparent;
}

.m-seller {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.m-seller:hover { color: var(--text); }

.m-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}

.m-avatar img { width: 100%; height: 100%; object-fit: cover; }

.m-seller-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-tags {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: none;
}

.m-tags::-webkit-scrollbar { display: none; }

.m-tag {
  pointer-events: auto;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s ease;
}

.m-tag:hover {
  background: rgba(15, 23, 42, 0.8);
  text-decoration: none;
}

.m-card-socials {
  padding-top: 8px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mk-card-acts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.m-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 750;
  color: var(--star);
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--pending-bg);
}

.m-rating-pill .icon {
  width: 12px;
  height: 12px;
  color: var(--star);
}

.mk-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-secondary);
}

.mk-empty h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; }
.mk-empty p { margin: 0 0 16px; font-size: 13.5px; }

/* ---------- Friends & Teams Grid (UI/friends-market.html) ---------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 24px;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.p-card-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}

.p-card-wrap.has-open-menu {
  position: relative;
  z-index: 40;
}

.stack-anchor {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding-top: var(--stack-h, 0px);
}

.stack-layer {
  position: absolute;
  left: calc(var(--d) * 5px);
  right: calc(var(--d) * 5px);
  top: calc(var(--stack-h) - (var(--d) * 4px));
  height: 24px;
  border-radius: 14px 14px 0 0;
  background: var(--mk-stack-bg);
  border: 1px solid var(--mk-stack-border);
  box-shadow: var(--mk-stack-shadow);
  filter: brightness(calc(1 + var(--d) * var(--mk-bright-step)));
  transition: transform 0.24s var(--ease-apple);
  pointer-events: none;
}

.p-card-wrap:hover .stack-layer {
  transform: translateY(calc(-1.5px * var(--d)));
}

.p-card {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px 12px;
  gap: 9px;
  box-shadow: var(--shadow);
  transition: transform 0.22s var(--ease-apple), box-shadow 0.22s var(--ease-apple), border-color 0.15s ease;
}

.p-card-wrap:hover .p-card {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--border-strong);
}

.p-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.p-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.p-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}

.p-badge--dating { color: var(--mk-rose); background: var(--mk-rose-bg); }
.p-badge--teams { color: var(--accent); background: var(--accent-soft); }
.p-badge--group { color: var(--text-secondary); background: var(--surface-muted); border: 1px solid var(--border); text-transform: none; letter-spacing: 0; }

.p-avatar-wrap {
  position: relative;
  display: block;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  padding: 3px;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}

.p-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.p-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--mk-rose-bg));
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.p-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 100%;
}

.p-name {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  line-height: 1.25;
}
.p-name:hover { color: var(--accent); }

.p-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  justify-content: center;
}

.p-seller-link {
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
}

.p-seller-link:hover {
  color: var(--accent);
}

.p-meta .icon { width: 12px; height: 12px; color: var(--text-tertiary); }
.p-meta .m-rating-pill .icon { color: var(--star); }

.p-reqs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.p-req {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.p-req:hover, .p-req.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  border-color: var(--pill-active-bg);
}

.p-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.p-people-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  flex-shrink: 1;
  text-decoration: none;
}

.p-people-label {
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.1;
  color: var(--text-secondary);
  white-space: nowrap;
}

.p-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.p-footer.p-footer--no-people {
  justify-content: center;
}

.p-footer .action-group {
  gap: 7px;
  flex-shrink: 0;
  margin-left: auto;
}

.p-footer.p-footer--no-people .action-group {
  margin-left: 0;
}

.p-mini-stack {
  display: flex;
  align-items: center;
}

.p-mini-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 8.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-left: -6px;
  text-decoration: none;
  flex-shrink: 0;
}

.p-mini-av:first-child { margin-left: 0; }
.p-mini-av img { width: 100%; height: 100%; object-fit: cover; }

.p-mini-more {
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
  flex-shrink: 0;
}

.p-footer-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* ---------- Market Item Detail (1:1 UI/market-item.html) ---------- */
.mi-page {
  width: 100%;
  max-width: 920px;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow-x: clip;
}

.mi-flow {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}

.mi-carousel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mi-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  user-select: none;
  touch-action: pan-y;
}

.mi-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.36s var(--ease-apple);
}

.mi-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.mi-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mi-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0.92;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.mi-nav-btn:hover { background: var(--surface); opacity: 1; transform: translateY(-50%) scale(1.04); }
.mi-nav-btn--prev { left: 16px; }
.mi-nav-btn--next { right: 16px; }

.mi-counter {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 15, 18, 0.56);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mi-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 15, 18, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mi-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.mi-dot.active { width: 18px; background: #fff; }

.mi-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}
.mi-thumbs::-webkit-scrollbar { display: none; }

.mi-thumb {
  flex: 0 0 84px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: var(--surface-muted);
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 0.16s ease, border-color 0.16s ease;
}

.mi-thumb:hover { opacity: 0.9; }
.mi-thumb.active { opacity: 1; border-color: var(--accent); }
.mi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mi-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 2px;
}

.mi-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mi-eyebrow-left, .mi-eyebrow-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mi-type-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mi-stock-meta {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.mi-seller-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}

.mi-seller-handle {
  font-weight: 600;
  color: var(--text);
}

.mi-seller-inline:hover .mi-seller-handle { color: var(--accent); }

.mi-rating-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.mi-rating-inline .icon { width: 13px; height: 13px; color: var(--star); }

.mi-title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.15;
  color: var(--text);
}

.mi-desc {
  margin: 0;
  max-width: 72ch;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-line;
}

.mi-commerce-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}

.mi-commerce-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mi-price-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mi-price-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mi-price-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mi-price-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.mi-price-amount {
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
}

.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--positive-bg);
  color: var(--positive);
}

.coin-badge--ext {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.mi-upfront-note {
  font-size: 13px;
  color: var(--text-secondary);
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.tier-card:hover { background: var(--surface-hover); }
.tier-card input { position: absolute; opacity: 0; pointer-events: none; }
.tier-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.tier-name { font-size: 13px; font-weight: 600; color: var(--text); }
.tier-price { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.range-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.range-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}

.range-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-num {
  width: 104px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  outline: none;
}

.range-num:focus { border-color: var(--accent); }
.range-slider { width: 100%; accent-color: var(--accent); cursor: pointer; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.spec-cell {
  background: var(--surface-subtle);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.spec-val { font-size: 14px; font-weight: 600; color: var(--text); }
.spec-sub { font-size: 12.5px; color: var(--text-secondary); }

.process-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.process-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-muted);
  padding: 5px 11px;
  border-radius: 999px;
}

.process-step-num {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.step-arrow { color: var(--text-tertiary); font-size: 12px; }

.mi-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.mi-btn-primary {
  height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: background 0.15s ease, transform 0.12s ease;
}

.mi-btn-primary:hover { background: var(--accent-hover, var(--accent)); filter: brightness(1.05); }
.mi-btn-primary:active { transform: scale(0.985); }

/* Tags & Social Actions Bar (1:1 UI/market-item.html) */
.mi-tags-social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.mi-tags-social.has-open-menu { z-index: 40; }

.mi-tag-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.mi-tag-pill {
  height: 29px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.mi-tag-pill:hover { background: var(--surface-hover); color: var(--text); }

.mi-social-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  position: relative;
}

.mi-social-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mi-social-btn--icon { padding: 0 9px; }
.mi-social-btn:hover { background: var(--surface-hover); color: var(--text); }

.mi-social-btn.like.active,
.mi-social-btn.share.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

.mi-social-btn.deslike.active {
  background: var(--mk-rose-bg);
  border-color: color-mix(in srgb, var(--mk-rose) 40%, transparent);
  color: var(--mk-rose);
}

.mi-social-btn.is-starred {
  color: var(--star);
  border-color: color-mix(in srgb, var(--star) 40%, transparent);
  background: color-mix(in srgb, var(--star) 10%, transparent);
}

.mi-social-btn.is-starred .icon { color: var(--star); }

.mi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mi-section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.mi-section-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 6px;
}

/* Apple Minimalist Comments & Ratings Card (1:1 UI/market-item.html) */
.mi-comments-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mi-empty-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.mi-comments-card #RatingsFormless,
.mi-comments-card #RatingsFormless > .card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.mi-comments-card .disc-tree > .tree-branch {
  padding-left: 0;
  padding-top: 0;
  gap: 0;
}

.mi-comments-card .disc-tree > .tree-branch > .tree-rail-hit,
.mi-comments-card .disc-tree > .tree-branch > .tree-item::before,
.mi-comments-card .disc-tree > .tree-branch > .tree-item::after {
  display: none;
}

.mi-comments-card .tree-item-composer {
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.mi-comments-card .disc-composer {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 8px 6px 10px;
  gap: 8px;
}

.mi-comments-card .disc-composer:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}

.mi-comments-card .disc-btn-post {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
}

.mi-comments-card .comment-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 0;
}

.mi-comments-card .tree-item:last-child > .comment-node > .comment-card,
.mi-comments-card #RatingsFormless .comment-node:last-child > .comment-card {
  border-bottom: 0;
  padding-bottom: 2px;
}

.mi-comments-card .comment-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.mi-comments-card .disc-social-btn {
  background: transparent;
  color: var(--text-tertiary);
  padding: 0 6px;
  height: 26px;
  border-radius: 999px;
  font-weight: 500;
}

.mi-comments-card .disc-social-btn:hover {
  background: var(--surface-muted);
  color: var(--accent);
}

.mi-comments-card .comment-node > .tree-branch {
  margin-left: 22px;
  padding-left: 14px;
  padding-top: 8px;
  border-left: 1.5px solid var(--border);
  gap: 8px;
}

.mi-comments-card .comment-node > .tree-branch > .tree-rail-hit,
.mi-comments-card .comment-node > .tree-branch > .tree-item::before,
.mi-comments-card .comment-node > .tree-branch > .tree-item::after {
  display: none;
}

.mi-comments-card .comment-node > .tree-branch .comment-card {
  border-bottom: 0;
  padding: 6px 0;
}

.mi-related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

/* ---------- Market Flow: Staged Create Wizard & Deal Workspace (UI/market-flow.html) ---------- */
.mf-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.mf-modal-backdrop {
  padding: 20px;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mf-modal-card {
  width: 100%;
  max-width: 920px;
  max-height: min(90dvh, 840px);
  padding: 0;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="dark"] .mf-modal-card {
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.65);
}

.flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.flow-card--modal {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  min-height: 0;
}

.flow-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.flow-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  background: var(--surface);
}

.flow-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.flow-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.flow-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.flow-kicker {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.flow-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.flow-stepper::-webkit-scrollbar { display: none; }

.step-sep {
  width: 14px;
  height: 1px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.step-pill:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.step-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.step-pill.done {
  color: var(--text-secondary);
}

.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-pill.active .step-dot { background: var(--accent); color: #fff; }
.step-pill.done .step-dot { background: var(--positive-bg); color: var(--positive); }

.flow-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.flow-step-panel[hidden] { display: none; }

.flow-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
}

.option-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-subtle);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option-card:hover { border-color: var(--border-strong); }
.option-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.option-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.option-card-title { font-size: 13.5px; font-weight: 750; color: var(--text); }
.option-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.flow-callout {
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.flow-callout--warn {
  background: var(--pending-bg);
  color: var(--pending);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mf-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mf-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.mf-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.mf-switch-info strong { display: block; font-size: 13px; color: var(--text); }
.mf-switch-info span { font-size: 12px; color: var(--text-secondary); }

.mf-list-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mf-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mf-list-row input { flex: 1; }

.mf-kv-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.mf-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.mf-kv-row:last-child { border-bottom: none; }
.mf-kv-row span { color: var(--text-secondary); }
.mf-kv-row strong { color: var(--text); text-align: right; }

.flow-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.flow-footer-meta {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.flow-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

@media (max-width: 640px) {
  .mf-modal-backdrop { padding: 10px; }
  .mf-modal-card { max-height: 94dvh; border-radius: 20px; }
  .flow-header { padding: 16px 18px 14px; }
  .flow-body { padding: 18px; }
  .flow-footer { padding: 14px 18px; flex-wrap: wrap; }
}

/* Deal Workspace Specifics */
.deal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.deal-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.deal-hero-thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-alt);
  flex-shrink: 0;
}

.delivery-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  word-break: break-all;
}

.chat-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-box-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 750;
}

.chat-messages {
  max-height: 300px;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.chat-msg-author { font-size: 11.5px; font-weight: 750; color: var(--accent); }
.chat-msg-body { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.45; }

.chat-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.chat-compose input { flex: 1; }

/* ---------- Market Orders Dashboard (UI/market-orders.html) ---------- */
.mo-page {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  margin: 0 auto;
  padding: 24px 20px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
  overflow-x: clip;
}

.mo-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

.mo-side {
  position: sticky;
  top: calc(var(--nav-h, 112px) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.mo-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.mo-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mo-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.mo-hero-amount {
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 850;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1.05;
}

.mo-hero-unit {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 6px;
}

.volume-bar {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-muted);
  gap: 2px;
}

.volume-seg--buy { background: var(--accent); }
.volume-seg--sell { background: var(--positive); }
.volume-seg--settled { background: var(--pending); }

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.metric-box { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metric-label { font-size: 11.5px; color: var(--text-tertiary); font-weight: 600; }
.metric-val { font-size: 18px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }

.mo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.mo-card .segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.mo-card .segmented::-webkit-scrollbar { display: none; }

.mo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mo-wallet-btn {
  width: 100%;
  height: 44px;
  font-size: 14.5px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  border-radius: 12px;
}

.mo-card-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }

.deal-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 15px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.deal-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deal-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-icon--buying { background: var(--accent-soft); color: var(--accent); }
.tx-icon--selling { background: var(--positive-bg); color: var(--positive); }
.tx-icon--arbitrating { background: var(--pending-bg); color: var(--pending); }

.deal-row-info { min-width: 0; }
.deal-row-title {
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-row-sub { font-size: 12px; color: var(--text-secondary); }

.deal-row-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.deal-amount { font-size: 14.5px; font-weight: 800; color: var(--text); }
.deal-amount--pos { color: var(--positive); }
.deal-amount--cancelled { text-decoration: line-through; color: var(--text-tertiary); }

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.status-pill--active { background: var(--accent-soft); color: var(--accent); }
.status-pill--delivered { background: var(--pending-bg); color: var(--pending); }
.status-pill--completed { background: var(--positive-bg); color: var(--positive); }
.status-pill--cancelled { background: var(--negative-bg); color: var(--negative); }

.deal-row-bottom {
  padding-left: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stage-bars {
  display: flex;
  gap: 4px;
  width: 110px;
}

.stage-seg {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
}

.stage-seg.done { background: var(--positive); }
.stage-seg.current { background: var(--accent); }

.ledger-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.order-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.order-row .deal-row-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-row:hover {
  background: var(--surface-subtle);
  border-color: var(--border);
}

.order-row-chev {
  color: var(--text-tertiary);
  transition: transform 0.18s var(--ease-apple);
}

.order-row:hover .order-row-chev { transform: translateX(3px); color: var(--text); }

.mo-listing-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mo-listing-item:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.mo-listing-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-alt);
  flex-shrink: 0;
}

.mo-listing-info { min-width: 0; flex: 1; }
.mo-listing-title { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-listing-meta { font-size: 11.5px; color: var(--text-secondary); }

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1120px) {
  .market-grid, .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .mo-page { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 60px; gap: 16px; }
  .mo-side { position: static; }
}

@media (max-width: 780px) {
  .mi-page { padding: 20px 16px 64px; gap: 24px; }
  .mi-flow { gap: 24px; }
  .mi-commerce-card { padding: 20px; }
  .mi-nav-btn { width: 34px; height: 34px; }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  .mi-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-grid { grid-template-columns: minmax(0, 1fr); }
  .option-grid-2, .field-grid, .field-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .deal-hero { flex-direction: column; align-items: flex-start; }
  .ledger-controls { flex-direction: column; align-items: stretch; }
  .ledger-controls .segmented { width: 100%; }
  .ledger-controls .mk-search-wrap, .ledger-controls .mk-search-input { width: 100%; }
}

@media (max-width: 560px) {
  .mk-stage { padding: 14px 12px 56px; }
  .mo-summary-card, .mo-card { padding: 16px; border-radius: 16px; }
  .summary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .metric-val { font-size: 15px; }
  .deal-row-top { flex-wrap: wrap; }
  .deal-row-right { flex-direction: row; align-items: center; gap: 8px; width: 100%; justify-content: space-between; padding-left: 50px; }
  .deal-row-bottom { padding-left: 0; }
  .order-row { padding: 10px 8px; gap: 8px; }
  .order-row .deal-row-right { width: auto; padding-left: 0; flex-direction: column; align-items: flex-end; gap: 2px; }
}

@media (max-width: 480px) {
  .market-grid, .people-grid, .mi-related-grid { grid-template-columns: minmax(0, 1fr); }
  .mk-search-input { width: 100%; max-width: 100%; }
  .mi-cta-row .btn, .mi-cta-row .mi-btn-primary { width: 100%; justify-content: center; }
}
