/* Trade page. Everything is namespaced tr- so it never collides with shared classes. */

/* ---------- shared bits ---------- */
.tr-tag { font: 600 9.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(255, 200, 90, 0.35); padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.tr-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--tx2); transition: background 0.15s, color 0.15s, transform 0.3s var(--spring); }
.tr-icon:hover, .tr-icon[aria-expanded="true"] { background: var(--s3); color: var(--tx); }
.tr-coin {
  --sz: 24px; width: var(--sz); height: var(--sz); border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: #fff; border: 1px solid var(--line2); color: #fff; font: 700 calc(var(--sz) * 0.46) var(--sans);
}
.tr-coin img { width: 100%; height: 100%; display: block; }
.tr-coin.tkl { background: none; border: 0; }
.tr-coin.hype { background: linear-gradient(135deg, #5a5a5a, #cfcfcf); border: 0; color: #fff; font: 800 13px var(--sans); }
.tr-coin.usdc { background: #2775ca; border: 0; }
.tr-coin.usdt { background: #26a17b; border: 0; }
.tr-coin.comet { background: radial-gradient(circle at 35% 30%, var(--violet), #242424 70%); border: 0; color: #000000; }
.tr-coin.txt { background: var(--s3); color: var(--violet); font: 700 calc(var(--sz) * 0.42) var(--mono); }
.tr-pair { display: flex; flex: none; }
.tr-pair .tr-coin + .tr-coin { margin-left: -8px; box-shadow: 0 0 0 2px var(--s1); }
.tr-v { font: 600 9.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line2); color: var(--tx2); white-space: nowrap; }
.tr-v.DLMM { color: var(--violet); border-color: rgba(255, 255, 255, 0.35); }
.tr-v.DAMM { color: #ebebeb; border-color: rgba(232, 236, 239, 0.3); }
.tr-v.CLMM { color: var(--up); border-color: rgba(134, 217, 180, 0.35); }
.tr-v.LAUNCH { color: var(--gold); border-color: rgba(255, 200, 90, 0.35); }

/* ---------- hero ---------- */
.tr-hero { padding-bottom: 40px; }
.tr-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); column-gap: clamp(32px, 6vw, 96px);
  grid-template-areas: "copy card" "facts card"; grid-template-rows: auto 1fr; align-items: start;
}
.tr-hero-copy { grid-area: copy; padding-top: clamp(8px, 4vw, 56px); }
.tr-pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(255, 200, 90, 0.16); }
.tr-hero h1 { font-size: clamp(46px, 7vw, 92px); line-height: 0.93; font-weight: 700; letter-spacing: -0.055em; margin-top: 24px; }
.tr-hero .lede { font-size: clamp(16px, 1.5vw, 18.5px); color: var(--tx2); margin-top: 24px; max-width: 470px; }
.tr-facts { grid-area: facts; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 44px 0 0; max-width: 470px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: start; }
.tr-facts > div { background: rgba(10, 10, 10, 0.85); padding: 16px 18px; }
.tr-facts dt { font-size: 30px; font-weight: 600; line-height: 1; height: 30px; overflow: hidden; display: flex; }
.tr-facts dd { margin: 8px 0 0; font: 500 10.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); }
.tr-roll { display: inline-block; height: 30px; overflow: hidden; }
.tr-roll > span { display: flex; flex-direction: column; transition: transform 1.4s var(--ease); }
.tr-roll > span > span { height: 30px; line-height: 30px; }
.tr-swap-col { grid-area: card; position: relative; }

/* ---------- swap card ---------- */
.tr-card { position: relative; padding: 10px; overflow: visible; }
.tr-card::before { /* soft violet glow behind the card */
  content: ""; position: absolute; inset: 18% 6% -4%; z-index: -1; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.16), transparent); filter: blur(30px); pointer-events: none;
}
.tr-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 10px; }
.tr-card-tools { display: flex; align-items: center; gap: 6px; }
.tr-seg { position: relative; display: flex; padding: 3px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); }
.tr-seg button { position: relative; z-index: 1; padding: 6px 14px; border-radius: 5px; font-size: 13.5px; font-weight: 650; color: var(--tx3); transition: color 0.2s; }
.tr-seg button.on { color: var(--tx); }
.tr-seg-ind, .tr-chips-ind {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 5px; background: var(--s3); box-shadow: var(--hi), 0 0 0 1px var(--line2);
  transition: transform 0.45s var(--spring), width 0.45s var(--spring);
}

