/*
 * Mobile layouts for the exchanges list (Pen EtGjU "F · Mobile · Exchanges")
 * and the exchange review (Pen lbyfV "F2 · Mobile · Exchange review"), 390 wide.
 * Desktop is untouched: the stacked layout applies up to 1300px (below that the
 * desktop card row and review header have no room), and mobile-only elements
 * (.d2-x-mob) are hidden above it.
 */
.d2-x-mob { display: none; }
.d2-xfilters__chips { display: contents; }

@media (max-width: 1300px) {
  .d2-x-dsk { display: none; }

  /* ---------- Exchanges: page head (kZanl) ---------- */
  .d2-xhead { gap: 12px; padding: 20px 16px 12px; }
  .d2-xhead__eyebrow { font-size: 10px; line-height: 13px; letter-spacing: 1.3px; }
  .d2-xhead__title { font-size: 30px; line-height: 33px; letter-spacing: -0.4px; }
  .d2-xfacts { align-self: stretch; width: 100%; max-width: 100%; gap: 0; padding: 4px 0; }
  .d2-xfact { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 10px; box-shadow: inset 1px 0 0 var(--line); }
  .d2-xfact__v { font-size: 20px; line-height: 26px; letter-spacing: 0; }
  .d2-xfact__k { width: auto; max-width: 100%; font-size: 11px; line-height: 14.3px; overflow-wrap: anywhere; }
  .d2-xhead { overflow: hidden; }
  .d2-xfilters { max-width: 100%; }
  .d2-xlist-wrap { overflow-x: clip; }
  .d2-xhead .d2-disclosure { position: relative; display: block; height: auto; padding: 10px 12px 10px 34px; line-height: 17.4px; white-space: normal; }
  .d2-xhead .d2-disclosure svg { position: absolute; left: 12px; top: 12px; }
  .d2-xhead .d2-disclosure span { overflow: visible; }
  .d2-xhead .d2-disclosure a { margin-left: 4px; white-space: nowrap; }

  /* Filters (PYJu3): a scrolling chip row, then the toggle and sort. */
  .d2-xfilters { flex-wrap: wrap; height: auto; gap: 10px 0; padding: 4px 0 12px; }
  .d2-xfilters__chips { display: flex; gap: 8px; width: 100%; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .d2-xfilters__chips::-webkit-scrollbar { display: none; }
  .d2-xfilters__chips .d2-fchip { flex: none; height: 30px; padding: 7px 12px; font-size: 12px; line-height: 16px; }
  .d2-xfilters__chips .d2-fchip svg { display: none; }
  .d2-xfilters__spacer { display: none; }
  .d2-xfilters .d2-toggle { margin-left: 16px; height: 18px; }
  .d2-xfilters .d2-sort { margin: 0 16px 0 auto; }
  .d2-xfilters .d2-sort summary { height: 17px; gap: 4px; padding: 0; box-shadow: none; }
  .d2-xfilters .d2-sort__menu { top: 24px; }

  /* Exchange cards (RDy0e) */
  .d2-xlist { gap: 12px; padding: 0 16px 16px; }
  .d2-xcard__main { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .d2-xcard .d2-xid { width: auto; gap: 12px; padding: 16px 16px 12px; }
  .d2-xid__rank { font-size: 12px; line-height: 16px; }
  .d2-xid__logo { width: 38px; height: 38px; }
  .d2-xid__names { flex: 1; min-width: 0; gap: 4px; }
  .d2-xid__name { font-size: 21px; line-height: 21px; }
  .d2 .d2-xid__mscore { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
  .d2-xid__mscore-v { font: 400 22px/29px var(--font-mono); color: var(--ink); }
  .d2-xid__mscore-of { font: 400 10px/13px var(--font-mono); color: var(--ink-muted); }
  .d2-xcard .d2-xdata { display: none; }
  .d2 .d2-xmgrid { display: grid; grid-template-columns: 1fr 1fr; box-shadow: inset 0 1px 0 var(--line); }
  .d2-xmcell { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 16px; }
  .d2-xmcell:nth-child(1) { box-shadow: inset -1px 0 0 var(--line), inset 0 -1px 0 var(--line); }
  .d2-xmcell:nth-child(2) { box-shadow: inset 0 -1px 0 var(--line); }
  .d2-xmcell:nth-child(3) { box-shadow: inset -1px 0 0 var(--line); }
  .d2-xmcell__k { font: 400 9px/12px var(--font-mono); letter-spacing: 1.1px; color: var(--ink-muted); white-space: nowrap; }
  .d2-xmcell__v { font: 400 17px/22px var(--font-mono); color: var(--ink); }
  .d2-xmcell__d { font: 400 10px/13px var(--font-mono); color: var(--ink-muted); }
  .d2-xmcell__t { font-size: 13px; line-height: 17px; color: var(--ink); }
  .d2 .d2-xmcell .d2-muted { color: var(--ink-muted); }
  .d2-xcard .d2-xactions { width: auto; flex-direction: row; align-items: center; gap: 10px; padding: 12px 16px; box-shadow: inset 0 1px 0 var(--line); }
  .d2-xcard .d2-cta { flex: 1; width: auto; height: 40px; padding: 11px 0; font-size: 14px; line-height: 18px; }
  .d2-xactions__review { font-weight: 500; }
  .d2 .d2-xactions__review .d2-x-mob { display: inline; }
  .d2-xreg { flex-direction: column; align-items: flex-start; gap: 3px; height: auto; padding: 10px 16px; box-shadow: none; font-size: 11px; white-space: normal; }
  .d2-xreg__status { line-height: 14px; }
  .d2-xreg__risk { overflow: visible; line-height: 15px; }
  .d2-xreg__link { display: none; }

  /* Onchain route (uRTEZ) */
  .d2-xcard--onchain .d2-xcard__main { gap: 10px; padding: 16px; }
  .d2-xcard--onchain .d2-xid { padding: 0; }
  .d2-xcard--onchain .d2-xid__rank { display: none; }
  .d2-xcard--onchain .d2-xid__logo { border-radius: 9px; }
  .d2 .d2-xm-summary { display: block; font-size: 13px; line-height: 19px; color: var(--ink-secondary); }
  .d2-xcard--onchain .d2-xactions { justify-content: flex-start; padding: 0; box-shadow: none; }

  /* How we score (w03YI): full-bleed, weights only. Before you buy follows. */
  .d2-xmethod { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
  .d2-scorecard { width: auto; gap: 12px; padding: 20px 16px; border-radius: 0; }
  .d2-scorecard__title, .d2-scorecard__link { display: none; }
  .d2-scorecard__eyebrow { font-size: 10px; line-height: 13px; letter-spacing: 1.4px; }
  .d2-weight { gap: 5px; }
  .d2-weight__track, .d2-weight__track i { height: 5px; }
  .d2-before { padding: 24px 16px 28px; }
  .d2-faq__item summary { height: auto; min-height: 21px; }

  /* ---------- Exchange review (lbyfV) ---------- */
  .d2-review .d2-crumbs { display: none; }
  .d2 .d2-rback { display: flex; align-items: center; gap: 4px; padding: 12px 16px 0; font-size: 13px; line-height: 17px; color: var(--ink-muted); }
  .d2-rback svg { transform: rotate(180deg); }
  .d2-rhead { flex-wrap: wrap; align-items: flex-start; height: auto; gap: 16px; padding: 14px 16px 20px; }
  .d2-rhead__id { flex: 1 1 100%; gap: 14px; }
  .d2-rhead__logo { width: 52px; height: 52px; }
  .d2-rhead__names { flex: 1; min-width: 0; gap: 6px; }
  .d2-rhead__title { font-size: 30px; line-height: 30px; letter-spacing: -0.4px; white-space: normal; }
  .d2-rhead__line .d2-rhead__meta { display: none; }
  .d2 .d2-rhead__mmeta { display: block; flex: 1 1 100%; font-size: 12px; line-height: 17px; color: var(--ink-secondary); }
  .d2-rscore { align-self: center; align-items: flex-start; gap: 2px; }
  .d2-rscore__v { gap: 3px; }
  .d2-rscore__n { font-size: 40px; line-height: 52px; letter-spacing: -1.2px; }
  .d2-rscore__of { font-size: 13px; line-height: 17px; }
  .d2-rhead__actions { flex: 1; align-self: center; width: auto; gap: 6px; }

  .d2-rbody { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px 16px 28px; }
  .d2-rmain, .d2-rrail { display: contents; }
  .d2-verdict { gap: 8px; padding: 18px; }
  .d2-verdict__t { font-size: 16px; line-height: 24px; }

  /* Key facts: 2 × 3 (cost, volume / share, minimum / deposits, withdraw). */
  .d2-rfacts { display: grid; grid-template-columns: 1fr 1fr; }
  .d2-rfacts__row { display: contents; }
  .d2 .d2-rfact { min-width: 0; gap: 6px; padding: 14px; box-shadow: none; }
  .d2-rfacts__row:first-child .d2-rfact:nth-child(1), .d2-rfacts__row:first-child .d2-rfact:nth-child(3) { box-shadow: inset -1px 0 0 var(--line), inset 0 -1px 0 var(--line); }
  .d2-rfacts__row:first-child .d2-rfact:nth-child(2) { box-shadow: inset 0 -1px 0 var(--line); }
  .d2-rfacts__row:nth-child(2) .d2-rfact:nth-child(1) { order: 2; box-shadow: inset -1px 0 0 var(--line); }
  .d2-rfacts__row:nth-child(2) .d2-rfact:nth-child(2) { order: 1; box-shadow: inset 0 -1px 0 var(--line); }
  .d2-rfacts__row:nth-child(2) .d2-rfact:nth-child(3) { order: 3; }
  .d2-rfact__k { line-height: 11.7px; white-space: normal; }
  .d2-rfact__v.is-mono { font-size: 20px; line-height: 26px; }
  .d2-rfact__v.is-text { font-size: 13px; line-height: 18.2px; }

  .d2-panel2 { padding: 16px; }
  .d2-rcoins { gap: 12px; }
  .d2-panel2__title { font-size: 20px; line-height: 20px; }
  .d2-rcoins .d2-rtable { display: none; }
  .d2 .d2-rmlist { display: flex; flex-direction: column; }
  .d2-rmrow { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
  .d2-rmrow + .d2-rmrow { box-shadow: inset 0 -1px 0 var(--line); }
  .d2-rmrow__head { display: flex; align-items: center; gap: 10px; }
  .d2-rmrow__head img { width: 24px; height: 24px; border-radius: 50%; }
  .d2-rmrow__coin { font: 600 14px/18px var(--font-body); color: var(--ink); }
  .d2-rmrow__pair { font: 400 12px/16px var(--font-mono); color: var(--ink-secondary); }
  .d2-rmrow__stats { display: flex; justify-content: space-between; }
  .d2-rmrow__stat { display: flex; flex-direction: column; gap: 2px; }
  .d2-rmrow__k { font: 400 9px/12px var(--font-mono); letter-spacing: 1.1px; color: var(--ink-muted); }
  .d2-rmrow__v { font: 400 15px/19px var(--font-mono); color: var(--ink); }
  .d2-rmrow__bs { font: 400 11px/14px var(--font-mono); color: var(--ink-secondary); }
  .d2-rcoins .d2-rnote { line-height: 17px; }

  .d2-rscores { gap: 14px; }
  .d2-rscores__head { height: 20px; }
  .d2-rscorebar__head { font-size: 13px; line-height: 17px; }
  .d2-tradeoffs { flex-direction: column; gap: 16px; }
  .d2-tradeoff { padding: 16px; }
  .d2-rreg, .d2-rcompare { padding: 16px; }

  /* Sticky visit bar (ETYXQ) */
  .d2 .d2-rsticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 16px 24px; background: #FFFFFFF2; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 1px 0 var(--line); }
  .d2-rsticky__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .d2-rsticky__p { font: 400 12px/16px var(--font-mono); color: var(--ink); }
  .d2-rsticky__s { font-size: 11px; line-height: 14px; color: var(--ink-muted); }
  .d2-rsticky__btn { flex: none; padding: 11px 18px; border-radius: 8px; background: var(--accent); font: 500 14px/18px var(--font-body); color: #fff; }
  .d2 .d2-rsticky__btn:hover { text-decoration: none; }
  body.single-ocm_provider { padding-bottom: 76px; }
}

/* 1301–1439: the desktop card row is a little tight; clip stat text rather than let it touch the next column. */
@media (min-width: 1301px) and (max-width: 1439px) {
  .d2-xstat { overflow: hidden; }
  .d2-xstat > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
