:root {
  color-scheme: dark;
  --bg: #01050d;
  --bg-soft: #040b16;
  --panel: rgba(5, 15, 29, .94);
  --panel-strong: rgba(7, 20, 38, .98);
  --line: rgba(139, 182, 207, .14);
  --line-bright: rgba(75, 244, 222, .3);
  --text: #effbff;
  --muted: #91a9b8;
  --muted-2: #647b8c;
  --cyan: #4ff5df;
  --blue: #54b9ff;
  --purple: #a67dff;
  --green: #35e6a5;
  --red: #ff5f82;
  --amber: #ffc669;
  --radius: 17px;
  --shadow: 0 20px 56px rgba(0, 0, 0, .27);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scrollbar-color: rgba(79, 245, 223, .28) transparent;
  scrollbar-width: thin;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% -10%, rgba(84, 185, 255, .11), transparent 30%),
    radial-gradient(circle at -8% 28%, rgba(166, 125, 255, .09), transparent 31%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.market-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  isolation: isolate;
}

.market-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .46;
  background-image: linear-gradient(rgba(117, 167, 195, .027) 1px, transparent 1px), linear-gradient(90deg, rgba(117, 167, 195, .027) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

.command-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(290px, 1fr);
  align-items: center;
  gap: 12px 20px;
  padding: 12px clamp(12px, 1.5vw, 24px) 10px;
  border-bottom: 1px solid rgba(79, 245, 223, .15);
  background: linear-gradient(115deg, rgba(4, 16, 30, .985), rgba(3, 9, 22, .985) 55%, rgba(5, 12, 27, .985));
  box-shadow: 0 8px 30px rgba(0, 0, 0, .24);
  contain: layout paint style;
}

.command-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.command-logo {
  position: relative;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 245, 223, .34);
  border-radius: 14px;
  background: radial-gradient(circle, rgba(79, 245, 223, .13), rgba(84, 185, 255, .04));
  box-shadow: 0 0 24px rgba(79, 245, 223, .11), inset 0 0 16px rgba(79, 245, 223, .05);
}

.command-logo::before,
.command-logo::after,
.command-logo i {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.command-logo::before {
  inset: 9px;
  border: 1px solid var(--cyan);
}

.command-logo::after {
  inset: 16px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.command-logo i {
  width: 5px;
  height: 5px;
  top: 8px;
  left: 19px;
  background: var(--blue);
  transform-origin: 2px 13px;
  animation: logoOrbit 3.4s linear infinite;
}

.eyebrow,
.surface-kicker,
.control-label {
  display: block;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.command-identity h1 {
  max-width: 100%;
  margin: 4px 0 0;
  overflow: hidden;
  color: #f4fcff;
  font-size: clamp(17px, 1.45vw, 23px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-identity h1 small {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid rgba(166, 125, 255, .26);
  border-radius: 999px;
  background: rgba(166, 125, 255, .08);
  color: #c9b6ff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  vertical-align: 3px;
}

.market-health {
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.health-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255, 198, 105, .25);
  border-radius: 999px;
  background: rgba(255, 198, 105, .06);
  color: var(--amber);
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.health-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.health-pill[data-tone='live'] {
  border-color: rgba(53, 230, 165, .29);
  background: rgba(53, 230, 165, .065);
  color: var(--green);
}

.health-pill[data-tone='bad'],
.health-pill[data-tone='offline'] {
  border-color: rgba(255, 95, 130, .3);
  background: rgba(255, 95, 130, .07);
  color: var(--red);
}

.freshness {
  display: grid;
  gap: 2px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
}

.freshness span {
  color: var(--muted);
  font-weight: 700;
}

.command-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.command-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(143, 181, 203, .18);
  border-radius: 11px;
  background: rgba(7, 21, 38, .86);
  color: #dceef5;
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}

.command-button span {
  color: var(--cyan);
  font-size: 14px;
}

.command-button:hover {
  border-color: rgba(79, 245, 223, .46);
  background: rgba(79, 245, 223, .075);
  color: #fff;
}

.command-button:active {
  transform: translateY(1px);
}

.command-button[aria-pressed='false'] span {
  color: var(--muted-2);
}

.command-button--primary {
  border-color: rgba(79, 245, 223, .42);
  background: linear-gradient(120deg, rgba(79, 245, 223, .16), rgba(84, 185, 255, .11));
  color: var(--cyan);
}

.command-button--primary.is-loading span {
  animation: buttonSpin .75s linear infinite;
}

.command-button--close {
  width: 37px;
  padding: 0;
  border-color: rgba(255, 95, 130, .2);
  color: #ffd9e2;
  font-size: 20px;
  line-height: 1;
}

.control-deck {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1.15fr) minmax(250px, 1.45fr) minmax(160px, .8fr) minmax(260px, 1.5fr);
  gap: 8px;
}

.control-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid rgba(135, 172, 195, .11);
  border-radius: 11px;
  background: rgba(2, 10, 21, .66);
}

.control-label {
  flex: 0 0 auto;
  color: var(--muted-2);
  letter-spacing: .1em;
}

.chip-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 26px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #8299a8;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip:hover {
  background: rgba(84, 185, 255, .07);
  color: #dceef5;
}

.filter-chip.is-active,
.filter-chip[aria-pressed='true'] {
  border-color: rgba(79, 245, 223, .33);
  background: linear-gradient(120deg, rgba(79, 245, 223, .13), rgba(84, 185, 255, .07));
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(79, 245, 223, .06);
}

.filter-chip:disabled,
.filter-chip.is-unavailable {
  opacity: .34;
  cursor: not-allowed;
}

.command-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  padding: 10px clamp(10px, 1.2vw, 20px) max(16px, env(safe-area-inset-bottom));
}

