/* Approved NoFee Markets workstation.
   Presentation only: live data, routing, filters and trading remain owned by app.js. */

body[data-screen="markets"] #markets {
  --nt-void: #080a0c;
  --nt-panel: #0d1013;
  --nt-panel-2: #11151a;
  --nt-line: rgba(220,232,226,.09);
  --nt-text: #edf2ef;
  --nt-muted: #89948f;
  --nt-faint: #5e6964;
  --nt-green: #66d99c;
  --nt-red: #f06b79;
  --nt-violet: #7a6cf0;
  --nt-amber: #e6b969;
  --nt-blue: #68a1ff;
  --nt-sans: var(--sans, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  --nt-mono: var(--mono, "Geist Mono", "SFMono-Regular", ui-monospace, monospace);
  color: var(--nt-text);
  font-family: var(--nt-sans);
  font-synthesis: none;
  font-optical-sizing: auto;
  font-kerning: normal;
}

body[data-screen="markets"] #markets,
body[data-screen="markets"] #markets * { box-sizing: border-box; }
body[data-screen="markets"] #markets button,
body[data-screen="markets"] #markets input { font: inherit; }

body[data-screen="markets"] #markets.active {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  padding: var(--header-h) 0 0;
  overflow: hidden;
  background:
    radial-gradient(760px 360px at 84% -12%,rgba(122,108,240,.065),transparent 62%),
    radial-gradient(560px 280px at 22% -18%,rgba(102,217,156,.035),transparent 64%),
    var(--nt-void);
}

body[data-screen="markets"] #markets::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 430px;
  height: 430px;
  top: calc(var(--header-h) + 78px);
  right: -84px;
  background: #eef1ed;
  opacity: .012;
  pointer-events: none;
  -webkit-mask: url("assets/nofee-route-mark.svg") center / contain no-repeat;
  mask: url("assets/nofee-route-mark.svg") center / contain no-repeat;
}

body[data-screen="markets"] #markets::after { display: none; }
body[data-screen="markets"] #markets > * { position: relative; z-index: 1; }
body[data-screen="markets"] #markets button:focus-visible {
  outline: 1px solid rgba(102,217,156,.62);
  outline-offset: -2px;
  box-shadow: 0 0 0 3px rgba(102,217,156,.07);
}

/* Command and filter rails */
body[data-screen="markets"] #markets .nt-commandbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(230px,.8fr) minmax(0,1.45fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--nt-line);
  background: #0a0d0f;
}

body[data-screen="markets"] #markets .nt-command-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

body[data-screen="markets"] #markets .nt-command-mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #cfd5d1;
  opacity: .86;
}

body[data-screen="markets"] #markets .nt-command-title > strong {
  color: #edf2ef;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -.018em;
}

body[data-screen="markets"] #markets .market-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6e7974;
  font: 10px/1 var(--nt-mono);
}

body[data-screen="markets"] #markets .market-status b { color: #aab5af; font-weight: 520; }

body[data-screen="markets"] #markets .nt-command-title em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #91a09a;
  font: 9px/1 var(--nt-mono);
  font-style: normal;
}

body[data-screen="markets"] #markets .nt-command-title em .status-scan {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  background: var(--nt-green);
  box-shadow: 0 0 8px rgba(102,217,156,.48);
}

body[data-screen="markets"] #markets .nt-command-title em .status-scan::after { display: none; }

body[data-screen="markets"] #markets .nt-chainrail {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-screen="markets"] #markets .nt-chainrail::-webkit-scrollbar,
body[data-screen="markets"] #markets .nt-command-actions::-webkit-scrollbar { display: none; }

body[data-screen="markets"] #markets .nt-chainrail .chain-chip,
body[data-screen="markets"] #markets .nt-command-actions button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #75817b;
  background: transparent;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
}

body[data-screen="markets"] #markets .nt-chainrail .chain-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body[data-screen="markets"] #markets .nt-chainrail .chain-logo {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

body[data-screen="markets"] #markets .nt-chainrail .chain-mark {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  font: 11px/1 var(--nt-mono);
}

