/* =========================================================================
   TCGDash — Compare styles.

   Companion stylesheet to product-explorer.css, which is loaded first by both
   the WordPress snippet and the local-preview HTML and provides the :root
   design tokens and the shared .tcgd-* component classes. This file adds only
   the Compare page's own layout and components.

   Visual direction: Apple compare pages — calm, spacious, comparison-first,
   premium. A centered content column, intentional whitespace, soft borders +
   shadows, rounded cards. Two mirrored columns throughout; the indexed price
   chart is the ONLY full-width section. No sidebars, no dashboard clutter.

   Do NOT redeclare tokens here. When a shared layer is extracted, these rules
   move alongside the other dashboards'.
   ========================================================================= */

#tcgd-compare,
#tcgd-compare * { box-sizing: border-box; }

#tcgd-compare {
  font-family: var(--tcgd-font);
  color: var(--tcgd-text);
  background: var(--tcgd-bg);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Full-bleed breakout (WordPress wraps page content in a narrow column),
     then re-center a calmer, comparison-width shell inside. */
  width: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  /* Respond to the page's OWN width, not the viewport — robust inside a narrow
     theme column. */
  container-type: inline-size;
  container-name: tcgdcmp;

  /* Comparison width — narrower than the analytical dashboards for an Apple-
     compare feel (centered, lots of air), capped on ultra-wide screens. */
  --cmp-max: 1120px;
  /* Per-side accents — left = primary accent, right = secondary violet. Both
     reference shared tokens so the side colors shift in dark mode alongside
     the rest of the palette. */
  --side-left:  var(--tcgd-accent);
  --side-right: var(--tcgd-violet);
}

[data-theme="dark"] #tcgd-compare, .dark #tcgd-compare { color: var(--tcgd-text); background: var(--tcgd-bg); }
[data-theme="light"] #tcgd-compare, .light #tcgd-compare { color: var(--tcgd-text); background: var(--tcgd-bg); }

.tcgd-cmp-shell {
  max-width: var(--cmp-max);
  margin: 0 auto;
  padding: 28px max(20px, (100cqw - var(--cmp-max)) / 2) 88px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Mirrored two-column grid used by heroes, metrics and details. */
.tcgd-cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.tcgd-cmp-muted { color: var(--tcgd-text-muted); }
.tcgd-cmp-mono  { font-family: var(--tcgd-mono); font-size: 12px; }
.tcgd-cmp-na    { color: var(--tcgd-text-faint) !important; font-weight: 500 !important; }
.tcgd-pos { color: var(--tcgd-positive); }
.tcgd-neg { color: var(--tcgd-negative); }
.tcgd-cmp-noimg { font-size: 11px; color: var(--tcgd-text-faint); }

/* Type badges (sealed / single / set). */
.tcgd-cmp-badge {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; align-self: flex-start;
  background: var(--tcgd-tag-bg); color: var(--tcgd-tag-text);
}
.tcgd-cmp-badge.t-sealed { background: var(--tcgd-accent-soft); color: var(--tcgd-accent-text); }
.tcgd-cmp-badge.t-single { background: var(--tcgd-violet-soft); color: var(--tcgd-violet-text); }
.tcgd-cmp-badge.t-set    { background: var(--tcgd-warn-soft); color: var(--tcgd-warn); }

/* =========================================================================
   Section 1 — entity selectors
   ========================================================================= */

.tcgd-cmp-selectrow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: end;
}

.tcgd-cmp-selector { position: relative; min-width: 0; }
.tcgd-cmp-sel-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--tcgd-text-muted); margin: 0 4px 6px;
}
.tcgd-cmp-sel-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr 18px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  min-height: 62px;
  border: 1px solid var(--tcgd-border);
  border-radius: var(--tcgd-radius-lg);
  background: var(--tcgd-surface);
  box-shadow: var(--tcgd-shadow);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
