/* Crypto Intelligence dashboard — base design system
 * One token set; every component reads from it. Sections:
 * 1 tokens · 2 base · 3 layout · 4 controls · 5 surfaces · 6 tables · 7 charts
 * 8 views · 9 dialogs · 10 breakout radar · 11 responsive
 */

/* ---------- 1. Tokens ---------- */
@font-face {
  font-family: 'Manrope';
  src: url('/static/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/static/fonts/dmmono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/static/fonts/dmmono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #07111c;
  --surface-1: #0f1b29;
  --surface-2: #142334;
  --surface-3: #1a2c40;
  --surface-inset: #0a1521;
  --border: rgba(164, 195, 219, 0.12);
  --border-strong: rgba(164, 195, 219, 0.24);
  --text: #eef3f7;
  --text-2: #b8c6d3;
  --muted: #8a9cad;
  --accent: #66e0d2;
  --accent-ink: #062024;
  --green: #5fd8a4;
  --red: #ff8791;
  --amber: #f4c77e;
  --blue: #7fb2ff;
  --violet: #b49aff;
  --font: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-lg: 15px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px rgba(0, 0, 0, 0.28);
  --ring: 0 0 0 3px rgba(102, 224, 210, 0.28);
}

/* Market directory: dense, source-backed discovery alongside the portfolio. */
.srOnly { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.marketPageHead { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 0 28px; }
.marketPageHead h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.15; letter-spacing: -.055em; margin: 10px 0; }
.headingDot { color: var(--accent); }
.marketPageHead p { margin: 0; color: var(--muted); font-size: 12px; }
.marketHeadActions, .marketCoinActions { display: flex; gap: 10px; flex-wrap: wrap; }
.navNew { font: 500 8px var(--mono); color: var(--accent); border: 1px solid var(--border); padding: 2px 4px; border-radius: 3px; margin-left: auto; }
.marketGlobal { margin: 0 0 10px; }
.marketGlobal + .chartnote { margin-bottom: 24px; }
.marketLeaders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.marketLeaderCard { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; min-width: 0; }
.marketLeaderCard > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.marketLeaderCard h3 { font-size: 13px; margin: 0; }
.marketLeaderCard > div > span { color: var(--muted); font-size: 9px; }
.marketLeaderCard > button { display: flex; width: 100%; align-items: center; gap: 10px; color: var(--text); background: transparent; border: 0; border-radius: 5px; padding: 8px 0; cursor: pointer; text-align: left; }
.marketLeaderCard > button:hover { background: var(--surface-2); }
.marketLeaderCard > button > b { font-size: 12px; }
.marketLeaderCard > button > span:last-child { margin-left: auto; font: 11px var(--mono); }
.coinAvatar { flex-shrink: 0; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font: 600 13px var(--font); color: var(--blue); background: #7fb2ff14; border: 1px solid #7fb2ff22; }
.coinAvatar[data-coin-color="1"] { color: var(--amber); background: #f4c77e14; border-color: #f4c77e22; }
.coinAvatar[data-coin-color="2"] { color: var(--accent); background: #66e0d214; border-color: #66e0d222; }
.coinAvatar[data-coin-color="3"] { color: var(--violet); background: #b49aff14; border-color: #b49aff22; }
.coinAvatar[data-coin-color="4"] { color: var(--red); background: #ff879114; border-color: #ff879122; }
.coinAvatar[data-coin-color="5"] { color: var(--green); background: #5fd8a414; border-color: #5fd8a422; }
.marketDirectory { overflow: hidden; }
.marketDirectoryHead { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 24px 0; }
.marketDirectoryHead h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.035em; }
.marketWatchBadge { color: var(--amber); font-size: 11px; white-space: nowrap; }
.marketFilters { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(145px, 1fr)); gap: 14px; padding: 22px 24px 14px; }
.marketFilters .field { min-width: 0; }
.marketFilters .field > input, .marketFilters .field > select { min-width: 0; width: 100%; }
.marketBreadth { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font: 10px var(--mono); padding: 6px 24px; }
#marketsStatus { margin: 8px 24px 18px; }
.marketTable { min-width: 1150px; }
.marketTable th { white-space: nowrap; font-size: 9px; }
.marketTable td { padding-top: 15px; padding-bottom: 15px; font-size: 11px; }
.marketTable td:nth-child(1), .marketTable th:nth-child(1) { width: 35px; padding-right: 0; }
.marketTable td:nth-child(2) { color: var(--muted); font-size: 10px; }
.marketTable .marketCoin { text-align: left; min-width: 185px; font-family: var(--font); }
.marketCoin > button { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.marketCoin > button:hover b { color: var(--accent); }
.marketCoin b { display: block; font-size: 12px; max-width: 160px; white-space: normal; }
.marketTable td.marketCoin { position: sticky; left: 0; z-index: 1; background: var(--surface-1); }
.marketTable th:nth-child(3) { left: 0; z-index: 2; }
.marketScrollHint { display: none; color: var(--muted); font-size: 10px; margin: 8px 16px 12px; }
.marketGlobal article span.positive { color: var(--green); }
.marketGlobal article span.negative { color: var(--red); }
.marketCoin small { display: block; font: 9px var(--mono); color: var(--muted); margin-top: 2px; }
.watchButton { background: transparent; border: 0; padding: 5px; color: var(--muted); font-size: 20px; cursor: pointer; }
.watchButton:hover, .watchButton.watched { color: var(--amber); }
.marketSpark { display: block; width: 120px; height: 36px; margin-left: auto; }
.marketSpark.stale { opacity: .45; }
.marketStaleRow .marketCoin small { color: var(--amber); }
.marketPagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.marketPagination > div { display: flex; align-items: center; gap: 14px; }
.marketPagination .field { margin-left: auto; }
.marketPagination .field select { min-height: 32px; padding: 5px 8px; }
.marketResearchLinks { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border-top: 1px solid var(--border); padding: 20px 0; margin-top: 24px; font-size: 11px; }
.marketResearchLinks > span { color: var(--muted); }
.marketCoinDialog { width: min(780px, 94vw); }
.marketCoinQuote { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; margin: 20px 0; }
.marketCoinQuote > strong { font: 500 clamp(26px, 5vw, 38px) var(--mono); letter-spacing: -.05em; overflow-wrap: anywhere; }
.marketCoinQuote > span { font: 12px var(--mono); }
.marketCoinChart { border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; margin: 10px 0 22px; background: var(--surface-inset); }
.marketCoinChart .marketSpark { width: 100%; height: 170px; }
.marketCoinMetrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.marketCoinMetrics article { min-width: 0; }
.marketCoinMetrics small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.marketCoinMetrics strong { font: 12px var(--mono); overflow-wrap: anywhere; }
.marketCoinActions { margin-top: 22px; }
.chartDisplayControls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.chartDisplayControls label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.chartDisplayControls select { padding: 4px 7px; min-height: 28px; background: var(--surface-inset); color: var(--text-2); border: 1px solid var(--border); border-radius: 5px; font: 10px var(--font); }
.chartDisplayControls > button { font-size: 10px; }
@media (min-width: 1300px) { #nav button[data-view=markets]::before { content: '◉'; } }
@media (max-width: 1100px) { .marketFilters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .marketScrollHint { display: block; } }
@media (max-width: 600px) {
  .marketPageHead { align-items: flex-start; flex-direction: column; gap: 18px; padding-top: 0; }
  .marketLeaders { grid-template-columns: 1fr; gap: 10px; }
  .marketLeaderCard { padding: 14px 16px; }
  .marketLeaderCard > button { padding: 5px 0; }
  .marketFilters { padding: 18px 16px 14px; gap: 12px; }
  .marketFilters .marketSearch { grid-column: 1 / -1; }
  .marketDirectoryHead, .marketPagination { padding-left: 16px; padding-right: 16px; }
  .marketBreadth { padding-left: 16px; padding-right: 16px; gap: 10px; line-height: 1.7; }
  #marketsStatus { margin-left: 16px; margin-right: 16px; overflow-wrap: anywhere; }
  .marketPagination { flex-wrap: wrap; gap: 12px; }
  .marketPagination > div { margin-left: auto; }
  .marketPagination .field { margin-left: 0; }
  .marketCoinMetrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .marketResearchLinks { gap: 16px; }
}

/* Currency and gold display the new Syrian pound denomination. */
.currencyGoldStatus { margin: 0 0 20px; overflow-wrap: anywhere; }
.currencyGoldHighlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; }
.currencyGoldHighlight { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); }
.currencyGoldHighlightGold { border-top-color: var(--amber); }
.currencyGoldHighlight > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.currencyGoldHighlight h3 { font-size: 13px; }
.currencyGoldHighlight > div > span { font-size: 9px; text-align: right; }
.currencyGoldHighlight > small { display: block; color: var(--muted); margin: 7px 0 16px; font-size: 10px; }
.currencyGoldHighlight dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.currencyGoldHighlight dt { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.currencyGoldHighlight dd { margin: 0; font: 500 clamp(16px, 1.5vw, 22px) var(--mono); overflow-wrap: anywhere; }
.currencyGoldHighlight p { font: 11px var(--mono); }
.currencyGoldHighlight p > span { color: var(--muted); font: 10px var(--font); }
.currencyGoldPanel { overflow: hidden; margin: 0 0 22px; }
.currencyGoldPanelHead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.currencyGoldPanelHead h2 { margin-top: 6px; font-size: 20px; }
.currencyGoldFeedStatus { padding: 12px 24px 0; overflow-wrap: anywhere; }
.currencyGoldTableNote { margin: 12px 24px 16px; color: var(--text-2); font-size: 11px; }
.currencyGoldTable { min-width: 1190px; }
.currencyGoldTable thead th { font-size: 9px; }
.currencyGoldTable td { padding-top: 15px; padding-bottom: 15px; font-size: 11px; }
.currencyGoldTable .currencyGoldIdentity { position: sticky; top: auto; left: 0; z-index: 1; min-width: 170px; background: var(--surface-1); border-bottom: 1px solid var(--border); padding: 15px 14px; color: var(--text); letter-spacing: 0; text-align: left; text-transform: none; }
.currencyGoldIdentity > b { font-size: 12px; }
.currencyGoldIdentity > small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; font-weight: 400; white-space: normal; }
.currencyGoldTime > span { font-size: 10px; }
.currencyGoldTime > small { display: block; color: var(--muted); font: 9px var(--font); margin-top: 6px; }
.currencyGoldTable .currencyGoldWarning, .currencyGoldWarning { color: var(--amber); }
.currencyGoldStaleRow .currencyGoldIdentity > b { color: var(--amber); }
.currencyGoldSource { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.currencyGoldSource a { text-decoration: none; }
.currencyGoldSource a:hover { text-decoration: underline; }
.currencyGoldFootnote { line-height: 1.8; }
@media (max-width: 900px) {
  .currencyGoldHighlights { gap: 10px; }
  .currencyGoldHighlight { padding: 16px; }
  .currencyGoldHighlight > div { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (max-width: 600px) {
  .currencyGoldHighlights { grid-template-columns: 1fr; }
  .currencyGoldHighlight > div { align-items: center; flex-direction: row; }
  .currencyGoldHighlight dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .currencyGoldPanelHead { align-items: flex-start; flex-wrap: wrap; padding: 18px 16px 0; gap: 12px; }
  .currencyGoldFeedStatus { padding-left: 16px; padding-right: 16px; }
  .currencyGoldTableNote { margin-left: 16px; margin-right: 16px; }
  .currencyGoldSource { padding-left: 16px; padding-right: 16px; }
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(102, 224, 210, 0.09), transparent 70%), var(--bg);
  color: var(--text);
  font: 400 var(--fs-md) / 1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.modalOpen {
  overflow: hidden;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1:focus,
h2:focus {
  outline: none;
}
p {
  margin: 0;
}
a {
  color: var(--accent);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
::selection {
  background: rgba(102, 224, 210, 0.3);
}
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}
[hidden] {
  display: none !important;
}
/* Keep targets clear of the sticky header when scrolled into view. */
section,
.sectionhead,
.panel {
  scroll-margin-top: 84px;
}
.positive {
  color: var(--green);
}
.negative {
  color: var(--red);
}
.oversoldText {
  color: var(--blue);
}
.muted,
.subtle {
  color: var(--muted);
}
.eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.empty {
  display: grid;
  place-items: center;
  gap: var(--sp-2);
  min-height: 96px;
  padding: var(--sp-5);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.empty strong {
  color: var(--text-2);
}
.chartnote,
.footnote {
  margin-top: var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.55;
}
.error {
  color: var(--red);
  font-size: var(--fs-sm);
  min-height: 1em;
}

/* ---------- 3. Layout ---------- */
.shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-6) var(--sp-6);
}
.top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: 0 calc(-1 * var(--sp-6));
  padding: var(--sp-3) var(--sp-6);
  background: rgba(7, 17, 28, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: inherit;
  text-decoration: none;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.brand b {
  font-size: var(--fs-lg);
}
.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: linear-gradient(145deg, #7ff0e2, #45c7b8);
  color: var(--accent-ink);
  font-weight: 800;
}
.status {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}
.actions {
  display: flex;
  gap: var(--sp-2);
}
nav {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) 0 var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.navGroup {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(15, 27, 41, 0.58);
}
.navGroupLabel {
  margin: 0 var(--sp-2) 0 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
nav button {
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
nav button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
nav button.active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.view {
  display: none;
}
.view.active {
  display: block;
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.sectionhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin: var(--sp-6) 0 var(--sp-3);
}
.sectionhead:first-child {
  margin-top: var(--sp-2);
}
.sectionhead.compact {
  margin: var(--sp-5) 0 var(--sp-3);
}
.sectionhead h2 {
  margin: 6px 0 4px;
  font-size: var(--fs-2xl);
}
.sectionhead h3 {
  margin: 6px 0 4px;
  font-size: var(--fs-xl);
}
.sectionhead p {
  max-width: 760px;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.filters {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
footer {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* ---------- 4. Controls ---------- */
.button {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.button:hover {
  border-color: var(--accent);
  background: var(--surface-3);
}
.button:active {
  transform: translateY(1px);
}
.button:disabled {
  opacity: 0.55;
  cursor: progress;
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.button.primary:hover {
  background: #84ebe0;
}
.button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.button.quiet:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.button.small {
  min-height: 28px;
  padding: 0 10px;
  font-size: var(--fs-xs);
}
.button.danger {
  color: var(--red);
}
.button.danger:hover {
  border-color: var(--red);
}
.button.full {
  width: 100%;
}
.textbutton {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.textbutton:hover {
  text-decoration: underline;
}
.field {
  display: grid;
  gap: 5px;
  min-width: 140px;
}
.field > span {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.field.inline {
  min-width: 0;
}
.field.grow {
  flex: 1 1 200px;
}
.field input,
.field select,
.filters > input,
.filters > select {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  color: var(--text);
  font-size: var(--fs-md);
}
.field input[type='range'] {
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--accent);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
select {
  cursor: pointer;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 36px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.check input,
.maToggle input {
  accent-color: var(--accent);
}
.formrow {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4);
}
.formStatus {
  color: var(--muted);
  font-size: var(--fs-sm);
  align-self: center;
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-inset);
}
.segmented button {
  min-height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.segmented button:hover {
  color: var(--text);
}
.segmented button.active {
  background: var(--accent);
  color: var(--accent-ink);
}
.segmented.small button {
  min-height: 24px;
  padding: 0 9px;
  font-size: var(--fs-xs);
}
.tabs {
  display: flex;
  gap: var(--sp-1);
  margin: var(--sp-2) 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tabs button {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: var(--fs-md);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.tabs button:hover {
  color: var(--text);
}
.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.pill {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.pill.good {
  color: var(--green);
  border-color: rgba(95, 216, 164, 0.35);
  background: rgba(95, 216, 164, 0.08);
}
.pill.good::before,
.pill.bad::before,
.pill.warn::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.bad {
  color: var(--red);
  border-color: rgba(255, 135, 145, 0.35);
  background: rgba(255, 135, 145, 0.08);
}
.pill.warn {
  color: var(--amber);
  border-color: rgba(244, 199, 126, 0.35);
}
.legendRow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}
.legendRow.static span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.legendToggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-inset);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}
.legendToggle i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legendToggle b {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text);
}
.legendToggle.off {
  opacity: 0.4;
}
.legendToggle.off i {
  background: transparent !important;
  border: 1px solid var(--muted);
}

/* ---------- 5. Surfaces ---------- */
.panel,
.metrics article,
.terminalcard {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1) 60%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.chartcard {
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.cardHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.cardHead h3 {
  margin: 6px 0 4px;
  font-size: var(--fs-xl);
}
.cardHead h4 {
  margin-top: 4px;
  font-size: var(--fs-lg);
}
.cardHead p {
  max-width: 640px;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.cardHead.compact {
  margin-top: var(--sp-5);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.metrics article {
  display: grid;
  gap: 4px;
  padding: var(--sp-4) var(--sp-4) 14px;
}
.metrics article small {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.metrics article strong {
  font-size: var(--fs-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.metrics article span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.metrics.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.metrics.compact article strong {
  font-size: var(--fs-lg);
}
.scanMethod {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-xs);
  line-height: 1.6;
}
.scanMethod > b {
  flex: none;
  color: var(--accent);
}
.scanMethod span {
  color: var(--text-2);
}
.filtersPanel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.filterCount {
  margin-left: auto;
  align-self: center;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.roadmap {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
}
.roadmap h3 {
  font-size: var(--fs-lg);
}
.roadmap p {
  color: var(--text-2);
}

/* ---------- 6. Tables ---------- */
.tablebox {
  overflow: auto;
  max-height: 72vh;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: var(--fs-sm);
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: right;
  text-transform: uppercase;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
th.left,
td.left,
td.asset,
td.note,
th:first-child + th.left {
  text-align: left;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr[data-symbol],
tbody tr[data-br-open] {
  cursor: pointer;
}
tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}
tbody tr:focus-visible td {
  background: rgba(102, 224, 210, 0.06);
}
tbody tr:focus-visible {
  outline: 1px solid var(--accent);
  box-shadow: none;
}
td.asset {
  font-family: var(--font);
  font-weight: 700;
}
td.asset small,
.priceCell small,
.footerSub {
  display: block;
  color: var(--muted);
  font-family: var(--font);
  font-size: var(--fs-xs);
  font-weight: 400;
}
.priceCell strong {
  font-weight: 500;
}
td.note {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font);
  color: var(--text-2);
}
td.empty {
  display: table-cell;
}
tfoot td {
  position: sticky;
  bottom: 0;
  background: var(--surface-3);
  border-top: 1px solid var(--border-strong);
  font-weight: 700;
}
.sortButton,
.scanSort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.sortButton span {
  opacity: 0.55;
  font-size: 10px;
}
th[aria-sort='ascending'],
th[aria-sort='descending'] {
  color: var(--accent);
}
.sortButton:hover,
.scanSort:hover {
  color: var(--text);
}
/* Keep row actions reachable when many wallet columns force horizontal scrolling. */
td.assetActions,
#portfolioHead th:last-child {
  position: sticky;
  right: 0;
  background: var(--surface-2);
  box-shadow: -10px 0 14px -10px rgba(0, 0, 0, 0.6);
}
td.assetActions,
tbody tr:hover td.assetActions {
  background: var(--surface-1);
}
.assetActions > div {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.marketBadge {
  color: var(--muted);
  font-family: var(--font);
}
.shareBar {
  display: inline-block;
  width: 60px;
  height: 6px;
  margin-right: 8px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.shareBar i {
  display: block;
  height: 100%;
  border-radius: 3px;
}

/* ---------- 7. Charts (shared) ---------- */
.chartArea {
  position: relative;
  min-height: 180px;
  margin-top: var(--sp-3);
}
.chartArea svg,
.pricechart svg,
.rsichart svg {
  display: block;
  width: 100%;
}
.chartGrid {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}
.chartGrid.dashed {
  stroke-dasharray: 3 4;
  stroke: rgba(255, 255, 255, 0.14);
}
.chartAxis {
  fill: var(--muted);
  font: 10px var(--mono);
}
.chartLabel {
  fill: var(--text);
}
.chartHoverLabel,
.compareTokenTooltip,
.brTip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 3px;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: rgba(6, 14, 24, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  font-size: var(--fs-xs);
  pointer-events: none;
}
.chartHoverLabel b,
.compareTokenTooltip > strong {
  color: var(--text);
  font-size: var(--fs-sm);
}
.chartHoverLabel span,
.compareTokenTooltip span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}
.chartHoverLabel strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
}
.chartHoverLabel small {
  color: var(--muted);
}
.chartHoverLabel .dot,
.compareTokenTooltip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--token-color, currentColor);
}
.walletCross,
.compareCrosshair {
  stroke: rgba(255, 255, 255, 0.45);
  stroke-dasharray: 3 4;
  pointer-events: none;
}

/* price chart + RSI */
.chartpanel {
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.charthead,
.charttoolbar,
.chartcontrols {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.charthead h2 {
  margin-top: 6px;
  font-size: var(--fs-xl);
}
.charttoolbar {
  margin-top: var(--sp-4);
}
.chartcontrols {
  margin: var(--sp-3) 0 var(--sp-2);
}
.chartquote {
  text-align: right;
}
.chartquote strong {
  display: block;
  font: 500 var(--fs-2xl) var(--mono);
}
.chartquote span {
  font-size: var(--fs-xs);
}
.maControls {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}
.maToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--fs-xs);
  cursor: pointer;
}
.maSwatch {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--amber);
}
.maSwatch.ma200 {
  background: repeating-linear-gradient(90deg, var(--violet) 0 5px, transparent 5px 8px);
}
.volumeLegend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.volumeLegend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #43d5a1 50%, #ff7184 50%);
}
.pricechart {
  position: relative;
  height: 300px;
  padding: var(--sp-2) 0;
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.pricechart svg {
  height: 100%;
}
.rsihead {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
}
.rsihead strong {
  font: 500 var(--fs-lg) var(--mono);
}
.rsihead span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.rsichart {
  position: relative;
  height: 96px;
  margin-top: var(--sp-2);
}
.rsichart svg {
  height: 100%;
}

/* horizontal bar lists */
.analyticsBars {
  display: grid;
  gap: 6px;
  margin-top: var(--sp-3);
  max-height: 540px;
  overflow: auto;
}
.analyticsBarRow {
  display: grid;
  grid-template-columns: 150px 1fr 110px;
  align-items: center;
  gap: var(--sp-3);
}
.analyticsBarLabel b {
  display: block;
  font-size: var(--fs-sm);
}
.analyticsBarLabel small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.analyticsBarTrack {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
}
.analyticsBarTrack.diverging::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--border-strong);
}
.analyticsBarTrack i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 5px;
}
.analyticsBarTrack i.gain {
  background: var(--accent);
}
.analyticsBarTrack i.loss {
  background: var(--red);
}
.analyticsBarRow > strong {
  font: 500 var(--fs-sm) var(--mono);
  text-align: right;
}
.analyticsBarRow > strong.gain {
  color: var(--text);
}
.analyticsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.analyticsWide {
  grid-column: 1 / -1;
}

/* ---------- 8. Views ---------- */
/* overview */
.welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-4) 0 var(--sp-5);
}
.welcome h1 {
  margin: 10px 0;
  font-size: clamp(32px, 3.6vw, 48px);
  letter-spacing: -0.045em;
  line-height: 1.05;
}
.welcome p {
  color: var(--muted);
}
.total {
  min-width: 300px;
  padding: var(--sp-4) var(--sp-5);
  border-left: 1px solid var(--border);
  text-align: right;
}
.total small {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.total strong {
  display: block;
  margin: 4px 0;
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.total span {
  font: var(--fs-sm) var(--mono);
}
.terminalcards {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.terminalcard {
  display: grid;
  align-content: start;
  gap: var(--sp-3);
  padding: var(--sp-4);
}
.walletSummary {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.walletDonutLabel {
  fill: var(--text);
  font: 700 16px var(--font);
}
.walletLegend {
  flex: 1;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}
.walletLegend li {
  display: grid;
  grid-template-columns: 10px 1fr auto 48px;
  align-items: center;
  gap: var(--sp-2);
}
.walletLegend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.walletLegend small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.walletLegend b {
  font: 500 var(--fs-sm) var(--mono);
}
.walletLegend em {
  color: var(--muted);
  font: normal var(--fs-xs) var(--mono);
  text-align: right;
}
.leaderList {
  display: grid;
  gap: 2px;
}
.leaderRow {
  display: flex;
  justify-content: space-between;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.leaderRow:hover {
  background: rgba(255, 255, 255, 0.04);
}
.leaderRow span {
  font-family: var(--mono);
}
.dataStatus {
  display: grid;
  gap: 6px;
}
.dataStatus span {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.sentimentReadout {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.sentimentReadout strong {
  font: 500 var(--fs-3xl) var(--mono);
}
.sentimentReadout span {
  font-weight: 700;
}
.sentimentReadout.extreme-fear span,
.sentimentReadout.fear span {
  color: var(--red);
}
.sentimentReadout.neutral span {
  color: var(--amber);
}
.sentimentReadout.greed span,
.sentimentReadout.extreme-greed span {
  color: var(--green);
}
.sentimentTrack {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--red), var(--amber) 50%, var(--green));
}
.sentimentTrack i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
}
.sentimentFoot {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  color: var(--muted);
  font-size: 10px;
}
.sentimentFoot a {
  text-decoration: none;
}
.sentimentNote {
  color: var(--muted);
  font-size: 10px;
}
.rankgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-3);
}
.rankgrid > .empty,
.walletCards > .empty,
.brTop > .empty,
.platformgrid > .empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
}
.platformgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}
.platformcard {
  display: grid;
  gap: 2px;
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.platformcard strong {
  color: var(--text);
  font: 500 var(--fs-lg) var(--mono);
}

/* wallets */
.walletGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
  gap: var(--sp-4);
}
.walletGrid .chartcard {
  margin-bottom: 0;
}
.donutArea {
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
.donutArea .walletLegend {
  width: 100%;
}
.donutValue {
  fill: var(--text);
  font: 700 17px var(--font);
}
.donutCaption {
  fill: var(--muted);
  font: 10px var(--font);
}
.donutSlice {
  transition: stroke-width 0.15s;
}
.donutSlice:hover {
  stroke-width: 26;
}
.walletCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
}
.walletCard {
  position: relative;
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1) 70%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.walletCard::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--wallet);
}
.walletCard.active {
  border-color: var(--wallet);
}
.walletCard header,
.walletCard footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}
.walletName {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 700;
}
.walletName i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--wallet);
}
.walletValue {
  font: 500 var(--fs-3xl) var(--mono);
  letter-spacing: -0.02em;
}
.walletChange {
  font: var(--fs-xs) var(--mono);
}
.walletSpark {
  width: 100%;
  height: 40px;
}
.walletSparkEmpty {
  display: grid;
  place-items: center;
  height: 40px;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.walletCompositionBar {
  display: flex;
  height: 8px;
  gap: 2px;
  border-radius: 4px;
  overflow: hidden;
}
.walletCompositionBar i {
  background: var(--wallet);
  opacity: 0.85;
}
.walletCompositionBar i:nth-child(2) {
  opacity: 0.7;
}
.walletCompositionBar i:nth-child(3) {
  opacity: 0.58;
}
.walletCompositionBar i:nth-child(n + 4) {
  opacity: 0.45;
}
.walletCompositionBar i.rest {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}
.walletTop {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}
.walletTop li {
  display: grid;
  grid-template-columns: 1fr auto 40px;
  gap: var(--sp-2);
}
.walletTop span,
.walletTop em {
  font: normal var(--fs-sm) var(--mono);
  text-align: right;
}
.walletTop em {
  color: var(--muted);
}
.walletCard footer {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.walletTopNote {
  color: var(--muted);
  font-size: 10px;
}
.compositionPanel {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
}
.compRow {
  display: grid;
  grid-template-columns: 130px 1fr 120px;
  align-items: center;
  gap: var(--sp-3);
}
.compName {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
}
.compName i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.compTrack {
  display: flex;
  gap: 2px;
  height: 28px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.compTrack i {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 6px;
  color: #fff;
  overflow: hidden;
}
.compTrack i.rest {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}
.compTrack b {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.compValue {
  font: 500 var(--fs-sm) var(--mono);
  text-align: right;
}

/* momentum */
.portfolioRsiSummary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.portfolioRsiSummary article {
  display: grid;
  gap: 3px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.portfolioRsiSummary article.oversold {
  border-left-color: var(--green);
}
.portfolioRsiSummary article.overbought {
  border-left-color: var(--red);
}
.portfolioRsiSummary small {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.portfolioRsiSummary strong {
  font-size: var(--fs-xl);
}
.portfolioRsiSummary span {
  color: var(--text-2);
  font-size: var(--fs-xs);
}
.portfolioRsiSummary em {
  color: var(--muted);
  font: normal var(--fs-xs) var(--mono);
}
.rsiStrip {
  min-height: 190px;
}
.stripZone.oversold {
  fill: rgba(95, 216, 164, 0.07);
}
.stripZone.overbought {
  fill: rgba(255, 135, 145, 0.07);
}
.stripZoneLabel {
  fill: var(--muted);
  font: 700 10px var(--font);
  letter-spacing: 0.08em;
}
.stripZoneLabel.oversold {
  fill: var(--green);
}
.stripZoneLabel.overbought {
  fill: var(--red);
}
.stripDot {
  stroke: var(--surface-1);
  stroke-width: 2;
  opacity: 0.9;
  cursor: pointer;
}
.stripDot:hover {
  opacity: 1;
  stroke: var(--text);
}
.stripLabel {
  fill: var(--accent-ink);
  font: 700 9px var(--font);
  pointer-events: none;
}
.heatmapArea {
  margin-top: var(--sp-3);
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.heatTable td,
.heatTable th {
  padding: 8px 12px;
}
.heatTable th.focus {
  color: var(--accent);
}
.heatCell {
  min-width: 58px;
  color: var(--text);
  font-weight: 500;
  text-align: center;
}
.heatCell.na {
  color: var(--muted);
}
.heatCell.oversold,
.heatCell.overbought {
  font-weight: 700;
}

/* history panels */
.portfolioHistorySummary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.portfolioHistorySummary article {
  display: grid;
  gap: 3px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.portfolioHistorySummary small {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.portfolioHistorySummary strong {
  font: 500 var(--fs-xl) var(--mono);
}
.portfolioHistorySummary span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.portfolioHistoryChart {
  height: 300px;
}
.portfolioHistoryChart svg {
  height: 100%;
}
.historyGrid {
  stroke: rgba(255, 255, 255, 0.07);
}
.historyAxis {
  fill: var(--muted);
  font: 10px var(--mono);
}
.historyLine {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}
.historyPoint {
  fill: var(--accent);
}
.historyCrosshair {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-dasharray: 3 4;
}
.historyFocusPoint {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
}
.historyLatest {
  fill: var(--accent);
  font: 500 11px var(--mono);
}
/* opportunities */
.opportunityCharts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.opportunityChart {
  display: grid;
  gap: 6px;
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  font-size: var(--fs-xs);
}
.opportunityChart > small {
  color: var(--muted);
}
.opportunityChartRow {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  gap: var(--sp-2);
}
.opportunityChartRow > i {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}
.opportunityChartRow > i > em {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--blue);
}
.opportunityChartRow > i > .holderRevenueBar {
  background: var(--green);
}
.opportunityChartRow > strong {
  font: 500 var(--fs-xs) var(--mono);
  text-align: right;
}
.opportunity {
  display: grid;
  align-content: start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1) 70%);
  font-size: var(--fs-xs);
}
.opportunityTop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.opportunityTop .num {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.opportunityTop b {
  font: 500 var(--fs-2xl) var(--mono);
}
.opportunityTop b small {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.opportunity h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.opportunity h3 small {
  color: var(--muted);
  font: var(--fs-sm) var(--mono);
}
.opportunityAsset {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 700 var(--fs-xl) var(--font);
  cursor: pointer;
}
.opportunityAsset:hover {
  color: var(--accent);
}
.whaleResearchCharts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.whaleResearchCharts > .panel {
  min-width: 0;
  padding: 14px;
}
.whaleResearchCharts h4 {
  margin: 0 0 10px;
  font-size: var(--fs-sm);
}
.whaleMiniChart {
  min-height: 180px;
}
.whaleMiniChart svg {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}
.whaleMiniChart .chartGrid {
  stroke: var(--border);
  stroke-width: 1;
}
.whaleMiniChart .chartAxisLabel {
  fill: var(--muted);
  font: 10px var(--mono);
}
.attentionBlock {
  margin: 0 0 var(--sp-5);
  padding: var(--sp-4);
  border: 1px solid var(--border-strong);
  border-top: 2px solid var(--accent);
  border-radius: var(--r-lg);
  background: linear-gradient(145deg, rgba(20, 35, 52, 0.92), rgba(10, 21, 33, 0.96));
  box-shadow: var(--shadow);
}
.attentionHeading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.attentionHeading h2 {
  margin: 5px 0 0;
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
}
.attentionHeading .chartnote {
  margin: 0;
  text-align: right;
}
.attentionGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
}
.attentionCard {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(7, 17, 28, 0.58);
}
.attentionCard > small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.attentionCard > strong {
  color: var(--text);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.attentionCard > span {
  min-height: 2.6em;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.attentionCard .textbutton {
  margin-top: auto;
  padding-top: 5px;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.attentionRisk {
  border-color: rgba(255, 135, 145, 0.3);
}
.attentionRisk > strong {
  color: var(--red);
}
.attentionSignal {
  border-color: rgba(102, 224, 210, 0.28);
}
.tokenResearchMetrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
}
.tokenResearchMetrics article {
  min-width: 0;
  padding: 12px;
  background: rgba(7, 17, 28, 0.45);
  box-shadow: none;
}
.tokenResearchMetrics article strong {
  overflow-wrap: anywhere;
  font-size: var(--fs-lg);
}
.tokenResearchMetrics article span {
  min-height: 2.6em;
  font-size: 10px;
}
.tokenResearch .brPanelHead {
  align-items: flex-end;
}
.tokenResearch .field select {
  min-width: 130px;
}
.tokenResearch {
  margin-top: 0 !important;
  padding: 18px;
  border-color: var(--border-strong);
}
.researchWorkspaceHead,
.researchControls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.researchWorkspaceHead h3 {
  margin-top: 3px;
  font-size: var(--fs-2xl);
}
.researchControls {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.researchAuto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.researchAuto input { accent-color: var(--accent); }
.researchLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 5px;
  font-size: var(--fs-sm);
}
.researchReadout {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) minmax(260px, 1.4fr);
  gap: 6px var(--sp-4);
  align-items: center;
  margin-top: var(--sp-3);
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.researchOpportunity {
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.researchOpportunity b {
  color: var(--text);
  font-size: var(--fs-sm);
}
.researchOpportunity p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.researchReadout h4 {
  margin-top: 3px;
  font-size: var(--fs-lg);
}
.researchReadout p {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.researchConditions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 6px;
}
.researchConditions span {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-2);
  background: rgba(255, 255, 255, .025);
  font-size: var(--fs-xs);
}
.researchOversold { color: var(--blue); }
.researchOverbought { color: var(--amber); }
.researchPositive { color: var(--green); }
.researchCharts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
.researchChart {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.researchPriceChart { grid-column: 1 / -1; }
.researchChart h4 {
  margin: 0 0 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.researchPlot { min-height: 186px; }
.researchPlot svg {
  display: block;
  width: 100%;
  height: 200px;
  overflow: visible;
}
.researchPriceChart .researchPlot svg { height: 300px; }
.researchPlot .chartGrid {
  stroke: var(--border);
  stroke-width: 1;
}
.researchPlot .chartGrid.dashed { stroke-dasharray: 4 4; }
.researchPlot .chartAxisLabel {
  fill: var(--muted);
  font: 10px var(--mono);
}
.rsiNeutralBand { fill: rgba(102, 224, 210, .045); }
.researchPlot .flowGap { fill: rgba(125, 145, 170, .13); }
.researchPlot .flowPartial { fill: rgba(201, 133, 0, .18); }
.researchLegend .legendGap { width: 9px; height: 9px; border-radius: 2px; background: rgba(125, 145, 170, .5); }
.researchLegend .legendPartial { width: 9px; height: 9px; border-radius: 2px; background: rgba(201, 133, 0, .7); }
.researchLegend {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}
.researchLegend span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.researchLegend i {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
}
.legendUp { background: var(--green); }
.legendDown { background: var(--red); }
.legendSma20 { background: var(--accent); }
.legendSma50 { background: #9e8cff; }
nav button.active {
  border-color: rgba(102, 224, 210, 0.34);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.panel,
.terminalcard,
.metrics article,
.attentionCard,
.opportunity,
.brPanel,
.chartpanel {
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.attentionCard:hover,
.opportunity:hover {
  border-color: var(--border-strong);
}
@media (max-width: 900px) {
  .attentionGrid {
    grid-template-columns: 1fr;
  }
  .attentionCard > span {
    min-height: 0;
  }
  .tokenResearchMetrics {
    grid-template-columns: 1fr 1fr;
  }
  .researchWorkspaceHead,
  .researchControls {
    align-items: flex-start;
    flex-direction: column;
  }
  .researchReadout {
    grid-template-columns: 1fr;
  }
  .researchCharts {
    grid-template-columns: 1fr;
  }
  .researchPriceChart {
    grid-column: auto;
  }
  .researchPriceChart .researchPlot svg {
    height: 240px;
  }
}
@media (max-width: 600px) {
  .attentionHeading {
    align-items: flex-start;
    flex-direction: column;
  }
  .attentionHeading .chartnote {
    text-align: left;
  }
  .tokenResearchMetrics {
    grid-template-columns: 1fr 1fr;
  }
  .tokenResearch .brPanelHead {
    align-items: flex-start;
  }
}
@media (max-width: 900px) {
  .whaleResearchCharts {
    grid-template-columns: 1fr;
  }
}
.opportunityFreshness {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
}
.sourcePill {
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 10px;
}
.opportunityStats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.opportunityStats span {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
}
.scoreBreakdown {
  display: grid;
  gap: var(--sp-2);
}
.scoreFactorGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.scoreFactor span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.scoreFactor b {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text-2);
}
.scoreFactor i {
  display: block;
  height: 5px;
  margin-top: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.scoreFactor em {
  display: block;
  height: 100%;
  background: var(--accent);
}
.opportunityWhy,
.opportunityRisk {
  display: grid;
  gap: 4px;
  color: var(--text-2);
  line-height: 1.55;
}
.opportunityReasonGroup small {
  color: var(--muted);
  font-weight: 700;
}
.opportunityRisk b {
  color: var(--amber);
}
.riskrow {
  display: grid;
  grid-template-columns: 90px 1fr 70px;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px var(--sp-4);
  font-size: var(--fs-sm);
}
.riskrow + .riskrow {
  border-top: 1px solid var(--border);
}
.riskrow > span:last-child {
  font-family: var(--mono);
  text-align: right;
}
.bars {
  padding: var(--sp-2) 0;
}
.bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

/* compare dates */
.platformBenchmarks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.platformDailyCard {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.platformDailyTop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.platformDailyTop span,
.platformCoverage {
  color: var(--muted);
  font: var(--fs-xs) var(--mono);
}
.platformDailyMetrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.platformDailyMetrics small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.platformDailyMetrics strong {
  display: block;
  font: 500 var(--fs-md) var(--mono);
}
.platformDailyMetrics span {
  color: var(--muted);
  font-size: 10px;
}
.platformDailyMetrics .gain,
.dailyBarRows .gain {
  color: var(--green);
}
.platformDailyMetrics .loss,
.dailyBarRows .loss {
  color: var(--red);
}
.dailyBarRows {
  display: grid;
  gap: 6px;
  font-size: var(--fs-xs);
}
.dailyBarRows > div {
  display: grid;
  grid-template-columns: 100px 1fr 90px;
  align-items: center;
  gap: var(--sp-2);
}
.dailyBarRows b {
  font: 500 var(--fs-xs) var(--mono);
  text-align: right;
}
.dailyTrack {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}
.dailyTrack i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--muted);
}
.dailyTrack i.gain {
  background: var(--green);
}
.dailyTrack i.loss {
  background: var(--red);
}
.portfolioCompareChart {
  margin-top: var(--sp-3);
}
.portfolioCompareChart svg {
  width: 100%;
  height: auto;
}
.gainSwatch,
.lossSwatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--green);
}
.lossSwatch {
  background: var(--red);
}

/* ---------- 9. Dialogs ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(2, 7, 12, 0.72);
  backdrop-filter: blur(6px);
}
.overlay.open {
  display: grid;
  animation: fadeIn 0.15s ease-out;
}
.dialog {
  position: relative;
  display: grid;
  gap: var(--sp-3);
  width: min(600px, 100%);
  max-height: 94vh;
  overflow: auto;
  padding: var(--sp-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.dialog:focus {
  outline: none;
}
.dialog.narrow {
  width: min(460px, 100%);
}
.dialog.detail {
  width: min(1320px, 100%);
}
.dialog.detail.researchWorkspaceOpen {
  width: min(1520px, calc(100vw - 28px));
  max-height: calc(100vh - 20px);
  gap: var(--sp-3);
  padding: var(--sp-5);
}
#detailModal .dialog.researchWorkspaceOpen > .eyebrow,
#detailModal .dialog.researchWorkspaceOpen > #detailTitle,
#detailModal .dialog.researchWorkspaceOpen > #detailPrice,
#detailModal .dialog.researchWorkspaceOpen > #detailChange,
#detailModal .dialog.researchWorkspaceOpen > #tokenSignal,
#detailModal .dialog.researchWorkspaceOpen > #assetLegacy {
  display: none;
}
.dialog h2 {
  font-size: var(--fs-2xl);
}
.dialog > p {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}
.x:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.formhint {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.formactions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}
.detailprice {
  font: 500 var(--fs-3xl) var(--mono);
}
.signalPanel {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.signalHeading {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
}
.signalHeading h3 {
  margin: 4px 0;
  font-size: var(--fs-xl);
}
.signalHeading p {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.signalUp {
  color: var(--green);
}
.signalDown {
  color: var(--red);
}
.signalFlat {
  color: var(--amber);
}
.signalScore {
  font: 500 var(--fs-3xl) var(--mono);
}
.signalMeter {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), rgba(255, 255, 255, 0.15) 50%, var(--green));
}
.signalMeter i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
  transition: left 0.3s;
}
.signalMetrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.signalMetrics article {
  display: grid;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
}
.signalMetrics small,
.signalMetrics span {
  color: var(--muted);
  font-size: 10px;
}
.signalMetrics strong {
  font: 500 var(--fs-sm) var(--mono);
}
.signalReasons ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.signalFootnote {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.tokenCompare,
.comparebox {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.tokenCompareControls {
  position: relative;
}
.compareTokenSuggestions {
  position: absolute;
  z-index: 3;
  top: 100%;
  left: 0;
  right: 0;
  display: grid;
  margin-top: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.compareTokenSuggestions:empty {
  display: none;
}
.compareTokenSuggestions button,
.compareTokenSuggestions span {
  padding: 9px 12px;
  border: 0;
  background: none;
  text-align: left;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.compareTokenSuggestions button:hover {
  background: var(--surface-3);
}
.compareTokenChips,
.compareTokenLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.compareTokenChip,
.compareTokenLegend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: none;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.compareTokenChip i,
.compareTokenLegend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--token-color);
}
.compareTokenLegend b {
  font-family: var(--mono);
  font-weight: 500;
}
.compareTokenPlot {
  position: relative;
  height: 300px;
}
.compareTokenPlot svg {
  width: 100%;
  height: 100%;
}
.compareResult {
  font-size: var(--fs-sm);
}
.compareValues {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.compareValues div {
  display: grid;
  gap: 2px;
}
.compareValues span {
  color: var(--muted);
  font-size: var(--fs-xs);
}
.compareValues b {
  font: 500 var(--fs-md) var(--mono);
}

/* ---------- 10. Breakout radar ---------- */
.brHead {
  align-items: flex-end;
}
.brControls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.brAutoToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.brAutoToggle input {
  accent-color: var(--accent);
}
.brAutoToggle span {
  min-width: 120px;
  color: var(--muted);
  font-family: var(--mono);
}
.brProgress {
  height: 3px;
  margin: -6px 0 var(--sp-3);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.brProgress i {
  display: block;
  width: 30%;
  height: 100%;
  background: var(--accent);
  animation: brSlide 1.4s ease-in-out infinite;
}
@keyframes brSlide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(340%);
  }
}
.brMetrics small {
  display: flex;
  align-items: center;
}
.brSwatch {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}
.brGridTop {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.brPanel {
  padding: var(--sp-5);
  min-width: 0;
}
.brPanelHead h3 {
  margin: 6px 0 4px;
  font-size: var(--fs-xl);
}
.brPanelHead p {
  margin-bottom: var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.brBreadthHead {
  margin-top: var(--sp-4);
}
.brMap {
  position: relative;
  min-height: 340px;
}
.brMap svg,
.brDetailChart svg {
  display: block;
  max-width: 100%;
}
.brGrid {
  stroke: rgba(255, 255, 255, 0.07);
}
.brGridDash {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-dasharray: 3 4;
}
.brAxis {
  fill: var(--muted);
  font: 10px var(--mono);
}
.brAxisTitle {
  fill: var(--muted);
  font: 700 11px var(--font);
}
.brZone {
  fill: rgba(102, 224, 210, 0.05);
  stroke: rgba(102, 224, 210, 0.3);
  stroke-dasharray: 4 4;
}
.brZoneLabel {
  fill: var(--accent);
  font: 700 10px var(--font);
}
.brDot {
  stroke: var(--surface-1);
  stroke-width: 2;
  opacity: 0.9;
}
.brDotDim {
  opacity: 0.2;
}
.brHalo {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  pointer-events: none;
}
.brPointLabel {
  fill: var(--text);
  font: 700 11px var(--font);
  paint-order: stroke;
  stroke: var(--surface-1);
  stroke-width: 3px;
  pointer-events: none;
}
.brTip dl {
  display: grid;
  grid-template-columns: auto auto;
  gap: 2px 12px;
  margin: 6px 0 0;
}
.brTip dt {
  color: var(--muted);
}
.brTip dd {
  margin: 0;
  font-family: var(--mono);
  text-align: right;
}
.brTip small {
  color: var(--accent);
}
.brTipMuted {
  color: var(--muted);
}
.brSetupMix {
  display: grid;
  gap: 2px;
}
.brMixRow {
  display: grid;
  grid-template-columns: 160px 1fr 36px 36px;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}
.brMixRow:hover {
  background: rgba(255, 255, 255, 0.04);
}
.brMixRow span {
  display: flex;
  align-items: center;
}
.brMixRow i {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.brMixRow em {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.brMixRow b {
  font: 500 var(--fs-sm) var(--mono);
  text-align: right;
}
.brMixRow small {
  color: var(--muted);
  text-align: right;
}
.brMixRow.off {
  opacity: 0.38;
}
.brMixRow.off span {
  text-decoration: line-through;
}
.brBreadthBars {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.brGauge {
  display: grid;
  grid-template-columns: 140px 1fr 44px;
  align-items: center;
  gap: var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.brGauge i {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}
.brGauge em {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}
.brGauge u {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--border-strong);
}
.brGauge b {
  color: var(--text);
  font: 500 var(--fs-xs) var(--mono);
  text-align: right;
}
.brFilters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
}
.brFilters .field > span b {
  color: var(--text);
  font-family: var(--mono);
}
.brTop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-3);
}
.brCard {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1) 70%);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.brCard:hover,
.brCard:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.brCardTop {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.brCardTop b {
  font-size: var(--fs-lg);
}
.brCardTop small {
  display: block;
  margin: 2px 0 5px;
  color: var(--muted);
  font: var(--fs-xs) var(--mono);
}
.brRing text {
  fill: var(--text);
  font: 500 13px var(--mono);
}
.brChip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px 2px 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}
.brCard .brSpark {
  width: 100%;
  height: 42px;
}
.brStats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 8px;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.brStats b {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 500;
}
.brCard p {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.brNew,
.brHeld {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font: 800 9px var(--font);
  letter-spacing: 0.08em;
  vertical-align: middle;
}
.brNew {
  background: var(--accent);
  color: var(--accent-ink);
}
.brHeld {
  margin-left: 4px;
  border: 1px solid rgba(102, 224, 210, 0.45);
  color: var(--accent);
}
.brDelta {
  font: var(--fs-xs) var(--mono);
}
.brAssetCell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.brScoreBar {
  display: inline-block;
  width: 46px;
  height: 6px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.brScoreBar em {
  display: block;
  height: 100%;
}
.brSetupCell {
  font-family: var(--font);
  font-weight: 700;
  text-align: left;
}
.brMore {
  display: flex;
  margin: var(--sp-3) auto var(--sp-4);
}
.brDialog {
  width: min(1120px, 100%);
}
.brDialog h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
#brDetailMeta {
  color: var(--muted);
  font-size: var(--fs-sm);
}
.brDetailChart {
  position: relative;
  min-height: 200px;
  padding: var(--sp-2) 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
}
.brLegend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: 2px 6px 6px;
  color: var(--muted);
  font-size: var(--fs-xs);
}
.brLegend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.brLegend i {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.brLegend .brLegendBand {
  height: 9px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}
.brBand {
  fill: rgba(255, 255, 255, 0.03);
  stroke: rgba(255, 255, 255, 0.15);
  stroke-dasharray: 3 3;
}
.brRsiBand {
  fill: rgba(102, 224, 210, 0.04);
}
.brLvlRes,
.brLvlTarget,
.brLvlStop {
  stroke-width: 1.2;
  stroke-dasharray: 6 4;
}
.brLvlRes {
  stroke: rgba(255, 255, 255, 0.45);
}
.brLvlTarget {
  stroke: var(--green);
}
.brLvlStop {
  stroke: var(--red);
}
.brLvlLabel,
.brPaneLabel {
  fill: var(--muted);
  font: 700 10px var(--font);
}
.brCross {
  stroke: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.brDetailGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.brFactor {
  display: grid;
  grid-template-columns: 140px 1fr 52px;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 6px;
  font-size: var(--fs-sm);
}
.brFactor span {
  color: var(--muted);
}
.brFactor i {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.brFactor em {
  display: block;
  height: 100%;
  background: var(--accent);
}
.brFactor b {
  font: 500 var(--fs-sm) var(--mono);
  text-align: right;
}
.brLevels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.brLevels b {
  display: block;
  color: var(--text);
  font: 500 var(--fs-md) var(--mono);
}
.brLevels b.positive {
  color: var(--green);
}
.brLevels b.negative {
  color: var(--red);
}
.brDetailNotes {
  display: grid;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
}
.brDetailNotes ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--text-2);
}

/* ---------- Trading desk, evidence and planning ---------- */
.skipLink { position: fixed; left: 20px; top: -80px; z-index: 100; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; }
.skipLink:focus { top: 12px; }
.mobileNav { display: none; }
.commandTrigger { gap: 12px; color: var(--text-2); }
.commandTrigger > span { font-size: 22px; line-height: 1; }
kbd { border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 5px; color: var(--muted); font: 10px var(--mono); }
.deskDataStrip { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 0 0 22px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.deskDataStrip > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.deskDataStrip #marketDataStatus { font-size: 11px; color: var(--muted); }
.deskDataStrip .textbutton { white-space: nowrap; }
.exposurePanel { margin-top: 24px; padding: 22px; }
.exposurePanel h2 { margin-top: 6px; font-size: var(--fs-xl); }
.exposureMap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 18px; }
.exposureTile { display: grid; align-content: center; gap: 5px; min-width: 95px; min-height: 116px; border: 1px solid transparent; border-radius: 7px; color: var(--text); padding: 14px; text-align: left; cursor: pointer; }
.exposureTile.gain { background: rgba(95, 216, 164, .105); border-color: rgba(95, 216, 164, .19); }
.exposureTile.loss { background: rgba(255, 135, 145, .10); border-color: rgba(255, 135, 145, .18); }
.exposureTile.unknown { background: var(--surface-2); border-color: var(--border); }
.exposureTile:hover { filter: brightness(1.25); border-color: var(--border-strong); }
.exposureTile b { font-size: 13px; letter-spacing: .06em; }
.exposureTile strong { font: 500 24px var(--mono); }
.exposureTile span { font: 11px var(--mono); color: var(--muted); }
.exposureTile.gain span { color: var(--green); }
.exposureTile.loss span { color: var(--red); }
.researchLaunch { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 22px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); }
.researchLaunch strong { font-size: 17px; }
.researchLaunch p, .researchLaunch span { color: var(--muted); font-size: 12px; }
.quoteWarning { color: var(--amber) !important; }
.qualityPanel, .scenarioPanel { padding: 24px; margin: 20px 0; }
.qualityHeadline { display: flex; align-items: center; gap: 16px; padding: 24px 0 14px; }
.qualityHeadline strong { font: 500 36px var(--mono); letter-spacing: -.04em; }
.qualityHeadline span { color: var(--muted); font-size: 12px; max-width: 360px; }
.qualityBar { display: flex; width: 100%; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.qualityBar .fresh, .qualityCount.fresh i { background: var(--green); }
.qualityBar .stale, .qualityCount.stale i { background: var(--amber); }
.qualityBar .saved, .qualityCount.saved i { background: var(--blue); }
.qualityCount.missing i { background: var(--red); }
.qualityBar .disputed, .qualityCount.disputed i { background: var(--red); }
.qualityCounts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.quoteAuditSource { display: block; margin: 5px 0; color: var(--muted); font: 10px var(--font); }
.qualityCount { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; padding-right: 12px; border-right: 1px solid var(--border); }
.qualityCount:last-child { border: 0; }
.qualityCount i { width: 7px; height: 7px; border-radius: 50%; }
.qualityCount span { font-size: 11px; color: var(--text-2); }
.qualityCount b { font: 500 20px var(--mono); }
.qualityCount small { grid-column: 2 / -1; color: var(--muted); font: 11px var(--mono); }
#connection { font-family: inherit; }
#connection:not(:disabled) { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
#connection:not(:disabled):hover { border-color: var(--blue); }
.refreshDetails { margin: 20px 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); scroll-margin-top: 20px; }
.refreshDetails summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.refreshOutcomeGroups { display: grid; gap: 18px; margin-top: 16px; }
.refreshOutcomeGroup > button { font-size: 12px; }
.refreshOutcomeGroup > button b { margin-left: 8px; font-family: var(--mono); }
.refreshTokenList { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.refreshToken { display: inline-flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.refreshToken b { font-size: 11px; }
.refreshToken span, .refreshTokenList > span { color: var(--muted); font-size: 10px; }
.refreshReason { min-width: 240px; max-width: 320px; white-space: normal; }
.refreshReason > b { display: block; font-size: 11px; margin-bottom: 6px; }
.refreshReason > small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; margin: 6px 0; }
.qualityPanel .tablebox { margin: 12px -24px -24px; border-radius: 0 0 var(--r-md) var(--r-md); }
.scenarioControls { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; padding: 24px 0; }
.scenarioControls > .field { flex: 1; min-width: 180px; }
.shockControl { flex: 2 !important; }
.shockControl > span { display: flex; justify-content: space-between; }
.shockControl b { color: var(--text); font-family: var(--mono); }
.shockControl input[type=range] { padding: 0; width: 100%; accent-color: var(--accent); height: 24px; box-shadow: none; }
.shockControl small { display: flex; justify-content: space-between; color: var(--muted); font: 10px var(--mono); }
.scenarioResults { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.scenarioResults small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.scenarioResults strong { font: 500 clamp(16px, 1.7vw, 25px) var(--mono); }
.commandDialog { width: min(620px, calc(100vw - 32px)); padding: 22px; }
.dialoghead { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.dialoghead h2 { margin-top: 6px; font-size: 20px; }
.dialoghead .close { border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px; font-size: 22px; cursor: pointer; width: 32px; height: 32px; }
.commandResults { max-height: 52vh; overflow: auto; padding: 12px 0; }
.commandItem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.commandItem.selected, .commandItem:hover { border-color: var(--border-strong); background: var(--surface-2); }
.commandIcon { color: var(--accent); padding: 5px; }
.commandItem b { display: block; font-size: 13px; }
.commandItem small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.commandKind { margin-left: auto; color: var(--muted); font: 10px var(--mono); }
.commandFoot { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; font-size: 10px; color: var(--muted); }
.brPlanner { margin-top: 20px; padding: 20px; }
.brPlanGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.brPlanGrid input { min-width: 0; width: 100%; font-family: var(--mono); }
.brPlanOutput { margin-top: 16px; }
.brPlanOutput.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opportunityEvidence { padding-top: 12px; margin-top: 14px; border-top: 1px solid var(--border); }
.opportunitygrid { align-items: start; }
.opportunityEvidence > summary { padding: 7px 0; cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 600; }
.opportunityEvidence[open] > summary { margin-bottom: 12px; }
.researchAudit { display: block; }
.researchAudit > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 4px 0; }
.researchAudit p, .researchAudit ul { margin-top: 12px; color: var(--muted); }
#marketScanRows td small { display: block; margin-top: 2px; color: var(--muted); font: 10px var(--font); }
.brPlanOutput strong { font-family: var(--mono); }
.brFilterActions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
main { min-width: 0; }
@media (min-width: 1300px) {
  .shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); grid-template-rows: auto 1fr auto; max-width: 1900px; padding: 0; }
  .top { grid-column: 1 / -1; margin: 0; padding: 18px 28px; min-height: 78px; background: rgba(7, 17, 28, .96); }
  .top .brand { min-width: 285px; }
  #nav { grid-column: 1; grid-row: 2 / 4; position: sticky; top: 78px; align-self: start; flex-direction: column; align-items: stretch; gap: 22px; height: calc(100vh - 78px); padding: 30px 14px; margin: 0; overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--border); background: rgba(10, 21, 33, .55); }
  .navGroup { flex-direction: column; align-items: stretch; border: 0; border-radius: 0; padding: 0; background: transparent; gap: 4px; }
  .navGroupLabel { margin: 0 12px 9px; font-size: 9px; letter-spacing: .16em; }
  #nav button { min-height: 38px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; text-align: left; font-size: 12px; color: var(--muted); }
  #nav button::before { content: '◇'; color: var(--muted); font: 15px var(--mono); }
  #nav button[data-view=overview]::before { content: '⊞'; }
  #nav button[data-view=breakout]::before { content: '⌁'; }
  #nav button[data-view=portfolio]::before { content: '▤'; }
  #nav button[data-view=analytics]::before { content: '▥'; }
  #nav button[data-view=system]::before { content: '◎'; }
  #nav button.active { background: rgba(102, 224, 210, .08); border-color: rgba(102, 224, 210, .14); color: var(--accent); box-shadow: none; }
  #nav button.active::before { color: var(--accent); }
  main { grid-column: 2; padding: 28px 32px 0; }
  footer { grid-column: 2; margin: 28px 32px 0; padding: 16px 0 24px; }
  .welcome { padding-top: 8px; }
  .welcome h1 { font-size: 44px; }
  .welcome > div:first-child { max-width: 440px; }
  .total { min-width: 340px; padding-right: 0; max-width: 52%; }
  .total strong { font: 500 clamp(34px, 3.4vw, 52px) var(--mono); }
  .total span { display: block; max-width: 450px; font-size: 11px; line-height: 1.7; }
  .metrics article { padding: 18px; background: transparent; box-shadow: none; }
  .metrics article strong { font-family: var(--mono); font-weight: 500; }
}
@media (max-width: 900px) {
  .qualityCounts, .brPlanGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deskDataStrip { align-items: flex-start; }
  .deskDataStrip > div { align-items: flex-start; flex-direction: column; gap: 6px; }
  .brPlanOutput.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .brPlanOutput article strong { font-size: clamp(15px, 4.1vw, 18px); overflow-wrap: anywhere; line-height: 1.4; }
  #nav .navGroup { display: none; }
  .mobileNav { display: flex; width: 100%; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
  .mobileNav select { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-1); color: var(--text); font-weight: 600; }
  .commandTrigger kbd { display: none; }
  .qualityPanel, .scenarioPanel { padding: 16px; }
  .qualityPanel .tablebox { margin: 12px -16px -16px; }
  .scenarioResults { grid-template-columns: 1fr; }
  .scenarioResults > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .qualityHeadline { align-items: flex-start; flex-direction: column; gap: 5px; }
  .exposureTile { min-height: 94px; padding: 12px; }
  .commandFoot > span:last-child { display: none; }
  .scenarioControls { gap: 18px; }
}

/* ---------- 11. Responsive (1100 · 768 · 480) ---------- */
@media (max-width: 1100px) {
  .shell {
    padding: var(--sp-3) var(--sp-4) var(--sp-5);
  }
  .top {
    margin: 0 calc(-1 * var(--sp-4));
    padding: var(--sp-3) var(--sp-4);
    flex-wrap: wrap;
  }
  .terminalcards {
    grid-template-columns: 1fr 1fr;
  }
  .walletGrid,
  .brGridTop,
  .analyticsGrid,
  .opportunityCharts {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .status {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
  .actions {
    margin-left: auto;
    flex-wrap: wrap;
  }
  #exportExcel {
    display: none;
  }
  nav {
    gap: var(--sp-3);
  }
  .navGroupLabel {
    display: none;
  }
  .welcome {
    flex-direction: column;
    align-items: flex-start;
  }
  .total {
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .terminalcards,
  .portfolioRsiSummary,
  .portfolioHistorySummary,
  .signalMetrics,
  .brDetailGrid,
  .formgrid,
  .platformDailyMetrics,
  .compareValues {
    grid-template-columns: 1fr;
  }
  .chartcard,
  .chartpanel,
  .brPanel,
  .compositionPanel {
    padding: var(--sp-4);
  }
  .compRow {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .compValue {
    text-align: left;
  }
  .analyticsBarRow {
    grid-template-columns: 90px 1fr 80px;
  }
  .brMixRow {
    grid-template-columns: 120px 1fr 30px 30px;
  }
  .brStats {
    grid-template-columns: repeat(2, 1fr);
  }
  .brAssetCell .brSpark {
    display: none;
  }
  .pricechart {
    height: 240px;
  }
  .filters,
  .filtersPanel,
  .brFilters {
    width: 100%;
  }
  .filters .field,
  .filtersPanel .field,
  .brFilters .field {
    flex: 1 1 140px;
  }
}
@media (max-width: 480px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .actions .button {
    flex: 1;
  }
  .tokenResearchMetrics {
    grid-template-columns: 1fr 1fr;
  }
  .dialog {
    padding: var(--sp-4);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
