
:root {
  color-scheme: dark;
  --bg: #070a0f;
  --surface: #0d1118;
  --surface-raised: #121824;
  --surface-hover: #182132;
  --border: #243043;
  --text: #f4f7fb;
  --text-secondary: #93a4b8;
  --text-muted: #5f7086;
  --accent: #14f195;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #22d3ee;
  --buy: #16c784;
  --sell: #ea3943;
  --warning: #f5b849;
  --danger: #ff5c7a;
  --chart-grid: #1b2533;
  --chart-axis-text: #6f8197;
  --chart-crosshair: #93a4b8;
  --shadow: 0 12px 40px rgb(0 0 0 / 0.28);
  --avatar-bg: #d8e0ea;
  --avatar-fg: #1c2534;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f8fc;
  --surface: #ffffff;
  --surface-raised: #f0f4fa;
  --surface-hover: #e8eef7;
  --border: #d5dfec;
  --text: #101724;
  --text-secondary: #4e6076;
  --text-muted: #7a8ba1;
  --accent: #059669;
  --accent-secondary: #7c3aed;
  --accent-cyan: #0284c7;
  --buy: #0e9f6e;
  --sell: #d92d3a;
  --warning: #b7791f;
  --danger: #d9365e;
  --chart-grid: #dce5f2;
  --chart-axis-text: #687a90;
  --chart-crosshair: #4e6076;
  --shadow: 0 12px 36px rgb(16 23 36 / 0.12);
  --avatar-bg: #1c2534;
  --avatar-fg: #d8e0ea;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  transform: translateY(-140%);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.detail-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  padding: 10px clamp(12px, 2vw, 24px);
  backdrop-filter: blur(14px);
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/*
 * The sidebar lives below the sticky top-nav in normal document flow (not an overlay), so it
 * structurally can never cover it -- collapsing only ever changes its width, never its
 * position. Two layers on purpose: .sidebar itself has no position/height rules of its own, so
 * the flex row's default stretch alignment makes it run the full remaining page height
 * (edge-to-edge, pump.fun-style) even on a page taller than the viewport. .sidebar-inner is
 * the one that's actually sticky, capped to the viewport height -- if position:sticky were put
 * on .sidebar directly instead, its height would equal its own containing block's height
 * (they're stretched to match), leaving sticky with zero room to move within its container and
 * silently doing nothing while the whole box scrolled away with the page.
 *
 * No overflow rule on .sidebar itself, on purpose: overflow:hidden (or any value other than
 * visible) on an ancestor of a position:sticky element makes that ancestor the sticky
 * element's scrolling container per the CSS spec, even though it never actually scrolls
 * itself (it just clips). .sidebar-inner would then stick relative to .sidebar's own box --
 * which scrolls away with the page -- instead of relative to the real viewport, breaking
 * sticky entirely once the page is taller than one screen. .sidebar-inner already has its own
 * overflow-x: hidden below to clip collapsed-state content, so nothing here needs to
 * duplicate that.
 */
.sidebar {
  flex: 0 0 208px;
  width: 208px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: flex-basis 0.15s ease, width 0.15s ease, border-color 0.15s ease;
}

/* display: flex + column, with min-height matching max-height, so .sidebar-footer (the
   Shrink/Expand toggle) can be pushed all the way to the bottom of the visible viewport via
   margin-top: auto -- without a real height here the column would only hug its own content
   and the footer would sit right after the last nav link instead of pinned to the bottom. */
.sidebar-inner {
  position: sticky;
  top: 64px;
  min-height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Collapses to a narrow icon-only rail: every item (including the footer toggle) keeps its
   icon and just hides its text label -- see .sidebar.collapsed .sidebar-nav a span,
   .sidebar.collapsed .sidebar-toggle span below. */
.sidebar.collapsed {
  flex-basis: 60px;
  width: 60px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  padding: 8px 8px 12px;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 8px;
}

/* .sidebar-toggle sits in .sidebar-footer, below the nav links, styled identically to the
   a. links above it (same layout/spacing/type) so it still reads as a menu item rather than
   a separate control bolted onto the sidebar. */
.sidebar-nav a,
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  overflow: hidden;
  border: none;
  border-radius: 8px;
  padding: 0 12px;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.sidebar-nav a svg,
.sidebar-toggle svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle-icon-chevron {
  transform: none;
}

/* Collapsed shows a menu (hamburger) icon instead of the collapse chevron -- a clearer "open
   the sidebar" affordance than a lone chevron once the sidebar itself is down to its icon
   rail. */
.sidebar-toggle-icon-menu {
  display: none;
}

.sidebar.collapsed .sidebar-toggle-icon-chevron {
  display: none;
}

.sidebar.collapsed .sidebar-toggle-icon-menu {
  display: block;
}

.sidebar-nav a span,
.sidebar-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar-nav a span,
.sidebar.collapsed .sidebar-toggle span {
  display: none;
}

.sidebar-nav a[data-admin-nav][hidden] {
  display: none;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav a[aria-current="page"],
.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: var(--surface-raised);
  color: var(--text);
  outline: none;
}

.brand,
.icon-button {
  color: var(--text);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.token-avatar {
  background: var(--avatar-bg);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
}

.brand-mark img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
}

.brand-mark svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  color: #07100d;
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-name {
  display: inline-flex;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.3px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-name-curve {
  color: var(--text);
}

.brand-name-radar {
  color: var(--accent);
  text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 65%, transparent);
}

.brand-subtitle {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
}

.search-wrap {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
}

.search-wrap svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  color: var(--text-muted);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgb(3 6 12 / 0.6);
  backdrop-filter: blur(2px);
  padding: 12vh 16px 16px;
}

.search-dialog-backdrop[hidden] {
  display: none;
}

.search-dialog {
  width: min(100%, 640px);
  max-height: 76vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.search-dialog .search-wrap {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  min-height: 46px;
}

.search-dialog-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.search-dialog-close:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.search-dialog-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-dialog .search-results {
  margin-top: 12px;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.search-result:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--border));
  outline: none;
}

.search-result-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.search-result-icon img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.search-result-title,
.search-result-subtitle,
.search-result-kind {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.search-result-subtitle {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 11px;
}

.search-result-kind {
  max-width: 72px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 780;
  text-align: right;
  text-transform: uppercase;
}

.wallet-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 12px;
  font-size: 15px;
  font-weight: 500;
}

.wallet-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.wallet-button.connected {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--surface-hover);
  color: var(--text);
  outline: none;
}

.wallet-button:hover,
.wallet-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--surface-hover);
  outline: none;
}

.wallet-button.connected:hover,
.wallet-button.connected:focus-visible {
  border-color: transparent;
  background: var(--surface-hover);
}

.wallet-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.wallet-button-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-fg);
  font-size: 11px;
  font-weight: 750;
}

.wallet-button-avatar[hidden] {
  display: none;
}

.wallet-button-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallet-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  background: rgb(3 6 12 / 0.4);
  padding: calc(56px + 8px) 16px 16px;
}

.wallet-popover-backdrop[hidden] {
  display: none;
}

.wallet-popover {
  width: min(100%, 320px);
  max-height: 80vh;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.wallet-popover-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.wallet-popover-section {
  display: grid;
  gap: 6px;
}

.wallet-popover-total {
  font-size: 26px;
  font-weight: 800;
}

.wallet-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallet-popover-sol {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--surface-raised);
  padding: 4px 10px 4px 6px;
  font-size: 12px;
  font-weight: 720;
}

.wallet-popover-sol-icon {
  width: 14px;
  height: 14px;
}

.wallet-popover-address-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}

.wallet-popover-address-row code {
  overflow: hidden;
  color: var(--text-secondary);
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-popover-copy {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.wallet-popover-copy:hover {
  color: var(--text-secondary);
  background: var(--surface-raised);
}

.wallet-popover-copy-icon-copy,
.wallet-popover-copy-icon-check {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-popover-copy-icon-check {
  display: none;
  color: var(--buy);
}

.wallet-popover-copy.copied .wallet-popover-copy-icon-copy {
  display: none;
}

.wallet-popover-copy.copied .wallet-popover-copy-icon-check {
  display: block;
}

.wallet-popover-provider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 720;
}

.wallet-popover-provider svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-popover-positions-head {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.wallet-popover-positions {
  display: grid;
  gap: 6px;
}

.wallet-popover-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.wallet-popover-position {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-popover-position-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--avatar-bg);
  color: var(--avatar-fg);
  font-size: 10px;
  font-weight: 850;
}

.wallet-popover-position-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallet-popover-position-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-popover-position-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.wallet-popover-position-value {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 720;
  text-align: right;
}

.wallet-popover-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wallet-popover-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.wallet-popover-profile svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.wallet-popover-profile:hover,
.wallet-popover-profile:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-raised));
}