body[data-screen="markets"] #markets .nt-chainrail .chain-chip:hover,
body[data-screen="markets"] #markets .nt-command-actions button:hover {
  color: #bec8c3;
  background: rgba(220,232,226,.035);
}

body[data-screen="markets"] #markets .nt-chainrail .chain-chip.selected,
body[data-screen="markets"] #markets .nt-command-actions button.selected {
  color: #e6ede9;
  border-color: rgba(122,108,240,.24);
  background: rgba(122,108,240,.11);
}

body[data-screen="markets"] #markets .nt-command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

body[data-screen="markets"] #markets .market-tabs,
body[data-screen="markets"] #markets .time-tabs,
body[data-screen="markets"] #markets .market-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-screen="markets"] #markets .market-tabs button,
body[data-screen="markets"] #markets .time-tabs button,
body[data-screen="markets"] #markets .market-view-switch button { height: auto; }

body[data-screen="markets"] #markets .market-tabs button b {
  margin-left: 3px;
  color: #68736e;
  font: 9px var(--nt-mono);
}

body[data-screen="markets"] #markets .nt-balance-button i { color: var(--nt-green); font-style: normal; }

body[data-screen="markets"] #markets .nt-market-filterbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 39px;
  height: 39px;
  margin: 0;
  padding: 0 18px;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--nt-line);
  background: #090c0e;
  scrollbar-width: none;
}

body[data-screen="markets"] #markets .nt-market-filterbar::-webkit-scrollbar { display: none; }
body[data-screen="markets"] #markets .filter-caption {
  flex: 0 0 auto;
  width: auto;
  margin-right: 4px;
  color: #626e68;
  font: 9px/1 var(--nt-mono);
  letter-spacing: .08em;
}

body[data-screen="markets"] #markets .filter-btn,
body[data-screen="markets"] #markets .toggle-filter {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid rgba(220,232,226,.075);
  border-radius: 6px;
  color: #7e8984;
  background: #0e1215;
  font-size: 9px;
}

body[data-screen="markets"] #markets .filter-btn b { color: #b8c3bd; font: 500 9px var(--nt-mono); }
body[data-screen="markets"] #markets .filter-btn i { color: #626e68; font-style: normal; }
body[data-screen="markets"] #markets .filter-btn:hover,
body[data-screen="markets"] #markets .toggle-filter:hover { border-color: rgba(102,217,156,.18); color: #cbd6d0; }
body[data-screen="markets"] #markets .nt-index-truth { flex: 0 0 auto; color: #68736e; font: 9px var(--nt-mono); }
body[data-screen="markets"] #markets #skeleton-toggle { display: none !important; }

/* Workstation shell */
body[data-screen="markets"] #markets[data-market-view="trenches"] .nt-workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: clamp(250px,22vw,310px) minmax(0,1fr);
  width: 100%;
  height: auto;
  min-height: 0;
  max-width: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #090b0d;
}

body[data-screen="markets"] #markets[data-market-view="table"] .nt-workspace { display: none; }
body[data-screen="markets"] #markets[data-market-view="trenches"] .markets-table-wrap { display: none; }
body[data-screen="markets"] #markets[data-market-view="table"] .markets-table-wrap {
  flex: 1 1 auto;
  display: block;
  min-height: 0;
  margin: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
}

body[data-screen="markets"] #markets .markets-table {
  width: 100%;
  min-width: 1210px;
}

body[data-screen="markets"] #markets .markets-table thead {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #0b0e11;
}

body[data-screen="markets"] #markets .markets-table th {
  height: 39px;
  color: #6c7771;
  border-bottom-color: var(--nt-line);
  font-size: 9px;
}

body[data-screen="markets"] #markets .markets-table tbody tr {
  height: 64px;
  border-bottom-color: rgba(220,232,226,.055);
}

body[data-screen="markets"] #markets .markets-table tbody tr:hover { background: rgba(255,255,255,.022); }
body[data-screen="markets"] #markets .markets-table td { color: #aeb8b3; font-size: 10px; }