.surface,
.metrics-strip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(6, 17, 32, .96), rgba(3, 10, 23, .96));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .025);
}

.surface {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: auto 280px;
}

.surface::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(79, 245, 223, .025), transparent 22%, transparent 70%, rgba(166, 125, 255, .025));
}

.surface-head {
  min-height: 55px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px 8px;
  flex: 0 0 auto;
}

.surface-head h2 {
  margin: 3px 0 0;
  color: #eaf7fc;
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.2;
}

.surface-head p,
.surface-meta {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.35;
}

.surface-meta {
  max-width: 45%;
  text-align: right;
}

.map-surface {
  grid-column: span 8;
  min-height: 440px;
  border-color: rgba(79, 245, 223, .2);
  background: linear-gradient(145deg, rgba(4, 18, 31, .97), rgba(2, 7, 18, .98));
}

.map-head {
  align-items: center;
  border-bottom: 1px solid rgba(133, 174, 198, .09);
}

.map-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px 9px;
  color: var(--muted);
  font-size: 8px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.map-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px currentColor;
}

.map-legend .legend-down { background: var(--red); }
.map-legend .legend-risk { background: var(--amber); }
.map-legend .legend-signal { background: var(--purple); }

.map-stage {
  position: relative;
  flex: 1;
  min-height: 360px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: pan-y;
}

#liveMap {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
}

.map-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .55;
  pointer-events: none;
  background-image: linear-gradient(rgba(100, 157, 187, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(100, 157, 187, .04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, #000, transparent 82%);
}

.map-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

.map-empty[hidden] {
  display: none;
}

.map-tooltip {
  position: absolute;
  z-index: 5;
  max-width: min(250px, calc(100% - 20px));
  padding: 9px 10px;
  border: 1px solid rgba(79, 245, 223, .31);
  border-radius: 11px;
  background: rgba(2, 12, 25, .96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
  color: #eaf8fc;
  font-size: 9px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity .12s ease, transform .12s ease;
}

.map-tooltip.is-visible {
  opacity: 1;
  transform: none;
}

.map-tooltip strong { color: var(--cyan); }
.map-tooltip .positive { color: var(--green); }
.map-tooltip .negative { color: var(--red); }

.map-telemetry {
  position: absolute;
  right: 9px;
  bottom: 8px;
  z-index: 4;
  display: flex;
  gap: 5px;
}

.map-telemetry span {
  padding: 4px 6px;
  border: 1px solid rgba(139, 182, 207, .13);
  border-radius: 7px;
  background: rgba(2, 9, 20, .68);
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .06em;
}

.decision-surface {
  grid-column: span 4;
  min-height: 440px;
  padding-bottom: 11px;
}

.confidence-badge {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(166, 125, 255, .22);
  border-radius: 999px;
  background: rgba(166, 125, 255, .06);
  color: #c7b2ff;
  font-size: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.decision-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 5px 13px 11px;
}

.score-ring {
  --score: 0;
  position: relative;
  width: clamp(82px, 7vw, 104px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) calc(var(--score) * 1%), rgba(106, 144, 165, .11) 0);
  box-shadow: 0 0 26px rgba(79, 245, 223, .08);
}

.score-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, rgba(84, 185, 255, .12), transparent 45%), #06101e;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .35);
}

.score-ring span {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}