.wallet-popover-disconnect {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--sell);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.wallet-popover-disconnect:hover {
  background: color-mix(in srgb, var(--sell) 14%, var(--surface-raised));
}

.detail-terminal {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: clamp(12px, 2vw, 22px);
}

/* Compact DexScreener-style token identity card: lives at the top of .detail-grid-side,
   above .status-grid, so it shares that column's ~280-340px width instead of the old
   .token-hero/.status-grid two-column hero row that left dead space once .token-hero (a
   short card) sat beside a much taller chart-panel. */
.token-summary-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.token-summary-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: start;
}

.token-summary-title {
  min-width: 0;
}

.token-summary-title h1 {
  font-size: 16px;
}

.token-summary-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.token-summary-pair,
.token-summary-age {
  font-weight: 700;
}

.token-back-link {
  justify-self: end;
}

.token-summary-route {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.token-summary-route svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#tokenSummaryDex {
  color: var(--text-secondary);
}

.token-summary-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  border-radius: 999px;
  background: var(--surface-raised);
  padding: 3px 9px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  fill: var(--text-muted);
}

.status-badge.status-active .status-badge-dot,
.status-badge.status-new .status-badge-dot {
  fill: var(--buy);
}

.status-badge.status-migrated .status-badge-dot {
  fill: #8b5cf6;
}

.status-badge.status-hidden .status-badge-dot,
.status-badge.status-blocked .status-badge-dot {
  fill: var(--sell);
}

/* Shared compact icon-button style for the external links (Solscan/DexScreener/Pump.fun) and
   the watch/alert toggles, so they all read as one consistent strip of tags/icons. */
.tag-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.tag-icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tag-icon-button img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
}

.tag-icon-button:hover {
  color: var(--text-secondary);
}

/* Full-bleed cover banner across the top of the card -- pulled out of .token-summary-card's
   own padding via negative margin (same technique as launch-page.ts/launch-review-page.ts's
   banner treatment) since there's no wrapping border here to clip against. */
.token-summary-banner {
  display: block;
  width: calc(100% + 24px);
  margin: -10px -12px 0;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.token-summary-banner[hidden] {
  display: none;
}

/* Full-bleed segmented row, same "escape .token-summary-card's own padding" technique as
   .token-summary-banner -- edge to edge, buttons packed with no gap between them. */
.token-social-links {
  display: flex;
  width: calc(100% + 24px);
  margin: 0 -12px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.token-social-links[hidden] {
  display: none;
}

.profile-update-note {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.profile-update-note[hidden] {
  display: none;
}

.profile-update-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgb(3 6 12 / 0.6);
  backdrop-filter: blur(2px);
  padding: 10vh 16px 16px;
  overflow-y: auto;
}

.profile-update-backdrop[hidden] {
  display: none;
}

.profile-update-dialog {
  width: min(100%, 480px);
  max-height: 78vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.profile-update-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-update-head h2 {
  font-size: 16px;
}

.profile-update-token-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}

.profile-update-token-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.profile-update-token-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-update-token-meta {
  display: grid;
  flex: 1 1 auto;
  gap: 1px;
  min-width: 0;
}

.profile-update-token-meta strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-update-token-meta span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.profile-update-intro {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.profile-update-fee {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  padding: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-update-fee.loading {
  color: var(--text-muted);
  font-weight: 400;
}

.profile-update-fee.error {
  color: var(--text-muted);
  font-weight: 400;
}

.profile-update-fee:empty {
  display: none;
}

.profile-update-fee-icon {
  width: 12px;
  height: 12px;
  margin: 0 2px;
}

#profileUpdateForm {
  display: grid;
  gap: 14px;
}

.profile-update-field {
  display: grid;
  gap: 6px;
}

.profile-update-field span:first-child {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-update-field input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.profile-update-field textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.profile-update-description-count {
  justify-self: end;
  color: var(--text-muted);
  font-size: 10px;
}

.profile-update-banner-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-update-banner-frame.dragover {
  border-color: var(--accent, var(--buy));
  background: var(--surface);
}

.profile-update-banner-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 0 16px 44px;
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
}

.profile-update-banner-placeholder span {
  max-width: 220px;
  font-size: 11px;
}

.profile-update-banner-placeholder svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.profile-update-banner-placeholder[hidden] {
  display: none;
}

.profile-update-banner-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-update-banner-image[hidden] {
  display: none;
}

.profile-update-banner-button {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgb(3 6 12 / 0.65);
  backdrop-filter: blur(4px);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.profile-update-banner-button:hover {
  background: rgb(3 6 12 / 0.85);
}

.profile-update-banner-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.profile-update-banner-status {
  color: var(--text-muted);
  font-size: 11px;
}

.profile-update-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-update-logo-frame {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-raised);
}

.profile-update-logo-frame svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-update-logo-frame svg[hidden] {
  display: none;
}

.profile-update-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-update-logo-image[hidden] {
  display: none;
}

.profile-update-logo-side {
  display: grid;
  min-width: 0;
  gap: 6px;
  justify-items: start;
}

.profile-update-logo-button {
  position: static;
  transform: none;
}

.profile-update-banner-status.error {
  color: var(--danger);
}

.profile-update-banner-status.success {
  color: var(--buy);
}

.profile-update-free {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 9px 11px;
}

.profile-update-free[hidden] {
  display: none;
}

.profile-update-free input {
  flex: none;
  margin-top: 3px;
}

.profile-update-free strong {
  color: var(--text);
}

.profile-update-quote {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 10px 12px;
}

.profile-update-quote[hidden] {
  display: none;
}

.profile-update-quote-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-update-quote-amount {
  font-size: 18px;
}

.profile-update-quote-expiry {
  color: var(--text-muted);
  font-size: 11px;
}

.profile-update-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.profile-update-status:empty {
  display: none;
}

.profile-update-status.error {
  color: var(--danger);
}

.profile-update-status.success {
  color: var(--buy);
}

.profile-update-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.profile-update-secondary {
  background: var(--surface-raised);
}

.profile-update-secondary[hidden] {
  display: none;
}

.social-link-button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
}

.social-link-button.icon-only {
  flex: 0 0 auto;
  width: 38px;
  padding: 0;
}

.social-link-button.icon-only span {
  display: none;
}

.profile-update-verify-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% + 24px);
  margin: 0 -12px;
  height: 38px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.profile-update-verify-button:hover {
  color: var(--text);
}

.profile-update-verify-button[hidden] {
  display: none;
}

.profile-update-verify-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-link-divider {
  flex: 0 0 auto;
  align-self: stretch;
  width: 1px;
  margin: 0;
  background: var(--border);
}

.social-link-divider[hidden] {
  display: none;
}

.social-link-button:last-of-type {
  border-right: 0;
}

.social-link-button:hover {
  color: var(--text);
}

.social-link-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-link-button[hidden] {
  display: none;
}

/* Watchlist/Alert pill buttons in the trade panel toolbar. Width/margin-inline come from the
   shared ".trade-panel > *" sizing rule below, same as the other trade-panel rows. */
.trade-panel-toolbar {
  display: flex;
  gap: 8px;
}

.pill-toggle {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.pill-toggle:hover {
  color: var(--text);
}

.pill-toggle-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.pill-toggle-icon svg,
.pill-toggle .pill-toggle-icon[viewBox] {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.watch-toggle.active {
  border-color: color-mix(in srgb, var(--warning) 50%, var(--border));
  color: var(--warning);
}

.watch-toggle:disabled {
  cursor: default;
  opacity: 0.6;
}

.alert-toggle.open,
.note-toggle.open {
  border-color: color-mix(in srgb, var(--accent-cyan) 50%, var(--border));
  color: var(--accent-cyan);
}

.alert-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgb(3 6 12 / 0.6);
  backdrop-filter: blur(2px);
  padding: 12vh 16px 16px;
}

.alert-dialog-backdrop[hidden] {
  display: none;
}

.alert-panel {
  width: min(100%, 520px);
  max-height: 76vh;
  overflow-y: auto;
}

.alert-composer {
  display: grid;
  gap: 8px;
  margin: 12px;
}

.alert-composer[hidden] {
  display: none;
}

.alert-composer-row {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto;
  gap: 8px;
}

.alert-composer-row.no-threshold {
  grid-template-columns: minmax(150px, auto) auto;
}

.alert-composer-row select,
.alert-composer-row input {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
}

.alert-composer-row input[hidden] {
  display: none;
}

.alert-composer-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.alert-composer-hint[hidden] {
  display: none;
}

.alert-composer-row .preview-button {
  width: auto;
  margin-inline: 0;
  padding-inline: 16px;
}
.preview-button {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.preview-button:hover,
.preview-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-hover));
  color: var(--text);
  outline: none;
}