.tr-box { position: relative; border-radius: 7px; background: var(--s1); border: 1px solid var(--line); padding: 14px 14px 12px; transition: border-color 0.2s; }
.tr-box:focus-within { border-color: var(--line2); }
.tr-box + .tr-box, .tr-flip + .tr-box { margin-top: 6px; }
.tr-box-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 16px; }
.tr-usd { font-size: 12px; color: var(--tx3); }
.tr-box-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
#payIn, #getOut {
  flex: 1; min-width: 0; width: 100%; background: none; border: 0; outline: none; padding: 0; color: var(--tx);
  font-size: clamp(26px, 7.4vw, 32px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#getOut { display: block; }
#getOut.dim { color: var(--tx3); }
#payIn::placeholder { color: var(--tx3); }
.tr-tok {
  display: flex; align-items: center; gap: 8px; flex: none; padding: 6px 10px 6px 6px; border-radius: 6px; background: var(--s3);
  font-weight: 700; font-size: 15px; box-shadow: var(--hi), 0 0 0 1px var(--line2); transition: background 0.15s, transform 0.3s var(--spring);
}
.tr-tok:hover { background: #24262a; }
.tr-tok:active { transform: scale(0.96); }
.tr-tok svg { color: var(--tx3); margin-left: -2px; }
.tr-quick { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tr-quick button { font: 500 11.5px var(--mono); color: var(--tx3); padding: 4px 8px; border-radius: 4px; border: 1px solid var(--line); transition: color 0.15s, border-color 0.15s, background 0.15s; }
.tr-quick button:hover { color: var(--tx); border-color: var(--line2); background: var(--s2); }

.tr-flip {
  display: grid; place-items: center; position: relative; z-index: 2; width: 38px; height: 38px; margin: -14px auto -20px; border-radius: 7px;
  background: var(--s3); border: 4px solid var(--s2); color: var(--tx2); transition: color 0.15s, transform 0.5s var(--spring);
}
.tr-flip:hover { color: var(--violet); }

/* route strip inside the card */
.tr-route { margin-top: 10px; padding: 12px 12px 10px; border-radius: 7px; border: 1px dashed var(--line2); min-height: 74px; }
.tr-route-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.tr-route-h .eyebrow { font-size: 10px; }
.tr-route-h b { font: 600 10px var(--mono); letter-spacing: 0.12em; color: var(--violet); text-transform: uppercase; }
.tr-path { display: flex; align-items: flex-start; }
.tr-node { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 44px; max-width: 76px; animation: tr-pop 0.5s var(--spring) both; }
.tr-node .tr-coin { --sz: 26px; }
.tr-node small { font: 500 10.5px var(--mono); color: var(--tx2); text-align: center; line-height: 1.25; overflow-wrap: anywhere; }
.tr-node small b { display: block; color: var(--tx3); font-weight: 500; font-size: 9.5px; letter-spacing: 0.06em; }
.tr-link { flex: 1; min-width: 26px; position: relative; height: 26px; display: grid; place-items: center; margin: 0 -4px; animation: tr-fade 0.5s var(--ease) both; }
.tr-link::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line2); }
.tr-beam { position: absolute; left: 0; right: 0; top: calc(50% - 1px); height: 2px; overflow: hidden; }
.tr-beam::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: 0;
  background: linear-gradient(90deg, transparent, var(--violet), transparent); transform: translateX(-110%);
  animation: tr-beam 1.8s var(--ease) infinite; animation-delay: var(--d, 0s);
}
.tr-link .tr-v { position: relative; background: var(--s2); font-size: 9px; padding: 2px 5px; }
.tr-route-empty { font: 500 12px var(--mono); color: var(--dn); text-align: center; padding: 12px 0; }
.paused .tr-beam::after, .paused .tr-edge.best { animation-play-state: paused; }
@keyframes tr-beam { to { transform: translateX(230%); } }
@keyframes tr-pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes tr-fade { from { opacity: 0; } }