body[data-screen="markets"] #markets .nt-sidecar {
  display: grid;
  grid-template-rows: minmax(0,1fr) minmax(0,1fr);
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--nt-line);
  background: #090b0d;
}

body[data-screen="markets"] #markets .nt-feed {
  min-height: 0;
  overflow: auto;
  border-bottom: 1px solid var(--nt-line);
}

body[data-screen="markets"] #markets .nt-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(220,232,226,.07);
}

body[data-screen="markets"] #markets .nt-feed-head strong { color: #dbe3df; font-size: 12px; font-weight: 600; }
body[data-screen="markets"] #markets .trench-rail-action,
body[data-screen="markets"] #markets .trench-live-count { color: #6f7a74; font: 9px/1 var(--nt-mono); }
body[data-screen="markets"] #markets .nt-feed-list { display: grid; padding: 0; }

body[data-screen="markets"] #markets .nt-feed-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 57px;
  padding: 7px 11px;
  border: 0;
  border-bottom: 1px solid rgba(220,232,226,.045);
  border-radius: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background .15s ease;
}

body[data-screen="markets"] #markets .nt-feed-row:hover { background: rgba(220,232,226,.025); transform: none; }
body[data-screen="markets"] #markets .nt-feed-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  color: #08100c;
  font-size: 10px;
  font-weight: 600;
}

body[data-screen="markets"] #markets .nt-feed-copy { display: block; min-width: 0; }
body[data-screen="markets"] #markets .nt-feed-copy strong {
  display: block;
  overflow: hidden;
  color: #dfe7e3;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-screen="markets"] #markets .nt-feed-copy span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #6a756f;
  font: 9px var(--nt-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-screen="markets"] #markets .nt-feed-value { text-align: right; color: #cbd4cf; font: 500 10px var(--nt-mono); }
body[data-screen="markets"] #markets .nt-feed-value > b { display: block; color: inherit; font: inherit; }
body[data-screen="markets"] #markets .nt-feed-value > span { display: block; margin-top: 4px; font: 500 9px var(--nt-mono); }
body[data-screen="markets"] #markets .trench-radar-empty { display: grid; gap: 5px; padding: 15px 12px; color: #6d7872; }
body[data-screen="markets"] #markets .trench-radar-empty b { color: #aab5b0; font-size: 11px; font-weight: 600; }
body[data-screen="markets"] #markets .trench-radar-empty span,
body[data-screen="markets"] #markets .trench-rail-note { color: #68736d; font: 9px/1.45 var(--nt-mono); }
body[data-screen="markets"] #markets .trench-rail-note { margin: 12px; }

body[data-screen="markets"] #markets .nt-trenches {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(11,14,17,.97);
}

body[data-screen="markets"] #markets .nt-trenches-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid var(--nt-line);
  background: linear-gradient(180deg,rgba(255,255,255,.012),transparent);
}

body[data-screen="markets"] #markets .nt-trenches-head strong { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 620; }
body[data-screen="markets"] #markets .nt-trenches-head strong i { width: 7px; height: 7px; border-radius: 50%; background: var(--nt-green); box-shadow: 0 0 10px rgba(102,217,156,.55); }
body[data-screen="markets"] #markets .nt-trenches-note { color: #6e7974; font: 9px var(--nt-mono); }
body[data-screen="markets"] #markets .nt-mobile-lanes { display: none; }

/* Real-data lanes */
body[data-screen="markets"] #markets .nt-lanes {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

body[data-screen="markets"] #markets .nt-lane {
  display: grid;
  grid-template-rows: 51px minmax(0,1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--nt-line);
  background: linear-gradient(180deg,color-mix(in srgb,var(--lane-color) 3%,#0b0e11),#0b0e11 18%);
}

body[data-screen="markets"] #markets .nt-lane:last-child { border-right: 0; }
body[data-screen="markets"] #markets .nt-lane-head {
  min-height: 51px;
  padding: 0;
  border-top: 1px solid color-mix(in srgb,var(--lane-color) 40%,transparent);
  border-bottom: 1px solid var(--nt-line);
  background: transparent;
  box-shadow: inset 0 1px color-mix(in srgb,var(--lane-color) 4%,transparent);
}