.preview-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.preview-button.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.preview-button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, var(--text-secondary) 30%, transparent);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: preview-button-spin 0.6s linear infinite;
}

@keyframes preview-button-spin {
  to {
    transform: rotate(360deg);
  }
}


.alert-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.note-composer {
  display: grid;
  gap: 8px;
  margin: 12px;
}

.note-composer[hidden] {
  display: none;
}

.note-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
}

.note-composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-counter {
  font-size: 11px;
  color: var(--text-muted);
}

.note-saved-at {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1 1 auto;
}

.note-composer-row .preview-button {
  width: auto;
  margin-inline: 0;
  padding-inline: 16px;
}

.alert-empty {
  margin: 0 12px 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 8px 10px;
  font-size: 12px;
}

.alert-item-copy {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.alert-item-status {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.alert-item-status.active {
  color: var(--accent-cyan);
  border-color: color-mix(in srgb, var(--accent-cyan) 45%, var(--border));
}

.alert-item-status.triggered {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
}

.alert-item-cancel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
}

.alert-item-cancel:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

.token-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: var(--avatar-fg);
  font-size: 12px;
  font-weight: 850;
}

.token-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.token-avatar-placeholder-icon {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Wraps a .token-avatar so a launchpad badge can be pinned to its bottom-right corner without
   being clipped by the avatar's own overflow:hidden circular/rounded image mask -- the badge is
   a sibling of the avatar, not a child, so JS that replaces the avatar's children (a fresh <img>
   or the placeholder icon) never touches it. */
.token-avatar-frame {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.launchpad-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  transform: translate(25%, 25%);
  display: grid;
  width: 34%;
  height: 34%;
  min-width: 13px;
  min-height: 13px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  box-sizing: content-box;
}

.launchpad-badge[hidden] {
  display: none;
}

.launchpad-badge svg {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The verified token icon (branding/verified-token.svg) is drawn as it is: no ring, no background, no outline. */
#tokenLaunchpadBadge {
  width: 40%;
  height: 40%;
  min-width: 16px;
  min-height: 16px;
  border: 0;
  background: transparent;
  transform: translate(18%, 18%);
}

#tokenLaunchpadBadge svg {
  width: 100%;
  height: 100%;
  stroke: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  overflow: hidden;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

.panel-heading p,
.token-price span,
.field span,
.stat-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

#tokenAddress {
  overflow: hidden;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.copy-button:hover {
  color: var(--text-secondary);
  background: var(--surface-raised);
}

.copy-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-icon-check {
  display: none;
  color: var(--buy);
}

.copy-button.copied .copy-icon-copy {
  display: none;
}

.copy-button.copied .copy-icon-check {
  display: block;
}

.token-price-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Overrides ".token-price span"'s muted label color for the badge's own text now that the
   badge lives inside .token-price -- needs to match ".status-badge"'s specificity. */
.token-price-label-row .status-badge span {
  color: var(--text-secondary);
}

.token-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.token-price-row strong {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.token-price-change {
  font-size: 12px;
  font-weight: 800;
}

.token-price-change:empty {
  display: none;
}

.bonding-curve {
  display: grid;
  gap: 5px;
}

.bonding-curve[hidden] {
  display: none;
}

.bonding-curve-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.bonding-curve-head strong {
  color: var(--text-secondary);
  font-size: 12px;
}

.bonding-curve-track {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-raised);
}

.bonding-curve-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent));
  transition: width 0.3s ease;
}

/* Lives in .detail-grid-side (see the HTML), matching the width of the trade panel below it
   -- 2 columns fits that ~300px width far better than the 6-across strip this used to be back
   when it spanned the full terminal width. Once .detail-grid collapses to a single
   column (see the max-width: 1023px block below), this goes back to a wide multi-column strip
   since it's full-width again at that point. */
/* 3 columns (2 rows for the 6 stats) fits the sidebar width better than a wide single row. */
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}

.stat {
  min-width: 0;
  background: var(--surface);
  padding: 8px 10px;
}

.stat strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 12px;
  margin-top: 6px;
}

/* Each column stacks its own cards independently (chart above transactions; trade above
   risk) so one column's height never forces empty space into the other -- .detail-grid's
   align-items: start alone isn't enough, since chart-panel and feed-panel would otherwise
   still need to be separate grid items in the same row as trade-panel/risk-panel. */
.detail-grid-main,
.detail-grid-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.chart-panel,
.feed-panel,
.risk-panel,
.trade-panel,
.token-profile-card,
.price-converter-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Full-bleed segmented footer row flush against the very bottom of .token-profile-card, same
   "escape the card's own padding" technique as .token-social-links -- edge to edge, buttons
   packed with no gap, a divider between each one instead of individual borders. */
.token-reactions-panel {
  display: flex;
  width: calc(100% + 32px);
  margin: 10px -16px -18px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.token-reaction-button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.token-reaction-button:last-of-type {
  border-right: 0;
}

.token-reaction-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.token-reaction-button.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-raised));
}

.token-reaction-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.token-reaction-emoji {
  font-size: 14px;
  line-height: 1;
}

.token-reaction-count {
  min-width: 1ch;
}

.token-profile-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 16px;
  text-align: center;
}

.token-profile-card[hidden] {
  display: none;
}

.token-profile-card-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 700;
}

.token-profile-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.token-profile-card-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.token-profile-card-name {
  font-size: 15px;
}

.token-profile-card-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.token-profile-card-links:empty {
  display: none;
}

.token-profile-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.token-profile-card-link:hover {
  color: var(--text);
}

.token-profile-card-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.token-profile-card-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.token-profile-card-description[hidden] {
  display: none;
}

.token-profile-card-footer {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.token-profile-card-footer:empty {
  display: none;
}

/* Read-only "1 TOKEN = X SOL/USD" calculator, independent of the trade panel -- no wallet
   needed, just the token's live USD price (already in the payload) and solUsdPrice (added
   alongside it in token-detail.ts specifically to power this). */
.price-converter-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.price-converter-row {
  position: relative;
  display: flex;
  align-items: center;
}

.price-converter-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}

.price-converter-input[readonly] {
  color: var(--text-secondary);
}

.price-converter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.price-converter-unit {
  position: absolute;
  right: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  pointer-events: none;
}

.price-converter-swap {
  display: grid;
  width: 26px;
  height: 26px;
  margin: -2px auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 1;
}

.price-converter-swap:hover {
  color: var(--text);
}

.price-converter-swap svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-converter-currency-toggle {
  position: absolute;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.price-converter-currency-toggle:hover {
  color: var(--text);
}

.price-converter-currency-toggle svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-converter-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.price-converter-status:empty {
  display: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}

/* Only meaningful for a collapsible panel heading (risk-panel's) -- a divider directly above
   nothing (the collapsed state) looks like a stray second border against the card's own bottom
   edge, so it's suppressed while collapsed and restored once there's content beneath it again. */
.panel-heading.no-divider {
  border-bottom-color: transparent;
}

.panel-heading.compact {
  min-height: auto;
  align-items: flex-start;
}

/* The tab bar replaces the usual heading title entirely (mirrors app-shell.ts's
   .market-tabs), so its .panel-heading needs less vertical padding than the default
   title+subtitle heading. */
.panel-heading:has(.feed-tabs) {
  min-height: 44px;
  padding: 6px 8px;
}

.feed-tabs {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.feed-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  padding: 8px 10px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.feed-tabs button svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-tabs button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-tab-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-raised);
  padding: 1px 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
}

.feed-tab-count:empty {
  display: none;
}