/* details accordion */
.tr-det { margin-top: 8px; }
.tr-det-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.tr-rate { padding: 4px; color: var(--tx2); font-size: 12.5px; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; transition: color 0.15s; }
.tr-rate:hover { color: var(--tx); }
.tr-det-r { display: flex; align-items: center; gap: 8px; color: var(--tx3); flex: none; padding: 4px; font-size: 12.5px; border-radius: 4px; transition: color 0.15s; }
.tr-det-r:hover { color: var(--tx); }
.tr-det-r svg { transition: transform 0.35s var(--spring); }
.tr-det-r[aria-expanded="true"] svg { transform: rotate(180deg); }
.tr-det-r .warn { color: var(--gold); }
.tr-det-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease); }
.tr-det-body.on { grid-template-rows: 1fr; }
.tr-det-in { overflow: hidden; min-height: 0; padding: 0 4px; }
.tr-det-in > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12.5px; border-top: 1px solid var(--line); }
.tr-det-in > div:first-child { border-top: 0; }
.tr-det-in dt { color: var(--tx3); }
.tr-det-in dd { margin: 0; text-align: right; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-det-body.on .tr-det-in { padding-bottom: 8px; }
.tr-cta { margin-top: 6px; }
.tr-cta:disabled { --face: var(--s3); --ink: var(--tx3); box-shadow: var(--hi), 0 0 0 1px var(--line2); cursor: not-allowed; filter: none; }
.tr-foot { text-align: center; font: 500 10px var(--mono); letter-spacing: 0.1em; color: var(--tx3); padding: 10px 0 2px; text-transform: uppercase; }

/* settings popover */
.tr-pop {
  position: absolute; z-index: 20; top: 50px; right: 10px; width: min(300px, calc(100% - 20px)); padding: 6px 14px 12px;
  border-radius: 8px; background: var(--s2); border: 1px solid var(--line2); box-shadow: var(--hi), 0 24px 60px -12px rgba(0, 0, 0, 0.85);
  transform-origin: top right; animation: tr-in 0.28s var(--spring);
}
@keyframes tr-in { from { opacity: 0; transform: translateY(-6px) scale(0.96); } }
.tr-pop-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tr-pop-row .eyebrow { font-size: 10px; }
.tr-pop-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tr-slip { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 4px; margin-top: 8px; }
.tr-slip button { padding: 7px 8px; border-radius: 5px; border: 1px solid var(--line); font: 600 12px var(--mono); color: var(--tx2); transition: all 0.15s; }
.tr-slip button:hover { color: var(--tx); border-color: var(--line2); }
.tr-slip button.on { background: var(--violet); color: #000000; border-color: var(--violet); }
.tr-slip-in, .tr-mini-in { display: flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); font: 500 12px var(--mono); color: var(--tx3); }
.tr-slip-in:focus-within, .tr-mini-in:focus-within, .tr-rcp:focus-within { border-color: var(--violet-d); }
.tr-slip-in.on { border-color: var(--violet); }
.tr-slip-in input, .tr-mini-in input, .tr-rcp input { width: 100%; min-width: 0; background: none; border: 0; outline: none; color: var(--tx); font: 600 13px var(--mono); padding: 7px 0; text-align: right; }
.tr-mini-in { width: 86px; }
.tr-warn { margin-top: 8px; font-size: 12px; color: var(--gold); }
.tr-switch { width: 38px; height: 22px; border-radius: 22px; background: var(--s3); border: 1px solid var(--line2); position: relative; flex: none; transition: background 0.2s; }
.tr-switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--tx2); transition: transform 0.35s var(--spring), background 0.2s; }
.tr-switch[aria-checked="true"] { background: var(--violet-dd); border-color: var(--violet-d); }
.tr-switch[aria-checked="true"] i { transform: translateX(16px); background: var(--violet); }
.tr-rcp { display: block; margin-top: 10px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); padding: 0 8px; }
.tr-rcp input { text-align: left; font-size: 12px; }
.tr-pop-note { font-size: 12px; color: var(--tx3); margin-top: 10px; line-height: 1.45; }