body[data-screen="markets"] #markets .nt-lane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 50px;
  padding: 0 10px;
}

body[data-screen="markets"] #markets .nt-lane-title strong { display: flex; align-items: center; gap: 6px; color: #e6ece8; font-size: 12px; font-weight: 620; }
body[data-screen="markets"] #markets .nt-lane-title strong i { width: 6px; height: 6px; border-radius: 50%; background: var(--lane-color,var(--nt-green)); }
body[data-screen="markets"] #markets .nt-lane-title > span { overflow: hidden; color: #748079; font: 9px var(--nt-mono); text-overflow: ellipsis; white-space: nowrap; }
body[data-screen="markets"] #markets .nt-token-grid {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(155,180,166,.25) transparent;
  scrollbar-width: thin;
}

body[data-screen="markets"] #markets .nt-token-grid::-webkit-scrollbar { width: 4px; }
body[data-screen="markets"] #markets .nt-token-grid::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(155,180,166,.25); }

/* Approved card, populated exclusively from the indexed feed. */
body[data-screen="markets"] #markets .nt-token-card {
  --tc: var(--nt-green);
  position: relative;
  display: grid;
  grid-template-columns: 66px minmax(0,1fr);
  grid-template-rows: auto auto auto auto;
  gap: 6px 10px;
  min-width: 0;
  min-height: 140px;
  margin: 0;
  padding: 11px 10px 9px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid rgba(220,232,226,.065);
  border-radius: 0;
  color: var(--nt-text);
  background: rgba(255,255,255,.006);
  text-align: left;
  transform: none;
  transition: background .16s ease,box-shadow .16s ease;
}

body[data-screen="markets"] #markets .nt-token-card:hover,
body[data-screen="markets"] #markets .nt-token-card:focus-within {
  border-color: rgba(220,232,226,.065);
  background: linear-gradient(90deg,color-mix(in srgb,var(--tc) 4%,transparent),rgba(220,232,226,.022) 62%,transparent);
  box-shadow: inset 0 1px rgba(255,255,255,.028);
  transform: none;
}

body[data-screen="markets"] #markets .nt-token-art {
  position: relative;
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--tc) 54%,transparent);
  border-radius: 14px;
  color: inherit;
  background: #12171b;
  box-shadow: inset 0 0 22px rgba(255,255,255,.03);
  transition: transform .18s ease,filter .18s ease,box-shadow .18s ease;
}

body[data-screen="markets"] #markets .nt-token-art::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; pointer-events: none; }
body[data-screen="markets"] #markets .nt-token-card:hover .nt-token-art { transform: translateY(-1px) scale(1.025); filter: saturate(1.08); box-shadow: inset 0 0 22px rgba(255,255,255,.045),0 6px 16px rgba(0,0,0,.2); }
body[data-screen="markets"] #markets .nt-token-avatar { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; font-size: 21px; }

body[data-screen="markets"] #markets .nt-chain-mark,
body[data-screen="markets"] #markets .nt-venue-mark {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  overflow: hidden;
  border: 2px solid #090c0e;
  color: #f4f8f6;
  background: #151a1d;
  box-shadow: 0 2px 9px rgba(0,0,0,.46),inset 0 0 0 1px rgba(255,255,255,.1);
  transition: transform .18s ease,box-shadow .18s ease;
}

body[data-screen="markets"] #markets .nt-chain-mark { top: -2px; left: -2px; border-radius: 7px; }
body[data-screen="markets"] #markets .nt-venue-mark { right: -2px; bottom: -2px; border-radius: 50%; }
body[data-screen="markets"] #markets .nt-chain-mark .chain-logo,
body[data-screen="markets"] #markets .nt-venue-mark .venue-logo { display: block; width: 16px; height: 16px; object-fit: contain; }
body[data-screen="markets"] #markets .nt-venue-mark .market-venue { display: grid; place-items: center; width: 100%; height: 100%; }
body[data-screen="markets"] #markets .nt-venue-mark .venue-logo-fallback { color: #e8efeb; font: 600 9px var(--nt-mono); }
body[data-screen="markets"] #markets .nt-token-card:hover .nt-chain-mark,
body[data-screen="markets"] #markets .nt-token-card:hover .nt-venue-mark { transform: scale(1.08); box-shadow: 0 3px 13px rgba(0,0,0,.55),0 0 12px color-mix(in srgb,var(--tc) 30%,transparent),inset 0 0 0 1px rgba(255,255,255,.15); }

