/* Paper Trench: trending styles (loaded after styles.css; this file belongs to one builder) */
/* #/board : the Trending table. A pro-terminal table on a desk, stacked cards on a phone. */

@media (min-width: 900px) {
  body[data-view="board"] .sheet { max-width: 1720px; padding-left: 20px; padding-right: 20px; }
  body[data-view="board"] .foot { max-width: 1720px; padding-left: 20px; }
}

.tr { --tr-line: var(--line); display: block; }

/* ---- the bar: tabs on the left, windows + quick buy on the right ---- */
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; padding: 6px 2px 12px; }
.tr-tabs { display: flex; align-items: baseline; gap: 4px 20px; flex-wrap: wrap; }
.tr-tab { border: 0; background: none; padding: 4px 0; cursor: pointer; color: var(--muted); font: 600 20px/1.1 var(--font-head); letter-spacing: -0.01em; }
.tr-tab:hover { color: var(--text); }
.tr-tab.on { color: var(--text); }
.tr-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.tr-wins { display: inline-flex; gap: 2px; }
.tr-win { border: 0; background: none; cursor: pointer; height: 28px; min-width: 34px; padding: 0 8px; border-radius: 6px; color: var(--text); font: 600 13px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.tr-win:hover { background: var(--bg-3); }
.tr-win.on { color: var(--blue-hi); background: var(--blue-soft); }
.tr-quick { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px 0 0; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); }
.tr-quick .qamt { border: 0; background: none; height: 30px; padding: 0 6px 0 12px; }
.tr-quick .qamt input { width: 38px; font-weight: 700; }
.tr-qlabel { color: var(--muted); font: 600 12.5px/1 var(--font-head); margin-right: 4px; white-space: nowrap; }
.tr-quick .presets { border-left: 1px solid var(--line-2); padding-left: 6px; }
.tr .asof { font-size: 12px; white-space: nowrap; }
.tr-heads-up:not(:empty) { margin: 0 0 10px; }
.tr-note { margin: 12px 2px 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 110ch; }

