/* Rules that only apply on /trading/ — loaded by that page after style.css. */
.trade-card { position: relative; }


.trade-compose-extra { padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--glass-border); }

.trade-compose-extra label:first-child { margin-top: 0; }


.confirm-card { padding: 16px; border-color: rgb(var(--brass-rgb) / 0.45); }

.confirm-card-tiles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

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

.vc-summary:empty { display: none; }

.vc-summary-col { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--border, rgb(255 255 255 / 0.08)); border-radius: var(--radius-sm); background: rgb(255 255 255 / 0.02); }

.vc-summary-label { width: 100%; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ash); }

.vc-group { display: grid; gap: 8px; }

.vc-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 14px; text-decoration: none; color: inherit; }

.vc-row-img { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle, color-mix(in srgb, var(--vc-color) 22%, transparent), transparent 75%); }

.vc-row-img img { width: 36px; height: 36px; object-fit: contain; }

.vc-row-name { display: flex; flex-direction: column; min-width: 0; }

.vc-row-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vc-row-name .muted { font-size: 0.72rem; text-transform: capitalize; }

.vc-row-values { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.85rem; }

.vc-row-pct { font-weight: 700; font-size: 0.85rem; color: var(--vc-color); min-width: 76px; text-align: right; }

@media (max-width: 640px) {
  .vc-summary { grid-template-columns: 1fr; }
  .vc-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .vc-row-values { display: none; }
}

.sc-card { padding: 20px; border-color: color-mix(in srgb, var(--risk) 45%, transparent); box-shadow: 0 12px 36px -18px color-mix(in srgb, var(--risk) 60%, transparent); }

.sc-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.sc-risk { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; color: var(--risk); background: color-mix(in srgb, var(--risk) 14%, transparent); border: 1px solid color-mix(in srgb, var(--risk) 40%, transparent); }

.sc-blurb { margin: 14px 0; color: var(--ash); font-size: 0.92rem; }

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

.sc-stat { padding: 10px 12px; border-radius: var(--radius-sm); background: rgb(255 255 255 / 0.03); text-align: center; }

.sc-stat strong { display: block; font-size: 1.35rem; font-family: var(--font-mono); }

.sc-stat span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ash); }

.sc-reasons { margin: 14px 0 0; padding-left: 18px; font-size: 0.88rem; color: var(--ash); line-height: 1.7; }

.trade-vote-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.trade-vote-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted, #8b95a8); margin-right: 2px; }

.trade-vote-count { font-family: var(--font-mono); opacity: 0.85; }

.trade-vote-hint { font-size: 0.72rem; }

/* ==========================================================================
   Trade listing card v2 — header / two-sided deal / value balance / footer
   ========================================================================== */
.trade-card { padding: 20px 22px 16px; overflow: hidden; }
.trade-card::before { inset: 0 0 auto 0; height: 3px; border-radius: 0; background: linear-gradient(90deg, var(--sea), var(--gold-bright)); opacity: 1; }
.trade-card.is-themed { border: 2px solid transparent; background: linear-gradient(165deg, var(--glass-bg-strong), var(--navy) 65%) padding-box, linear-gradient(135deg, var(--tc-from), var(--tc-to)) border-box; }
.trade-card.is-themed::before { background: linear-gradient(90deg, var(--tc-from), var(--tc-to)); }

.tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 4px; }
.tc-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tc-user-meta { min-width: 0; }
.tc-user-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.tc-name { color: var(--bone); font-weight: 700; font-size: 0.98rem; text-decoration: none; }
.tc-name:hover { color: var(--brass-bright); }
.tc-time { margin: 3px 0 0; font-size: 0.74rem; color: var(--ash); display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.tc-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tc-tool { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ash); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.tc-tool:hover { background: var(--glass-bg-strong); color: var(--bone); border-color: var(--glass-border); }
.tc-tool-ok:hover { color: var(--sea); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.tc-tool-bad:hover { color: var(--blood); border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.1); }

.tc-note { margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid var(--brass); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgb(var(--brass-rgb) / 0.07); color: var(--bone); font-size: 0.86rem; line-height: 1.5; overflow-wrap: anywhere; }

.tc-deal { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; margin-top: 16px; }
.tc-side { --side: var(--sea); position: relative; padding: 12px 14px 14px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--side) 28%, transparent); background: linear-gradient(170deg, color-mix(in srgb, var(--side) 11%, transparent), rgb(255 255 255 / 0.015) 70%); min-width: 0; }
.tc-side-request { --side: var(--gold); }
.tc-side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.tc-side-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--side); }
.tc-side-total { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--bone); }
.tc-side .trade-item-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px 8px; justify-items: center; }
.tc-empty { font-size: 0.8rem; grid-column: 1 / -1; padding: 10px 0; text-align: center; }
.tc-swap { align-self: center; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); border: 1px solid var(--glass-border); color: var(--brass-bright); box-shadow: 0 6px 16px -8px rgb(var(--brass-rgb) / 0.6); }

.tc-balance { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.tc-bar { flex: 1 1 160px; height: 8px; border-radius: 999px; background: var(--gold); background: linear-gradient(90deg, rgb(var(--gold-rgb) / 0.55), rgb(var(--gold-rgb) / 0.55)); overflow: hidden; }
.tc-bar-offer { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, var(--sea)); box-shadow: 2px 0 0 var(--navy); }
.tc-fair { flex: none; }

.tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--glass-border); }
.tc-foot .trade-vote-row { margin-top: 0; }
.tc-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }

@media (max-width: 720px) {
  .trade-card { padding: 16px 14px 12px; }
  .tc-deal { grid-template-columns: 1fr; gap: 8px; }
  .tc-swap { margin: -2px auto; transform: rotate(90deg); }
  .tc-foot { flex-direction: column; align-items: stretch; }
  .tc-actions { margin-left: 0; justify-content: flex-end; }
}

.tc-note + .chat-scam-warn { margin: 8px 0 0; max-width: none; }

/* ---- Offer chat thread ---- */
.offer-thread { margin-top: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--glass-border); background: rgb(0 0 0 / 0.18); }
.offer-thread[hidden] { display: none; }
.ot-log { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.ot-empty { margin: 0; font-size: 0.8rem; }
.ot-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ot-msg.is-mine { align-items: flex-end; }
.ot-bubble { max-width: 85%; padding: 8px 13px; border-radius: 4px 14px 14px 14px; background: var(--glass-bg-strong); border: 1px solid var(--glass-border); font-size: 0.86rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ot-msg.is-mine .ot-bubble { border-radius: 14px 4px 14px 14px; background: rgb(var(--brass-rgb) / 0.18); border-color: rgb(var(--brass-rgb) / 0.4); }
.ot-msg small { font-size: 0.66rem; color: var(--ash); }
.ot-msg .chat-scam-warn { max-width: 85%; margin: 0; }
.ot-form { display: flex; gap: 8px; margin-top: 10px; }
.ot-form input { margin: 0; flex: 1; font-size: 0.86rem; border-radius: 999px; padding: 9px 16px; }
.ot-form + .chat-scam-hint, .offer-thread .chat-scam-hint { margin-top: 8px; }
.ot-form .btn { border-radius: 999px; }