body[data-screen="markets"] #markets .nt-token-main {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: start;
  gap: 7px;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

body[data-screen="markets"] #markets .nt-token-name { min-width: 0; }
body[data-screen="markets"] #markets .nt-token-name strong { display: block; overflow: hidden; color: #edf2ef; font-size: 14px; font-weight: 620; letter-spacing: -.012em; text-overflow: ellipsis; white-space: nowrap; }
body[data-screen="markets"] #markets .nt-token-name > span { display: block; margin-top: 3px; overflow: hidden; color: #8e9994; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
body[data-screen="markets"] #markets .nt-token-price { text-align: right; }
body[data-screen="markets"] #markets .nt-token-price > b { display: block; color: #dfe7e3; font: 550 13px var(--nt-mono); font-variant-numeric: tabular-nums; }
body[data-screen="markets"] #markets .nt-token-price > span { display: block; margin-top: 4px; font: 550 10px var(--nt-mono); }

body[data-screen="markets"] #markets .nt-token-meta {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #7f8b85;
  font: 10px var(--nt-mono);
}

body[data-screen="markets"] #markets .nt-token-meta > b { color: var(--tc); font-weight: 550; }
body[data-screen="markets"] #markets .nt-origin {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 24px;
  padding: 2px 5px 2px 3px;
  overflow: hidden;
  border: 1px solid rgba(220,232,226,.075);
  border-radius: 7px;
  color: #adb8b2;
  background: linear-gradient(90deg,rgba(255,255,255,.035),rgba(255,255,255,.012));
  white-space: nowrap;
}

body[data-screen="markets"] #markets .nt-origin-marks { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
body[data-screen="markets"] #markets .nt-origin-marks .chain-logo,
body[data-screen="markets"] #markets .nt-origin-marks .venue-logo {
  display: block;
  width: 17px;
  height: 17px;
  padding: 2px;
  border-radius: 5px;
  object-fit: contain;
  background: #151a1d;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}

body[data-screen="markets"] #markets .nt-origin-marks .market-venue { display: inline-grid; place-items: center; }
body[data-screen="markets"] #markets .nt-origin-marks .venue-logo { border-radius: 50%; }
body[data-screen="markets"] #markets .nt-origin-copy { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

body[data-screen="markets"] #markets .nt-token-stats {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid rgba(220,232,226,.035);
  font-variant-numeric: tabular-nums;
}

body[data-screen="markets"] #markets .nt-token-stats > span { min-width: 0; color: #78847e; font: 9px var(--nt-mono); letter-spacing: .035em; }
body[data-screen="markets"] #markets .nt-token-stats > span:not(:first-child) { text-align: right; }
body[data-screen="markets"] #markets .nt-token-stats strong { display: block; margin-top: 3px; overflow: hidden; color: #bfc9c4; font: 550 10px var(--nt-mono); text-overflow: ellipsis; white-space: nowrap; }
body[data-screen="markets"] #markets .nt-token-stats strong > b { color: inherit; font: inherit; }

body[data-screen="markets"] #markets .nt-riskbar {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 24px;
  padding-right: 1px;
}

body[data-screen="markets"] #markets .nt-risk {
  min-width: 0;
  max-width: 120px;
  padding: 3px 5px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--risk-color,var(--tc)) 20%,transparent);
  border-radius: 5px;
  color: color-mix(in srgb,var(--risk-color,var(--tc)) 76%,#fff);
  background: color-mix(in srgb,var(--risk-color,var(--tc)) 5%,transparent);
  font: 9px var(--nt-mono);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-screen="markets"] #markets .nt-card-actions { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