.feed-tabs button[aria-selected="true"] .feed-tab-count {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.feed-tabs button[aria-selected="true"] {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.feed-tabs button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

/* No padding here on purpose: the trade table, comment list/composer, and holder summary
   each already carry their own internal padding/margin (sized for sitting flush against a
   panel edge), so a wrapper padding here would just double up on the horizontal/bottom insets. */
.feed-tab-panel {
  padding-top: 10px;
}

.feed-tab-meta {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 4px;
  padding: 0 12px;
}

.trade-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 12px 8px;
}

.trade-filters select,
.trade-filters input,
.trade-filters > button[aria-pressed] {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  color-scheme: dark;
  font-size: 12px;
  padding: 0 8px;
}

:root[data-theme="light"] .trade-filters select,
:root[data-theme="light"] .trade-filters input {
  color-scheme: light;
}

/* The open list of a select is drawn by the browser: give it the theme's colours too. */
.trade-filters select option {
  background: var(--surface-raised);
  color: var(--text);
}

.trade-filters input::placeholder {
  color: var(--text-muted);
}

.trade-filter-empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.trade-more[hidden],
.trade-filter-empty[hidden] {
  display: none;
}

.trade-more {
  display: flex;
  justify-content: center;
  padding: 8px 12px 12px;
}

.trade-more-button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 16px;
}

.trade-more-button:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.trade-more-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.trade-filters input {
  flex: 1 1 110px;
  min-width: 0;
}

.trade-filters > button[aria-pressed="true"] {
  border-color: var(--accent, #3b82f6);
}

#tradeRows tr.trade-hidden {
  display: none;
}

.trade-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.trade-tag.creator {
  background: rgba(245, 158, 11, 0.22);
}

.trade-tag.you {
  background: rgba(59, 130, 246, 0.25);
}

.comment-panel-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 10px;
}

.comment-panel-head .feed-tab-meta {
  margin: 0;
  padding: 0;
}

.comment-post-toggle {
  padding-inline: 14px;
}

#holderSummary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 12px 12px;
}

#pnlTabPanel .empty-state {
  margin: 0 12px 12px;
}

/* Mine / All: whose PnL the tab shows. Same segmented control as the chart tabs and the All / Buys / Sells filter. */
.pnl-mode {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  margin: 0 12px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0;
}

.pnl-mode button {
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  padding: 0 12px;
}

.pnl-mode button + button {
  border-left: 1px solid var(--border);
}

.pnl-mode button:hover {
  color: var(--text);
}

.pnl-mode button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--text);
}

.pnl-mode button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.pnl-pager[hidden] {
  display: none;
}

.pnl-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
}

.pnl-toolbar .pnl-mode {
  margin: 0;
}

.pnl-toolbar .pnl-filter {
  margin-left: auto;
}

.pnl-toolbar .pnl-filter[hidden] {
  display: none;
}

.pnl-trader {
  cursor: pointer;
}

.pnl-trader:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

.pnl-trader-namebox {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.pnl-position {
  width: min(100%, 560px);
  max-height: min(82vh, 82dvh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pnl-position-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.pnl-position-head .pnl-trader-avatar {
  grid-row: auto;
}

.pnl-position-title {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.pnl-position-title strong {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-size: 14px;
}

.pnl-position-title span {
  color: var(--text-muted);
  font-size: 11px;
}

.pnl-position-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.pnl-position-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pnl-position-grid > div {
  min-width: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 9px;
}

.pnl-position-grid > div:nth-child(3n) {
  border-right: 0;
}

.pnl-position-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.pnl-position-grid small {
  display: block;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pnl-position-grid b {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-position-grid b.buy {
  color: var(--buy);
}

.pnl-position-grid b.sell {
  color: var(--sell, var(--danger));
}

.pnl-position-grid em {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10.5px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-position-section {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pnl-position-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.pnl-position-trades {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.pnl-position-trades th {
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 4px;
  text-align: right;
  text-transform: uppercase;
}

.pnl-position-trades td {
  border-top: 1px solid var(--border);
  padding: 4px;
  text-align: right;
  white-space: nowrap;
}

.pnl-position-trades td.buy {
  color: var(--buy);
}

.pnl-position-trades td.sell {
  color: var(--sell, var(--danger));
}

.pnl-position-trades th:first-child,
.pnl-position-trades td:first-child {
  text-align: left;
}

.pnl-position-scroll {
  max-height: 200px;
  overflow: auto;
}

@media (max-width: 480px) {
  .pnl-position-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pnl-position-grid > div:nth-child(3n) {
    border-right: 1px solid var(--border);
  }

  .pnl-position-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .pnl-position-grid > div:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--border);
  }

  .pnl-position-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

.pnl-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 12px 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.pnl-pager button {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 4px 12px;
}

.pnl-pager button:disabled {
  cursor: default;
  opacity: 0.4;
}

/* Everyone's PnL on the token: one compact row per person. */
.pnl-board {
  display: grid;
  margin: 0 12px 12px;
}

.pnl-trader {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 2px 10px;
  border-bottom: 1px solid var(--border);
  padding: 8px 2px;
}

.pnl-trader:last-child {
  border-bottom: 0;
}

.pnl-trader.is-me {
  background: color-mix(in srgb, var(--accent, #14f195) 7%, transparent);
}

.pnl-trader-avatar {
  width: 30px;
  height: 30px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: var(--surface-raised);
  object-fit: cover;
}

.pnl-trader-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-trader-name:hover {
  color: var(--accent);
}

.pnl-trader-you {
  margin-left: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 800;
  padding: 0 6px;
}

.pnl-trader-sub {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-trader-total {
  grid-column: 3;
  grid-row: 1;
  font-size: 13.5px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.pnl-trader-value {
  grid-column: 3;
  grid-row: 2;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.pnl-trader-share {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.pnl-trader .buy {
  color: var(--buy);
}

.pnl-trader .sell {
  color: var(--sell, var(--danger));
}

/* Your PnL on this token: one compact row of six figures, each with an icon, kept live by the price stream. */
.pnl-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 12px 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--border);
  gap: 1px;
}

.pnl-cell {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
  background: var(--surface);
  padding: 8px 10px;
}

.pnl-cell-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.pnl-cell-label svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pnl-cell-label span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pnl-cell-value {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-cell-sub {
  overflow: hidden;
  min-height: 12px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pnl-cell .buy {
  color: var(--buy);
}

.pnl-cell .sell {
  color: var(--sell, var(--danger));
}

/* A figure that just moved flashes in the direction it moved. */
.pnl-cell.flash-up .pnl-cell-value {
  animation: pnl-flash-up 0.9s ease-out;
}

.pnl-cell.flash-down .pnl-cell-value {
  animation: pnl-flash-down 0.9s ease-out;
}

@keyframes pnl-flash-up {
  0% {
    text-shadow: 0 0 10px var(--buy);
  }

  100% {
    text-shadow: 0 0 0 transparent;
  }
}

@keyframes pnl-flash-down {
  0% {
    text-shadow: 0 0 10px var(--sell, var(--danger));
  }

  100% {
    text-shadow: 0 0 0 transparent;
  }
}

#pnlRows .side-buy {
  color: var(--buy);
}

#pnlRows .side-sell {
  color: var(--sell, var(--danger));
}

#pnlRows .pnl-up {
  color: var(--buy);
}

#pnlRows .pnl-down {
  color: var(--sell, var(--danger));
}

/* The chart's controls are segments: one outline around the group and a single divider line between the buttons. */
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chart-segment,
.interval-tabs {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0;
}

.chart-segment button,
.interval-tabs button {
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  padding: 0 12px;
}

.chart-segment button + button,
.interval-tabs button + button {
  border-left: 1px solid var(--border);
}

.chart-segment button:hover,
.interval-tabs button:hover {
  color: var(--text);
}

.chart-segment button.active,
.chart-segment button[aria-pressed="true"],
.interval-tabs button.active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: none;
}

.chart-segment button:focus-visible,
.interval-tabs button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.side-tabs button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.side-tabs button {
  cursor: pointer;
  opacity: 0.45;
}

.side-tabs button.active {
  opacity: 1;
}

.side-tabs .buy {
  background: var(--buy);
  color: #06170d;
}

.side-tabs .sell {
  background: var(--sell);
  color: #200608;
}

.chart-canvas {
  position: relative;
  height: clamp(320px, 38vw, 520px);
  min-height: 320px;
  margin: 12px;
}

.chart-container {
  position: absolute;
  inset: 0;
}

.chart-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  pointer-events: none;
}

.chart-overlay[hidden] {
  display: none;
}

.chart-legend {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: calc(100% - 76px);
  margin: 0;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  pointer-events: none;
}

.chart-legend[hidden] {
  display: none;
}

.empty-state {
  display: grid;
  gap: 12px;
  min-height: 140px;
  place-items: center;
  margin: 12px 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  padding: 10px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.trade-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-block: 12px;
}

.trade-panel .side-tabs,
.field,
.preview-button,
.preset-row,
.slippage-row,
.trade-divider,
.trade-panel-toolbar,
#tradeState {
  width: calc(100% - 24px);
  margin-inline: 12px;
}

/* Overrides .preview-button's width above: this button sits inline next to the comment
   count instead of stretching full-width like the trade panel's action buttons. */
.comment-post-toggle {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

.trade-divider {
  height: 0;
  margin-block: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.field {
  display: grid;
  gap: 6px;
}

.field input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 0 10px;
}

.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-input-wrap input {
  padding-left: 30px;
  padding-right: 96px;
}

.amount-input-wrap.no-icon input {
  padding-left: 10px;
}

.preset-row[hidden] {
  display: none;
}

.amount-unit-toggle {
  position: absolute;
  right: 6px;
  display: inline-flex;
  height: 26px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.02em;
  padding: 0 8px;
  cursor: pointer;
}

.amount-unit-toggle:hover:not(:disabled),
.amount-unit-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
  outline: none;
}

.amount-unit-toggle svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.amount-token-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 11px;
  pointer-events: none;
}

.amount-token-label {
  position: absolute;
  right: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.slippage-row .preset-row {
  grid-template-columns: repeat(5, 1fr);
}

.preset-button {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.preset-button:hover:not(:disabled) {
  color: var(--text);
}

.preset-button.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-raised));
  color: var(--text);
}

.slippage-row {
  display: grid;
  gap: 6px;
}

.slippage-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

#tradeState {
  margin-block: 0;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}

#tradeState.error {
  color: var(--danger);
}

#tradeState a {
  color: var(--accent);
}

.preview-button {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-raised));
  color: var(--text-secondary);
  font-weight: 820;
  padding: 0 16px;
  cursor: pointer;
}

