/* Trade tab: token feed, token screen, order sheet. */
.tk-feed .screen-scroll { overflow-anchor: none; }
.tk-feed .screen-body { gap: 10px; }
.tk-head { display: flex; flex-direction: column; gap: 10px; }

.search { position: relative; }
.tk-clear { display: flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; margin-right: -5px; color: var(--hint); }
.tk-clear[hidden] { display: none; }

/* Network capsules */
.tk-rail { touch-action: pan-y; }
.tk-rail .carousel-track { gap: 8px; }
.tk-net {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 6px; border-radius: 17px;
  background: var(--fill); color: var(--text); font-size: 14px; line-height: 18px; font-weight: 500; white-space: nowrap;
  transition: transform .42s var(--spring), background-color .2s ease, color .2s ease;
}
.tk-net.press:active { transform: scale(.94); }
.tk-net.is-on { background: var(--text); color: var(--bg); font-weight: 600; }
.tk-net .tk-logo { width: 22px; height: 22px; }
.tk-net .tk-tile { font-size: 10px; }
.tk-net.is-on .tk-tile { color: var(--bg); background: color-mix(in srgb, var(--bg) 22%, transparent); }

.tk-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 18px; font-size: 13px; line-height: 18px; color: var(--hint); font-variant-numeric: tabular-nums; }
.tk-total { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-count [data-data-status] { flex: none; }

/* Logo: the tile is always there, the image fades in over it */
img.coin[data-tile] { background: var(--fill-strong); }
.tk-logo { position: relative; flex: none; display: block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
.tk-tile { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--fill-strong); color: var(--hint); font-size: 13px; line-height: 1; font-weight: 600; white-space: nowrap; overflow: hidden; }
.tk-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.tk-img.is-on { opacity: 1; }
/* A logo with a transparent background must not show the initials through it. */
.tk-logo:has(.tk-img.is-on) .tk-tile { color: transparent; }

/* Rows: fixed height, fixed slots */
.tk-list { position: relative; contain: layout paint; }
.tk-list[hidden] { display: none; }
.tk-list.is-reloading .tk-row { opacity: .55; }
.tk-row { position: absolute; left: 0; right: 0; top: 0; height: 64px; min-height: 64px; contain: layout paint style; transition: opacity .18s ease; }
.tk-row[hidden] { display: none; }
.tk-row::before { content: ""; position: absolute; top: 0; right: 0; left: 68px; height: .5px; background: var(--sep); }
.tk-row.is-first::before { display: none; }
.cell + .tk-row::before { left: 68px; }
.tk-row .market-name { min-width: 0; flex: 1 1 0; }
.tk-sub { display: flex; align-items: center; gap: 5px; min-width: 0; }
.market-name .tk-sym { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.market-name .tk-tag { flex: none; height: 17px; padding-inline: 5px; border-radius: 6px; font-size: 11px; line-height: 15px; font-weight: 500; }
.market-name .tk-tag.tag--down { font-weight: 600; }
.tk-tag[hidden] { display: none; }
/* In the narrowest frame the ticker keeps its room. Only the warning tag stays, and the address fits beside its icon. */
@container app (max-width: 350px) {
  .market-name .tk-tag:not(.tag--down) { display: none; }
  dd .tk-copy { font-size: 14px; }
}
.tk-row .market-price { min-width: 0; max-width: 62%; }
.tk-price.is-none { overflow: hidden; text-overflow: ellipsis; color: var(--hint); font-weight: 400; letter-spacing: 0; }
.tk-change { display: inline-flex; align-items: center; gap: 2px; height: 17px; font-size: 13px; line-height: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--green); }
.tk-change[hidden] { display: none; }
.tk-change.is-down { color: var(--red); }
.tk-change .icon { stroke-width: 3; }
.tk-change.is-down .icon { transform: rotate(180deg); }

/* Skeleton: the same row with its text turned into quiet bars */
.tk-row.is-skel { pointer-events: none; }
.tk-row.is-skel .tk-tile { color: transparent; background: var(--fill); }
.tk-row.is-skel .tk-name, .tk-row.is-skel .tk-sym, .tk-row.is-skel .tk-price, .tk-row.is-skel .tk-change {
  display: block; height: 11px; margin-block: 5px; border-radius: 5px; background: var(--fill); color: transparent; overflow: hidden;
}
.tk-row.is-skel .tk-name { width: 58%; font-size: 0; }
.tk-row.is-skel .tk-sym { width: 34%; font-size: 0; height: 9px; }
.tk-row.is-skel .tk-price { width: 66px; font-size: 0; }
.tk-row.is-skel .tk-change { width: 44px; font-size: 0; height: 9px; }
.tk-row.is-skel .tk-change > * { display: none; }
.tk-row.is-skel .tk-tag { display: none; }
.tk-row.is-skel .market-name { flex: 1 1 0; }
.tk-row.is-skel .market-price { align-items: flex-end; }
.tk-list:has(.is-skel) .tk-row.is-skel { animation: tk-breathe 1.5s ease-in-out infinite; }
@keyframes tk-breathe { 50% { opacity: .55; } }

.tk-state[hidden] { display: none; }
.tk-state .empty { gap: 10px; }
.tk-retry { margin-top: 4px; }

/* Back to the top, only when far down */
.tk-up {
  position: absolute; z-index: 8; right: calc(var(--gutter) + var(--safe-right)); bottom: calc(max(8px, var(--safe-bottom)) + 84px);
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text);
  background: var(--glass-tint); -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%);
  box-shadow: var(--float-shadow), inset 0 .5px 0 var(--glass-edge), inset 0 0 0 .5px var(--glass-line);
  opacity: 0; transform: translate3d(0, 12px, 0) scale(.8); pointer-events: none;
  transition: transform .42s var(--spring), opacity .18s ease;
}
.tk-up.is-on { opacity: 1; transform: none; pointer-events: auto; }