body[data-screen="markets"] #markets .trench-star,
body[data-screen="markets"] #markets .trench-inspect {
  display: inline-grid;
  place-items: center;
  min-height: 23px;
  border: 1px solid rgba(220,232,226,.075);
  border-radius: 5px;
  color: #78847e;
  background: rgba(255,255,255,.012);
}

body[data-screen="markets"] #markets .trench-star { width: 24px; padding: 0; font-size: 13px; }
body[data-screen="markets"] #markets .trench-star:hover,
body[data-screen="markets"] #markets .trench-star.active { color: #e6bd6b; background: rgba(230,185,105,.08); }
body[data-screen="markets"] #markets .trench-inspect { grid-auto-flow: column; gap: 4px; padding: 0 7px; color: #aeb9b3; font: 600 9px var(--nt-sans); }
body[data-screen="markets"] #markets .trench-inspect:hover { color: #eef2ef; border-color: rgba(220,232,226,.16); background: #1a2024; }
body[data-screen="markets"] #markets .trench-inspect i { font: 11px var(--nt-sans); font-style: normal; }

body[data-screen="markets"] #markets .nt-card-spark {
  position: absolute;
  right: 5px;
  bottom: 27px;
  width: 44%;
  height: 28px;
  padding: 0;
  overflow: hidden;
  opacity: .25;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg,transparent,#000 22%);
  mask-image: linear-gradient(90deg,transparent,#000 22%);
}

body[data-screen="markets"] #markets .nt-card-spark .tm-spark { display: block; width: 100%; height: 100%; }
body[data-screen="markets"] #markets .nt-token-card:hover .nt-card-spark { opacity: .34; }
body[data-screen="markets"] #markets .trench-empty { display: grid; min-height: 140px; place-items: center; padding: 18px; color: #78838a; text-align: center; font: 10px var(--nt-mono); }

body[data-screen="markets"] #markets .trench-rail-skeleton,
body[data-screen="markets"] #markets .trench-card-skeleton {
  background: rgba(255,255,255,.05);
  animation: nf-skeleton-pulse 1.2s ease-in-out infinite;
}

body[data-screen="markets"] #markets .trench-rail-skeleton { height: 46px; margin: 6px; border-radius: 6px; }
body[data-screen="markets"] #markets .trench-card-skeleton { height: 140px; margin: 0; padding: 11px; border: 0; border-bottom: 1px solid rgba(220,232,226,.055); border-radius: 0; }

body[data-screen="markets"] #markets .market-foot {
  flex: 0 0 auto;
  min-height: 27px;
  height: 27px;
  margin: 0;
  padding: 0 12px;
  border-top: 1px solid var(--nt-line);
  background: #07090b;
  color: #6d7872;
  font: 9px var(--nt-mono);
}

body[data-screen="markets"] #markets[data-market-view="trenches"] .market-foot .view-all { display: none; }

/* Colour-only flashes: a blurred text-shadow keyframe was rasterised on every
   frame for every ticking value (~30 flashes/s on a busy board). The missing
   100% keyframe resolves to the value's own resting colour. */
@keyframes nt-market-up {
  0% { color: var(--nt-green); }
}

@keyframes nt-market-down {
  0% { color: var(--nt-red); }
}

body[data-screen="markets"] #markets .market-live-value.tick-up { animation: nt-market-up .48s ease; }
body[data-screen="markets"] #markets .market-live-value.tick-down { animation: nt-market-down .48s ease; }

body[data-screen="markets"] #markets .market-token-open {
  min-width: 0;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  color: inherit;
  text-align: left;
}

body[data-screen="markets"] #markets .market-token-copy {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #68756f;
  font: 11px/1 var(--nt-mono);
}

body[data-screen="markets"] #markets .market-token-copy:hover,
body[data-screen="markets"] #markets .market-token-copy:focus-visible {
  color: var(--nt-green);
  background: rgba(102,217,156,.08);
}