.trade-cta.connect {
  height: 44px;
  border: none;
  background: var(--buy);
  color: #06170d;
  font-size: 13px;
  font-weight: 860;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 1;
}

.trade-cta.connect:hover {
  filter: brightness(1.06);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.trade-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  height: 42px;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  text-align: right;
  white-space: nowrap;
}

th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

th:first-child,
td:first-child {
  text-align: left;
}

td {
  color: var(--text-secondary);
  font-size: 13px;
}

.holder-table--numbered th:first-child,
.holder-table--numbered td:first-child {
  width: 32px;
  text-align: right;
  color: var(--text-muted);
}

.holder-table--numbered th:nth-child(2),
.holder-table--numbered td:nth-child(2) {
  text-align: left;
}

.liquidity-table th:first-child,
.liquidity-table td:first-child,
.liquidity-table th:nth-child(2),
.liquidity-table td:nth-child(2) {
  text-align: left;
}

.holder-address {
  color: var(--text);
  text-decoration: none;
}

.holder-address:hover {
  text-decoration: underline;
}

.holder-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.holder-icon-dev {
  color: #f0a020;
}

.holder-icon-locked {
  color: var(--accent-cyan);
}

.buy {
  color: var(--buy);
}

.sell {
  color: var(--sell);
}

.risk-list {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.risk-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 8px 10px;
}

.risk-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.risk-item strong,
.risk-item p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.risk-item strong {
  font-size: 13px;
  white-space: nowrap;
}

.risk-item p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.3;
}

.risk-badge {
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.risk-badge.pass {
  background: color-mix(in srgb, var(--buy) 16%, transparent);
  color: var(--buy);
}

.risk-badge.warn,
.risk-badge.unknown {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
}

.risk-badge.fail {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.risk-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.risk-severity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.risk-severity.low {
  color: var(--text-secondary);
}

.risk-severity.medium {
  color: var(--warning);
}

.risk-severity.high {
  color: var(--danger);
}

.risk-evidence-link {
  font-size: 11px;
  font-weight: 650;
  color: var(--accent-cyan);
  text-decoration: none;
  white-space: nowrap;
}

.risk-evidence-link:hover {
  text-decoration: underline;
}

.risk-panel-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.risk-level-badge {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.risk-level-badge[hidden] {
  display: none;
}

.risk-level-badge.low {
  background: color-mix(in srgb, var(--buy) 16%, transparent);
  color: var(--buy);
}

.risk-level-badge.medium,
.risk-level-badge.unknown {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
}

.risk-level-badge.high {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.risk-panel-toggle {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-muted);
  cursor: pointer;
}

.risk-panel-toggle:hover {
  color: var(--text);
}

.risk-panel-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.risk-panel-toggle[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.risk-list[hidden] {
  display: none;
}

.comment-signed-out {
  margin: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.comment-signed-out a {
  color: var(--accent-cyan);
}

.wallet-required-panel {
  width: min(100%, 360px);
}

.wallet-required-copy {
  margin: 4px 12px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

#walletRequiredConnect {
  margin: 0 12px 12px;
  width: calc(100% - 24px);
}

.comment-composer {
  display: grid;
  gap: 8px;
  max-width: 640px;
  margin: 12px auto;
  padding-inline: 12px;
}

.comment-composer[hidden] {
  display: none;
}

.comment-composer textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 9px 10px;
  resize: vertical;
}

.comment-composer-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.turnstile-wrap {
  min-height: 1px;
}

.turnstile-wrap:empty {
  display: none;
}

.char-counter {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 11px;
}

.comment-attach-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
}

.comment-attach-button:hover {
  color: var(--text);
}

.comment-attach-button.active {
  color: var(--accent);
  border-color: var(--accent);
}

.comment-attach-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.comment-attach-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.comment-attachment-status {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-attachment-status.error {
  color: var(--danger);
}

.comment-attachment-status:empty {
  display: none;
}

.comment-attachment-preview {
  position: relative;
  display: inline-block;
  max-width: 220px;
}

.comment-attachment-preview[hidden] {
  display: none;
}

.comment-attachment-preview img,
.comment-attachment-preview video {
  display: block;
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  object-fit: cover;
}

.comment-attachment-preview img[hidden],
.comment-attachment-preview video[hidden] {
  display: none;
}

.comment-attachment-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.comment-attachment-remove:hover {
  color: var(--text);
}

.comment-attachment-remove svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Compact attachment thumbnail on a posted comment -- capped small so a wall of comments with
   images/video doesn't turn into an image feed; click an image to open it full-size in a new
   tab (a <video> already has its own native controls for that). Always centered under the
   comment body regardless of the thumbnail's own (variable) aspect ratio. */
.comment-item-attachment {
  width: auto;
  height: auto;
  display: block;
  max-width: 260px;
  max-height: 200px;
  margin: 6px auto 0;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
}

.comment-item-attachment[data-attachment-kind="video"] {
  cursor: default;
}

/* The <a> wrapping an image attachment (buildCommentAttachmentElement) is inline by default,
   which would leave it shrink-wrapped and left-aligned regardless of the img's own centering --
   block-ify it and center it the same way, with the img's own margin cleared so it isn't
   double-applied. */
.comment-item-attachment-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 6px auto 0;
}

.comment-item-attachment-link .comment-item-attachment {
  margin: 0;
}

.comment-error {
  color: var(--danger);
  font-size: 12px;
}

.comment-list {
  display: grid;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 4px 12px 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

/* Full-bleed the same way My Feed's cards on the profile page do: width/margin extend
   .comment-item past .comment-list's 12px side padding to its actual border edge, with that
   same 12px folded into this item's own padding (4px original + 12px list padding = 16px) so
   the content sits at the same visual inset either way -- only the divider line (::after,
   which paints this box, padding included) actually reaches the vertical borders. */
.comment-item {
  position: relative;
  display: block;
  width: calc(100% + 24px);
  margin: 0 -12px;
  padding: 10px 16px 0;
}

.comment-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-bottom: 1px solid var(--accent);
}

.comment-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-item-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-fg);
  font-size: 10px;
  font-weight: 850;
}

.comment-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-item-author {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-item-author:hover,
.comment-item-author:focus-visible {
  text-decoration: underline;
  outline: none;
}

.comment-item-time {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 11px;
}

/* The shared follow button, sized and coloured like the share, tip and report buttons beside it; the icon alone turns green on hover and once followed, with no background. */
.comment-item-head .comment-follow-button {
  width: 24px;
  height: 24px;
  margin-left: -4px;
  color: var(--text-muted);
}

.comment-item-head .comment-follow-button svg {
  width: 15px;
  height: 15px;
}

.comment-item-head .comment-follow-button:hover,
.comment-item-head .comment-follow-button:focus-visible,
.comment-item-head .comment-follow-button.is-following,
.comment-item-head .comment-follow-button.is-following:hover,
.comment-item-head .comment-follow-button.is-following:focus-visible {
  background: transparent;
  color: var(--accent, #14f195);
}

/* The author row and the text together open the post in a dialog (nothing in them is a control except the author link and the buttons). */
.comment-item-main {
  /* Room on all four sides for the hover highlight, taken back with a negative margin so the text does not move. */
  margin: -6px -10px -6px;
  border-radius: 10px;
  cursor: pointer;
  padding: 6px 10px;
  transition: background 0.1s ease;
}

.comment-item-main:hover {
  background: color-mix(in srgb, var(--surface-hover) 45%, transparent);
}

.comment-item-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* In the dialog the post is the whole card, edge to edge. This panel has no padding of its own, so the body takes the full width. */
.alert-panel.post-dialog {
  width: min(100%, 480px);
  max-height: min(80vh, 80dvh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.alert-panel.post-dialog .panel-heading {
  align-items: center;
  flex-direction: row;
  min-height: 0;
  padding: 8px 12px;
}

.alert-panel.post-dialog .panel-heading h2 {
  margin: 0;
  font-size: 15px;
}

.post-dialog-body {
  min-width: 0;
  margin: 0;
}

.post-dialog-body .comment-item-body,
.post-dialog-body .comment-item-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.post-dialog-body .comment-item {
  width: 100%;
  margin: 0;
  padding: 10px 16px 0;
}

.post-dialog-body .comment-item-main {
  cursor: default;
}

.post-dialog-body .comment-item-main:hover {
  background: transparent;
}

.post-dialog-body .comment-token-card,
.post-dialog-body .comment-item-footer {
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-right: -16px;
}

.comment-item-body {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
  /* Line breaks and blank lines are shown as typed. */
  white-space: pre-wrap;
}

.comment-report-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  cursor: pointer;
}

.comment-report-button:hover,
.comment-report-button:focus-visible {
  color: var(--danger);
  background: var(--surface-hover);
  outline: none;
}

.comment-report-button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  font-size: 10px;
}

.comment-report-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One full-width segmented bar (React | Reply | Share), divider lines between segments instead
   of individual button borders -- full-bleed past .comment-item's own 16px side padding so the
   dividers reach the card's actual edges (same technique .comment-item itself uses to reach
   .comment-list's border). Each segment is icon + label + count. */
.comment-item-footer {
  display: flex;
  width: calc(100% + 32px);
  margin: 10px -16px 0;
  border-top: 1px solid var(--border);
}

.comment-reaction-wrap {
  position: relative;
  display: flex;
  flex: 1;
}

.comment-action-button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.comment-action-button:last-child {
  border-right: 0;
}

.comment-action-button:hover,
.comment-action-button:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
  outline: none;
}

.comment-share-button:hover {
  color: var(--accent-cyan);
}

.comment-action-count:empty {
  display: none;
}

.comment-react-button.active {
  color: var(--accent-cyan);
}

.comment-share-button.active {
  color: var(--accent-cyan);
}

.comment-share-button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.comment-share-button:disabled:hover {
  background: transparent;
  color: var(--text-muted);
}

.comment-react-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  overflow: hidden;
}

/* Bare emoji (no circle badge), pinned to the same fixed 12x12 box .comment-reply-button's SVG
   uses (width/height attrs, not font metrics) so both icons sit at the exact same baseline --
   grayscale until this is actually the viewer's own reaction (.active), same cue the badge
   version gives in the picker/summary. */
.comment-react-button-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  font-size: 12px;
  line-height: 12px;
  filter: grayscale(1) opacity(0.75);
  transition: filter 0.15s ease;
}