.tcgd-cmp-sel-btn:hover { border-color: var(--tcgd-border-strong); box-shadow: var(--tcgd-shadow-hover); }
.tcgd-cmp-open .tcgd-cmp-sel-btn { border-color: var(--tcgd-accent); box-shadow: 0 0 0 3px var(--tcgd-accent-soft); }
.tcgd-cmp-sel-thumb {
  width: 40px; height: 40px; border-radius: var(--tcgd-radius-sm);
  background: var(--tcgd-surface-2); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tcgd-cmp-sel-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tcgd-cmp-sel-thumb-empty { font-size: 20px; font-weight: 300; color: var(--tcgd-text-faint); }
.tcgd-cmp-sel-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tcgd-cmp-sel-name {
  font-size: 14px; font-weight: 700; color: var(--tcgd-text); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tcgd-cmp-sel-type { font-size: 11px; color: var(--tcgd-text-muted); font-weight: 500; }
.tcgd-cmp-sel-chev { width: 16px; height: 16px; color: var(--tcgd-text-muted); display: flex; }
.tcgd-cmp-sel-chev svg { width: 100%; height: 100%; }

/* center swap button */
.tcgd-cmp-swap {
  width: 44px; height: 44px; margin-bottom: 9px;
  border-radius: 50%;
  border: 1px solid var(--tcgd-border);
  background: var(--tcgd-surface);
  box-shadow: var(--tcgd-shadow);
  color: var(--tcgd-text-soft);
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 160ms ease, border-color 130ms ease, color 130ms ease;
}
.tcgd-cmp-swap:hover { border-color: var(--tcgd-accent); color: var(--tcgd-accent); transform: rotate(180deg); }
.tcgd-cmp-swap-ico { width: 18px; height: 18px; display: flex; }
.tcgd-cmp-swap-ico svg { width: 100%; height: 100%; }

/* search picker panel */
.tcgd-cmp-picker {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--tcgd-surface);
  border: 1px solid var(--tcgd-border);
  border-radius: var(--tcgd-radius-lg);
  box-shadow: var(--tcgd-shadow-drawer);
  overflow: hidden;
}
.tcgd-cmp-pickfield { padding: 10px; border-bottom: 1px solid var(--tcgd-divider); }
.tcgd-cmp-pickinput {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--tcgd-border); border-radius: var(--tcgd-radius-sm);
  background: var(--tcgd-surface-2); color: var(--tcgd-text);
  font-family: inherit; font-size: 13.5px; outline: none;
}
.tcgd-cmp-pickinput:focus { border-color: var(--tcgd-accent); box-shadow: 0 0 0 3px var(--tcgd-accent-soft); }
.tcgd-cmp-results { max-height: 340px; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.tcgd-cmp-result-state { padding: 18px 12px; text-align: center; color: var(--tcgd-text-muted); font-size: 12.5px; }
.tcgd-cmp-result {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  padding: 7px 8px; border: none; background: transparent; border-radius: var(--tcgd-radius-sm);
  cursor: pointer; text-align: left; font-family: inherit; color: inherit;
}
.tcgd-cmp-result:hover { background: var(--tcgd-surface-2); }
.tcgd-cmp-result-thumb {
  width: 34px; height: 34px; border-radius: 5px; overflow: hidden; flex-shrink: 0;
  background: var(--tcgd-surface-3); display: flex; align-items: center; justify-content: center;
}
.tcgd-cmp-result-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tcgd-cmp-result-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tcgd-cmp-result-name { font-size: 13px; font-weight: 600; color: var(--tcgd-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcgd-cmp-result-sub { font-size: 11px; color: var(--tcgd-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcgd-cmp-result-badge { font-size: 8.5px; padding: 2px 7px; }

/* =========================================================================
   Section 2 — hero cards
   ========================================================================= */

.tcgd-cmp-hero {
  border: 1px solid var(--tcgd-border);
  border-radius: var(--tcgd-radius-lg);
  background: var(--tcgd-surface);
  box-shadow: var(--tcgd-shadow);
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 18px;
  /* a whisper of the side color at the very top edge */
  border-top: 3px solid var(--side-color, var(--tcgd-accent));
}
.tcgd-cmp-hero-top { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.tcgd-cmp-hero-img {
  width: 96px; height: 130px; border-radius: var(--tcgd-radius);
  background: var(--tcgd-surface-2); border: 1px solid var(--tcgd-border);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.tcgd-cmp-hero-img img { width: 100%; height: 100%; object-fit: contain; }
.tcgd-cmp-hero-head { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tcgd-cmp-hero-title {
  margin: 2px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--tcgd-text);
}
.tcgd-cmp-hero-cat { font-size: 12.5px; color: var(--tcgd-text-soft); font-weight: 600; }
.tcgd-cmp-hero-sub { font-size: 12.5px; color: var(--tcgd-text-muted); }
.tcgd-cmp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tcgd-cmp-tag {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--tcgd-tag-bg); color: var(--tcgd-tag-text);
}

.tcgd-cmp-hero-value {
  padding-top: 16px; border-top: 1px solid var(--tcgd-divider);
}
.tcgd-cmp-hero-vlabel {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--tcgd-text-muted); margin-bottom: 4px;
}
.tcgd-cmp-hero-vrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tcgd-cmp-hero-vnum {
  font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  color: var(--tcgd-text); font-variant-numeric: tabular-nums;
}
.tcgd-cmp-hero-chg {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 3px 10px; border-radius: 999px; background: var(--tcgd-surface-2);
}
.tcgd-cmp-hero-chg.tcgd-pos { color: var(--tcgd-positive); background: var(--tcgd-positive-soft); }
.tcgd-cmp-hero-chg.tcgd-neg { color: var(--tcgd-negative); background: var(--tcgd-negative-soft); }
.tcgd-cmp-hero-chg-sub { font-size: 10.5px; font-weight: 500; color: var(--tcgd-text-muted); }

.tcgd-cmp-metarow {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding-top: 16px; border-top: 1px solid var(--tcgd-divider);
}
.tcgd-cmp-metacell { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tcgd-cmp-metacell-k {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--tcgd-text-faint);
}
.tcgd-cmp-metacell-v {
  font-size: 13px; font-weight: 700; color: var(--tcgd-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Empty / loading placeholder card (heroes, metrics, details). */
.tcgd-cmp-empty {
  border: 1px dashed var(--tcgd-border-strong);
  border-radius: var(--tcgd-radius-lg);
  background: var(--tcgd-surface);
  padding: 40px 22px; text-align: center;
  color: var(--tcgd-text-muted); font-size: 13.5px;
  min-height: 120px; display: flex; align-items: center; justify-content: center;
}

/* =========================================================================
   Section 3 — indexed price chart (full width)
   ========================================================================= */

.tcgd-cmp-chartcard {
  border: 1px solid var(--tcgd-border);
  border-radius: var(--tcgd-radius-lg);
  background: var(--tcgd-surface);
  box-shadow: var(--tcgd-shadow);
  padding: 20px 22px 16px;
}
.tcgd-cmp-chart-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.tcgd-cmp-chart-title { font-size: 15px; font-weight: 700; }
.tcgd-cmp-chart-title small { font-weight: 500; color: var(--tcgd-text-muted); margin-left: 8px; font-size: 11.5px; }
.tcgd-cmp-windows {
  display: inline-flex; background: var(--tcgd-surface-2);
  border-radius: var(--tcgd-radius-sm); padding: 2px;
}
.tcgd-cmp-windows button {
  border: none; background: transparent; color: var(--tcgd-text-muted);
  font-size: 11.5px; font-weight: 700; padding: 6px 13px; border-radius: 5px;
  cursor: pointer; font-family: inherit; letter-spacing: 0.03em;
}
.tcgd-cmp-windows button.tcgd-active {
  background: var(--tcgd-surface); color: var(--tcgd-text); box-shadow: var(--tcgd-shadow);
}
.tcgd-cmp-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 4px; }
.tcgd-cmp-legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--tcgd-text-soft); }
.tcgd-cmp-legend-item.tcgd-cmp-dim { color: var(--tcgd-text-faint); }
.tcgd-cmp-legend-swatch { width: 14px; height: 4px; border-radius: 2px; flex-shrink: 0; }
.tcgd-cmp-legend-chg { font-variant-numeric: tabular-nums; font-weight: 700; }

.tcgd-cmp-chart { width: 100%; position: relative; }
.tcgd-cmp-chart svg { display: block; width: 100%; height: 360px; overflow: visible; }
.tcgd-cmp-chart-grid { stroke: var(--tcgd-divider); stroke-width: 1; }
.tcgd-cmp-chart-base { stroke: var(--tcgd-border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.tcgd-cmp-chart-axis { font-size: 10px; fill: var(--tcgd-text-muted); font-family: var(--tcgd-mono); }
.tcgd-cmp-chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tcgd-cmp-chart-endchip { font-size: 11px; font-weight: 800; font-family: var(--tcgd-mono); }
.tcgd-cmp-chart-empty {
  display: flex; align-items: center; justify-content: center;
  height: 360px; color: var(--tcgd-text-faint); font-size: 13.5px; text-align: center;
}
.tcgd-cmp-chart-foot { font-size: 11px; color: var(--tcgd-text-faint); margin-top: 8px; line-height: 1.5; }

/* ----- chart hover crosshair + tooltip -----
   Mirrors the Product Explorer's market-chart scrubber: a transparent hit
   rect catches mouse/touch; a single dashed vertical line snaps to the
   nearest date; one dot per side sits at that date's value on each line.
   The HTML tooltip shows the date and, per side, the indexed and raw value. */
.tcgd-cmp-chart-hit { cursor: crosshair; }
.tcgd-cmp-chart-cursor-line {
  stroke: var(--tcgd-text-muted);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  pointer-events: none;
}
.tcgd-cmp-chart-cursor-dot {
  stroke: var(--tcgd-surface);
  stroke-width: 2;
  pointer-events: none;
}
.tcgd-cmp-chart-tooltip {
  position: absolute;
  background: var(--tcgd-surface);
  border: 1px solid var(--tcgd-border-strong);
  border-radius: var(--tcgd-radius-sm);
  padding: 8px 11px 9px;
  box-shadow: var(--tcgd-shadow-hover);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
  transform: translateY(calc(-100% - 10px));
}
.tcgd-cmp-chart-tooltip.tcgd-cmp-chart-tooltip-below { transform: translateY(10px); }
.tcgd-cmp-chart-tooltip-date {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--tcgd-text-muted); font-variant-numeric: tabular-nums;
  text-transform: uppercase; margin-bottom: 6px;
}
.tcgd-cmp-chart-tooltip-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 2px 0;
}
.tcgd-cmp-chart-tooltip-swatch {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}
.tcgd-cmp-chart-tooltip-name {
  font-weight: 600; color: var(--tcgd-text);
  flex: 1 1 auto; min-width: 60px; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tcgd-cmp-chart-tooltip-idx {
  color: var(--tcgd-text-muted); font-weight: 600;
}
.tcgd-cmp-chart-tooltip-raw {
  color: var(--tcgd-text); font-weight: 700;
}

/* =========================================================================
   Sections 4 & 5 — cards (metrics, detail, retailer)
   ========================================================================= */

.tcgd-cmp-card {
  border: 1px solid var(--tcgd-border);
  border-radius: var(--tcgd-radius-lg);
  background: var(--tcgd-surface);
  box-shadow: var(--tcgd-shadow);
  padding: 18px 20px;
}
.tcgd-cmp-detailcol { display: flex; flex-direction: column; gap: 22px; }
.tcgd-cmp-card-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
}
.tcgd-cmp-card-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: 0.01em; color: var(--tcgd-text); }
.tcgd-cmp-card-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tcgd-cmp-card-sub {
  margin-left: auto; font-size: 11.5px; color: var(--tcgd-text-muted); font-weight: 500;
  max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* metrics list */
.tcgd-cmp-metriclist { display: flex; flex-direction: column; }
.tcgd-cmp-metric {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--tcgd-divider);
}
.tcgd-cmp-metric:last-child { border-bottom: none; }
.tcgd-cmp-metric-k { font-size: 12.5px; color: var(--tcgd-text-muted); }
.tcgd-cmp-metric-vwrap { display: flex; align-items: baseline; gap: 8px; }
.tcgd-cmp-metric-v { font-size: 14.5px; font-weight: 700; color: var(--tcgd-text); font-variant-numeric: tabular-nums; }
.tcgd-cmp-metric-sub { font-size: 10.5px; color: var(--tcgd-text-faint); font-variant-numeric: tabular-nums; }

/* definition list (detail cards) */
.tcgd-cmp-deflist { display: flex; flex-direction: column; }
.tcgd-cmp-def {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--tcgd-divider);
}
.tcgd-cmp-def:last-child { border-bottom: none; }
.tcgd-cmp-def-k { font-size: 12.5px; color: var(--tcgd-text-muted); flex-shrink: 0; }
.tcgd-cmp-def-v { font-size: 13px; font-weight: 600; color: var(--tcgd-text); text-align: right; font-variant-numeric: tabular-nums; }
.tcgd-cmp-def-link { font-size: 13px; font-weight: 600; color: var(--tcgd-accent-text); text-decoration: none; text-align: right; }
.tcgd-cmp-def-link:hover { text-decoration: underline; }

/* BOM contents */
.tcgd-cmp-bom { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tcgd-divider); }
.tcgd-cmp-bom-head {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--tcgd-text-muted); margin-bottom: 8px;
}
.tcgd-cmp-bom-list { display: flex; flex-direction: column; gap: 6px; }
.tcgd-cmp-bom-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; }
.tcgd-cmp-bom-qty { font-size: 12px; font-weight: 700; color: var(--tcgd-accent-text); font-variant-numeric: tabular-nums; }
.tcgd-cmp-bom-name { font-size: 12.5px; color: var(--tcgd-text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcgd-cmp-bom-val { font-size: 12.5px; font-weight: 600; color: var(--tcgd-text-soft); font-variant-numeric: tabular-nums; }

/* ----- top chase tiles (set view) -----
   A row of card tiles inside the Set Overview card: full-bleed image at the
   top of each tile, name below, rarity pill + price on the bottom row. The
   tile is a link to the card's TCGplayer page when one is available. */
.tcgd-cmp-chaseblock {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--tcgd-divider);
}
.tcgd-cmp-chase-head {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--tcgd-text-muted); margin-bottom: 10px;
}
.tcgd-cmp-chase-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.tcgd-cmp-chase-link { text-decoration: none; color: inherit; display: block; }
.tcgd-cmp-chase {
  border: 1px solid var(--tcgd-border);
  border-radius: var(--tcgd-radius);
  background: var(--tcgd-surface);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}