/* ---- the table ---- */
.tr-table { border: 1px solid var(--tr-line); border-radius: 8px; background: var(--bg-2); }
.tr-head, .tr-row {
  display: grid; align-items: center; column-gap: 14px;
  grid-template-columns: minmax(330px, 2.5fr) minmax(88px, 0.75fr) minmax(76px, 0.65fr) minmax(76px, 0.65fr) minmax(92px, 0.7fr) minmax(250px, 2fr) 158px;
  padding: 0 16px;
}
.tr-head { position: sticky; top: var(--top-h, 48px); z-index: 4; height: 34px; background: var(--bg-2); border-bottom: 1px solid var(--tr-line); border-radius: 8px 8px 0 0; }
.tr-h { color: var(--muted); font: 500 12px/1 var(--font-body, inherit); white-space: nowrap; }
.tr-h6 { text-align: right; padding-right: 6px; }
.tr-row { position: relative; min-height: 66px; padding-top: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--tr-line); }
.tr-row:last-child { border-bottom: 0; border-radius: 0 0 8px 8px; }
.tr-row:hover { background: var(--bg-3); }
.tr-row.busy { opacity: 0.7; }
.tr-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tr-link:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.tr-c { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.tr-c .up { color: var(--up); }
.tr-c .down { color: var(--down); }
.tr-big { font: 700 14px/1.1 var(--font-head); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-big.mc-mid { color: var(--warn); }
.tr-big.mc-hi { color: var(--up); }
.tr-sub { font: 600 12px/1.1 var(--font-head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-big[data-tip], .tr-chip[data-tip], .tr-age[data-tip], .tr-stage[data-tip] { position: relative; z-index: 2; cursor: help; width: fit-content; }

/* pair info */
.tr-pair { flex-direction: row; align-items: center; gap: 12px; }
.tr-img { flex: none; display: block; padding: 1px; border-radius: 6px; border: 1px solid var(--line-2); line-height: 0; }
.tr-img.lv-green { border-color: var(--up); }
.tr-img.lv-yellow { border-color: var(--warn); }
.tr-img.lv-red { border-color: var(--down); }
.tr-img .coin-img { position: static; left: auto; top: auto; display: block; object-fit: cover; width: 46px; height: 46px; border-radius: 4px; border: 0; font-size: 13px; }
.tr-img .coin-fb { display: grid; place-items: center; }
.tr-id { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.tr-l1, .tr-l2 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tr-sym { font: 700 15px/1.1 var(--font-head); color: var(--text); white-space: nowrap; flex: none; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
.tr-name { color: var(--muted); font-size: 14px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.tr-copy { position: relative; z-index: 2; flex: none; border: 0; background: none; padding: 2px; color: var(--muted); cursor: pointer; line-height: 0; border-radius: 4px; }
.tr-copy:hover { color: var(--text); background: var(--bg); }
.tr-stage { flex: none; padding: 2px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--tr-line); color: var(--muted); font: 600 11px/1.2 var(--font-head); white-space: nowrap; }
.tr-age { color: var(--up); font: 600 13px/1 var(--font-head); }
.tr-soc { position: relative; z-index: 2; color: var(--muted); line-height: 0; padding: 2px; border-radius: 4px; }
.tr-soc:hover { color: var(--blue-hi); background: var(--bg); }
.tr-played { color: var(--blue-hi); font-size: 11.5px; white-space: nowrap; }
.tr-sparkbox { flex: none; width: 84px; height: 30px; line-height: 0; margin-right: 4px; }
.tr-spark { display: block; width: 84px; height: 30px; overflow: visible; }
.tr-spark-line { stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tr-spark.up .tr-spark-line { stroke: var(--up); }
.tr-spark.up .tr-spark-fill { fill: var(--up-soft); }
.tr-spark.down .tr-spark-line { stroke: var(--down); }
.tr-spark.down .tr-spark-fill { fill: var(--down-soft); }
.tr-spark.flat .tr-spark-line { stroke: var(--line-2); stroke-dasharray: 3 3; }
.tr-spark-fill { stroke: none; }

/* token info: small chips in a grid */
.tr-info { display: grid; grid-template-columns: repeat(3, max-content); gap: 4px 6px; align-items: center; }
.tr-chip { display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--tr-line); background: var(--bg); color: var(--text); font: 600 11.5px/1 var(--font-mono, ui-monospace, monospace); white-space: nowrap; }
.tr-chip .ico { width: 11px; height: 11px; }
.tr-chip .lvl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.tr-chip.tc-green { color: var(--up); }
.tr-chip.tc-yellow, .tr-chip.tc-warn { color: var(--warn); }
.tr-chip.tc-red { color: var(--down); }
.tr-chip.tc-plain, .tr-chip.tc-unknown { color: var(--muted); }
.tr-chip.tc-green .lvl-dot { background: var(--up); }
.tr-chip.tc-yellow .lvl-dot { background: var(--warn); }
.tr-chip.tc-red .lvl-dot { background: var(--down); }
.tr-verdict { font-family: var(--font-head); }

/* action */
.tr-act { align-items: flex-end; }
.tr-buy { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; max-width: 158px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font: 700 12.5px/1 var(--font-head); cursor: pointer; white-space: nowrap; }
.tr-buy:hover { background: var(--blue-hi); }
.tr-buy:active { transform: translateY(1px); }
.tr-buy:disabled { opacity: 0.55; cursor: progress; }
.tr-buy .ico { width: 12px; height: 12px; }
.tr-body > .loading, .tr-body > .empty, .tr-body > .errbox, .tr-body > :not(.tr-row) { margin: 18px 16px; }

/* ---- a narrow desk: keep the table, scroll it sideways ---- */
@media (min-width: 761px) and (max-width: 1180px) {
  .tr-table { overflow-x: auto; }
  .tr-head, .tr-row { min-width: 1120px; }
  .tr-head { position: static; }
}

/* ---- phone: stacked cards with the same facts ---- */
@media (max-width: 760px) {
  .tr { padding: 0 10px; }
  .tr-bar { padding-bottom: 10px; }
  .tr-l1 { flex-wrap: wrap; row-gap: 4px; }
  .tr-tabs { gap: 4px 16px; }
  .tr-tab { font-size: 18px; min-height: 36px; }
  .tr-tools { width: 100%; justify-content: space-between; }
  .tr .asof { display: none; }
  .tr-table { border: 0; background: none; border-radius: 0; }
  .tr-head { display: none; }
  .tr-body { display: grid; gap: 10px; }
  .tr-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; padding: 12px; border: 1px solid var(--tr-line); border-radius: 10px; background: var(--bg-2); align-items: start; }
  .tr-row:last-child { border-bottom: 1px solid var(--tr-line); border-radius: 10px; }
  .tr-pair, .tr-tok, .tr-act { grid-column: 1 / -1; }
  .tr-mcap::before, .tr-liq::before, .tr-vol::before, .tr-tx::before, .tr-tok::before { content: attr(data-label); color: var(--muted); font-size: 11px; line-height: 1; }
  .tr-info { grid-template-columns: none; display: flex; flex-wrap: wrap; }
  .tr-chip { height: 22px; }
  .tr-act { align-items: stretch; }
  .tr-buy { max-width: none; height: 40px; font-size: 14px; }
  .tr-sparkbox { width: 72px; }
  .tr-spark { width: 72px; }
  .tr-win { height: 32px; }
}