.score-ring b {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1;
}

.score-ring small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.decision-copy {
  min-width: 0;
}

.decision-copy strong {
  display: block;
  color: #f1fbff;
  font-size: clamp(13px, 1.1vw, 17px);
  line-height: 1.28;
}

.decision-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.decision-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 13px 10px;
}

.decision-facts span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid rgba(139, 182, 207, .11);
  border-radius: 10px;
  background: rgba(2, 10, 21, .6);
}

.decision-facts small {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .08em;
}

.decision-facts b {
  overflow: hidden;
  color: #dceff6;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-checklist {
  min-height: 68px;
  display: grid;
  align-content: start;
  gap: 5px;
  margin: 0 13px 10px;
  padding: 0;
  list-style: none;
}

.decision-checklist li {
  position: relative;
  padding-left: 17px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.decision-checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

.decision-checklist li.is-warning::before { content: '!'; color: var(--amber); }
.decision-checklist li.is-danger::before { content: '×'; color: var(--red); }

.surface-action {
  min-height: 34px;
  margin: auto 13px 0;
  border: 1px solid rgba(79, 245, 223, .28);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(79, 245, 223, .1), rgba(84, 185, 255, .07));
  color: var(--cyan);
  font-size: 9px;
  font-weight: 850;
  cursor: pointer;
}

.surface-action:disabled {
  opacity: .35;
  cursor: default;
}

.disclaimer {
  margin: 7px 13px 0;
  color: #516777;
  font-size: 7px;
  line-height: 1.35;
  text-align: center;
}

.metrics-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: rgba(125, 168, 193, .12);
}

.metric-card,
.metric-skeleton {
  min-width: 0;
  min-height: 86px;
  padding: 11px 12px;
  background: linear-gradient(145deg, rgba(7, 19, 35, .98), rgba(4, 12, 25, .98));
}

.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'label icon' 'value value' 'detail detail';
  gap: 3px;
}

.metric-label {
  grid-area: label;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-icon {
  grid-area: icon;
  color: var(--cyan);
  font-size: 11px;
}

.metric-value {
  grid-area: value;
  overflow: hidden;
  color: #f0fbff;
  font-size: clamp(16px, 1.55vw, 23px);
  font-weight: 850;
  letter-spacing: -.03em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-detail {
  grid-area: detail;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card[data-tone='up'] .metric-value { color: var(--green); }
.metric-card[data-tone='down'] .metric-value { color: var(--red); }
.metric-card[data-tone='risk'] .metric-value { color: var(--amber); }

.metric-skeleton {
  animation: skeletonPulse 1.3s ease-in-out infinite alternate;
}

.risk-surface,
.funding-surface,
.liquidation-surface {
  grid-column: span 4;
  min-height: 258px;
}

.patterns-surface {
  grid-column: span 7;
  min-height: 255px;
}

.radar-context-surface {
  grid-column: span 5;
  min-height: 255px;
}

.data-table,
.funding-map,
.liquidation-feed,
.pattern-list,
.radar-signal-list {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 9px 10px;
  overscroll-behavior: contain;
}

.data-table,
.liquidation-feed,
.pattern-list,
.radar-signal-list {
  display: grid;
  align-content: start;
  gap: 5px;
}

.data-table,
.funding-map,
.liquidation-feed {
  max-height: 250px;
}

.pattern-list,
.radar-signal-list {
  max-height: 260px;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.risk-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 58px 54px minmax(70px, .8fr);
  align-items: center;
  gap: 6px;
  min-height: 35px;
  padding: 5px 7px;
  border: 1px solid rgba(139, 182, 207, .09);
  border-radius: 9px;
  background: rgba(2, 10, 21, .52);
  font-size: 9px;
}

.risk-symbol,
.liq-symbol,
.pattern-symbol,
.signal-symbol {
  overflow: hidden;
  color: #dff1f7;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-symbol small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7px;
  letter-spacing: .06em;
}

.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.warning { color: var(--amber) !important; }

.risk-score {
  text-align: right;
  font-weight: 850;
}

.risk-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(130, 166, 187, .11);
}

.risk-meter i {
  display: block;
  width: var(--risk, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber) 62%, var(--red));
}

.funding-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
}

.funding-cell {
  min-width: 0;
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(139, 182, 207, .1);
  border-radius: 9px;
  background: rgba(3, 12, 24, .64);
}

.funding-cell[data-heat='long'] { border-color: rgba(255, 95, 130, .22); background: rgba(255, 95, 130, .055); }
.funding-cell[data-heat='short'] { border-color: rgba(53, 230, 165, .2); background: rgba(53, 230, 165, .045); }