/* Tablet and phone: a real tabpanel, not a fake horizontal snapshot. */
@media (max-width: 1180px) {
  body[data-screen="markets"] #markets[data-market-view="trenches"] .nt-workspace { grid-template-columns: minmax(0,1fr); }
  body[data-screen="markets"] #markets .nt-sidecar { display: none; }
}

@media (max-width: 900px) {
  body[data-screen="markets"] #markets .nt-commandbar {
    grid-template-columns: minmax(180px,.65fr) minmax(0,1.35fr);
    gap: 8px 12px;
    padding: 5px 10px;
  }
  body[data-screen="markets"] #markets .nt-command-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body[data-screen="markets"] #markets .nt-market-filterbar { padding-inline: 10px; }
}

@media (max-width: 850px) {
  body[data-screen="markets"] #markets.active { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}

@media (max-width: 820px) {
  body[data-screen="markets"] #markets .nt-trenches-note { display: none; }
  body[data-screen="markets"] #markets .nt-mobile-lanes {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 4px;
    padding: 6px 9px;
    border-bottom: 1px solid var(--nt-line);
    background: #090c0e;
  }
  body[data-screen="markets"] #markets .nt-mobile-lanes button {
    min-width: 0;
    min-height: 38px;
    padding: 0 5px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #728079;
    background: transparent;
    font-size: 11px;
  }
  body[data-screen="markets"] #markets .nt-mobile-lanes button[data-active="true"] {
    border-color: rgba(102,217,156,.22);
    color: #dff8e9;
    background: rgba(102,217,156,.08);
  }
  body[data-screen="markets"] #markets .nt-lanes { display: block; overflow: hidden; }
  body[data-screen="markets"] #markets .nt-lane { display: none; height: 100%; border-right: 0; }
  body[data-screen="markets"] #markets .nt-lane[data-mobile-active="true"] { display: grid; }
}