.tcgd-cmp-chase-link:hover .tcgd-cmp-chase {
  border-color: var(--tcgd-border-strong);
  box-shadow: var(--tcgd-shadow-hover);
}
.tcgd-cmp-chase-img {
  width: 100%; aspect-ratio: 5 / 7;
  background: var(--tcgd-surface-2);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tcgd-cmp-chase-img img { width: 100%; height: 100%; object-fit: contain; }
.tcgd-cmp-chase-img .tcgd-cmp-noimg { font-size: 10px; color: var(--tcgd-text-faint); }
.tcgd-cmp-chase-body {
  padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.tcgd-cmp-chase-name {
  font-size: 12.5px; font-weight: 700; line-height: 1.25; color: var(--tcgd-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.5em;
}
.tcgd-cmp-chase-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.tcgd-cmp-chase-rar {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--tcgd-accent-text); background: var(--tcgd-accent-soft);
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%;
  flex-shrink: 0;
}
.tcgd-cmp-chase-price {
  font-size: 13px; font-weight: 800; color: var(--tcgd-text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* retailer table */
.tcgd-cmp-tablewrap { overflow-x: auto; margin: 2px -4px -4px; }
.tcgd-cmp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tcgd-cmp-table th {
  text-align: left; font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--tcgd-text-muted); font-weight: 700; padding: 8px 10px;
  border-bottom: 1px solid var(--tcgd-border); white-space: nowrap;
}
.tcgd-cmp-table td { padding: 8px 10px; border-bottom: 1px solid var(--tcgd-divider); vertical-align: middle; }
.tcgd-cmp-table tr:last-child td { border-bottom: none; }
.tcgd-cmp-table td.tcgd-cmp-mono { font-family: var(--tcgd-mono); font-size: 11.5px; color: var(--tcgd-text-soft); }

/* =========================================================================
   Responsive — container queries on the page's own width.
   ========================================================================= */

@container tcgdcmp (max-width: 760px) {
  .tcgd-cmp-grid { grid-template-columns: 1fr; gap: 18px; }
  /* Selectors stack; the swap control rotates to sit between them. */
  .tcgd-cmp-selectrow { grid-template-columns: 1fr; gap: 10px; }
  .tcgd-cmp-swap { justify-self: center; transform: rotate(90deg); margin: 0; }
  .tcgd-cmp-swap:hover { transform: rotate(270deg); }
  .tcgd-cmp-hero-vnum { font-size: 28px; }
}

@container tcgdcmp (max-width: 460px) {
  .tcgd-cmp-hero-top { grid-template-columns: 72px 1fr; gap: 14px; }
  .tcgd-cmp-hero-img { width: 72px; height: 98px; }
  .tcgd-cmp-hero-title { font-size: 19px; }
  .tcgd-cmp-metarow { grid-template-columns: 1fr 1fr; }
}

/* Safety net for engines without @container support. */
@media (max-width: 640px) {
  .tcgd-cmp-grid { grid-template-columns: 1fr; }
}