.funding-cell strong {
  overflow: hidden;
  color: #dff0f6;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-cell b {
  color: var(--muted);
  font-size: 11px;
}

.funding-cell small {
  color: var(--muted-2);
  font-size: 7px;
}

.stream-status {
  display: flex;
  gap: 4px;
  padding: 0 9px 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.stream-status::-webkit-scrollbar { display: none; }

.stream-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid rgba(139, 182, 207, .12);
  border-radius: 7px;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 850;
}

.stream-chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.stream-chip.is-live { border-color: rgba(53, 230, 165, .2); color: var(--green); }
.stream-chip.is-wait { color: var(--amber); }
.stream-chip.is-off { color: #536a79; }
.stream-chip.is-error { color: var(--red); }

.liq-event {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(70px, 1fr) 76px 45px;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid rgba(139, 182, 207, .09);
  border-left: 2px solid var(--red);
  border-radius: 9px;
  background: rgba(2, 10, 21, .56);
  font-size: 9px;
}

.liq-event[data-side='LONG'] { border-left-color: var(--red); }
.liq-event[data-side='SHORT'] { border-left-color: var(--green); }
.liq-exchange { color: var(--muted-2); font-size: 7px; font-weight: 850; }
.liq-value { overflow: hidden; color: #f3d9df; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.liq-time { color: var(--muted-2); font-size: 7px; text-align: right; }

.pattern-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pattern-card,
.radar-signal {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(139, 182, 207, .1);
  border-radius: 10px;
  background: rgba(2, 10, 21, .58);
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}

.pattern-card:hover,
.radar-signal:hover {
  border-color: rgba(79, 245, 223, .3);
  background: rgba(79, 245, 223, .045);
  transform: translateY(-1px);
}

.pattern-card.is-focused,
.radar-signal.is-focused {
  border-color: rgba(166, 125, 255, .46);
  box-shadow: 0 0 18px rgba(166, 125, 255, .09);
}

.pattern-top,
.signal-top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.direction-badge,
.sample-badge,
.signal-score {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(53, 230, 165, .08);
  color: var(--green);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .05em;
}

.direction-badge[data-side='SHORT'] { background: rgba(255, 95, 130, .08); color: var(--red); }
.sample-badge { margin-left: auto; background: rgba(166, 125, 255, .08); color: #c7b4ff; }
.sample-badge.is-insufficient { background: rgba(255, 198, 105, .07); color: var(--amber); }

.pattern-name,
.signal-pattern {
  margin-top: 6px;
  overflow: hidden;
  color: #e7f5fa;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pattern-stats,
.signal-meta {
  display: flex;
  gap: 7px;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 8px;
}

.pattern-stats b,
.signal-meta b {
  color: var(--muted);
}

.signal-score {
  margin-left: auto;
  background: rgba(84, 185, 255, .08);
  color: var(--blue);
}

.radar-signal-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.market-toast-region {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  width: min(330px, calc(100vw - 28px));
  display: grid;
  gap: 7px;
  pointer-events: none;
}

.market-toast {
  padding: 10px 12px;
  border: 1px solid rgba(79, 245, 223, .28);
  border-radius: 11px;
  background: rgba(3, 14, 27, .96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .38);
  color: #e8f8fc;
  font-size: 9px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px);
  animation: toastIn .2s ease forwards;
}

.market-toast.is-error { border-color: rgba(255, 95, 130, .34); }

.noscript-message {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

body.is-compact .surface-head { min-height: 47px; padding-block: 9px 6px; }
body.is-compact .map-surface,
body.is-compact .decision-surface { min-height: 385px; }
body.is-compact .map-stage { min-height: 310px; }
body.is-compact .risk-surface,
body.is-compact .funding-surface,
body.is-compact .liquidation-surface { min-height: 220px; }
body.is-compact .metric-card { min-height: 72px; padding-block: 8px; }

body[data-lens='risk'] .risk-surface,
body[data-lens='funding'] .funding-surface,
body[data-lens='liquidations'] .liquidation-surface,
body[data-lens='patterns'] .patterns-surface {
  border-color: rgba(79, 245, 223, .34);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .32), 0 0 24px rgba(79, 245, 223, .07);
}

@keyframes logoOrbit { to { transform: rotate(360deg); } }
@keyframes buttonSpin { to { transform: rotate(360deg); } }
@keyframes skeletonPulse { from { opacity: .42; } to { opacity: .8; } }
@keyframes toastIn { to { opacity: 1; transform: none; } }

@media (min-width: 1680px) {
  .map-surface,
  .decision-surface { min-height: 500px; }
  .map-stage { min-height: 415px; }
  .risk-surface,
  .funding-surface,
  .liquidation-surface { min-height: 295px; }
  .patterns-surface,
  .radar-context-surface { min-height: 285px; }
  .data-table,
  .funding-map,
  .liquidation-feed { max-height: 290px; }
}

@media (max-width: 1280px) {
  .command-header { grid-template-columns: minmax(230px, 1fr) auto minmax(270px, 1fr); }
  .control-deck { grid-template-columns: minmax(190px, 1fr) minmax(220px, 1.25fr) minmax(150px, .7fr) minmax(240px, 1.25fr); }
  .map-surface { grid-column: span 8; }
  .decision-surface { grid-column: span 4; }
  .risk-surface,
  .funding-surface { grid-column: span 6; }
  .liquidation-surface { grid-column: span 5; }
  .patterns-surface { grid-column: span 7; }
  .radar-context-surface { grid-column: 1 / -1; }
  .radar-signal-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .command-header { grid-template-columns: minmax(220px, 1fr) minmax(270px, auto); }
  .market-health { display: none; }
  .control-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-surface,
  .decision-surface { grid-column: 1 / -1; }
  .decision-surface { min-height: 365px; }
  .metrics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .risk-surface,
  .funding-surface,
  .liquidation-surface { grid-column: span 6; }
  .patterns-surface,
  .radar-context-surface { grid-column: 1 / -1; }
  .radar-signal-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .command-header {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 9px 8px;
  }
  .command-logo { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; }
  .command-logo::before { inset: 8px; }
  .command-logo::after { inset: 14px; }
  .command-logo i { top: 7px; left: 16px; transform-origin: 2px 11px; }
  .command-identity h1 { font-size: 17px; }
  .command-actions { overflow-x: auto; scrollbar-width: none; }
  .command-actions::-webkit-scrollbar { display: none; }
  .command-button { min-height: 38px; }
  .command-button--quiet b { display: none; }
  .control-deck { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 5px; }
  .control-group { min-height: 39px; }
  .filter-chip { min-height: 30px; padding-inline: 10px; }
  .command-grid { display: block; padding: 8px; }
  .surface,
  .metrics-strip { margin-bottom: 8px; }
  .map-surface { min-height: 430px; }
  .map-stage { min-height: 350px; }
  .decision-surface { min-height: 390px; }
  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risk-surface,
  .funding-surface,
  .liquidation-surface,
  .patterns-surface,
  .radar-context-surface { min-height: 270px; }
  .data-table,
  .funding-map,
  .liquidation-feed,
  .pattern-list,
  .radar-signal-list { max-height: none; }
  .radar-signal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .command-identity .eyebrow { display: none; }
  .command-identity h1 small { display: none; }
  .command-actions { gap: 4px; }
  .command-button { width: 38px; padding: 0; }
  .command-button b { display: none; }
  .command-button--close { width: 38px; }
  .control-label { width: 55px; }
  .map-head { align-items: flex-start; }
  .map-legend { max-width: 135px; }
  .map-legend span:nth-child(3) { display: none; }
  .map-surface { min-height: 390px; }
  .map-stage { min-height: 315px; }
  .decision-hero { grid-template-columns: 74px minmax(0, 1fr); }
  .score-ring { width: 74px; }
  .funding-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pattern-list,
  .radar-signal-list { grid-template-columns: 1fr; }
  .risk-row { grid-template-columns: minmax(70px, 1fr) 48px 44px minmax(54px, .7fr); }
  .liq-event { grid-template-columns: 46px minmax(66px, 1fr) 68px 40px; }
}

@media (max-width: 370px) {
  .command-logo { display: none; }
  .control-label { display: none; }
  .map-legend { display: none; }
  .metrics-strip { grid-template-columns: 1fr 1fr; }
  .metric-card { padding-inline: 9px; }
  .decision-facts { grid-template-columns: 1fr; }
  .decision-surface { min-height: 450px; }
}

@media (max-height: 780px) and (min-width: 761px) {
  .map-surface,
  .decision-surface { min-height: 370px; }
  .map-stage { min-height: 295px; }
  .metric-card { min-height: 74px; }
  .risk-surface,
  .funding-surface,
  .liquidation-surface { min-height: 225px; }
}

@media (pointer: coarse) {
  .filter-chip { min-height: 32px; }
  .command-button { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
