/* Elisia Trade — standalone terminal (trade.html). Tokens come from tokens.css; nothing here redefines brand colours. */
:root { --tp-line: rgba(255, 255, 255, .06); --tp-line-2: rgba(255, 255, 255, .11); --tp-top-h: 52px; --tp-bar-h: 48px; --tp-red-08: rgba(255, 77, 77, .08); --tp-red-24: rgba(255, 77, 77, .28);
  /* local shades derived from the tokens.css surfaces; kept here so no rule below carries a literal */
  --tp-warn: #D9A441; --tp-warn-08: rgba(217, 164, 65, .08); --tp-warn-24: rgba(217, 164, 65, .3); --tp-elevated-hover: #2B2F34; --tp-tip-bg: #15181A; }

.tp-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-terminal); font-size: 13px; line-height: 1.4; }
.tp-body h1, .tp-body h2 { font-stretch: normal; }
.tp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tp-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tp-body :where(a, button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.is-up { color: var(--accent); }
.is-down { color: var(--red-down); }
.tp-muted { color: var(--text-secondary); font-size: 12px; }
.tp-source { color: var(--text-faint); font: 10px var(--font-mono); margin-top: 8px; }
.tp-grow { flex: 1; min-width: 0; }

/* ---------- top bar ---------- */
.tp-top { height: var(--tp-top-h); flex: none; display: flex; align-items: center; gap: 20px; padding: 0 16px; background: var(--bg-base); border-bottom: 1px solid var(--tp-line); position: relative; z-index: 30; }
.tp-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.tp-brand img { width: 24px; height: 24px; border-radius: 6px; }
.tp-brand span { font-family: var(--font-display); font-stretch: var(--display-wdth); font-weight: 800; font-size: 15px; letter-spacing: var(--ls-display); }
.tp-nav { display: flex; align-items: center; gap: 2px; }
.tp-nav-link { height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-muted); transition: color var(--dur-fast) var(--ease-ui), background-color var(--dur-fast) var(--ease-ui); }
.tp-nav-link:hover { color: var(--text-primary); background: var(--bg-white-5); }
.tp-nav-link.is-active { color: var(--accent); }
.tp-search { position: relative; flex: 0 1 340px; margin-left: auto; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; background: var(--bg-terminal); border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); color: var(--text-faint); }
.tp-search:focus-within { border-color: var(--accent); }
.tp-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 13px; color: var(--text-primary); }
.tp-search input:focus-visible { outline: 0; }
.tp-search input::placeholder { color: var(--text-faint); }
.tp-kbd { font: 11px var(--font-mono); padding: 1px 6px; border: 1px solid var(--tp-line-2); border-radius: 4px; color: var(--text-faint); }
.tp-search-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px; max-height: 420px; overflow: auto; background: var(--bg-card); border: 1px solid var(--tp-line-2); border-radius: var(--radius-card); box-shadow: var(--shadow-card-xl); padding: 4px; z-index: 50; }
.tp-search-opt { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-primary); }
.tp-search-opt.is-active, .tp-search-opt:hover { background: var(--bg-elevated); }
.tp-search-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-search-text strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-search-text span { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-search-nums { flex: none; display: flex; flex-direction: column; align-items: flex-end; font: 11px var(--font-mono); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tp-search-note { padding: 10px; font-size: 12px; color: var(--text-secondary); }
.tp-top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.tp-account { display: flex; align-items: center; gap: 8px; }
.tp-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--bg-terminal); white-space: nowrap; }
button.tp-chip:hover { color: var(--text-primary); border-color: rgba(255, 255, 255, .2); }
.tp-net-dot, .tp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.tp-wallet-balance { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 500; }
.tp-wallet-unit { color: var(--text-faint); }
.tp-wallet-chip .tp-ico:last-child { width: 12px; height: 12px; }
.tp-account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }

/* ---------- buttons, selects, chips ---------- */
.tp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; transition: filter var(--dur-fast) var(--ease-ui), background-color var(--dur-fast) var(--ease-ui); }
.tp-btn:disabled { opacity: .5; cursor: not-allowed; }
.tp-btn-primary { background: var(--accent); color: var(--accent-text-on); }
.tp-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.tp-btn-sell { background: var(--red-down); color: var(--accent-text-on); }
.tp-btn-sell:hover:not(:disabled) { filter: brightness(1.08); }
.tp-btn-ghost { background: var(--accent-08); color: var(--accent); border-color: var(--accent-24); }
.tp-btn-ghost:hover { background: var(--accent-20); }
.tp-btn-dark { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--tp-line); }
.tp-btn-dark:hover:not(:disabled) { background: var(--tp-elevated-hover); }
.tp-icon-btn { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 6px; color: var(--text-faint); flex: none; }
.tp-icon-btn:hover { color: var(--text-primary); background: var(--bg-white-10); }
.tp-icon-btn .tp-ico { width: 13px; height: 13px; }
.tp-select { height: 32px; max-width: 210px; padding: 0 28px 0 10px; border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); background: var(--bg-terminal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A8A8A8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center; color: var(--text-primary); font: 12px var(--font-ui); appearance: none; -webkit-appearance: none; text-overflow: ellipsis; }
.tp-select:disabled { opacity: .55; }
.tp-chips { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--tp-line); border-radius: var(--radius-sm); background: var(--bg-base); }
.tp-chip-btn { height: 26px; min-width: 34px; padding: 0 9px; border-radius: 6px; font: 500 12px var(--font-mono); color: var(--text-muted); }
.tp-chip-btn:hover { color: var(--text-primary); }
.tp-chip-btn.is-active { background: var(--accent-08); color: var(--accent); }
.tp-tag { flex: 0 1 auto; min-width: 0; display: inline-block; height: 18px; line-height: 16px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--tp-line-2); font: 500 10px/16px var(--font-mono); color: var(--text-secondary); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tp-tag.is-good { color: var(--accent); border-color: var(--accent-24); background: var(--accent-08); }
.tp-tag.is-bad { color: var(--red-down); border-color: var(--tp-red-24); background: var(--tp-red-08); }
.tp-avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; font: 700 14px var(--font-mono); letter-spacing: -.02em; user-select: none; }
.tp-avatar-sm { width: 28px; height: 28px; border-radius: 7px; font-size: 11px; }
.tp-avatar-lg { width: 44px; height: 44px; border-radius: 11px; font-size: 15px; }
.tp-dot-key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tp-dot-key.is-hollow { background: transparent; border: 1.5px solid var(--text-faint); }