.comment-react-button.active .comment-react-button-emoji {
  filter: none;
}

/* Small circle badge with an emoji centered inside -- shared by the react button's own icon,
   the picker's options, and the reaction-count summary. */
.comment-reaction-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface-raised);
  overflow: hidden;
  /* Muted/grayscale until the viewer has actually picked a reaction -- the full color only
     appears once .comment-react-button carries .active, so it's clear which reaction (if
     any) is currently theirs. */
  filter: grayscale(1) opacity(0.75);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.comment-react-button.active .comment-reaction-badge {
  filter: none;
}

/* Emoji fonts commonly carry taller internal line metrics than their nominal font-size, so the
   glyph is pinned to a fixed box (not just font-size + line-height) to actually center inside
   .comment-reaction-badge's circle instead of overflowing it and throwing off the button row's
   alignment against its sibling .comment-reply-button (a plain SVG icon has no such quirk). */
.comment-reaction-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 9px;
  height: 9px;
  font-size: 9px;
  line-height: 9px;
}

.comment-reaction-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 5;
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 4px;
}

.comment-reaction-picker[hidden] {
  display: none;
}

.comment-reaction-picker button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

.comment-reaction-picker button .comment-reaction-badge {
  width: 26px;
  height: 26px;
  filter: none;
}

.comment-reaction-picker button .comment-reaction-badge-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 16px;
}

.comment-reaction-picker button:hover .comment-reaction-badge,
.comment-reaction-picker button:focus-visible .comment-reaction-badge {
  transform: scale(1.2);
}

.comment-reaction-picker button:hover {
  background: var(--surface-hover);
  transform: scale(1.2);
}


.report-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.report-form select,
.report-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

.report-form select {
  height: 36px;
}

.report-form textarea {
  min-height: 48px;
  resize: vertical;
}

.reply-thread-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

/* Extra horizontal inset beyond .modal-dialog's own 16px padding, specifically for the "No
   replies yet" dashed box -- at the dialog's full content width it read as stretching edge to
   edge with no breathing room of its own. */
.reply-thread-list .empty-state {
  margin-left: 8px;
  margin-right: 8px;
}

.reply-thread-composer-footer .preview-button {
  flex: 0 0 auto;
  width: 88px;
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
}

.reply-thread-item {
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--border);
}