/* token selector */
.tr-sel {
  position: absolute; z-index: 30; inset: 0; display: flex; flex-direction: column; padding: 14px 12px 10px; border-radius: 8px;
  background: linear-gradient(180deg, #121314, #0d0e0f); border: 1px solid var(--line2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
  animation: tr-up 0.32s var(--ease); outline: none;
}
@keyframes tr-up { from { opacity: 0; transform: translateY(14px); } }
.tr-sel-h { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.tr-sel-h h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.tr-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg); color: var(--tx3); transition: border-color 0.15s; }
.tr-search:focus-within { border-color: var(--violet-d); }
.tr-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--tx); font: 500 14.5px var(--sans); padding: 10px 0; }
.tr-search kbd { font: 500 10px var(--mono); color: var(--tx3); border: 1px solid var(--line2); border-radius: 3px; padding: 1px 5px; }
.tr-sel-pop { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0 6px; }
.tr-sel-pop button { display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 5px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; transition: border-color 0.15s, background 0.15s; }
.tr-sel-pop button .tr-coin { --sz: 20px; }
.tr-sel-pop button:hover { border-color: var(--line2); background: var(--s2); }
.tr-sel-pop button.cur { border-color: var(--violet-d); }
.tr-sel-list { list-style: none; margin: 4px -4px 0; padding: 0 4px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.tr-sel-list li { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 6px; cursor: pointer; transition: background 0.12s; }
.tr-sel-list li .tr-coin { --sz: 32px; }
.tr-sel-list li.act { background: var(--s3); }
.tr-sel-list li[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.tr-sel-list .t-main { flex: 1; min-width: 0; }
.tr-sel-list .t-main b { display: block; font-size: 14.5px; }
.tr-sel-list .t-main span { font-size: 12.5px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tr-sel-list .t-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tr-sel-list .t-side .num { font-size: 12.5px; color: var(--tx2); }
.tr-sel-list mark { background: none; color: var(--violet); }
.tr-sel-empty { padding: 30px 8px; text-align: center; color: var(--tx3); font-size: 14px; cursor: default !important; justify-content: center; }
.tr-sel-foot { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid var(--line); margin-top: 6px; font-size: 12.5px; color: var(--tx3); }
.tr-sel-foot .tr-coin { --sz: 22px; }
.tr-sel-foot b { color: var(--violet); }

/* ---------- section rhythm ---------- */
.tr-sec { padding: 120px 0 40px; }
.tr-sec h2 { font-size: clamp(36px, 5vw, 60px); }

/* ---------- routing ---------- */
.tr-rt { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 44px; align-items: stretch; }
.tr-rt-graph { display: flex; flex-direction: column; }
.tr-rt-ctl { padding: 18px 20px 4px; }
.tr-rt-ctl label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tr-rt-ctl b { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.tr-rt-usd { font-size: 12px; color: var(--tx3); }
.tr-graph { position: relative; flex: 1; padding: 6px 12px 0; min-height: 250px; display: flex; align-items: center; }
.tr-graph svg { flex: 1; min-width: 0; }
.tr-graph svg { display: block; width: 100%; height: auto; overflow: visible; }
.tr-edge { fill: none; stroke: var(--line2); stroke-width: 2; transition: stroke 0.35s, stroke-width 0.35s, opacity 0.35s; }
.tr-edge.off { opacity: 0.35; stroke-dasharray: 2 6; }
.tr-edge.hl { stroke: #ebebeb; }
.tr-edge.best { stroke: var(--violet); stroke-width: 3; stroke-dasharray: 10 8; animation: tr-flow 0.9s linear infinite; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5)); }
@keyframes tr-flow { to { stroke-dashoffset: -18; } }
.tr-elbl rect { fill: var(--s1); stroke: var(--line2); transition: stroke 0.35s, fill 0.35s; }
.tr-elbl text { font: 600 10.5px var(--mono); letter-spacing: 0.06em; fill: var(--tx3); transition: fill 0.35s; }
.tr-elbl.best rect { stroke: var(--violet-d); fill: #161616; }
.tr-elbl.best text { fill: var(--violet); }
.tr-elbl.hl text { fill: var(--tx); }
.tr-elbl.off { opacity: 0.4; }
.tr-gnode circle.ring { fill: var(--s2); stroke: var(--line2); stroke-width: 1.5; transition: stroke 0.35s; }
.tr-gnode.on circle.ring { stroke: var(--violet); }
.tr-gnode text { font: 600 12px var(--sans); fill: var(--tx); }
.tr-gnode text.glyph { font: 700 15px var(--sans); fill: #fff; }
.tr-gnode text.sub { font: 500 10px var(--mono); fill: var(--tx3); }
.tr-rt-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 20px 16px; font: 500 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx3); }
.tr-key { display: inline-block; width: 18px; height: 2px; background: var(--line2); margin-right: -6px; vertical-align: middle; }
.tr-key.best { background: var(--violet); height: 3px; }
.tr-key.off { background: repeating-linear-gradient(90deg, var(--line2) 0 2px, transparent 2px 6px); }

.tr-rt-list { display: flex; flex-direction: column; padding: 18px 14px 14px; }
.tr-rt-lh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 6px 12px; }
.tr-cands { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; align-content: start; }
.tr-cand {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 11px 12px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--s1); cursor: default; transition: border-color 0.3s, background 0.3s, opacity 0.3s;
}
.tr-cand:hover { border-color: var(--line2); }
.tr-cand.best { border-color: var(--violet-d); background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(10, 10, 10, 0.9) 70%); }
.tr-cand.off { opacity: 0.45; }
.tr-cand .c-path { display: flex; align-items: center; gap: 5px; font: 600 12px var(--mono); min-width: 0; flex-wrap: wrap; }
.tr-cand .c-path i { width: 10px; height: 1px; background: var(--tx3); display: block; }
.tr-cand .c-via { display: flex; gap: 4px; flex-wrap: wrap; }
.tr-cand .c-out { grid-row: span 2; text-align: right; font: 600 13.5px var(--mono); }
.tr-cand .c-out small { display: block; font: 500 10px var(--mono); letter-spacing: 0.1em; color: var(--tx3); text-transform: uppercase; margin-top: 3px; }
.tr-cand.best .c-out small { color: var(--violet); }
.tr-cand.off .c-out small { color: var(--dn); }
.tr-use { margin-top: 12px; }