@media (max-width: 620px) {
  body[data-screen="markets"] #markets.active { min-height: 620px; padding-bottom: 67px; }
  body[data-screen="markets"] #markets .nt-commandbar { grid-template-columns: 1fr; gap: 6px; padding: 7px 9px; }
  body[data-screen="markets"] #markets .nt-command-title { justify-content: flex-start; }
  body[data-screen="markets"] #markets .nt-chainrail {
    padding-right: 18px;
    -webkit-mask-image: linear-gradient(90deg,#000 0,#000 calc(100% - 22px),transparent);
    mask-image: linear-gradient(90deg,#000 0,#000 calc(100% - 22px),transparent);
  }
  body[data-screen="markets"] #markets .nt-command-actions { grid-column: 1; }
  body[data-screen="markets"] #markets .nt-market-filterbar { min-height: 42px; height: 42px; padding-inline: 9px; }
  body[data-screen="markets"] #markets .nt-trenches-head { min-height: 42px; }
  body[data-screen="markets"] #markets .nt-token-card { grid-template-columns: 64px minmax(0,1fr); min-height: 142px; padding: 11px 10px 9px; }
  body[data-screen="markets"] #markets .nt-token-art { width: 64px; height: 64px; }
  body[data-screen="markets"] #markets .nt-token-name strong { font-size: 14px; }
  body[data-screen="markets"] #markets .nt-token-price > b { font-size: 12px; }
  body[data-screen="markets"] #markets .nt-risk:nth-of-type(n+3) { display: none; }
  body[data-screen="markets"] #markets .market-foot { display: none; }
}

@media (pointer: coarse) {
  body[data-screen="markets"] #markets .nt-chainrail .chain-chip,
  body[data-screen="markets"] #markets .nt-command-actions button,
  body[data-screen="markets"] #markets .nt-mobile-lanes button { min-height: 44px; }
  body[data-screen="markets"] #markets .trench-star,
  body[data-screen="markets"] #markets .trench-inspect { min-height: 38px; }
}

/* UHD density guardrails: more information, not oversized controls. */
@media (min-width: 1600px) and (min-height: 850px) {
  body[data-screen="markets"] #markets .nt-commandbar { grid-template-columns: minmax(260px,.85fr) minmax(0,1.5fr) auto; min-height: 52px; padding-inline: 20px; }
  body[data-screen="markets"] #markets[data-market-view="trenches"] .nt-workspace { grid-template-columns: clamp(320px,18vw,380px) minmax(0,1fr); }
  body[data-screen="markets"] #markets .nt-feed-row { min-height: 62px; padding: 9px 14px; }
  body[data-screen="markets"] #markets .nt-feed-avatar { width: 36px; height: 36px; }
  body[data-screen="markets"] #markets .nt-lane { grid-template-rows: 55px minmax(0,1fr); }
  body[data-screen="markets"] #markets .nt-lane-title { min-height: 54px; padding-inline: 12px; }
  body[data-screen="markets"] #markets .nt-token-card { min-height: 144px; }
}

@media (min-width: 2400px) and (min-height: 1200px) {
  body[data-screen="markets"] #markets[data-market-view="trenches"] .nt-workspace { grid-template-columns: clamp(320px,15vw,380px) minmax(0,1fr); }
  body[data-screen="markets"] #markets .nt-token-card { grid-template-columns: 66px minmax(0,1fr); min-height: 140px; }
  body[data-screen="markets"] #markets .nt-token-art { width: 66px; height: 66px; }
}

@media (min-width: 3400px) and (min-height: 1800px) {
  body[data-screen="markets"] #markets[data-market-view="trenches"] .nt-workspace { grid-template-columns: 400px minmax(0,1fr); }
  body[data-screen="markets"] #markets .nt-token-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body[data-screen="markets"] #markets .nt-token-card { grid-template-columns: 68px minmax(0,1fr); min-height: 144px; padding: 12px; }
  body[data-screen="markets"] #markets .nt-token-card:nth-child(odd) { border-right: 1px solid rgba(220,232,226,.065); }
  body[data-screen="markets"] #markets .nt-token-art { width: 68px; height: 68px; }
  body[data-screen="markets"] #markets .nt-token-name strong { font-size: 15px; }
  body[data-screen="markets"] #markets .nt-token-price > b { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-screen="markets"] #markets .nt-token-card,
  body[data-screen="markets"] #markets .nt-token-art,
  body[data-screen="markets"] #markets .nt-chain-mark,
  body[data-screen="markets"] #markets .nt-venue-mark,
  body[data-screen="markets"] #markets .nt-feed-row { transition: none; }
  body[data-screen="markets"] #markets .market-live-value { animation: none !important; }
  body[data-screen="markets"] #markets .trench-rail-skeleton,
  body[data-screen="markets"] #markets .trench-card-skeleton { animation: none; }
}

/* Board tools: the Layout toggle widens the lanes (hides the radar), the density
   toggle tightens cards; the settings button gets a real hit area. */
body[data-screen="markets"] .trenches-screen[data-trench-layout="wide"] .trench-layout { grid-template-columns: minmax(0, 1fr); }
body[data-screen="markets"] .trenches-screen[data-trench-layout="wide"] .trench-radar { display: none; }
body[data-screen="markets"] .trenches-screen[data-trench-density="compact"] .trench-card { padding: 7px 9px; font-size: 12px; }
body[data-screen="markets"] .trenches-screen[data-trench-density="compact"] .trench-card-skeleton { height: 96px; }
#trench-settings-tool { min-width: 36px; min-height: 24px; padding: 0 8px; }
#trench-settings-tool:empty::before, #trench-settings-tool > span:empty::before { content: "⚙"; }
@media (max-width: 850px) { #trench-settings-tool, #trench-layout-tool { display: none; } }


/* Off-screen cards and radar rows skip layout/paint entirely. With ~180 cards
   on the board and ~18 visible, this removed every long task from the live
   delta path. The intrinsic size keeps the scroll height stable. */
body[data-screen="markets"] #markets .nt-token-card { content-visibility: auto; contain-intrinsic-size: auto 140px; }
body[data-screen="markets"] #markets .nt-feed-row { content-visibility: auto; contain-intrinsic-size: auto 57px; }
