:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 18px;
  background: #fafafa;
  color: #222;
}

h1 {
  margin: 0 0 10px;
}

a {
  color: #2a5bd7;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.muted {
  color: #666;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 6px 0 16px;
  flex-wrap: wrap;
}

.navItem {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.panel {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
}

.panelTitle {
  font-size: 14px;
  color: #222;
}

.panelSub {
  color: #666;
  font-size: 12px;
}

.btnRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gridTop {
  margin-top: 12px;
}

.gridTopLg {
  margin-top: 14px;
}

.inlineForm {
  display: inline;
}

@media (max-width: 900px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  /* Improve OFFERED / WANT ribbon readability on mobile (match desktop placement) */
  .page-me-space .ribbon {
    width: 118px;
    height: 22px;
    font-size: 11px;
    right: -34px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  }

  /* Keep OFFERED at its normal top position (do not override .ribbonOffered top) */

  /* WANT ribbon – longer diagonal span + positioned like desktop with a small gap */
  .page-me-space .ribbonWant {
    width: 240px;
    right: -64px;
    top: 38px; /* small gap below OFFERED */
  }
}

/* ---------------- Auth pages ---------------- */

.page-auth .authCard {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 18px;
  max-width: 420px;
}

.page-auth form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-auth input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

.page-auth button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.page-auth .authLinks {
  margin-top: 12px;
  font-size: 12px;
}

/* ---------------- Matches list ---------------- */

.page-matches-list .panelTitle {
  font-weight: 800;
  margin-bottom: 6px;
}

.page-matches-list .panelSub {
  font-size: 12px;
}

.page-matches-list .userList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-matches-list .userRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.page-matches-list .userRow:hover {
  border-color: #cfe0ff;
  background: #fbfdff;
  text-decoration: none;
}

.page-matches-list .userEmail {
  font-weight: 750;
  color: #222;
}

.page-matches-list .userSub {
  font-size: 12px;
  margin-top: 2px;
}

.page-matches-list .userStats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-matches-list .pill {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #eee;
  background: #f7f7f7;
  font-size: 12px;
}

.page-matches-list .pillLabel {
  color: #555;
}

.page-matches-list .pillVal {
  font-weight: 800;
  color: #111;
}

@media (max-width: 560px) {
  .page-matches-list .userRow {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-matches-list .userStats {
    justify-content: flex-start;
  }
}

/* ---------------- Matches detail ---------------- */

.page-matches-detail .panel {
  margin-bottom: 12px;
}

.page-matches-detail .composer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.page-matches-detail .panelTitle {
  font-weight: 850;
  margin-bottom: 6px;
}

.page-matches-detail .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.page-matches-detail .tile {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  display: block;
  cursor: pointer;
  position: relative;
}

.page-matches-detail .pick {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 18px;
  height: 18px;
  z-index: 3;
}

.page-matches-detail .imgBox {
  background: #f7f7f7;
  padding: 12px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.page-matches-detail .imgBox img {
  width: 100%;
  height: auto;
  max-width: 220px;
}

.page-matches-detail .noimg {
  color: #888;
  font-size: 12px;
}

.page-matches-detail .pill {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #eee;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-matches-detail .ribbon {
  position: absolute;
  right: -28px;
  top: 10px;
  width: 92px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  transform: rotate(45deg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  pointer-events: none;
  background: #2a5bd7;
}

.page-matches-detail .pick:checked ~ .imgBox .ribbon {
  display: flex;
}

.page-matches-detail .meta {
  padding: 10px 10px 12px;
}

.page-matches-detail .t {
  font-weight: 750;
  font-size: 14px;
  margin-bottom: 6px;
}

.page-matches-detail .s {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.page-matches-detail button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.page-matches-detail button.primary {
  border-color: #bcd0ff;
  background: #f3f7ff;
}

.page-matches-detail .hint {
  font-size: 12px;
  color: #666;
}

@media (max-width: 520px) {
  .page-matches-detail .cards {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .page-matches-detail .imgBox {
    padding: 10px;
    min-height: 200px;
  }

  .page-matches-detail .pick {
    width: 20px;
    height: 20px;
  }

  .page-matches-detail .ribbon {
    width: 84px;
    height: 20px;
    font-size: 10px;
  }
}

/* ---------------- Me collection ---------------- */

.page-me-collection .who {
  font-size: 12px;
  color: #999;
  font-weight: 600;
  margin-left: 8px;
}

.page-me-collection .panelTitle {
  font-weight: 900;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.page-me-collection .panelSub {
  margin-bottom: 10px;
}

.page-me-collection .stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}

.page-me-collection .statPill {
  padding: 8px 10px;
  border: 1px solid #eee;
  background: #f7f7f7;
  border-radius: 999px;
  font-size: 12px;
  display: flex;
  gap: 8px;
}

.page-me-collection .statPill b {
  font-size: 13px;
}

.page-me-collection .filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 14px;
}

.page-me-collection .filtersRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.page-me-collection .searchWrap {
  flex: 1 1 260px;
}

.page-me-collection .searchWrap input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

.page-me-collection .filterSelect {
  padding: 9px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.page-me-collection .filterToggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #eee;
  background: #f7f7f7;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.page-me-collection .filterToggle input {
  width: 14px;
  height: 14px;
}

.page-me-collection .list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-me-collection .row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eee;
}

.page-me-collection .thumb {
  width: 44px;
  height: 60px;
  border-radius: 10px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #eee;
  flex: 0 0 auto;
}

.page-me-collection .thumb img {
  width: 100%;
  height: auto;
}

.page-me-collection .info {
  min-width: 0;
  flex: 1 1 auto;
}

.page-me-collection .name {
  font-weight: 800;
  color: #222;
}

.page-me-collection .meta {
  font-size: 12px;
  color: #444;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.page-me-collection .dot {
  color: #aaa;
}

.page-me-collection .toggles {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto;
}

.page-me-collection .toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #333;
  user-select: none;
}

.page-me-collection input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.page-me-collection .toast {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

.page-me-collection .error {
  color: #b00020;
}

@media (max-width: 820px) {
  .page-me-collection .row {
    align-items: flex-start;
  }

  .page-me-collection .toggles {
    flex-direction: column;
    align-items: flex-end;
  }

  .page-me-collection input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}

/* ---------------- Me space ---------------- */

.page-me-space .who {
  font-size: 12px;
  color: #999;
  font-weight: 600;
  margin-left: 8px;
}

.page-me-space .row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 12px;
  align-items: start;
}

.page-me-space .panelTitle {
  font-weight: 750;
  margin-bottom: 8px;
}

.page-me-space .modeToggle {
  display: inline-flex;
  gap: 0;
  align-items: center;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.page-me-space .modeToggle a {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #333;
  text-decoration: none;
  background: #fff;
}

.page-me-space .modeToggle a.active {
  background: #f3f7ff;
}

.page-me-space .modeRow {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.page-me-space .modeNote {
  font-size: 12px;
  color: #777;
}

.page-me-space .setGroup {
  margin-top: 10px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.page-me-space .setGroupHeader {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.page-me-space .setGroupHeader:hover {
  background: #fbfdff;
}

.page-me-space .setGroupTitle {
  font-weight: 750;
  font-size: 14px;
  color: #222;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.page-me-space .era {
  font-weight: 600;
  font-size: 12px;
  color: #777;
}

.page-me-space .chev {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #777;
  transform: rotate(0deg);
  transition: transform 120ms ease;
  font-size: 18px;
  line-height: 18px;
}

.page-me-space .setChips {
  display: none;
  padding: 10px 12px 12px;
  border-top: 1px solid #eee;
}

.page-me-space .setGroup.open .setChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-me-space .setGroup.open .chev {
  transform: rotate(90deg);
}

.page-me-space .chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #eee;
  background: #fff;
}

.page-me-space .chipActive {
  border-color: #bcd0ff;
  background: #f3f7ff;
}

.page-me-space .statsBox {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-me-space .statsBoxSpaced {
  margin-top: 10px;
}

.page-me-space .statRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: #f7f7f7;
  border: 1px solid #eee;
}

.page-me-space .statLabel {
  font-size: 12px;
  color: #444;
}

.page-me-space .statValue {
  font-weight: 800;
  font-size: 18px;
}

.page-me-space .collectionLink {
  display: block;
  color: inherit;
  text-decoration: none;
}

.page-me-space .collectionLink:hover {
  text-decoration: none;
}

.page-me-space .collectionLink .panel {
  border-color: #cfe0ff;
}

.page-me-space .collectionHint {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

.page-me-space .gridWrap {
  margin-top: 14px;
}

.page-me-space .filtersBar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.page-me-space .searchWrap {
  flex: 1 1 260px;
}

.page-me-space .searchWrap input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

.page-me-space .select {
  padding: 9px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.page-me-space .pillBtn {
  padding: 9px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  background: #f7f7f7;
  font-size: 12px;
  cursor: pointer;
}

.page-me-space .searchHint {
  font-size: 12px;
  color: #777;
  flex: 0 0 auto;
}

.page-me-space .setHeader {
  margin: 18px 0 10px;
  font-weight: 900;
  color: #222;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.page-me-space .setHeader .small {
  font-size: 12px;
  color: #777;
  font-weight: 700;
}

.page-me-space .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.page-me-space .tile {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.page-me-space .imgBox {
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
}

.page-me-space .imgBox img {
  width: 100%;
  height: auto;
  max-width: 220px;
  transition: opacity 120ms ease;
}

.page-me-space .variantPill {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #eee;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #333;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.page-me-space .variantPill:hover {
  background: rgba(255, 255, 255, 1);
}

.page-me-space .ribbon {
  position: absolute;
  top: 10px;
  width: 190px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  transform: rotate(45deg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 3;
}

.page-me-space .ribbonOffered {
  right: -44px;
  width: 158px;
  background: #1f7a3a;
  z-index: 5;
}

.page-me-space .ribbonWant {
  right: -44px;
  top: 36px;
  background: #b00020;
  z-index: 4;
}

/* Pending delivery banner */
.page-me-space .pendingBar {
  position: absolute;
  left: -10px;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-transform: uppercase;
  background: repeating-linear-gradient(
    135deg,
    #f4c542 0,
    #f4c542 10px,
    #111 10px,
    #111 20px
  );
  border-top: 1px solid rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  z-index: 6;
  pointer-events: none;
}

.page-me-space .tile.hasPending .pendingBar {
  display: flex;
}

.page-me-space .tile.hasOffered .ribbonOffered {
  display: flex;
}

.page-me-space .tile.hasWant .ribbonWant {
  display: flex;
}

.page-me-space .meta {
  padding: 10px 10px 12px;
}

.page-me-space .title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.page-me-space .sub {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #555;
  margin-bottom: 10px;
}

.page-me-space .controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-me-space .toggles {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.page-me-space .toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: #333;
  user-select: none;
}

.page-me-space input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.page-me-space .visuallyHiddenSelect {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-me-space .loadState {
  margin: 14px 0;
  display: flex;
  justify-content: center;
  color: #666;
}

.page-me-space .error {
  color: #b00020;
}

@media (max-width: 920px) {
  .page-me-space .row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .page-me-space .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .page-me-space .imgBox {
    padding: 10px;
  }

  .page-me-space input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .page-me-space .toggles {
    gap: 10px;
  }

  .page-me-space .ribbon {
    width: 84px;
    height: 20px;
    font-size: 10px;
  }

  .page-me-space .ribbonWant {
    top: 34px;
  }
}

/* ---------------- Trades ---------------- */

.page-trades .panelTitle {
  font-weight: 900;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.page-trades .rowLink {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #eee;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  margin-bottom: 10px;
}

.page-trades .rowLink:hover {
  border-color: #cfe0ff;
  background: #fbfdff;
  text-decoration: none;
}

.page-trades .title {
  font-weight: 750;
  color: #222;
}

.page-trades .sub {
  font-size: 12px;
  margin-top: 4px;
}

.page-trades .chev {
  color: #999;
  font-size: 22px;
  line-height: 1;
}

.page-trades .status {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #eee;
  background: #f7f7f7;
  font-size: 11px;
  color: #333;
}

.page-trades .status-PENDING {
  background: #fff7e6;
  border-color: #ffe2b3;
}

.page-trades .status-ACCEPTED {
  background: #e9ffef;
  border-color: #baf0c7;
}

.page-trades .status-DECLINED {
  background: #ffe9e9;
  border-color: #f3b6b6;
}

.page-trades .status-CANCELLED {
  background: #f0f0f0;
  border-color: #e0e0e0;
}

.page-trades button,
.page-trades .btn {
  appearance: none;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #222;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-trades button:hover,
.page-trades .btn:hover {
  border-color: #cfe0ff;
  background: #fbfdff;
}

.page-trades .btnPrimary {
  background: #2a5bd7;
  border-color: #2a5bd7;
  color: #fff;
}

.page-trades .btnPrimary:hover {
  background: #1f49b1;
  border-color: #1f49b1;
}

.page-trades .btnDanger {
  background: #fff;
  border-color: #f3b6b6;
  color: #8a1f1f;
}

.page-trades .btnDanger:hover {
  background: #fff7f7;
}

.page-trades input,
.page-trades select {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
}

.page-trades label {
  display: block;
  font-size: 12px;
  color: #444;
  font-weight: 700;
  margin: 10px 0 6px;
}

.page-trades .checkList {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  background: #fafafa;
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-trades .checkRow {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 12px;
}

.page-trades .checkRow input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.page-trades .checkText {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.page-trades .checkMain {
  font-weight: 800;
  color: #222;
}

.page-trades .checkSub {
  font-size: 12px;
  color: #666;
}

.page-trades .pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #eee;
  background: #f7f7f7;
  font-size: 11px;
  color: #333;
  width: max-content;
}

.page-trades .hint {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
}

.page-trades .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.page-trades .tile {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  display: block;
  position: relative;
}

.page-trades .imgBox {
  background: #f7f7f7;
  padding: 12px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.page-trades .imgBox img {
  width: 100%;
  height: auto;
  max-width: 220px;
}

.page-trades .noimg {
  color: #888;
  font-size: 12px;
}

.page-trades .vPill {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #eee;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-trades .ribbon {
  position: absolute;
  right: -28px;
  top: 10px;
  width: 92px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  transform: rotate(45deg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  pointer-events: none;
  background: #2a5bd7;
}

.page-trades .ribbon.request {
  background: #7a3bd7;
}

.page-trades .meta {
  padding: 10px 10px 12px;
}

.page-trades .t {
  font-weight: 750;
  font-size: 14px;
  margin-bottom: 6px;
}

.page-trades .s {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

@media (max-width: 520px) {
  .page-trades .cards {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .page-trades .imgBox {
    padding: 10px;
    min-height: 200px;
  }

  .page-trades .ribbon {
    width: 84px;
    height: 20px;
    font-size: 10px;
  }
}

/* ---------------- Trade weighting scale (propose views) ---------------- */
.tradeScale {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fafafa;
  margin: 12px 0;
}
.tradeScale .scaleSide {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.tradeScale .scaleLabel {
  font-size: 12px;
  color:#666;
  font-weight: 800;
}
.tradeScale .scaleValue {
  font-size: 26px;
  font-weight: 900;
  color:#111;
}
.tradeScale .scaleCenter { display:flex; flex-direction:column; gap:8px; align-items:center; }
.tradeScale .scaleBeam {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.tradeScale .scaleGreen {
  position:absolute;
  left: 40%;
  width: 20%;
  top:0;
  height:100%;
  background: rgba(31,122,58,0.12);
}
.tradeScale .scaleNeedle {
  position:absolute;
  top: -6px;
  left: 50%;
  width: 3px;
  height: 26px;
  border-radius: 999px;
  background: #111;
  transform: translateX(-50%);
  transition: transform 120ms ease;
}
.tradeScale .scaleStatus {
  font-size: 12px;
  font-weight: 800;
  color: #666;
  text-align:center;
  line-height: 1.25;
}
.tradeScale .scaleStatus.ok { color: #1f7a3a; }
.tradeScale .scaleStatus.bad { color: #b00020; }

@media (max-width: 820px) {
  .tradeScale { grid-template-columns: 1fr; }
  .tradeScale .scaleCenter { order: 3; }
}


/* Pending – Sending (blue + black) */
.page-me-space .pendingBar.sending {
  background: repeating-linear-gradient(
    135deg,
    #0b5ed7 0,
    #0b5ed7 10px,
    #111 10px,
    #111 20px
  );
}

/* Pending – Receiving (purple + black) */
.page-me-space .pendingBar.receiving {
  background: repeating-linear-gradient(
    135deg,
    #6f42c1 0,
    #6f42c1 10px,
    #111 10px,
    #111 20px
  );
}


@media (max-width: 520px) {
  /* Improve OFFERED / WANT ribbon readability on mobile */
  .page-me-space .ribbon {
    width: 118px;
    height: 22px;
    font-size: 11px;
    right: -34px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
  }

  /* WANT ribbon – longer diagonal span + more spacing */
  .page-me-space .ribbonWant {
    width: 200px;   /* longer to match diagonal length */
    top: 42px;      /* more separation from OFFERED */
  }
}