.tr-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tr-steps li { padding: 20px; border-top: 1px solid var(--line2); }
.tr-step-no { font-size: 12px; color: var(--violet); font-weight: 600; }
.tr-steps h3 { font-size: 19px; margin: 8px 0 6px; letter-spacing: -0.02em; }
.tr-steps p { color: var(--tx2); font-size: 14.5px; }

/* ---------- pools explorer ---------- */
.tr-px { margin-top: 44px; padding: 14px 14px 6px; }
.tr-px-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; }
.tr-chips { position: relative; display: flex; padding: 3px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tr-chips::-webkit-scrollbar { display: none; }
.tr-chips button { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 5px; font-size: 13px; font-weight: 600; color: var(--tx3); white-space: nowrap; transition: color 0.2s; }
.tr-chips button.on { color: var(--tx); }
.tr-chips button sup { font: 500 10px var(--mono); color: var(--tx3); top: 0; }
.tr-chips button.on sup { color: var(--violet); }
.tr-px-q { width: min(260px, 100%); }
.tr-px-q input { padding: 8px 0; font-size: 14px; }

.tr-px-head, .tr-prow-g {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1fr) 92px 28px; gap: 14px; align-items: center;
}
.tr-px-head { padding: 8px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 500 10.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); }
.tr-px-head button { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; transition: color 0.15s; }
.tr-px-head button:hover, .tr-px-head button.on { color: var(--tx); }
.tr-px-head button i { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0.3; transition: transform 0.3s var(--spring), opacity 0.2s; }
.tr-px-head button.on i { opacity: 1; }
.tr-px-head button.on.asc i { transform: rotate(180deg); }
.tr-px-head .c-fee, .tr-px-head .c-tvl, .tr-px-head .c-vol { justify-content: flex-end; }
.tr-px-head .c-spark { text-align: center; }
.tr-prow { border-bottom: 1px solid var(--line); }
.tr-prow:last-child { border-bottom: 0; }
.tr-prow-g { width: 100%; padding: 12px; text-align: left; transition: background 0.15s; border-radius: 6px; margin: 2px 0; }
.tr-prow-g:hover { background: var(--s2); }
.tr-prow.open .tr-prow-g { background: var(--s2); }
.tr-prow .c-pair { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tr-prow .c-pair .tr-coin { --sz: 28px; }
.tr-prow .c-name { min-width: 0; }
.tr-prow .c-name b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-prow .c-name span { display: flex; align-items: center; gap: 6px; margin-top: 3px; font: 500 10.5px var(--mono); color: var(--tx3); white-space: nowrap; }
.tr-prow .c-fee, .tr-prow .c-tvl, .tr-prow .c-vol { text-align: right; font-size: 13.5px; }
.tr-prow .c-vol { color: var(--tx2); }
.tr-prow .c-spark svg { width: 92px; height: 30px; display: block; overflow: visible; }
.tr-spark { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tr-spark.up { stroke: var(--up); } .tr-spark.dn { stroke: var(--dn); }
.tr-spark-a.up { fill: rgba(134, 217, 180, 0.12); } .tr-spark-a.dn { fill: rgba(238, 142, 142, 0.1); }
.tr-prow-g:hover .tr-spark { animation: tr-draw 0.9s var(--ease); }
@keyframes tr-draw { from { stroke-dashoffset: 1; } }
.tr-prow .c-x { display: grid; place-items: center; color: var(--tx3); }
.tr-prow .c-x svg { transition: transform 0.35s var(--spring); }
.tr-prow.open .c-x svg { transform: rotate(45deg); color: var(--violet); }

.tr-pd { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease); }
.tr-prow.open .tr-pd { grid-template-rows: 1fr; }
.tr-pd-in { overflow: hidden; min-height: 0; }
.tr-pd-g { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; padding: 8px 12px 18px; }
.tr-pd-viz { border-radius: 7px; border: 1px solid var(--line); background: var(--bg); padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.tr-pd-viz svg { display: block; width: 100%; flex: 1; min-height: 120px; height: auto; overflow: visible; }
.tr-pd-viz .eyebrow { font-size: 10px; display: flex; justify-content: space-between; gap: 10px; }
.tr-pd-viz .t { font: 500 10px var(--mono); fill: var(--tx3); }
.tr-pd-txt p { color: var(--tx2); font-size: 14px; }
.tr-pd-kv { margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tr-pd-kv > div { background: var(--s1); padding: 9px 12px; }
.tr-pd-kv dt { font: 500 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--tx3); }
.tr-pd-kv dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; }
.tr-pd-act { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tr-px-empty { padding: 30px 12px; text-align: center; color: var(--tx3); }
.tr-px-foot { padding: 12px 12px 8px; font-size: 12px; color: var(--tx3); border-top: 1px solid var(--line); }

/* ---------- rules (spotlight cards) ---------- */
.tr-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 44px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tr-rule { position: relative; padding: 26px 24px 28px; background: rgba(12, 13, 14, 0.94); overflow: hidden; }
.tr-rule::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.1), transparent 70%);
}
.tr-rule:hover::before { opacity: 1; }
.tr-rule-i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 7px; border: 1px solid var(--line2); background: var(--s2); color: var(--violet); }
.tr-rule-i svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tr-rule h3 { font-size: 18px; margin: 18px 0 6px; letter-spacing: -0.02em; }
.tr-rule p { color: var(--tx2); font-size: 14.5px; max-width: 300px; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .tr-hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "card" "facts"; grid-template-rows: auto; }
  .tr-hero-copy { padding-top: 0; }
  .tr-swap-col { margin-top: 36px; width: min(480px, 100%); }
  .tr-facts { max-width: 480px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }
  .tr-rt { grid-template-columns: minmax(0, 1fr); }
  .tr-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tr-px-head, .tr-prow-g { grid-template-columns: minmax(0, 1fr) auto auto 20px; gap: 12px; }
  .tr-px-head .c-vol, .tr-prow .c-vol, .tr-px-head .c-spark, .tr-prow .c-spark { display: none; }
  .tr-pd-g { grid-template-columns: minmax(0, 1fr); }
  .tr-steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tr-steps li { padding: 16px 0; }
}
@media (max-width: 640px) {
  .tr-hero { padding-top: calc(var(--nav-h) + 40px); }
  .tr-hero h1 { margin-top: 20px; }
  .tr-swap-col { margin-top: 28px; }
  .tr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-facts > div { padding: 14px; }
  .tr-sec { padding: 88px 0 28px; }
  .tr-card { padding: 8px; }
  .tr-box { padding: 12px 12px 10px; }
  .tr-rt-ctl { padding: 16px 16px 4px; }
  .tr-graph { padding: 4px 4px 0; min-height: 0; }
  .tr-rt-list { padding: 16px 10px 10px; }
  .tr-rt-lh { flex-wrap: wrap; }
  .tr-px { padding: 10px 8px 4px; }
  .tr-px-bar { padding: 2px 4px 10px; }
  .tr-chips { width: 100%; }
  .tr-chips button { flex: 1 0 auto; justify-content: center; gap: 3px; padding: 6px 7px; font-size: 12.5px; }
  .tr-px-q { width: 100%; }
  .tr-prow-g { padding: 12px 6px; }
  .tr-px-head { padding: 8px 6px; }
  .tr-prow .c-name span .tr-bs { display: none; }
  .tr-pd-g { padding: 6px 6px 16px; }
  .tr-rules { grid-template-columns: minmax(0, 1fr); }
  .tr-rule { padding: 20px 18px; display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .tr-rule-i { grid-row: span 2; }
  .tr-rule h3 { margin: 2px 0 4px; font-size: 17px; }
  .tr-rule p { font-size: 14px; max-width: none; }
  .final { padding: 120px 0 90px; }
}
@media (hover: none) {
  .tr-rule::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-beam::after, .tr-edge.best, .tr-node, .tr-link, .tr-sel, .tr-pop { animation: none; }
  .tr-roll > span, .tr-seg-ind, .tr-chips-ind, .tr-det-body, .tr-pd, .tr-flip { transition: none; }
  .tr-prow-g:hover .tr-spark { animation: none; }
}