/* ---------- popover, tooltip, toast ---------- */
.tp-pop { position: fixed; z-index: 900; min-width: 230px; max-width: calc(100vw - 16px); padding: 6px; background: var(--bg-card); border: 1px solid var(--tp-line-2); border-radius: var(--radius-card); box-shadow: var(--shadow-card-xl); }
.tp-pop-title { padding: 6px 10px 8px; font: 10px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; }
.tp-pop-note { padding: 4px 10px 8px; font-size: 12px; color: var(--text-secondary); }
.tp-pop-item { width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-primary); text-align: left; }
.tp-pop-item:hover { background: var(--bg-elevated); }
.tp-pop-item.is-active { color: var(--accent); }
.tp-pop-detail { font: 11px var(--font-mono); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tp-pop-rule { border: 0; border-top: 1px solid var(--tp-line); margin: 6px 0; }
.tp-tip { position: fixed; z-index: 1200; pointer-events: none; min-width: 120px; max-width: 280px; padding: 8px 10px; background: var(--tp-tip-bg); border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); font-size: 12px; }
.tp-tip-title { font: 10px var(--font-mono); color: var(--text-faint); margin-bottom: 5px; }
.tp-tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.7; }
.tp-tip-row span { color: var(--text-secondary); flex: 1; }
.tp-tip-row strong { font: 500 12px var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-toast { position: fixed; left: 50%; bottom: 44px; z-index: 1300; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 9px 14px; background: var(--bg-elevated); border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); font-size: 12px; max-width: calc(100vw - 32px); transition: opacity var(--dur-fast) var(--ease-ui), transform var(--dur-fast) var(--ease-ui); }
.tp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- main, toolbar, status ---------- */
.tp-main { flex: 1; min-height: 0; overflow: auto; overflow-x: hidden; }
.tp-main:focus-visible { outline: 0; }
.tp-view { min-height: 100%; }
.tp-toolbar { position: sticky; top: 0; z-index: 12; min-height: var(--tp-bar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--bg-terminal); border-bottom: 1px solid var(--tp-line); }
.tp-title { font-family: var(--font-display); font-stretch: var(--display-wdth) !important; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--ls-display); margin-right: 4px; }
.tp-live { display: inline-flex; align-items: center; gap: 6px; font: 11px var(--font-mono); color: var(--text-secondary); }
.tp-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tp-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-faint); }
.tp-fresh, .tp-status-item { font: 11px var(--font-mono); color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tp-fresh.is-late, .tp-status-item.is-late { color: var(--tp-warn); }
.tp-quick { display: inline-flex; align-items: center; gap: 8px; }
.tp-quick-label { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.tp-quick-amount { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); background: var(--bg-terminal); font: 11px var(--font-mono); color: var(--text-faint); }
.tp-quick-amount input { width: 52px; background: none; border: 0; outline: 0; font: 500 13px var(--font-mono); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.tp-quick-amount:focus-within { border-color: var(--accent); }
.tp-quick-amount.is-bad { border-color: var(--red-down); }
.tp-status { height: 28px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--bg-base); border-top: 1px solid var(--tp-line); font-size: 11px; color: var(--text-secondary); }
.tp-status-conn { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-status-spacer { flex: 1; }
.tp-status-hype strong { color: var(--text-primary); font-weight: 500; }
.tp-dot.is-off, .tp-dot.is-wait { background: var(--text-faint); }
.tp-dot.is-bad { background: var(--red-down); }
.tp-tabbar { display: none; }
.tp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 180px; padding: 28px 20px; text-align: center; color: var(--text-secondary); }
.tp-empty strong { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tp-empty p { max-width: 420px; font-size: 12px; line-height: 1.6; }
.tp-notice { margin: 12px 16px 0; border: 1px dashed var(--tp-line-2); border-radius: var(--radius-card); }
.tp-skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--bg-white-5) 25%, var(--bg-white-10) 50%, var(--bg-white-5) 75%); background-size: 200% 100%; animation: tp-shimmer 1.4s linear infinite; }
.tp-skel-chip { width: 96px; height: 34px; border-radius: var(--radius-sm); }
.tp-skel-avatar { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.tp-skel-line { height: 12px; width: 38%; }
.tp-skel-line.is-short { width: 16%; }
@keyframes tp-shimmer { to { background-position: -200% 0; } }
@keyframes tp-flash { from { background-color: var(--accent-08); } to { background-color: transparent; } }

/* ---------- Discover table ---------- */
.tp-table { min-width: 0; }
.tp-tr { display: grid; grid-template-columns: minmax(250px, 2.3fr) 148px minmax(100px, 1fr) minmax(88px, .9fr) minmax(88px, .9fr) minmax(88px, .9fr) 84px 108px 128px; align-items: center; gap: 0 12px; height: 72px; padding: 0 16px; border-bottom: 1px solid var(--tp-line); cursor: pointer; }
.tp-tbody .tp-tr:hover { background: rgba(255, 255, 255, .025); }
.tp-tr.is-skeleton { cursor: default; display: flex; gap: 14px; }
.tp-thead { position: sticky; top: var(--tp-bar-h); z-index: 10; height: 36px; background: var(--bg-terminal); cursor: default; }
.tp-th { font-size: 12px; color: var(--text-faint); font-weight: 500; white-space: nowrap; }
.tp-th-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; color: inherit; font: inherit; }
.tp-th-btn:hover { color: var(--text-primary); }
.tp-sort-arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .35; }
.tp-th.is-sorted { color: var(--text-primary); }
.tp-th.is-sorted .tp-sort-arrow { opacity: 1; color: var(--accent); }
.tp-th.is-asc .tp-sort-arrow { transform: rotate(180deg); }
.tp-td { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-td.c-pair { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; font-family: var(--font-ui); }
.tp-pair-text { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tp-pair-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tp-sym { font-size: 15px; font-weight: 700; color: var(--text-primary); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; flex: none; }
.tp-sym:hover { color: var(--accent); }
.tp-name { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tp-pair-sub { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; font-size: 12px; color: var(--text-secondary); }
.tp-age { flex: none; font: 12px var(--font-mono); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tp-links { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.tp-link-ico { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 5px; color: var(--text-faint); }
.tp-link-ico:hover { color: var(--accent); background: var(--bg-white-5); }
.tp-link-ico .tp-ico { width: 13px; height: 13px; }
.tp-val { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.tp-sub { font-size: 12px; color: var(--text-faint); }
.tp-chg { color: var(--text-faint); }
.tp-chg.is-up { color: var(--accent); }
.tp-chg.is-down { color: var(--red-down); }
.tp-slash { color: var(--text-faint); }
.tp-kvline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-primary); }
.tp-kvline i { font-style: normal; color: var(--text-faint); }
.tp-kvline b { font-weight: 500; }
.tp-kvline .tp-ico { width: 13px; height: 13px; color: var(--text-faint); }
.tp-td.c-buy { align-items: flex-end; }
.tp-buy { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-text-on); font: 700 13px var(--font-ui); white-space: nowrap; font-variant-numeric: tabular-nums; transition: filter var(--dur-fast) var(--ease-ui); }
.tp-buy:hover { filter: brightness(1.08); }
.tp-buy .tp-ico { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.tp-spark { width: 100%; max-width: 140px; height: 36px; overflow: visible; }
.tp-spark-line { fill: none; stroke: var(--text-faint); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tp-spark-area { fill: var(--text-faint); opacity: .08; stroke: none; }
.tp-spark.is-up .tp-spark-line { stroke: var(--accent); }
.tp-spark.is-up .tp-spark-area { fill: var(--accent); opacity: .12; }
.tp-spark.is-down .tp-spark-line { stroke: var(--red-down); }
.tp-spark.is-down .tp-spark-area { fill: var(--red-down); opacity: .12; }

/* ---------- Pulse ---------- */
.tp-view.is-pulse { height: 100%; }
.tp-pulse { height: 100%; display: flex; flex-direction: column; }
.tp-pulse-tabs { display: none; }
.tp-pulse-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-pcol { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--tp-line); }
.tp-pcol:last-child { border-right: 0; }
.tp-pcol-head { flex: none; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--tp-line); }
.tp-pcol-head h2 { font-size: 13px; font-weight: 700; }
.tp-pcol-hint { font-size: 11px; color: var(--text-faint); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-pcol-count { font: 11px var(--font-mono); color: var(--text-secondary); }
.tp-pcol-body { flex: 1; min-height: 0; overflow: auto; }
.tp-pcard { padding: 12px 14px; border-bottom: 1px solid var(--tp-line); cursor: pointer; }
.tp-pcard:hover { background: rgba(255, 255, 255, .025); }
.tp-pcard.is-new { animation: tp-flash 1.6s var(--ease-ui); }
.tp-pcard.is-skeleton { display: flex; align-items: center; gap: 12px; height: 86px; cursor: default; }
.tp-pcard-top { display: flex; align-items: center; gap: 12px; }
.tp-pcard-top .tp-pair-text { flex: 1; }
.tp-pcard-right { display: flex; align-items: center; gap: 12px; flex: none; }
.tp-pcard-mc { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-pcard-mc span { font-size: 10px; color: var(--text-faint); }
.tp-pcard-mc strong { font-size: 14px; font-weight: 500; }
.tp-pcard .tp-buy { height: 32px; padding: 0 11px; font-size: 12px; }
.tp-pcard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; margin-top: 10px; padding-left: 52px; font: 11px var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-pstat { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; min-width: 0; overflow: hidden; }
.tp-pstat b { overflow: hidden; text-overflow: ellipsis; }
.tp-pstat i { font-style: normal; color: var(--text-faint); }
.tp-pstat b { font-weight: 500; color: var(--text-primary); }
.tp-pstat .tp-ico { width: 12px; height: 12px; color: var(--text-faint); align-self: center; }
.tp-pstat-split { font-size: 10px; }

/* ---------- cards and charts ---------- */
.tp-card { background: var(--bg-base); border: 1px solid var(--tp-line); border-radius: var(--radius-card); min-width: 0; }
.tp-chartbox { position: relative; width: 100%; min-width: 0; }
.tp-svg { display: block; overflow: visible; }
.tp-area-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tp-area-fill { fill: var(--accent); opacity: .1; stroke: none; }
.tp-area-line.is-live { stroke-dasharray: 3 4; opacity: .75; }
.tp-cross line { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; }
.tp-cross circle { fill: var(--accent); stroke: var(--bg-base); stroke-width: 2; }
.tp-hit { fill: transparent; cursor: crosshair; }
.tp-grid { stroke: var(--tp-line); stroke-width: 1; }
.tp-grid.is-base { stroke: var(--tp-line-2); }
.tp-axis { fill: var(--text-faint); font: 10px var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-col-hi { fill: rgba(255, 255, 255, .05); }
.tp-change { font: 500 11px var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.tp-change.is-up { color: var(--accent); }
.tp-change.is-down { color: var(--red-down); }
.tp-scroll-x { overflow-x: auto; }
.tp-dt { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.tp-dt th { position: sticky; top: 0; padding: 8px 12px; text-align: left; font: 500 10px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); background: var(--bg-base); border-bottom: 1px solid var(--tp-line); }
.tp-dt td { padding: 7px 12px; border-bottom: 1px solid var(--tp-line); color: var(--text-primary); }
.tp-dt tr:last-child td { border-bottom: 0; }
.tp-dt .is-num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tp-dt td.is-up { color: var(--accent); }
.tp-dt td.is-down { color: var(--red-down); }
.tp-dt td.tp-muted { color: var(--text-secondary); }
.tp-dt tr.is-new td { animation: tp-flash 1.4s var(--ease-ui); }
.tp-dt tr.is-current td { background: var(--accent-05); }

/* ---------- Chain ---------- */
.tp-chain { padding-bottom: 20px; }
.tp-chain.is-loading .tp-card { opacity: .6; }
.ch-top { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 12px; padding: 12px 16px 0; }
.ch-volume { padding: 16px 18px; }
.ch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ch-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.ch-label.is-strong { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.ch-sub { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.ch-big { font: 700 44px/1.1 var(--font-mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.ch-mid { font: 700 24px/1.2 var(--font-mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ch-split { display: flex; gap: 2px; height: 6px; margin-top: 12px; }
.ch-split-buy { background: var(--accent); border-radius: 3px 0 0 3px; min-width: 2px; }
.ch-split-sell { background: var(--red-down); border-radius: 0 3px 3px 0; min-width: 2px; }
.ch-split-text { display: flex; justify-content: space-between; margin-top: 7px; font: 11px var(--font-mono); font-variant-numeric: tabular-nums; }
.ch-split-text i { font-style: normal; color: var(--text-faint); }
.ch-split-text b { font-weight: 500; }
.ch-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ch-stat { padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.ch-stat-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.ch-spark { flex: 0 1 150px; }
.ch-spark .tp-area-line { stroke-width: 1.5; }
.ch-launch, .ch-table-card { margin: 12px 16px 0; padding: 16px 18px; }
.ch-launch .tp-chips { flex: none; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 14px 0 10px; min-height: 17px; font-size: 12px; line-height: 17px; color: var(--text-secondary); }
.ch-legend-skel { width: 72px; height: 17px; }
.ch-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ch-table-card { padding: 16px 0 6px; }
.ch-table-card .ch-head { padding: 0 18px 10px; }
.ch-name { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.ch-table th:first-child, .ch-table td:first-child { padding-left: 18px; }
.ch-table th:last-child, .ch-table td:last-child { padding-right: 18px; }
.ch-table tr.is-total td { font-weight: 600; background: rgba(255, 255, 255, .025); }
.ch-share, .tk-share { min-width: 150px; }
.ch-share-bar { display: inline-block; vertical-align: middle; width: 84px; height: 4px; margin-right: 10px; border-radius: 2px; background: var(--bg-white-10); overflow: hidden; }
.ch-share-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.ch-share span:last-child, .tk-share span:last-child { display: inline-block; min-width: 46px; }

/* ---------- Token view ---------- */
.tk-head { display: flex; align-items: center; gap: 14px 28px; padding: 12px 16px; border-bottom: 1px solid var(--tp-line); background: var(--bg-terminal); flex-wrap: wrap; }
/* fixed width: the stats strip does not move sideways when the symbol and chips arrive */
.tk-id { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; flex: 0 0 clamp(300px, 34vw, 480px); }
.tk-head .tp-pair-sub { min-height: 22px; }
/* chips keep their full text: a row that does not fit wraps instead of cutting every chip to an ellipsis */
@media (min-width: 761px) {
  .tk-head .tp-pair-sub { flex-wrap: wrap; overflow: visible; gap: 4px 6px; }
  .tk-head .tp-pair-sub > .tp-tag { flex: none; max-width: min(100%, 220px); }
}
.tk-id-text { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tk-id-top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tk-symbol { font-family: var(--font-display); font-stretch: var(--display-wdth) !important; font-size: 20px; font-weight: 800; letter-spacing: var(--ls-display); line-height: 1.25; white-space: nowrap; min-width: 0; max-width: min(320px, 100%); overflow: hidden; text-overflow: ellipsis; }
.tk-name { font-size: 13px; color: var(--text-secondary); min-width: 0; max-width: 240px; flex: 0 1000 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-id-top .tp-icon-btn { align-self: center; flex: none; }
.tk-addr, .tk-trader { font: 11px var(--font-mono); color: var(--text-faint); white-space: nowrap; }
.tk-stats { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.tk-stat { display: flex; flex-direction: column; gap: 3px; }
.tk-stat span { font-size: 11px; color: var(--text-faint); }
.tk-stat strong { font: 500 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.tk-stat.is-big strong { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.tk-notice { margin: 12px 16px 0; padding: 10px 14px; border: 1px dashed var(--tp-line-2); border-radius: var(--radius-sm); font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; padding: 12px 16px 20px; align-items: start; }
.tk-main, .tk-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tk-chart { padding: 12px 14px; }
.tk-chart-wait { min-height: calc(var(--tk-chart-h, 350px) + 58px); }
.tk-chart.is-empty .tk-chart-wait { min-height: 220px; }
.tp-chart .elisia-chart-canvas { background: transparent; min-height: var(--tk-chart-h, 350px); }
.tp-chart .elisia-chart-empty { min-height: var(--tk-chart-h, 350px); }
.tp-chart .elisia-chart-up { fill: var(--accent); stroke: var(--accent); }
.tp-chart .elisia-chart-down { fill: var(--red-down); stroke: var(--red-down); }
.tp-chart .elisia-chart-legend { display: none; }
.tp-chart .elisia-chart-title { font: 600 13px var(--font-ui); }
.tp-chart .elisia-chart-interval { font-family: var(--font-mono); min-height: 28px; }
.tp-chart .elisia-chart-note { font-family: var(--font-mono); color: var(--text-faint); min-height: 15px; }
.tp-chart .elisia-chart-axis { font-size: 11px; fill: var(--text-secondary); font-variant-numeric: tabular-nums; }
/* the hover readout never sits on the price axis */
.tp-chart .elisia-chart-tooltip { right: 88px; left: 8px; width: fit-content; max-width: calc(100% - 96px); font-variant-numeric: tabular-nums; }
.tk-tablist { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--tp-line); overflow-x: auto; scrollbar-width: none; }
.tk-tablist::-webkit-scrollbar { display: none; }
.tk-tab { height: 40px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; flex: none; }
.tk-tab:hover { color: var(--text-primary); }
.tk-tab.is-active { color: var(--text-primary); border-bottom-color: var(--accent); }
.tk-panel { min-height: 240px; max-height: 520px; overflow: auto; }
.tk-panel:focus-visible { outline-offset: -2px; }
.tk-pad { padding: 14px; }
.tk-age { font-family: var(--font-mono); color: var(--text-secondary) !important; font-variant-numeric: tabular-nums; width: 56px; }
.tk-trader { color: var(--text-secondary) !important; }
.tk-sub { margin-left: 8px; }
.tk-holder { display: inline-flex; align-items: center; gap: 6px; height: 18px; vertical-align: middle; }
.tp-dt .tp-sym { font-size: 13px; font-weight: 600; }
.tk-late { padding: 6px 12px; font: 11px var(--font-mono); color: var(--tp-warn); border-bottom: 1px solid var(--tp-line); }
.tk-late[hidden] { display: none; }
.tk-hstats { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--tp-line); }
.tk-hstat { display: inline-flex; align-items: baseline; gap: 7px; height: 28px; padding: 0 10px; border: 1px solid var(--tp-line); border-radius: var(--radius-sm); font: 11px var(--font-mono); font-variant-numeric: tabular-nums; align-items: center; }
.tk-hstat i { font-style: normal; color: var(--text-faint); }
.tk-hstat b { font-weight: 500; }
.tk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--tp-line); flex-wrap: wrap; }
.tk-foot .tp-source { margin: 0; }
.tk-card-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.tk-activity { margin-left: auto; display: grid; grid-template-columns: 26px minmax(58px, auto) minmax(40px, auto) minmax(40px, auto) 72px; gap: 3px 14px; align-items: center; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12px; }
.tk-act-h { font: 11px var(--font-ui); color: var(--text-faint); }
.tk-act-p { font-size: 11px; color: var(--text-secondary); }
.tk-activity strong { font-weight: 500; }
.tk-act-bar { height: 4px; border-radius: 2px; background: var(--red-down); overflow: hidden; }
.tk-act-bar i { display: block; height: 100%; background: var(--accent); border-right: 2px solid var(--bg-base); }
.tk-act-bar.is-empty { background: var(--bg-white-10); }
.tk-act-bar.is-empty i { display: none; }
.tk-ticket, .tk-checks, .tk-position { padding: 14px; }
.tk-ticket .tk-card-title { display: none; }
.tk-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tk-checks .tp-btn { margin-top: 10px; }
.tk-pos-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tk-pos { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tk-pos span { font-size: 11px; color: var(--text-faint); }
.tk-pos strong { font: 500 13px var(--font-mono); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.tk-pos-grid .tp-source { grid-column: 1 / -1; margin: 0; }

/* ---------- TradeTicket ---------- */
.tt { display: flex; flex-direction: column; gap: 12px; }
.tt-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-terminal); border: 1px solid var(--tp-line); border-radius: 10px; }
.tt-side { height: 36px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.tt-side:hover:not(:disabled) { color: var(--text-primary); }
.tt-side.is-buy.is-active { background: var(--accent); color: var(--accent-text-on); }
.tt-side.is-sell.is-active { background: var(--red-down); color: var(--accent-text-on); }
.tt-field { display: flex; flex-direction: column; gap: 6px; }
.tt-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tt-label { font-size: 12px; color: var(--text-secondary); }
.tt-balance { font: 11px var(--font-mono); color: var(--text-faint); font-variant-numeric: tabular-nums; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-wallet { width: 100%; max-width: none; height: 38px; font-size: 13px; }
.tt-input { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; background: var(--bg-terminal); border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); }
.tt-input:focus-within { border-color: var(--accent); }
.tt-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font: 500 16px var(--font-mono); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.tt-input input:focus-visible { outline: 0; }
.tt-unit { font: 12px var(--font-mono); color: var(--text-faint); }
.tt-presets { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.tt-chip { height: 30px; padding: 0 8px; border: 1px solid var(--tp-line-2); border-radius: 7px; font: 500 12px var(--font-mono); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tt-chip:hover:not(:disabled) { color: var(--text-primary); border-color: rgba(255, 255, 255, .22); }
.tt-chip.is-active { color: var(--accent); border-color: var(--accent-24); background: var(--accent-08); }
.tt-slip { display: flex; align-items: center; gap: 8px; }
.tt-slip-chips { display: flex; gap: 6px; margin-left: auto; }
.tt-slip-input { width: 76px; height: 30px; padding: 0 8px; }
.tt-slip-input input { font-size: 12px; text-align: right; }
.tt-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--tp-line); border-radius: var(--radius-sm); background: var(--bg-terminal); }
.tt-bot-link { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; font-size: 12px; font-weight: 500; color: var(--accent); }
.tt-bot-link:hover { text-decoration: underline; }
.tt-bot-link .tp-ico { width: 12px; height: 12px; }
.tt-flow { display: flex; flex-direction: column; gap: 8px; }
.tt-flow:empty { display: none; }
.tt-main { width: 100%; height: 42px; font-size: 14px; }
.tt-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; }
.tt-card { display: flex; flex-direction: column; gap: 7px; padding: 12px; border: 1px solid var(--tp-line-2); border-radius: var(--radius-sm); background: var(--bg-terminal); }
.tt-card.is-ok { border-color: var(--accent-24); background: linear-gradient(var(--accent-05), var(--accent-05)), var(--bg-terminal); }
.tt-card.is-unknown, .tt-risk { border-color: var(--tp-red-24); }
.tt-eyebrow { font: 10px var(--font-mono); letter-spacing: .08em; color: var(--accent); }
.tt-risk .tt-eyebrow { color: var(--red-down); }
.tt-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; min-width: 0; }
.tt-kv span { color: var(--text-secondary); flex: none; }
.tt-kv strong { font: 500 12px var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.tt-kv.is-main strong { font-size: 14px; color: var(--text-primary); }
.tt-kv .tp-icon-btn { margin-left: -6px; align-self: center; }
.tt-kv:has(.tp-icon-btn) strong { margin-left: auto; }
.tt-error { font-size: 12px; line-height: 1.5; color: var(--red-down); }
.tt-note, .tt-foot { font-size: 11px; line-height: 1.55; color: var(--text-faint); }
.tt-receipt-status { font-size: 14px; font-weight: 600; }
.tt-countdown { font: 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.tt-opid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px; align-items: center; margin-top: 2px; }
.tt-opid .tt-label { grid-column: 1 / -1; font: 10px var(--font-mono); color: var(--text-faint); }
.tt-opid code { font: 10px var(--font-mono); color: var(--text-secondary); padding: 7px 8px; background: var(--bg-base); border-radius: 6px; overflow-wrap: anywhere; }
.tt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tt-actions .tp-btn { flex: 1 1 auto; height: 34px; font-size: 12px; padding: 0 10px; }
.tt-chip { min-width: 40px; }
.tt-warnings { margin: 2px 0 4px 16px; font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.tt-warnings li { overflow-wrap: anywhere; }
.tt-check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 13px; cursor: pointer; }
.tt-check { align-items: flex-start; padding: 8px 0; line-height: 1.45; }
.tt-check input { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1.5px solid var(--accent); border-radius: 5px; background: var(--bg-base); display: inline-grid; place-items: center; cursor: pointer; }
.tt-check input::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-text-on); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); opacity: 0; }
.tt-check input:checked { background: var(--accent); }
.tt-check input:checked::after { opacity: 1; }
.tt-check input:disabled { opacity: .5; cursor: not-allowed; }
.tt.is-locked .tt-input, .tt.is-locked .tt-sides { opacity: .55; }

/* ---------- quick-buy drawer ---------- */
.tp-drawer-wrap { position: fixed; inset: 0; z-index: 800; }
.tp-drawer-shade { position: absolute; inset: 0; background: rgba(8, 10, 11, .6); }
.tp-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow: auto; background: var(--bg-base); border-left: 1px solid var(--tp-line-2); box-shadow: var(--shadow-card-xl); animation: tp-slide-in var(--dur-med) var(--ease-pop); }
@keyframes tp-slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes tp-sheet-in { from { transform: translateY(24px); opacity: 0; } }
.tp-drawer-head { display: flex; align-items: center; gap: 12px; position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 16px 16px 10px; background: var(--bg-base); }
.tp-drawer-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-drawer-title strong { font-size: 16px; font-weight: 700; }
.tp-drawer-title span { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-drawer-head .tp-icon-btn { width: 40px; height: 40px; }
.tp-drawer-head .tp-icon-btn .tp-ico { width: 16px; height: 16px; }
.tp-drawer-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 12px; border: 1px solid var(--tp-line); border-radius: var(--radius-sm); }
.tp-drawer-stats .tt-kv { flex-direction: column; align-items: flex-start; gap: 3px; }
.tp-drawer-stats .tt-kv strong { text-align: left; font-size: 13px; }
.tp-drawer-more { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: 12px; color: var(--accent); align-self: flex-start; }
.tp-drawer-more .tp-ico { width: 12px; height: 12px; }

@media (prefers-reduced-motion: reduce) {
  .tp-skel, .tp-pcard.is-new, .tp-dt tr.is-new td, .tp-drawer { animation: none; }
}

/* ---------- narrower desktop ---------- */
@media (max-width: 1280px) {
  .tp-tr { grid-template-columns: minmax(220px, 2fr) 120px minmax(92px, 1fr) minmax(80px, .9fr) minmax(80px, .9fr) minmax(80px, .9fr) 76px 100px 118px; gap: 0 10px; }
  .tk-stats { gap: 20px; }
}
@media (max-width: 1100px) {
  .tp-toolbar { flex-wrap: wrap; padding: 8px 16px; gap: 8px 12px; position: static; }
  .tp-thead { position: static; }
  .tp-tr { grid-template-columns: minmax(200px, 2fr) minmax(90px, 1fr) minmax(80px, 1fr) minmax(80px, 1fr) minmax(80px, 1fr) 100px 116px; }
  .tp-tr .c-trend, .tp-tr .c-tax { display: none; }
  .tp-top { gap: 12px; }
  .tp-network { display: none; }
  .ch-top { grid-template-columns: 1fr; }
  .tk-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  /* the 5m / 1h / 24h block gets its own full row instead of wrapping alone to the right */
  .tk-activity { margin-left: 0; flex: 1 1 100%; grid-template-columns: 26px minmax(70px, 120px) minmax(48px, 90px) minmax(48px, 90px) minmax(72px, 220px); justify-content: start; }
  /* Pulse: one stage at a time (the mobile switcher), cards in two columns */
  .tp-view.is-pulse { height: auto; }
  .tp-pulse { height: auto; }
  .tp-pulse-tabs { display: flex; margin: 10px 16px 0; align-self: flex-start; }
  .tp-pulse-grid { display: block; }
  .tp-pcol { display: none; border-right: 0; }
  .tp-pulse-grid[data-show="new"] .tp-pcol[data-stage="new"], .tp-pulse-grid[data-show="stretch"] .tp-pcol[data-stage="stretch"], .tp-pulse-grid[data-show="migrated"] .tp-pcol[data-stage="migrated"] { display: block; }
  .tp-pcol-body { overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-pcol-body > .tp-empty { grid-column: 1 / -1; }
  .tp-pcard:nth-child(odd) { border-right: 1px solid var(--tp-line); }
}
/* tablet: the Discover row must fit the viewport (the Buy button was cut off between 761 and 850px) */
@media (max-width: 900px) {
  .tp-tr { grid-template-columns: minmax(170px, 2fr) minmax(76px, 1fr) minmax(72px, 1fr) minmax(72px, 1fr) minmax(72px, 1fr) 112px; gap: 0 10px; }
  .tp-tr .c-info { display: none; }
}
/* tablet: token page in one column so the tables keep every column; ticket and bot checks share a row */
@media (max-width: 980px) and (min-width: 761px) {
  .tk-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tk-main, .tk-side { display: contents; }
  .tk-ticket { order: 1; grid-row: span 2; }
  .tk-checks { order: 1; }
  .tk-position { order: 1; }
  .tk-chart { order: 2; grid-column: 1 / -1; }
  .tk-tabs { order: 3; grid-column: 1 / -1; }
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .tp-top { gap: 10px; padding: 0 12px; }
  .tp-brand span, .tp-nav, .tp-kbd, .tp-account-name, .tp-wallet-unit { display: none; }
  .tp-search { flex: 1 1 auto; margin-left: 0; height: 40px; min-width: 0; }
  .tp-search input { font-size: 16px; }
  .tp-search-list { position: fixed; top: calc(var(--tp-top-h) + 4px); left: 8px; right: 8px; min-width: 0; }
  .tp-chip, .tp-btn { height: 40px; }
  .tp-account-chip { width: 40px; padding: 0; justify-content: center; }
  .tp-tabbar { display: grid; grid-template-columns: repeat(4, 1fr); flex: none; height: 52px; background: var(--bg-base); border-top: 1px solid var(--tp-line); order: 3; }
  .tp-tab-link { display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-muted); }
  .tp-tab-link.is-active { color: var(--accent); box-shadow: inset 0 2px var(--accent); }
  .tp-status { order: 2; height: 26px; padding: 0 12px; gap: 10px; }
  #tp-status-fresh { display: none; }
  .tp-toast { bottom: 92px; }
  .tp-toolbar { padding: 10px 12px; }
  .tp-toolbar .tp-grow, .tp-toolbar .tp-live { display: none; }
  .tp-title { width: 100%; }
  .tp-chip-btn { height: 40px; min-width: 40px; }
  .tp-select, .tp-quick-amount { height: 40px; }
  .tp-quick-amount input { font-size: 16px; width: 60px; }
  .tp-quick { flex-wrap: wrap; width: 100%; }
  .tp-quick .tp-wallet-select { flex: 1; min-width: 0; }
  .tp-quick .tp-select { max-width: none; width: 100%; }
  .tp-fresh { width: 100%; }
  .tp-thead { display: none; }
  /* compact card: identity, sparkline and Buy on one line, four figures under it, holders and tax on a last line */
  .tp-tr { height: auto; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "pair pair trend buy" "mcap vol liq txns" "info info tax tax"; gap: 8px; padding: 12px; align-items: start; }
  .tp-tr.is-skeleton { height: 160px; align-items: center; }
  .tp-tr .c-pair { grid-area: pair; }
  .tp-tr .c-buy { grid-area: buy; }
  .tp-tr .c-trend { grid-area: trend; display: flex; align-self: center; }
  .tp-tr .c-trend::before, .tp-tr .c-info::before, .tp-tr .c-tax::before { display: none; }
  .tp-tr .c-pair { align-self: center; gap: 10px; }
  .tp-tr .c-buy { align-self: center; }
  .tp-tr .tp-spark { height: 28px; }
  .tp-td { justify-content: flex-start; }
  .tp-tr .tp-val { font-size: 13px; }
  .tp-tr .tp-links, .tp-tr .tp-pair-top .tp-icon-btn { display: none; }
  .tp-tr .c-mcap { grid-area: mcap; }
  .tp-tr .c-vol { grid-area: vol; }
  .tp-tr .c-liq { grid-area: liq; }
  .tp-tr .c-txns { grid-area: txns; }
  .tp-tr .c-info { grid-area: info; display: flex; }
  .tp-tr .c-tax { grid-area: tax; display: flex; }
  .tp-td.c-tax { flex-direction: row; justify-content: flex-end; gap: 10px; }
  .tp-td[data-label]::before { content: attr(data-label); font: 10px var(--font-ui); color: var(--text-faint); }
  .tp-td.c-info { flex-direction: row; gap: 12px; }
  .tp-buy { height: 40px; }
  .tp-name { display: none; }
  .tp-link-ico { width: 40px; height: 40px; }
  .tp-pair-sub { gap: 6px; }
  .tp-pulse-tabs { margin: 10px 12px 0; align-self: stretch; }
  .tp-pcol-body { display: block; }
  .tp-pcard:nth-child(odd) { border-right: 0; }
  .tp-pulse-tabs .tp-chip-btn { flex: 1; }
  .tp-pcard .tp-buy { height: 40px; }
  .ch-top { padding: 12px 12px 0; }
  .ch-launch, .ch-table-card { margin: 12px 12px 0; }
  .ch-launch { padding: 14px; }
  .ch-volume { padding: 14px; }
  .ch-big { font-size: 34px; }
  .ch-mid { font-size: 20px; }
  .ch-stat { padding: 12px; }
  .ch-stat-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .ch-spark { flex: none; }
  .ch-launch .ch-head { flex-direction: column; }
  .tk-head { padding: 12px; gap: 14px; }
  /* one fixed-height line (it scrolls sideways if needed), so the header does not grow when chips arrive */
  .tk-head .tp-pair-sub { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-height: 40px; gap: 6px 8px; }
  .tk-head .tp-pair-sub::-webkit-scrollbar { display: none; }
  .tk-head .tp-pair-sub > * { flex: none; }
  .tk-id, .tk-id-text { width: 100%; }
  .tk-id { flex: 1 1 100%; }
  .tk-id-top { align-items: center; }
  .tk-id-text { width: auto; flex: 1; }
  .tp-pcard .tp-links { display: none; }
  .tp-tag { max-width: 116px; }
  .tk-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; width: 100%; }
  .tk-name { max-width: 130px; }
  .tk-grid { display: flex; flex-direction: column; align-items: stretch; padding: 12px 12px 20px; }
  .tk-main, .tk-side { display: contents; }
  .tk-activity { margin-left: 0; width: 100%; grid-template-columns: 26px 1fr 1fr 1fr 1.2fr; font-size: 13px; gap: 6px 12px; justify-content: stretch; }
  .tk-ticket { order: 2; }
  .tk-chart { order: 3; padding: 10px; }
  .tk-tabs { order: 4; }
  .tk-checks { order: 5; }
  .tk-position { order: 6; }
  .tk-tab { height: 44px; }
  .tk-pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-side { height: 40px; }
  .tt-chip { height: 40px; }
  .tt-slip { flex-wrap: wrap; }
  .tt-slip-input { height: 40px; }
  .tt-slip-input input, .tt-input input { font-size: 16px; }
  .tt-wallet { height: 44px; font-size: 16px; }
  .tt-bot-link { min-height: 40px; }
  .tt-main { height: 46px; }
  .tt-actions .tp-btn { height: 40px; }
  .tp-chart .elisia-chart-interval { min-height: 40px; min-width: 40px; }
  .tp-drawer-head { top: -16px; }
  .tp-drawer { top: auto; left: 0; width: auto; max-height: 90dvh; border-left: 0; border-top: 1px solid var(--tp-line-2); border-radius: 16px 16px 0 0; animation-name: tp-sheet-in; padding-bottom: 24px; }
  .tp-icon-btn { width: 40px; height: 40px; }
  .tp-brand { width: 40px; height: 40px; justify-content: center; }
  .tp-search input, .tp-quick-amount input, .tt-input input { align-self: stretch; height: auto; }
  .tp-pair-top { gap: 4px; }
  .tp-pop-item { min-height: 44px; }
  .tp-body .skip-link { min-height: 40px; display: inline-flex; align-items: center; }
  /* tables fit the screen: low-value columns are dropped on purpose instead of being cut off */
  .tp-dt th, .tp-dt td { padding: 8px 6px; }
  .tp-dt th:first-child, .tp-dt td:first-child { padding-left: 12px; }
  .tp-dt th:last-child, .tp-dt td:last-child { padding-right: 12px; }
  .tk-trades th:nth-child(7), .tk-trades td:nth-child(7) { display: none; }
  .tk-trades th:nth-child(5), .tk-trades td:nth-child(5) { display: none; }
  .ch-table th:nth-child(5), .ch-table td:nth-child(5) { display: none; }
  .tk-account .tk-sub { display: none; }
  .tp-dt a.tp-sym { display: inline-flex; align-items: center; min-width: 40px; min-height: 40px; }
  .tk-account td { padding-top: 0; padding-bottom: 0; }
  .tk-panel { max-height: 460px; }
  .ch-share, .tk-share { min-width: 0; }
  .ch-share-bar { display: none; }
  .ch-share span:last-child, .tk-share span:last-child { min-width: 0; }
  .tk-age { width: 40px; }
  .tp-op { flex-wrap: wrap; padding: 8px 12px; }
  .tp-op-actions { width: 100%; }
  .tp-op-actions .tp-btn { flex: 1; }
}

/* ---------- unresolved operations bar (under the header, on every route) ---------- */
.tp-ops { flex: none; max-height: 40vh; overflow: auto; background: var(--bg-base); border-bottom: 1px solid var(--tp-warn-24); }
.tp-ops[hidden] { display: none; }
.tp-op { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 16px; background: var(--tp-warn-08); border-top: 1px solid var(--tp-line); font-size: 12px; }
.tp-op:first-child { border-top: 0; }
.tp-op.is-done { background: var(--accent-05); }
.tp-op-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tp-warn); }
.tp-op.is-done .tp-op-dot { background: var(--accent); }
.tp-op-text { flex: 1; min-width: 0; line-height: 1.5; color: var(--text-secondary); }
.tp-op-text strong { color: var(--text-primary); font-weight: 600; }
.tp-op-text code { margin-left: 8px; font: 10px var(--font-mono); color: var(--text-faint); white-space: nowrap; }
.tp-op-actions { flex: none; display: flex; gap: 6px; }
.tp-op-actions .tp-btn { height: 32px; padding: 0 12px; font-size: 12px; }
.tp-op-more { padding: 6px 16px; font-size: 11px; color: var(--text-faint); }

/* ---------- loading states that keep the final geometry ---------- */
.tp-chain.is-pending .ch-big, .tp-chain.is-pending .ch-mid { width: fit-content; min-width: 96px; color: transparent; border-radius: 6px; background: linear-gradient(90deg, var(--bg-white-5) 25%, var(--bg-white-10) 50%, var(--bg-white-5) 75%); background-size: 200% 100%; animation: tp-shimmer 1.4s linear infinite; }
.tp-chain.is-pending .ch-big { min-width: 180px; }
.tp-chain.is-pending .tp-chartbox { border-radius: 6px; background: linear-gradient(90deg, var(--bg-white-5) 25%, rgba(255, 255, 255, .07) 50%, var(--bg-white-5) 75%); background-size: 200% 100%; animation: tp-shimmer 1.4s linear infinite; }
.tp-chain.is-pending .ch-split { visibility: hidden; }
.ch-table tr.is-skel td { height: 32px; }
.ch-table tr.is-skel .tp-skel { display: inline-block; width: 56px; height: 10px; vertical-align: middle; }
.ch-table tr.is-skel td:first-child .tp-skel { width: 110px; }
.tk-head.is-pending .tk-symbol { min-width: 130px; color: transparent; border-radius: 6px; background: linear-gradient(90deg, var(--bg-white-5) 25%, var(--bg-white-10) 50%, var(--bg-white-5) 75%); background-size: 200% 100%; animation: tp-shimmer 1.4s linear infinite; }
.tk-head.is-pending .tp-avatar { color: transparent !important; box-shadow: none !important; background: var(--bg-white-10) !important; }
@media (prefers-reduced-motion: reduce) {
  .tp-chain.is-pending .ch-big, .tp-chain.is-pending .ch-mid, .tp-chain.is-pending .tp-chartbox, .tk-head.is-pending .tk-symbol { animation: none; }
}

.tt-risk-link{color:var(--accent);text-decoration:underline;text-underline-offset:2px}

/* Token pictures: the image fades in over the monogram; a failed load leaves the monogram. */
.tp-avatar { position: relative; overflow: hidden; }
.tp-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-fast) var(--ease-ui); }
.tp-avatar.has-img { color: transparent !important; background: var(--bg-card) !important; }
.tp-avatar.has-img .tp-avatar-img { opacity: 1; }
.tp-avatar-mark { width: 100%; height: 100%; display: block; }
.tp-avatar.has-img .tp-avatar-mark { visibility: hidden; }

/* sell: token amount behind the chosen percentage */
.tt-hint { margin: 0; font: 11px var(--font-mono); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tt-hint[hidden] { display: none; }
.tp-btn-primary.tt-main.is-sell { background: var(--red-down); border-color: transparent; color: var(--accent-text-on); }
