/* ════════════════════════════════════════════════════════════════════════
   Resale trade card (.rtc) — the asset-detail purchase card in RESALE mode.

   Quick-Trade look: a Buy/Sell toggle, the best available price, a share
   stepper and a receipt-style total — wired to the
   simple resale market (fixed-price listings, cheapest-first):
     • Buy  — takes the lowest-priced open offers and shows the buyer fee before
              the real trade settles server-side.
     • Sell — lists the viewer's own free shares inside the ±band of the asset's
              independent valuation; the seller pays the 5% fee on sale.

   Shares the brand language of the primary-market .ad-invest card (white 24px
   surface, electric-blue figures, mint accents) so the two cards feel like one
   family. Lives next to asset.css; loaded by asset.html and styleguide.html.
   ════════════════════════════════════════════════════════════════════════ */

.rtc { position: sticky; top: 96px; background: #fff; border-radius: 24px; box-shadow: 0 18px 48px rgba(0,0,0,.10); padding: 22px; }
/* In-shell pages drop the sticky offset a touch (mirrors .ad-invest). */
.ad-main--shell .rtc { top: 68px; }
/* Mobile: the asset grid collapses to one column — the card flows inline
   (the primary-market mobile bottom bar is suppressed in resale mode). */
@media (max-width: 980px) { .rtc { position: static; } }

/* ── Buy / Sell toggle (segmented, with direction arrows) ───────────────── */
.rtc__seg { display: flex; gap: 4px; background: var(--bg-subtle); border: 1px solid var(--border-soft); border-radius: 12px; padding: 4px; }
.rtc__seg-btn { flex: 1; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; background: transparent; font-family: var(--font-family); font-size: 13px; font-weight: 800; color: var(--fg-heading-2); cursor: pointer; transition: background .18s ease, color .18s ease; }
.rtc__seg-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }
.rtc__seg-btn:not(.on):hover { background: var(--bg-surface); }
/* Active state mirrors the canonical .seg toggle: mint fill, electric-blue ink. */
.rtc__seg-btn.on { background: var(--brand-green-mint); color: var(--brand-blue); }

/* ── Price block (Buy: best available · Sell: pricing tabs) ─────────────── */
.rtc__ptabs { display: flex; gap: 18px; align-items: center; margin: 18px 2px 0; }
.rtc__ptab { border: 0; background: transparent; padding: 6px 0; font-family: var(--font-family); font-size: 13.5px; font-weight: 700; color: var(--fg-muted); cursor: pointer; position: relative; }
.rtc__ptab.on { color: var(--fg-heading-2); }
.rtc__ptab.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-blue); }
.rtc__ptab-lead { font-size: 13.5px; font-weight: 700; color: var(--fg-heading-2); margin-right: auto; }

.rtc__hr { border: 0; border-top: 1px solid var(--border-soft); margin: 16px 0; }

.rtc__price { text-align: center; margin-top: 18px; }
.rtc__price-k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.rtc__price-v { font-size: 30px; font-weight: 800; color: var(--fg-heading-2); letter-spacing: -.02em; line-height: 1.1; margin: 5px 0 12px; font-variant-numeric: tabular-nums; }
/* Inline-block (not flex) so the line wraps as normal text and the pill never
   exceeds the card; svg sits inline. Shrinks a touch on narrow cards. */
.rtc__avail { display: inline-block; max-width: 100%; box-sizing: border-box; padding: 7px 14px; border-radius: 16px; background: var(--bg-subtle); font-size: 12px; font-weight: 600; color: var(--fg-secondary); line-height: 1.5; }
.rtc__avail b { color: var(--fg-heading-2); font-weight: 800; }
.rtc__avail svg { width: 13px; height: 13px; color: var(--fg-muted); vertical-align: -2px; margin-right: 5px; }

/* ── Share stepper (typeable, big) ─────────────────────────────────────── */
.rtc__field { text-align: center; margin: 4px 0; }
.rtc__field-k { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-muted); }
.rtc-step { margin: 8px 0 2px; }
.rtc-step .ad-step__in { font-size: 30px; }
.rtc__avail-sub { font-size: 12px; color: var(--fg-muted); text-align: center; margin: 2px 0 0; }

/* ── Sell price slider (custom price within the ±band) ─────────────────── */
.rtc__rng { width: 100%; appearance: none; -webkit-appearance: none; height: 6px; border-radius: var(--radius-pill); background: var(--bg-hover); outline: 0; margin: 14px 0 0; }
.rtc__rng::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-blue); border: 4px solid var(--brand-green-mint); box-shadow: var(--shadow-card); cursor: pointer; }
.rtc__rng::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-blue); border: 4px solid var(--brand-green-mint); cursor: pointer; }
.rtc__band { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--fg-muted); margin-top: 8px; }
.rtc__band b { color: var(--fg-heading-2); font-weight: 700; }

/* ── Receipt (subtotal / fee / total) ──────────────────────────────────── */
.rtc__rcpt { margin: 16px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.rtc__rcpt-r { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13.5px; color: var(--fg-secondary); }
.rtc__rcpt-r + .rtc__rcpt-r { border-top: 1px dotted var(--border-strong); }
.rtc__rcpt-r .v { font-weight: 700; color: var(--fg-heading-2); font-variant-numeric: tabular-nums; }
.rtc__rcpt-r .v.free { color: var(--success-fg); }
.rtc__rcpt-total { display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed var(--border-strong); margin-top: 4px; padding-top: 12px; }
.rtc__rcpt-total .k { font-size: 16px; font-weight: 800; color: var(--fg-heading-2); }
.rtc__rcpt-total .v { font-size: 22px; font-weight: 800; color: var(--brand-blue); font-variant-numeric: tabular-nums; }

/* ── CTA (mint text on electric blue — the resale accent) ──────────────── */
.rtc__cta { width: 100%; margin-top: 16px; border: 0; border-radius: 14px; background: var(--brand-blue); color: var(--brand-green-neon); font-family: var(--font-family); font-size: 16px; font-weight: 800; padding: 15px; cursor: pointer; transition: background .15s ease, transform .1s ease; }
.rtc__cta:hover:not(:disabled) { background: var(--brand-blue-hover); }
.rtc__cta:active:not(:disabled) { transform: scale(.99); }
.rtc__cta:disabled { opacity: .5; cursor: default; }
.rtc__cta--sell { color: var(--brand-green-neon); }

.rtc__note { font-size: 12px; color: var(--fg-muted); text-align: center; margin: 12px 0 0; line-height: 1.55; }
.rtc__err { font-size: 12.5px; color: var(--danger-fg); background: var(--danger-bg); border-radius: 10px; padding: 9px 12px; margin: 12px 0 0; text-align: center; }

/* Empty "nothing to sell" state */
.rtc__empty { text-align: center; padding: 8px 4px 4px; }
.rtc__empty h4 { font-size: 15px; font-weight: 800; color: var(--fg-heading-2); margin: 6px 0 6px; }
.rtc__empty p { font-size: 12.5px; color: var(--fg-muted); line-height: 1.6; margin: 0 0 14px; }
