/* ---------- Trade calculator ---------- */
.trade {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* Offer panels */
.side { padding: 18px; position: relative; overflow: hidden; }
.side::before {
  /* thin side-colour hairline along the top edge */
  content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--side-c) 50%, transparent);
  opacity: 0.55;
}
.side.you { --side-c: var(--accent); }
.side.them { --side-c: var(--accent-2); }

.side-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 32px; }
.side-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-title h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.side-title .tag { width: 8px; height: 8px; border-radius: 50%; background: var(--side-c); box-shadow: 0 0 10px var(--side-c); flex-shrink: 0; }
.side-count {
  font: 600 12px/1 var(--font); color: var(--muted); font-variant-numeric: tabular-nums;
  padding: 5px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
}
.side.is-full .side-count { color: var(--side-c); border-color: color-mix(in srgb, var(--side-c) 35%, transparent); }
.side-clear {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 600;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.side-clear svg { width: 14px; height: 14px; }
.side-clear:hover { color: var(--lose); border-color: color-mix(in srgb, var(--lose) 55%, transparent); background: color-mix(in srgb, var(--lose) 8%, transparent); }
.side-clear[hidden] { display: none; }

.side-total { margin: 14px 0 16px; }
.st-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.st-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.st-val {
  font: 800 44px/1.02 var(--font-display); letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.st-val.zero { color: var(--surface-3); }
.st-val.no-num { color: var(--muted); }
.flags { display: flex; gap: 6px; flex-wrap: wrap; }
.flags:empty { display: none; }
.flag {
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; cursor: help;
}
.flag.oc { color: #ffc46b; background: rgba(255, 170, 60, 0.1); border: 1px solid rgba(255, 170, 60, 0.3); }
.flag.none { color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-2); }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.slot {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
  padding: 7px 7px 9px;
  border-radius: 14px;
  text-align: left;
}
.slot-link { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; border-radius: 10px; }
.slot-art {
  display: grid; place-items: center;
  aspect-ratio: 1; width: 100%;
  border-radius: 10px;
  background: var(--inset);
  overflow: hidden;
}
.slot-art .art { width: 100%; height: 100%; border-radius: 10px; }
.slot-art .art-inner { border-radius: 8px; }
.slot-name {
  display: block; margin-top: 8px; padding: 0 2px;
  font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--text);
  max-height: 2.5em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.slot-val { display: flex; align-items: center; height: 22px; margin-top: 2px; padding: 0 2px; font-size: 15px; line-height: 1; }
.slot-val .val { font-weight: 800; letter-spacing: -0.02em; }
.slot-val .val-oc { font-size: 10.5px; padding: 4px 7px; box-shadow: none; }
.slot-val .val-none { font-size: 12px; }

.slot.filled {
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.slot.filled:hover { border-color: var(--line-2); background: #1c2029; }
.slot.filled:hover .slot-art { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent); }
.slot-link:focus-visible { outline-offset: 4px; }

.slot-remove {
  position: absolute; top: 3px; right: 3px; z-index: 4;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(12, 14, 19, 0.82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--text); display: grid; place-items: center; padding: 0;
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.15s, transform 0.15s, background 0.15s, border-color 0.15s;
}
.slot-remove svg { width: 14px; height: 14px; }
.slot-remove::after { content: ''; position: absolute; inset: -8px; } /* bigger tap target */
.slot.filled:hover .slot-remove, .slot-remove:focus-visible { opacity: 1; transform: none; }
.slot-remove:hover { background: var(--lose); border-color: transparent; color: #fff; }
@media (hover: none) { .slot-remove { opacity: 1; transform: none; } }

.slot.empty {
  border: 1px dashed rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.slot.empty .slot-art { background: transparent; }
.slot.empty .slot-name { color: var(--muted); font-weight: 600; }
.slot.empty .plus { display: none; }
.slot.empty.next { border-color: var(--line-2); cursor: pointer; }
.slot.empty.next .slot-art { background: var(--bg-2); }
.slot.empty.next .plus {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.slot.empty.next .plus svg { width: 18px; height: 18px; }
.slot.empty:hover { border-color: color-mix(in srgb, var(--side-c) 45%, transparent); }
.slot.empty.next:hover { background: color-mix(in srgb, var(--side-c) 4%, transparent); }
.slot.empty.next:hover .plus { background: var(--side-c); color: #0a0c10; border-color: transparent; transform: scale(1.06); }
.slot.empty.next:hover .slot-name { color: var(--text); }

.slot.pop { animation: slotPop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.25); }
@keyframes slotPop { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: none; } }

/* Verdict column */
.verdict-col { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; }
.verdict {
  --vc: var(--muted);
  position: relative;
  padding: 20px 18px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
  overflow: hidden;
  transition: border-color 0.3s;
}
.verdict::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--vc) 16%, transparent), transparent 65%);
  transition: opacity 0.3s;
}
.verdict.idle::before { opacity: 0; }
.verdict.win { --vc: var(--win); border-color: color-mix(in srgb, var(--win) 32%, transparent); }
.verdict.fair { --vc: var(--fair); border-color: color-mix(in srgb, var(--fair) 32%, transparent); }
.verdict.lose { --vc: var(--lose); border-color: color-mix(in srgb, var(--lose) 32%, transparent); }
.verdict > * { position: relative; }
.v-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.v-word {
  margin-top: 6px;
  font: 900 64px/1 var(--font-display); letter-spacing: -0.05em;
  color: var(--vc);
}
.verdict.idle .v-word { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-2); padding: 14px 0 8px; }
.v-word.bump { animation: vBump 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes vBump { from { opacity: 0.2; transform: translateY(6px) scale(0.94); } to { opacity: 1; transform: none; } }
.v-sub { margin-top: 8px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; min-height: 1.45em; }

.meter { margin-top: 18px; }
.meter-track {
  position: relative; height: 12px; border-radius: 999px;
  background: var(--inset); box-shadow: inset 0 0 0 1px var(--line);
}
.meter-give, .meter-get {
  position: absolute; top: 2px; bottom: 2px;
  transition: width 0.5s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.meter-give { left: 2px; border-radius: 999px 0 0 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); max-width: calc(100% - 4px); }
.meter-get { right: 2px; border-radius: 0 999px 999px 0; background: linear-gradient(270deg, color-mix(in srgb, var(--accent-2) 55%, transparent), var(--accent-2)); max-width: calc(100% - 4px); }
.meter-fair {
  /* the band where the trade still counts as fair (give share 47.4%–52.6%) */
  position: absolute; top: -4px; bottom: -4px; left: 47.37%; right: 47.37%;
  border-radius: 4px; background: color-mix(in srgb, var(--fair) 14%, transparent);
  border: 1px dashed color-mix(in srgb, var(--fair) 35%, transparent);
}
.meter-mid { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: rgba(255, 255, 255, 0.25); }
.meter-needle {
  position: absolute; top: 50%; z-index: 2;
  width: 6px; height: 22px; margin: -11px 0 0 -3px; border-radius: 3px;
  background: #fff; box-shadow: 0 0 0 3px var(--surface), 0 2px 10px rgba(0, 0, 0, 0.6);
  transition: left 0.5s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.meter.blank .meter-give, .meter.blank .meter-get { opacity: 0; }
.meter.blank .meter-needle { background: var(--surface-3); }
.meter-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.meter-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.meter-legend i { width: 8px; height: 8px; border-radius: 2px; }
.ml-give i { background: var(--accent); }
.ml-get i { background: var(--accent-2); }
.meter-legend b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.v-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin-top: 16px; border-radius: 12px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line);
}
.v-stats > div { background: var(--bg-2); padding: 10px 8px; display: flex; flex-direction: column; gap: 3px; }
.v-stats span { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.v-stats b { font: 800 20px/1.1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.v-stats b.pos { color: var(--win); }
.v-stats b.neg { color: var(--lose); }

.trade-note {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.45; color: var(--text-2); text-align: left;
  background: rgba(255, 170, 60, 0.06); border: 1px solid rgba(255, 170, 60, 0.2);
}
.trade-note b { color: #ffc46b; font-weight: 700; }
.trade-note[hidden] { display: none; }

.trade-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trade-actions .btn { height: 42px; padding: 0 12px; font-size: 13.5px; }
.trade-actions .btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.trade-actions .share-img-btn { grid-column: 1 / -1; height: 46px; font-size: 14.5px; font-weight: 700; }
.share-img-btn.is-busy { opacity: 0.75; cursor: progress; }

/* Share-as-image preview */
.share-modal { width: min(760px, 100%); max-height: none; }
.share-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.share-frame {
  border-radius: 14px; overflow: hidden; background: var(--inset);
  border: 1px solid var(--line-2); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  aspect-ratio: 16 / 9;
}
.share-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.share-hint { margin: 0; font-size: 13px; color: var(--muted); }
.share-fallback {
  margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; color: var(--text-2);
  background: rgba(255, 170, 60, 0.06); border: 1px solid rgba(255, 170, 60, 0.25);
}
.share-fallback[hidden] { display: none; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-actions .btn { flex: 1 1 160px; height: 46px; font-weight: 700; }
@media (max-width: 600px) {
  .share-backdrop .modal.share-modal { height: auto; max-height: 92vh; }
  .share-body { padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
  .share-actions .btn { flex-basis: 100%; }
}

/* Tablet: sides next to each other, verdict below */
@media (max-width: 1080px) {
  .trade { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .verdict-col { grid-column: 1 / -1; order: 3; position: static; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
  .side.them { order: 2; }
  .trade-actions { grid-template-columns: 1fr; }
}

/* Phone: everything stacks */
@media (max-width: 720px) {
  .trade { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .verdict-col { display: flex; align-items: stretch; }
  .trade-actions { grid-template-columns: 1fr 1fr; }
  .side { padding: 14px; }
  .side::before { left: 14px; right: 14px; }
  .side-total { margin: 10px 0 14px; }
  .st-val { font-size: 36px; }
  .slots { gap: 8px; }
  .slot { padding: 5px 5px 7px; border-radius: 12px; }
  .slot-name { font-size: 12px; margin-top: 6px; }
  .slot-val { font-size: 14px; height: 20px; }
  .slot.extra { display: none; }
  .v-word { font-size: 56px; }
  .slot-remove { top: 1px; right: 1px; }
}

/* Pinned mini verdict (phones and tablets) */
.mini-verdict { display: none; }
@media (max-width: 1080px) {
  .mini-verdict {
    --vc: var(--text-2);
    position: fixed; left: 12px; right: 12px; z-index: 45;
    bottom: calc(80px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
    max-width: 560px; margin: 0 auto;
    padding: 10px 16px; border-radius: 16px; text-align: left;
    background: rgba(18, 21, 27, 0.94); border: 1px solid color-mix(in srgb, var(--vc) 40%, var(--line-2));
    box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: transform 0.25s ease, opacity 0.25s ease, border-color 0.25s;
    animation: miniIn 0.25s ease;
  }
  .mini-verdict[hidden] { display: none; }
  .mini-verdict.away { opacity: 0; transform: translateY(14px); pointer-events: none; }
  .mini-verdict.win { --vc: var(--win); }
  .mini-verdict.fair { --vc: var(--fair); }
  .mini-verdict.lose { --vc: var(--lose); }
  .mv-word { font: 900 20px/1 var(--font-display); letter-spacing: -0.03em; color: var(--vc); min-width: 50px; display: inline-block; }
  .mini-verdict.idle .mv-word { font-size: 15px; font-weight: 800; }
  .mv-word.bump { animation: vBump 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
  .mv-meter { position: relative; height: 6px; border-radius: 999px; background: var(--inset); overflow: hidden; display: flex; gap: 2px; }
  .mv-give, .mv-get { height: 100%; transition: width 0.5s cubic-bezier(0.3, 0.8, 0.3, 1); }
  .mv-give { background: var(--accent); border-radius: 999px 0 0 999px; }
  .mv-get { background: var(--accent-2); border-radius: 0 999px 999px 0; }
  .mini-verdict.blank .mv-give, .mini-verdict.blank .mv-get { background: var(--surface-3); }
  .mv-nums { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
  .mv-nums b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
  .trade-page:has(.mini-verdict:not([hidden])) { padding-bottom: 72px; }
}
@media (min-width: 721px) and (max-width: 1080px) { .mini-verdict { bottom: 16px; } }
@keyframes miniIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .slot.pop, .v-word.bump, .mv-word.bump, .mini-verdict { animation: none; }
}

/* ---------- Slot details: mutation look, badges, serials ---------- */
button.slot-link {
  width: 100%; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.slot-art { position: relative; }
.slot-badges {
  position: absolute; left: 4px; right: 4px; bottom: 4px; z-index: 6;
  display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-end; pointer-events: none;
}
.slot-badges .mut-badge {
  height: 18px; padding: 0 6px 0 4px; font-size: 10px; max-width: 100%;
  background: color-mix(in srgb, var(--mc) 30%, rgba(8, 11, 18, 0.82));
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.slot-badges .mut-badge span { overflow: hidden; text-overflow: ellipsis; }
.serial {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 999px;
  font: 800 10.5px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; white-space: nowrap;
  color: var(--text-2); background: rgba(8, 11, 18, 0.82); box-shadow: inset 0 0 0 1px var(--line-2);
}
.serial.mid { color: #e8eefc; box-shadow: inset 0 0 0 1px rgba(200, 215, 255, 0.4); background: linear-gradient(180deg, rgba(60, 72, 100, 0.9), rgba(20, 26, 40, 0.9)); }
.serial.low {
  color: #2b1a00;
  background: linear-gradient(135deg, #fff1b8, #ffcf4a 45%, #f0a020);
  box-shadow: 0 0 0 1px rgba(255, 230, 160, 0.7), 0 0 12px -2px rgba(255, 200, 70, 0.8);
}
.slot.has-mut .slot-art { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 20%, transparent); }
.slot-why { font-size: 11.5px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.filled.is-none .slot-why { color: var(--muted); }

/* ---------- Tokens on a side ---------- */
.tok-row { margin-top: 10px; }
.tok-add {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  height: 40px; border-radius: 12px;
  border: 1px dashed var(--line-2); background: transparent; color: var(--text-2);
  font-size: 13.5px; font-weight: 650;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.tok-add svg { width: 15px; height: 15px; }
.tok-add:hover { color: var(--text); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 5%, transparent); }
.tok-tile {
  position: relative; display: flex; align-items: stretch;
  border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(90% 140% at 0% 50%, rgba(255, 201, 74, 0.16), transparent 60%),
    var(--surface-2);
  border: 1px solid rgba(255, 201, 74, 0.28);
}
.tok-edit {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 8px 12px 8px 8px; border: 0; background: none; color: var(--text); text-align: left; font: inherit;
}
.tok-coin { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--inset); }
.tok-coin .tok { width: 30px; height: 30px; margin: 0; filter: drop-shadow(0 2px 6px rgba(255, 190, 60, 0.45)); }
.tok-txt { font-size: 14px; font-weight: 600; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tok-txt b { font: 800 18px/1 var(--font-display); letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 2px; }
.tok-hint { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--muted); }
.tok-edit:hover .tok-hint { color: var(--text); }
.tok-remove {
  width: 44px; flex: none; border: 0; border-left: 1px solid rgba(255, 201, 74, 0.18);
  background: transparent; color: var(--text-2); display: grid; place-items: center;
}
.tok-remove svg { width: 15px; height: 15px; }
.tok-remove:hover { background: var(--lose); color: #fff; }

.trade-why { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; color: var(--muted); }

/* ---------- Sheets: pet details and tokens ---------- */
.sheet-backdrop .modal.sheet { width: min(480px, 100%); max-height: min(720px, 88vh); height: auto; }
.td-body, .tk-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overscroll-behavior: contain; }
.td-hero { display: flex; gap: 14px; align-items: center; }
.td-art { width: 104px; flex: none; }
.td-art .art { width: 100%; border-radius: 16px; }
.td-art .art-inner { border-radius: 15px; }
.td-who { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.td-name { font: 800 20px/1.15 var(--font-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.td-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.td-tags .rarity { height: 20px; font-size: 11px; padding: 0 8px; }
.td-tags .vtag { height: 18px; font-size: 9.5px; padding: 0 6px; }
.td-value { font-size: 20px; display: flex; flex-direction: column; gap: 2px; }
.td-value .val { font-weight: 800; letter-spacing: -0.02em; }
.td-unvalued { font-size: 14px; font-weight: 700; color: #ffc46b; }
.td-unvalued-sub { font-size: 12px; color: var(--muted); }
.td-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.td-field legend, .td-field > label { display: block; padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.td-field > label span { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.td-vars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.td-var {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; padding: 6px 4px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; font-weight: 650;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.td-var small { font-size: 10px; font-weight: 600; color: var(--muted); }
.td-var-dot { width: 14px; height: 14px; border-radius: 50%; background: #8c96aa; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.td-var.v-golden .td-var-dot { background: linear-gradient(135deg, #fff1b0, #f2b13a); }
.td-var.v-rainbow .td-var-dot { background: conic-gradient(#f0566f, #f0a63e, #2fcf9a, #4a9cf0, #a576f0, #f0566f); }
.td-var.v-diamond .td-var-dot { background: linear-gradient(135deg, #f0fdff, #7fd3f5); }
.td-var:hover { color: var(--text); border-color: var(--line-3); }
.td-var[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 65%, transparent); }
.td-var.unlisted[aria-pressed="true"] { background: color-mix(in srgb, #ffaa3c 10%, var(--surface-2)); border-color: rgba(255, 170, 60, 0.55); }
.td-var.unlisted[aria-pressed="true"] small { color: #ffc46b; }
.td-mut-note { margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.td-mut-note .mut-unofficial { margin: 0 4px 0 0; font-size: 9.5px; padding: 2px 6px; }
.td-mut-note[hidden] { display: none; }
.td-serial-row {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px;
  border-radius: 12px; background: var(--bg-2, var(--inset)); border: 1px solid var(--line-2);
}
.td-serial-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.18); }
.td-hash { font: 800 18px/1 var(--font-display); color: var(--muted); }
.td-serial-row input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; padding: 0;
  font: 700 17px/1 var(--font); color: var(--text); font-variant-numeric: tabular-nums;
}
.td-serial-flair { font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.td-serial-flair.low { color: #2b1a00; padding: 4px 9px; border-radius: 999px; background: linear-gradient(135deg, #fff1b8, #ffcf4a 45%, #f0a020); box-shadow: 0 0 14px -2px rgba(255, 200, 70, 0.8); }
.td-serial-flair.mid { color: #cfdaf5; }
.td-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.td-foot {
  display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.td-foot .btn { flex: 1 1 0; height: 46px; font-weight: 700; padding: 0 12px; }
.td-foot .btn-primary { flex-grow: 1.4; }
.td-foot .btn svg { width: 15px; height: 15px; }

.tk-input {
  display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 14px 0 10px;
  border-radius: 14px; background: var(--bg-2, var(--inset)); border: 1px solid var(--line-2);
}
.tk-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 207, 74, 0.16); }
.tk-coin .tok { width: 36px; height: 36px; margin: 0; }
.tk-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; padding: 0; font: 800 24px/1 var(--font-display); letter-spacing: -0.02em; color: var(--text); }
.tk-input input::placeholder { font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.tk-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tk-chip {
  height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text-2); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tk-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.tk-preview { margin: 0; font-size: 13.5px; color: var(--muted); min-height: 1.5em; }
.tk-preview b { color: var(--text); }
.tk-preview.bad { color: #ffc46b; }
.td-foot .btn:disabled { opacity: 0.45; pointer-events: none; }

@media (max-width: 600px) {
  .sheet-backdrop .modal.sheet { width: 100%; height: auto; max-height: 92vh; }
  .td-body, .tk-body { padding: 14px 16px; gap: 14px; }
  .td-art { width: 92px; }
}
@media (max-width: 720px) {
  .slot-badges { left: 3px; right: 3px; bottom: 3px; }
  .slot-badges .mut-badge { height: 16px; font-size: 9.5px; padding: 0 5px 0 3px; }
  .serial { height: 16px; font-size: 9.5px; padding: 0 5px; }
}