/* Token screen */
.detail-title { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-price.is-none { font: 600 24px/44px var(--font-display); letter-spacing: -.02em; color: var(--hint); }
.detail-price .roll { max-width: 100%; }
.detail-change[hidden], .detail-frame[hidden] { display: none; }
.tk-warn { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--red); margin-top: -14px; }
.tk-warn[hidden] { display: none; }
.tk-warn .icon { flex: none; }
.tk-chart-empty .chart-plot { opacity: 0; }
.tk-chart-empty .chart-note { top: 50%; left: 0; right: 0; margin: -8px 0 0; background: none; text-align: center; font-size: 14px; opacity: 1; }
.tk-chart-loading .chart-plot { opacity: 0; }
.tk-chart-loading::after { content: ""; position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; height: 2px; border-radius: 1px; background: var(--fill-strong); animation: tk-breathe 1.5s ease-in-out infinite; }
.tk-copy { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font: inherit; color: var(--link); }
.tk-copy span { overflow: hidden; text-overflow: ellipsis; }
.tk-copy .icon { flex: none; }
.tk-notice { padding: 15px 4px; text-align: center; font-size: 14px; line-height: 19px; color: var(--hint); }

/* Order sheet */
.tk-sheet-token { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tk-sheet-name { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.tk-sheet-name b { font-size: 16px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-sheet-name span { font-size: 13px; line-height: 17px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-sheet-price { flex: none; max-width: 56%; overflow: hidden; }
.tk-sheet-roll { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-order { gap: 12px; padding-bottom: 12px; }
/* The body is a flex column that scrolls on a small screen: its rows keep their height instead of shrinking. */
.tk-order > *, .tk-done > * { flex: none; }
.tk-order .field[hidden] { display: none; }
.tk-order .slider-stops { height: 24px; }
.tk-order-lev { display: flex; flex-direction: column; gap: 2px; }
.tk-summary { gap: 6px; padding-top: 12px; box-shadow: 0 -.5px 0 var(--sep); }
.tk-summary .summary-row > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tk-done { gap: 12px; padding-bottom: 12px; animation: list-in .28s var(--ease-out) both; }
.tk-done .receipt-hero { padding-top: 0; }
.tk-done .summary-row > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tk-disclaimer { text-align: center; font-size: 13px; line-height: 18px; color: var(--hint); }
.tk-link { align-self: center; min-height: 36px; padding-inline: 14px; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--link); }

/* Portfolio lines that came from the feed */
.order-title .coin { flex: none; }
.market-name b, .asset-row .market-name span { overflow: hidden; text-overflow: ellipsis; }

@container app (max-width: 375px) {
  .tk-sort .seg-btn { font-size: 12.5px; }
}
@container app (max-width: 350px) {
  .tk-net { font-size: 13px; }
  .tk-sort .seg-btn { font-size: 11.5px; }
  /* The swipe label keeps its whole text and its sheen beside the thumb. */
  .sheet-dock .swipe-text { font-size: 15px; }
  .sheet-dock .swipe-text, .sheet-dock .swipe-sheen, .sheet-dock .swipe-sheen-text { padding-inline: 60px 6px; }
  .tk-row { gap: 10px; }
  .tk-order { gap: 10px; }
  .tk-sheet-roll { font-size: 15px; }
}