.reply-thread-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.reply-thread-composer {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.reply-thread-composer textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.reply-thread-composer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.load-more {
  width: calc(100% - 24px);
  max-width: 640px;
  margin: 0 auto 12px;
}

.mobile-dock,
.sidebar-backdrop,
.sheet-close,
.side-panel-head,
.feed-select,
.quick-trade {
  display: none;
}

/* Centered loading spinner, used in place of "loading" text inside the trades table body. */
.loading-row td {
  height: 72px;
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: middle;
  animation: crdr-spin 0.8s linear infinite;
}

@keyframes crdr-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

@media (max-width: 1023px) {
  .status-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1022px) {
  /*
   * Mobile navigation, same as the Markets page: no sidebar rail at all. The menu is a bottom
   * sheet (rounded top corners, flush with the bottom edge) opened from a floating dock, and the
   * dock hides while any full-screen overlay is open. The desktop collapsed/expanded preference
   * is ignored here.
   */
  .top-nav {
    min-height: 52px;
    gap: 8px;
    padding: 8px 12px;
  }

  .brand-subtitle {
    display: none;
  }

  .wallet-button {
    display: none;
  }

  .detail-terminal {
    padding: 10px 10px calc(140px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    flex: none;
    width: 100%;
    border-top: 1px solid var(--border);
    border-right: 0;
    border-radius: 20px 20px 0 0;
    transform: translateY(102%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }

  .sidebar.collapsed {
    flex: none;
    width: 100%;
  }

  .sidebar.mobile-open {
    transform: translateY(0);
    visibility: visible;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.22s ease;
  }

  .sidebar-inner {
    position: static;
    max-height: 78vh;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar-inner::before {
    content: "";
    display: block;
    flex: 0 0 auto;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 999px;
    background: var(--border);
  }

  .sidebar-nav {
    padding: 8px 10px 4px;
  }

  .sidebar.collapsed .sidebar-nav a span {
    display: inline;
  }

  .sidebar-footer {
    display: none;
  }

  .sheet-close {
    display: block;
    margin: 4px 10px 12px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .sidebar-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(0, 0, 0, 0.55);
  }

  .mobile-dock {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    width: min(calc(100% - 16px), 400px);
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    padding: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
  }

  .dock-item {
    display: flex;
    min-width: 0;
    height: 40px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 0 4px;
    text-decoration: none;
    cursor: pointer;
  }

  .dock-item svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .dock-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #dockWalletText {
    font-size: 11px;
  }

  /*
   * Attention cues for the Details button until it has been opened once: a pulsing accent ring, the
   * icon nudging sideways, and a one-time "Tap for token details" bubble. They run a fixed number of
   * cycles (about 11s) rather than forever, and are switched off for reduced-motion users.
   */
  .dock-item.attention {
    position: relative;
    color: var(--accent);
  }

  .dock-item.attention::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    animation: crdr-pulse 1.8s ease-out 6;
  }

  .dock-item.attention svg {
    animation: crdr-peek 1.8s ease-in-out 6;
  }

  .dock-hint {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    z-index: 2;
    translate: -50% 0;
    border-radius: 10px;
    background: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    color: #04120a;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    padding: 6px 10px;
    pointer-events: none;
    white-space: nowrap;
    animation: crdr-hint 5.6s ease forwards;
  }

  .dock-hint::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-bottom-color: var(--accent);
  }

  .dock-hint[hidden] {
    display: none;
  }

  /* While the hint bubble shows below the dock, lift the dock and quick-trade bar to make room. */
  body.dock-hinting .mobile-dock {
    bottom: calc(46px + env(safe-area-inset-bottom));
  }

  body.dock-hinting .quick-trade {
    bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .mobile-dock,
  .quick-trade {
    transition: bottom 0.25s ease;
  }

  @keyframes crdr-pulse {
    0% {
      box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
    }

    70%,
    100% {
      box-shadow: 0 0 0 10px transparent;
    }
  }

  @keyframes crdr-peek {
    0%,
    100% {
      transform: translateX(0);
    }

    30% {
      transform: translateX(3px);
    }

    60% {
      transform: translateX(-1px);
    }
  }

  @keyframes crdr-hint {
    0% {
      opacity: 0;
      transform: translateY(6px);
    }

    8%,
    88% {
      opacity: 1;
      transform: none;
    }

    100% {
      opacity: 0;
      transform: translateY(4px);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .dock-item.attention::after,
    .dock-item.attention svg {
      animation: none;
    }

    .dock-item.attention {
      background: color-mix(in srgb, var(--accent) 14%, transparent);
    }

    .dock-hint {
      animation-name: none;
    }
  }

  .dock-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--avatar-bg);
    color: var(--avatar-fg);
    font-size: 9px;
    font-weight: 800;
  }

  .dock-avatar[hidden] {
    display: none;
  }

  .dock-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /*
   * Everything in the right-hand column (token summary, stats, trade panel, risk) leaves the page
   * on mobile and lives in a slide-in panel from the right, opened by the dock's Trade button.
   * The page itself then shows only the chart and the tabs. The summary card's "back to markets"
   * X is hidden here because it would read as this panel's close button; the panel has its own.
   * (transform: none when open, not translateX(0), so position: fixed descendants are not
   * trapped inside a transformed containing block.)
   */
  .detail-grid-side {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(380px, 92vw);
    overflow-y: auto;
    border-left: 1px solid var(--border);
    border-radius: 16px 0 0 16px;
    background: var(--bg);
    padding: 10px 10px calc(16px + env(safe-area-inset-bottom));
    gap: 10px;
    grid-auto-rows: max-content;
    transform: translateX(102%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }

  .detail-grid-side.mobile-open {
    transform: none;
    visibility: visible;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.22s ease;
  }

  .side-panel-head {
    position: sticky;
    top: -10px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -10px -10px 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    padding: 10px;
    font-size: 14px;
  }

  .pair-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
  }

  .pair-title strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pair-icons {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .pair-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    overflow: hidden;
    border: 2px solid var(--bg);
    border-radius: 50%;
    background: var(--avatar-bg);
    color: var(--avatar-fg);
    font-size: 10px;
    font-weight: 800;
  }

  .pair-icon + .pair-icon {
    margin-left: -8px;
  }

  .pair-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .pair-icon-sol {
    background: #0b0f16;
  }

  .pair-icon-sol svg {
    width: 15px;
    height: 12px;
  }

  .panel-close {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--text-secondary);
    padding: 0;
    cursor: pointer;
  }

  .panel-close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .token-back-link {
    display: none;
  }

  /* The dock hides behind the menu sheet / trade panel and every bottom-sheet dialog. */
  body.menu-open .mobile-dock,
  body:has(#walletPopoverBackdrop:not([hidden])) .mobile-dock,
  body:has(#searchDialogBackdrop:not([hidden])) .mobile-dock,
  body:has(#pnlPositionBackdrop:not([hidden])) .mobile-dock,
  body:has(#alertDialogBackdrop:not([hidden])) .mobile-dock,
  body:has(#noteDialogBackdrop:not([hidden])) .mobile-dock,
  body:has(#commentDialogBackdrop:not([hidden])) .mobile-dock,
  body:has(#postDialogBackdrop:not([hidden])) .mobile-dock,
  body:has(#replyThreadDialogBackdrop:not([hidden])) .mobile-dock,
  body:has(#walletRequiredDialogBackdrop:not([hidden])) .mobile-dock,
  body.menu-open .quick-trade,
  body:has(#walletPopoverBackdrop:not([hidden])) .quick-trade,
  body:has(#searchDialogBackdrop:not([hidden])) .quick-trade,
  body:has(#pnlPositionBackdrop:not([hidden])) .quick-trade,
  body:has(#alertDialogBackdrop:not([hidden])) .quick-trade,
  body:has(#noteDialogBackdrop:not([hidden])) .quick-trade,
  body:has(#commentDialogBackdrop:not([hidden])) .quick-trade,
  body:has(#postDialogBackdrop:not([hidden])) .quick-trade,
  body:has(#replyThreadDialogBackdrop:not([hidden])) .quick-trade,
  body:has(#walletRequiredDialogBackdrop:not([hidden])) .quick-trade {
    display: none;
  }

  /* Popups: full-width bottom sheets with rounded top corners, flush with the screen bottom. */
  .search-dialog-backdrop,
  .wallet-popover-backdrop,
  .alert-dialog-backdrop {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .search-dialog,
  .wallet-popover,
  .alert-panel {
    width: 100%;
    max-height: 88vh;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .search-dialog {
    padding-top: 0;
  }

  .alert-panel.post-dialog {
    max-height: 90vh;
    max-height: 90dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .search-dialog::before,
  .wallet-popover::before,
  .alert-panel::before {
    content: "";
    display: block;
    flex: 0 0 auto;
    width: 36px;
    height: 4px;
    margin: 8px auto 10px;
    border-radius: 999px;
    background: var(--border);
  }

  .wallet-popover::before {
    margin: -6px auto 0;
  }

  /*
   * Quick-trade bar: a one-row floating panel above the dock (Buy/Sell toggle, amount, action
   * button). It holds no trade logic of its own: it drives the real trade panel's controls (in the
   * Details side panel) and mirrors their state, so validation, the simulation gate and the wallet
   * flow all stay in one place. It hides behind the same overlays as the dock.
   */
  .quick-trade {
    position: fixed;
    left: 50%;
    bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 44;
    display: block;
    width: min(calc(100% - 16px), 400px);
    transform: translateX(-50%);
  }

  .quick-trade-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .quick-trade-side {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    padding: 2px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  .quick-trade-side button {
    height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    padding: 0 10px;
    cursor: pointer;
  }

  .quick-trade-side button.buy.active {
    background: var(--buy);
    color: #06170d;
  }

  .quick-trade-side button.sell.active {
    background: var(--sell);
    color: #200608;
  }

  .quick-trade-amount {
    position: relative;
    display: block;
    min-width: 0;
  }

  .quick-trade-amount input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-raised);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 0 78px 0 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  .quick-unit-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    display: inline-flex;
    height: 26px;
    max-width: 74px;
    align-items: center;
    gap: 4px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    background: var(--surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    padding: 0 7px;
    cursor: pointer;
  }

  .quick-unit-toggle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quick-unit-toggle svg {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .quick-trade-action {
    height: 36px;
    min-width: 76px;
    max-width: 128px;
    overflow: hidden;
    border: 0;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 0 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  .quick-trade-action.buy {
    background: var(--buy);
    color: #06170d;
  }

  .quick-trade-action.sell {
    background: var(--sell);
    color: #200608;
  }

  .quick-trade-action.connect {
    border: 1px solid var(--border);
    background: var(--surface-raised);
    color: var(--text);
  }

  .quick-trade-action:disabled {
    cursor: default;
    opacity: 0.45;
  }

  .quick-trade-status {
    margin: 0 0 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
    padding: 6px 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  }

  .quick-trade-status[hidden] {
    display: none;
  }

  .quick-trade-status.error {
    color: var(--danger);
  }

  .quick-trade-status a {
    color: var(--accent);
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alert-composer-row {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .interval-tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  /*
   * Tab lists as compact cards. The wide tables (they need ~680px and scroll sideways) become a
   * stack of small cards, one per row, built purely from CSS: the header row is hidden and each
   * cell is placed on a small grid by its position, since the column order is fixed. Empty-state
   * rows (a single cell spanning every column) stay plain text.
   */
  .feed-tab-panel {
    padding-top: 8px;
  }

  .feed-tab-meta {
    padding: 0 10px;
  }

  .feed-tab-panel .trade-table-wrap {
    overflow: visible;
    padding: 4px 8px 8px;
  }

  .feed-tab-panel table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .feed-tab-panel thead {
    display: none;
  }

  .feed-tab-panel tbody {
    display: grid;
    gap: 6px;
  }

  .feed-tab-panel tr {
    display: grid;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-raised);
    padding: 7px 10px;
  }

  .feed-tab-panel td {
    display: block;
    min-width: 0;
    height: auto;
    overflow: hidden;
    border: 0;
    padding: 0;
    font-size: 12px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .feed-tab-panel tr:has(> td[colspan]) {
    display: block;
    border-style: dashed;
    background: transparent;
    padding: 12px 10px;
    text-align: center;
  }

  .feed-tab-panel td[colspan] {
    text-align: center;
    white-space: normal;
  }

  .feed-tab-panel tbody tr.loading-row {
    display: block;
    border: 0;
    background: transparent;
    padding: 14px 0;
  }

  .feed-tab-panel tr.loading-row td {
    height: auto;
    overflow: visible;
    text-align: center;
  }

  /* Your PnL trades: [side] [amount] .... [pnl] / [MC entry] [price] .... [time] */
  /* Phones: two columns and three rows, with the labels back, so every figure is whole. */
  .pnl-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 4px 8px 6px;
  }

  .pnl-cell {
    gap: 2px;
    padding: 7px 10px;
  }

  .pnl-cell-value {
    font-size: 14px;
  }

  .pnl-cell-sub {
    font-size: 10.5px;
  }

  #pnlRows tr {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  #pnlRows td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-weight: 800;
  }

  #pnlRows td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    color: var(--text);
    font-weight: 700;
  }

  #pnlRows td:nth-child(5) {
    grid-column: 3;
    grid-row: 1;
    font-weight: 800;
    text-align: right;
  }

  #pnlRows td:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
    color: var(--text-muted);
    font-size: 11px;
  }

  #pnlRows td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    color: var(--text-muted);
    font-size: 11px;
  }

  #pnlRows td:nth-child(6) {
    grid-column: 3;
    grid-row: 2;
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
  }

  /* Transactions: [side] [amount] .... [value] / [trader] ........ [time] */
  #tradeRows tr {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  #tradeRows td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  #tradeRows td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    color: var(--text);
    font-weight: 700;
  }

  #tradeRows td:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
    color: var(--text);
    font-weight: 700;
    text-align: right;
  }

  #tradeRows td:nth-child(4) {
    grid-column: 1 / span 2;
    grid-row: 2;
    color: var(--text-muted);
    font-size: 11px;
  }

  #tradeRows td:nth-child(5) {
    grid-column: 3;
    grid-row: 2;
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
  }

  /* Holders: [#] [holder] .... [% of supply] / [amount] */
  #holderRows tr {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  #holderRows td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    min-width: 16px;
    text-align: left;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
  }

  #holderRows td:nth-child(1):not(:empty)::before {
    content: "#";
  }

  #holderRows td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    color: var(--text);
    font-weight: 700;
  }

  #holderRows td:nth-child(3) {
    grid-column: 2 / span 2;
    grid-row: 2;
    color: var(--text-muted);
    font-size: 11px;
  }

  #holderRows td:nth-child(4) {
    grid-column: 3;
    grid-row: 1;
    color: var(--text);
    font-weight: 750;
    text-align: right;
  }

  /* Liquidity: [dex] .... [usd value] / [pool] / [token amount] .... [sol balance] */
  #liquidityRows tr {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #liquidityRows td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    color: var(--text);
    font-weight: 700;
  }

  #liquidityRows td:nth-child(5) {
    grid-column: 2;
    grid-row: 1;
    color: var(--text);
    font-weight: 750;
    text-align: right;
  }

  #liquidityRows td:nth-child(2) {
    grid-column: 1 / span 2;
    grid-row: 2;
    font-size: 11px;
  }

  #liquidityRows td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
    color: var(--text-muted);
    font-size: 11px;
  }

  #liquidityRows td:nth-child(4) {
    grid-column: 2;
    grid-row: 3;
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
  }

  /* All four holder stats stay in one row on phones too, just tighter. */
  #holderSummary {
    margin: 4px 8px 6px;
  }

  #holderSummary .stat {
    padding: 6px 4px;
  }

  #holderSummary .stat strong {
    font-size: 12px;
  }

  #holderSummary .stat-label {
    font-size: 10px;
  }

  /* Comments: hide the list's own side borders on phones (full-bleed to the viewport edge is
     enough of a visual boundary at this width without them). */
  .comment-panel-head {
    margin-bottom: 8px;
    padding: 0 8px;
  }

  .comment-post-toggle {
    height: 32px;
    font-size: 13px;
    padding: 0 14px;
  }

  .comment-list {
    max-width: none;
    padding: 8px;
    padding-bottom: 0;
    border-left: 0;
    border-right: 0;
  }

  .comment-item-body {
    font-size: 13px;
  }

  /*
   * On phones the activity tab row (Transactions / PnL / Comments / Holders / Liquidity, with
   * their live count badges) is replaced by a dropdown that drives the same tab buttons and
   * mirrors their labels, counts and disabled state. The original row stays in the DOM, hidden.
   */
  .feed-tabs {
    display: none;
  }

  .feed-select {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
  }

  .feed-select-trigger {
    display: flex;
    width: 100%;
    height: 36px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 720;
    padding: 0 10px;
    cursor: pointer;
  }

  .feed-select svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .feed-select-icon,
  .feed-select-option-icon {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .feed-select-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .feed-select-chevron {
    color: var(--text-muted);
    transition: transform 0.15s ease;
  }

  .feed-select-trigger[aria-expanded="true"] .feed-select-chevron {
    transform: rotate(180deg);
  }

  .feed-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 30;
    display: grid;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }

  .feed-select-menu[hidden] {
    display: none;
  }

  .feed-select-option {
    display: flex;
    height: 38px;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 0 10px;
    text-align: left;
    cursor: pointer;
  }

  .feed-select-option > span:nth-child(2) {
    flex: 1;
  }

  .feed-select-option[aria-selected="true"] {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
  }

  .feed-select-option:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.55;
  }

  /*
   * Compact chart header: one row, title and candle count on the left, the interval buttons on
   * the right. Scoped to the chart so the other panel headings keep their stacked layout.
   */
  .chart-panel .panel-heading {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    min-height: 0;
    padding: 8px 10px;
  }

  /* Risk header: same single row as desktop (title + summary left, level badge + collapse
     toggle right) instead of the stacked layout the generic mobile rule gives panel headings. */
  .risk-panel .panel-heading {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    min-height: 0;
    padding: 8px 10px;
  }

  .risk-panel .panel-heading > div:first-child {
    min-width: 0;
  }

  .risk-panel .panel-heading h2 {
    font-size: 14px;
  }

  .risk-panel .panel-heading p {
    margin-top: 1px;
    font-size: 10px;
  }

  .chart-panel .panel-heading h2 {
    font-size: 14px;
  }

  .chart-panel .panel-heading p {
    margin-top: 1px;
    font-size: 10px;
  }

  .chart-panel .chart-controls {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .chart-panel .chart-segment,
  .chart-panel .interval-tabs {
    border-radius: 7px;
  }

  .chart-panel .interval-tabs {
    flex: 1 1 auto;
  }

  .chart-panel .chart-segment button,
  .chart-panel .interval-tabs button {
    height: 28px;
    font-size: 11px;
    padding: 0 9px;
  }

  .chart-panel .interval-tabs button {
    flex: 1 1 0;
  }

  .chart-legend {
    max-width: calc(100% - 16px);
    font-size: 10px;
  }

  .chart-canvas {
    height: clamp(260px, 78vw, 380px);
    min-height: 260px;
  }
}

@media (max-width: 374px) {
  .detail-terminal {
    padding: 10px 10px calc(140px + env(safe-area-inset-bottom));
  }

  .brand-name {
    font-size: 14px;
  }

  .interval-tabs button {
    padding-inline: 8px;
  }

  .status-grid,
  .token-summary-card {
    gap: 1px;
  }
}
