:root {
  --bg: #05070c;
  --panel: #0b1019;
  --panel-strong: #101827;
  --panel-soft: #151d2b;
  --ink: #f7fbff;
  --muted: #8c96a8;
  --faint: #566173;
  --line: #222c3e;
  --line-strong: #354057;
  --green: #42f36f;
  --green-deep: #158b42;
  --green-soft: rgba(66, 243, 111, 0.14);
  --red: #ff465b;
  --red-deep: #a91931;
  --red-soft: rgba(255, 70, 91, 0.15);
  --blue: #65a8ff;
  --blue-soft: rgba(101, 168, 255, 0.16);
  --amber: #ffab47;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  --leader-list-height: clamp(340px, 46vh, 540px);
  --map-panel-height: clamp(540px, 68vh, 820px);
  --analytics-panel-height: clamp(360px, 48vh, 480px);
  --lab-visual-height: clamp(430px, 56vh, 640px);
  --workbench-height: clamp(640px, 92svh, 960px);
  --fast: 160ms ease;
  --smooth: 520ms cubic-bezier(0.2, 0.75, 0.18, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(66, 243, 111, 0.08), transparent 28%),
    linear-gradient(245deg, rgba(255, 70, 91, 0.07), transparent 32%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  color: #05070c;
  font-weight: 950;
  text-decoration: none;
  transform: translateY(-72px);
  transition: transform var(--fast);
}

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

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0 40px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  min-height: 78px;
  padding: 10px 0 14px;
}

.brand-block {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-width: 0;
}

.brand-block > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 171, 71, 0.5);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffba64, #ff7b38);
  color: #070a11;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(255, 123, 56, 0.2);
}

.eyebrow,
.stat-label,
.source-panel span,
.search-box span,
.control-group > span,
.axis-control > span {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 3px;
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-top: 4px;
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.message {
  max-width: 780px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.source-panel {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 240px;
  padding-top: 4px;
  text-align: right;
  overflow-wrap: anywhere;
}

.data-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101827;
  color: var(--ink);
}

.data-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(66, 243, 111, 0.78);
}

.data-badge.demo {
  color: var(--amber);
  background: rgba(255, 171, 71, 0.12);
  border-color: rgba(255, 171, 71, 0.35);
}

.data-badge.demo::before {
  background: var(--amber);
  box-shadow: 0 0 14px rgba(255, 171, 71, 0.74);
}

.source-panel a {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.source-panel a:hover {
  text-decoration: underline;
}

.leader-list,
.lab-stage,
.map-detail,
.analytics-stats {
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.leader-list::-webkit-scrollbar,
.lab-stage::-webkit-scrollbar,
.map-detail::-webkit-scrollbar,
.analytics-stats::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.leader-list::-webkit-scrollbar-track,
.lab-stage::-webkit-scrollbar-track,
.map-detail::-webkit-scrollbar-track,
.analytics-stats::-webkit-scrollbar-track {
  background: transparent;
}

.leader-list::-webkit-scrollbar-thumb,
.lab-stage::-webkit-scrollbar-thumb,
.map-detail::-webkit-scrollbar-thumb,
.analytics-stats::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--line-strong);
  background-clip: content-box;
}

.control-deck,
.market-board,
.ranking-board,
.analytics-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 16, 25, 0.94);
  box-shadow: var(--shadow);
}

.app-header,
.hero-stats,
.control-deck,
.verdict-card,
.distribution-card,
.audit-card,
.signal-panel,
.market-board,
.ranking-board,
.analytics-board {
  animation: fadeUp var(--smooth) both;
}

.control-deck {
  animation-delay: 110ms;
}

.hero-stats {
  animation-delay: 35ms;
}

.verdict-card {
  animation-delay: 345ms;
}

.distribution-card {
  animation-delay: 370ms;
}

.audit-card {
  animation-delay: 395ms;
}

.signal-panel:nth-child(1) {
  animation-delay: 255ms;
}

.signal-panel:nth-child(2) {
  animation-delay: 285ms;
}

.signal-panel:nth-child(3) {
  animation-delay: 315ms;
}

.market-board {
  animation-delay: 150ms;
}

.ranking-board {
  animation-delay: 70ms;
}

.analytics-board {
  animation-delay: 175ms;
}

.control-deck {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
}

.intelligence-board {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.95fr) minmax(280px, 0.9fr);
  gap: 10px;
  margin-top: 12px;
}

.verdict-card,
.distribution-card,
.audit-card,
.signal-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 25, 39, 0.98), rgba(8, 12, 20, 0.98));
  box-shadow: var(--shadow);
}

.verdict-card,
.distribution-card,
.audit-card {
  min-height: 190px;
  padding: 14px;
}

.verdict-top {
  display: grid;
  gap: 5px;
}

.verdict-top span,
.card-headline span,
.panel-head span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.verdict-top strong {
  font-size: clamp(1.65rem, 3.6vw, 3rem);
  line-height: 0.96;
}

.verdict-top em {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 950;
}

.verdict-top.legit strong,
.verdict-top.legit em {
  color: var(--green);
}

.verdict-top.bunk strong,
.verdict-top.bunk em {
  color: var(--red);
}

.verdict-top.tie strong,
.verdict-top.tie em {
  color: var(--blue);
}

.verdict-top.legit em {
  background: var(--green-soft);
}

.verdict-top.bunk em {
  background: var(--red-soft);
}

.verdict-top.tie em {
  background: var(--blue-soft);
}

.global-split,
.status-stack {
  display: flex;
  overflow: hidden;
  width: 100%;
  height: 20px;
  margin: 16px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #070b12;
}

.global-up,
.stack-legit {
  background: linear-gradient(90deg, var(--green-deep), var(--green));
}

.global-down,
.stack-bunk {
  background: linear-gradient(90deg, var(--red), var(--red-deep));
}

.stack-tie {
  background: linear-gradient(90deg, #3c74c8, var(--blue));
}

.stack-empty {
  background: linear-gradient(90deg, #4b5565, #2f3848);
}

.verdict-metrics,
.shape-grid,
.audit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.verdict-metrics span,
.shape-grid span,
.audit-grid span {
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070b12;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.verdict-metrics strong,
.shape-grid b,
.audit-grid b {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 1.05rem;
}

.card-headline {
  display: grid;
  gap: 5px;
}

.card-headline strong {
  font-size: 1.18rem;
  line-height: 1.12;
}

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

.shape-grid.compact,
.audit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.audit-focus,
.mini-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070b12;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
}

.audit-focus {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  min-height: 48px;
  margin-top: 10px;
  padding: 8px;
  text-align: left;
}

.audit-focus span,
.mini-row span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
}

.audit-focus strong,
.mini-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.audit-focus em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 850;
}

.audit-focus.legit span,
.mini-row.legit span {
  background: var(--green-soft);
  color: var(--green);
}

.audit-focus.bunk span,
.mini-row.bunk span {
  background: var(--red-soft);
  color: var(--red);
}

.audit-focus.tie span,
.mini-row.tie span {
  background: var(--blue-soft);
  color: var(--blue);
}

.mini-row.leader-up span {
  background: rgba(66, 243, 111, 0.2);
  color: var(--green);
}

.mini-row.leader-down span {
  background: rgba(255, 70, 91, 0.2);
  color: var(--red);
}

.signal-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.signal-panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head strong {
  font-size: 1.08rem;
}

.mini-list {
  display: grid;
}

.mini-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border-width: 0 0 1px;
  border-radius: 0;
  text-align: left;
}

.mini-row:hover,
.audit-focus:hover {
  border-color: var(--line-strong);
  background: #111927;
  transform: translateY(-1px);
}

.mini-row em {
  color: var(--ink);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 950;
}

.mini-row small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.hero-stats {
  margin-top: 12px;
}

.stat {
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #111927, #0a0f18);
}

.stat strong {
  display: block;
  margin-top: 9px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1;
}

.stat.positive strong {
  color: var(--green);
}

.stat.negative strong {
  color: var(--red);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.control-grid > .search-box {
  grid-column: span 2;
}

.control-grid > .control-group:nth-child(2) {
  grid-column: span 4;
}

.control-grid > .control-group:nth-child(3) {
  grid-column: span 6;
}

.control-grid > .control-group:nth-child(n + 4) {
  grid-column: span 4;
}

.search-box,
.control-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #070b12;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}

input::placeholder {
  color: rgba(140, 150, 168, 0.76);
}

input:focus,
.segment:focus-visible,
.sort-chip:focus-visible,
.signal-chip:focus-visible,
.market-chip:focus-visible,
.size-chip:focus-visible,
.axis-chip:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(101, 168, 255, 0.18);
}

.segmented,
.sort-buttons,
.signal-toggle,
.market-toggle,
.size-toggle,
.axis-buttons {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    #070b12;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 10px 24px rgba(0, 0, 0, 0.12);
}

.segmented {
  grid-template-columns: repeat(5, minmax(66px, 1fr));
}

.sort-buttons {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.market-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signal-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.size-toggle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.axis-buttons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segment,
.sort-chip,
.signal-chip,
.market-chip,
.size-chip,
.axis-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  isolation: isolate;
  transition: background var(--fast), color var(--fast), border-color var(--fast), box-shadow var(--fast), transform var(--fast), filter var(--fast);
}

.segment::before,
.sort-chip::before,
.signal-chip::before,
.market-chip::before,
.size-chip::before,
.axis-chip::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent);
  opacity: 0;
  transition: opacity var(--fast);
}

.segment:hover,
.sort-chip:hover,
.signal-chip:hover,
.market-chip:hover,
.size-chip:hover,
.axis-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

.segment:hover::before,
.sort-chip:hover::before,
.signal-chip:hover::before,
.market-chip:hover::before,
.size-chip:hover::before,
.axis-chip:hover::before {
  opacity: 1;
}

.segment:active,
.sort-chip:active,
.signal-chip:active,
.market-chip:active,
.size-chip:active,
.axis-chip:active {
  transform: translateY(0);
}

.segment {
  gap: 7px;
}

.segment b {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 0.74rem;
}

.segment.is-active,
.sort-chip.is-active,
.signal-chip.is-active,
.market-chip.is-active,
.size-chip.is-active,
.axis-chip.is-active {
  color: #061008;
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 10px 24px rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

.segment.is-active b {
  background: rgba(6, 16, 8, 0.12);
  color: #061008;
}

.sort-chip.is-active {
  background: var(--green);
}

.segment[data-filter="bunk"].is-active,
.sort-chip[data-sort="bunk-ratio"].is-active,
.signal-chip[data-signal-filter="contested"].is-active {
  background: var(--red);
}

.segment[data-filter="tie"].is-active,
.sort-chip[data-sort="tao-flow"].is-active,
.sort-chip[data-sort="emission-share"].is-active,
.market-chip.is-active {
  background: var(--blue);
}

.segment[data-filter="no-votes"].is-active,
.sort-chip[data-sort="name"].is-active {
  color: var(--ink);
  background: #2f394b;
}

.signal-chip.is-active {
  background: #ffffff;
}

.size-chip.is-active {
  background: linear-gradient(180deg, #ffb967, #ff823c);
}

.axis-chip.is-active {
  background: var(--amber);
}

.lab-workbench {
  margin-top: 12px;
  scroll-margin-top: 12px;
}

.lab-stage {
  display: grid;
  grid-template-columns: minmax(700px, 1.12fr) minmax(540px, 0.88fr);
  gap: 12px;
  align-items: stretch;
  height: var(--workbench-height);
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.lab-stage > .market-board,
.lab-stage > .analytics-board {
  display: grid;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: 0;
  scroll-snap-align: start;
}

.lab-stage .market-board {
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 700px;
}

.lab-stage .analytics-board {
  --analytics-panel-height: var(--lab-visual-height);
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 540px;
}

.lab-stage .map-layout {
  grid-template-columns: minmax(0, 1fr) 280px;
  height: 100%;
  min-height: 0;
}

.lab-stage .map-shell {
  min-height: 0;
}

.lab-stage .bubble-map {
  height: 100%;
  min-height: 0;
}

.lab-stage .map-detail {
  height: 100%;
  max-height: none;
}

.lab-stage .analytics-layout {
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: 1fr;
  height: 100%;
  overflow: hidden;
}

.lab-stage .scatter-plot,
.lab-stage .three-lab {
  height: 100%;
  min-height: 0;
}

.lab-stage .three-scene {
  min-height: 0;
}

.lab-stage .analytics-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(38px, auto);
  gap: 6px;
  max-height: none;
  padding: 10px;
  border-top: 1px solid var(--line);
  border-left: 0;
}

.lab-stage .analytics-stats span {
  min-height: 38px;
  padding: 7px;
  font-size: 0.72rem;
}

.lab-stage .analytics-stats strong {
  font-size: 0.98rem;
}

@media (min-width: 821px) and (max-height: 780px) {
  .lab-stage .board-head {
    min-height: 58px;
    padding: 10px 14px;
  }

  .lab-stage h2 {
    font-size: clamp(1.08rem, 2vw, 1.45rem);
  }

  .lab-stage .board-meta,
  .lab-stage .analytics-summary {
    font-size: 0.76rem;
    line-height: 1.25;
  }

  .lab-stage .analytics-controls {
    gap: 7px;
    padding: 8px 10px;
  }

  .lab-stage .axis-control {
    gap: 5px;
  }

  .lab-stage .axis-buttons {
    gap: 3px;
    padding: 3px;
  }

  .lab-stage .axis-chip {
    min-height: 28px;
    padding: 0 5px;
    font-size: 0.74rem;
  }

  .lab-stage .three-lab {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .lab-stage .three-hud {
    gap: 5px;
    padding: 8px 8px 0;
  }

  .lab-stage .three-hud span {
    min-height: 34px;
    padding: 5px 6px;
    font-size: 0.66rem;
  }

  .lab-stage .three-hud b,
  .lab-stage .three-hud em {
    font-size: 0.58rem;
  }

  .lab-stage .analytics-stats {
    grid-auto-rows: minmax(34px, auto);
    padding: 8px;
  }

  .lab-stage .analytics-stats span {
    min-height: 34px;
    padding: 5px 6px;
    font-size: 0.68rem;
  }

  .lab-stage .analytics-stats strong {
    font-size: 0.9rem;
  }
}

.market-board {
  overflow: hidden;
  margin-top: 12px;
  scroll-margin-top: 12px;
}

.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #111927, #0b1019);
}

.board-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.board-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.legit {
  background: var(--green);
}

.legend-dot.bunk {
  background: var(--red);
}

.legend-dot.tie {
  background: var(--blue);
}

.legend-dot.flow {
  background: #ffffff;
}

.legend-dot.emission {
  background: #7dd3fc;
}

.legend-dot.burn {
  background: var(--amber);
}

.legend-dot.quiet {
  background: var(--faint);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
}

.map-shell {
  position: relative;
  min-width: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    #05080e;
  background-size: 44px 44px;
}

.map-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 70, 91, 0.16), transparent 35%, transparent 65%, rgba(66, 243, 111, 0.14));
  opacity: 0.72;
}

.map-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  opacity: 0.25;
  transform: translateY(-100%);
  animation: scanSweep 9s linear infinite;
}

.axis-bar {
  position: absolute;
  z-index: 5;
  left: 14px;
  right: 14px;
  top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 28px;
  pointer-events: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.axis-bar span:nth-child(1) {
  color: #ff8b98;
}

.axis-bar span:nth-child(2) {
  text-align: center;
}

.axis-bar span:nth-child(3) {
  color: #7dff9a;
  text-align: right;
}

.bubble-map {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: min(620px, var(--map-panel-height));
  contain: layout paint;
  touch-action: none;
}

.bubble-map.is-physics-active {
  cursor: progress;
}

.bubble-map.is-dragging {
  cursor: grabbing;
}

.bubble {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  align-content: center;
  width: var(--size);
  height: var(--size);
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: #ffffff;
  cursor: grab;
  outline: none;
  overflow: hidden;
  --bubble-visual-opacity: 0.78;
  opacity: calc(var(--bubble-opacity, 1) * var(--bubble-visual-opacity));
  transform: translate3d(-50%, -50%, 0) scale(var(--bubble-scale, 1));
  background:
    radial-gradient(circle at 31% 21%, rgba(255, 255, 255, 0.96) 0 6%, rgba(255, 255, 255, 0.24) 7%, transparent 24%),
    radial-gradient(circle at 64% 78%, rgba(0, 0, 0, 0.4), transparent 42%),
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.38) 72%),
    conic-gradient(from -90deg, var(--green) 0 var(--support), var(--red) var(--support) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 16px 34px rgba(0, 0, 0, 0.34),
    0 0 30px var(--glow-color),
    inset 0 0 22px rgba(255, 255, 255, 0.2),
    inset 0 -28px 30px rgba(0, 0, 0, 0.46);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, filter 140ms ease, opacity 120ms ease;
  will-change: left, top, transform, opacity;
}

.bubble::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: inherit;
  pointer-events: none;
}

.bubble::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid transparent;
  border-radius: inherit;
  pointer-events: none;
}

.bubble:hover,
.bubble:focus-visible,
.bubble.is-selected {
  border-color: #ffffff;
  filter: saturate(1.1) brightness(1.07);
  --bubble-scale: 1.08;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.34),
    0 20px 42px rgba(0, 0, 0, 0.42),
    0 0 40px var(--glow-color),
    inset 0 0 24px rgba(255, 255, 255, 0.24),
    inset 0 -26px 28px rgba(0, 0, 0, 0.42);
}

.bubble.is-dragging {
  --bubble-scale: 1.12;
  --bubble-visual-opacity: 1;
  cursor: grabbing;
  filter: saturate(1.16) brightness(1.1);
  z-index: 40 !important;
}

.bubble.is-falling {
  pointer-events: none;
}

.bubble.is-settled {
  will-change: transform;
}

.bubble.is-selected::after {
  border-color: rgba(255, 255, 255, 0.54);
  animation: selectedPulse 1.45s ease-out infinite;
}

.bubble.bunk {
  border-color: rgba(255, 170, 178, 0.82);
}

.bubble.legit {
  border-color: rgba(165, 255, 185, 0.82);
}

.bubble.tie {
  border-color: rgba(160, 200, 255, 0.86);
}

.bubble.quiet {
  --bubble-visual-opacity: 0.56;
  border-color: rgba(160, 170, 190, 0.48);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.5) 0 7%, transparent 25%),
    linear-gradient(180deg, #3a4354, #202735);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 18px rgba(110, 122, 145, 0.26),
    inset 0 -22px 24px rgba(0, 0, 0, 0.34);
}

.bubble:hover,
.bubble:focus-visible,
.bubble.is-selected {
  --bubble-visual-opacity: 0.98;
}

.bubble-code,
.bubble-name,
.bubble-change,
.bubble-volume {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 84%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.64);
}

.bubble-code {
  display: grid;
  place-items: center;
  min-width: var(--code-size);
  height: var(--code-size);
  margin-bottom: 2px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #0b1019;
  font-size: calc(var(--code-size) * 0.34);
  font-weight: 950;
  text-shadow: none;
}

.bubble-name {
  font-size: var(--name-size);
  font-weight: 950;
  line-height: 1.02;
}

.bubble-change {
  margin-top: 2px;
  font-size: var(--change-size);
  font-weight: 950;
  line-height: 1;
}

.bubble-volume {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--volume-size);
  font-weight: 900;
}

.bubble.is-small .bubble-volume,
.bubble.is-tiny .bubble-name,
.bubble.is-tiny .bubble-volume {
  display: none;
}

.bubble.is-tiny .bubble-code {
  margin-bottom: 1px;
}

.map-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: var(--map-panel-height);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #0b1019;
}

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

.detail-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.detail-top.legit .detail-number {
  background: var(--green-soft);
  color: var(--green);
}

.detail-top.bunk .detail-number {
  background: var(--red-soft);
  color: var(--red);
}

.detail-top.tie .detail-number {
  background: var(--blue-soft);
  color: var(--blue);
}

.detail-top h3 {
  overflow-wrap: anywhere;
  font-size: 1.03rem;
  line-height: 1.16;
}

.detail-top span:not(.detail-number) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.detail-signal {
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070b12;
}

.detail-signal strong {
  font-size: 2.25rem;
  line-height: 0.96;
}

.detail-signal span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.detail-signal.legit strong {
  color: var(--green);
}

.detail-signal.bunk strong {
  color: var(--red);
}

.detail-signal.tie strong {
  color: var(--blue);
}

.detail-signal.quiet strong {
  color: var(--faint);
}

.vote-balance {
  display: grid;
  gap: 7px;
}

.balance-numbers,
.balance-labels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
}

.balance-numbers span,
.balance-labels span {
  min-width: 0;
}

.balance-numbers span:last-child,
.balance-labels span:last-child {
  text-align: right;
}

.vote-up {
  color: var(--green);
}

.vote-down {
  color: var(--red);
}

.balance-track {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 20% 100%,
    #111927;
}

.vote-balance-detail .balance-track {
  height: 22px;
}

.balance-up,
.balance-down {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
  min-width: 0;
  height: auto;
}

.balance-up {
  left: 0;
  background: linear-gradient(90deg, var(--green-deep), var(--green));
}

.balance-down {
  right: 0;
  background: linear-gradient(90deg, var(--red), var(--red-deep));
  box-shadow: -8px 0 16px rgba(5, 7, 12, 0.3);
}

.vote-balance.is-empty .balance-track {
  background: repeating-linear-gradient(135deg, #182030 0 8px, #111927 8px 16px);
}

.vote-balance.is-empty .balance-up,
.vote-balance.is-empty .balance-down {
  display: none;
}

.market-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.market-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111927;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.market-tag.flow-positive {
  border-color: rgba(66, 243, 111, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.market-tag.flow-negative {
  border-color: rgba(255, 70, 91, 0.3);
  background: var(--red-soft);
  color: var(--red);
}

.market-tag.burn {
  border-color: rgba(255, 171, 71, 0.28);
  background: rgba(255, 171, 71, 0.12);
  color: var(--amber);
}

.market-tag.emission {
  border-color: rgba(101, 168, 255, 0.3);
  background: var(--blue-soft);
  color: var(--blue);
}

.market-tag.hype-high {
  border-color: rgba(255, 171, 71, 0.35);
  background: rgba(255, 171, 71, 0.13);
  color: var(--amber);
}

.market-tag.hype-some {
  border-color: rgba(101, 168, 255, 0.28);
  background: var(--blue-soft);
  color: var(--blue);
}

.market-tag.hype-flat {
  color: var(--faint);
}

.market-tag.muted {
  color: var(--faint);
}

.detail-market {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.detail-market span {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #111927, #070b12);
}

.detail-market strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.detail-market em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.detail-stats span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #111927;
  color: var(--muted);
  font-weight: 850;
}

.detail-stats strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  background: #ffffff;
  color: #070a11;
  font-weight: 950;
  text-decoration: none;
  transition: transform var(--fast), box-shadow var(--fast);
}

.detail-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(255, 255, 255, 0.08);
}

.empty-detail {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.ranking-board {
  overflow: hidden;
  margin-top: 12px;
}

.thumbs-board {
  --leader-list-height: clamp(560px, 68vh, 720px);
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(66, 243, 111, 0.05), transparent 34%, transparent 66%, rgba(255, 70, 91, 0.05)),
    rgba(11, 16, 25, 0.94);
}

.leader-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.leader-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  background: #0b1019;
}

.leader-column-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.leader-column-head > span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 1.15rem;
}

.leader-column-up .leader-column-head > span {
  background: var(--green-soft);
}

.leader-column-down .leader-column-head > span {
  background: var(--red-soft);
}

.leader-column-head h3,
.leader-column-head p {
  margin: 0;
}

.leader-column-head h3 {
  font-size: 1rem;
}

.leader-column-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.leader-list {
  display: grid;
  align-content: start;
  max-height: var(--leader-list-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.leader-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto auto;
  gap: 4px 8px;
  align-items: start;
  width: 100%;
  height: max-content;
  min-height: max-content;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #0b1019;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background var(--fast), box-shadow var(--fast), transform var(--fast);
}

.leader-row:hover,
.leader-row.is-selected {
  background: #111927;
}

.leader-row.is-selected {
  box-shadow: inset 4px 0 0 var(--amber);
}

.leader-row.is-podium.leader-row-up {
  background:
    linear-gradient(90deg, rgba(66, 243, 111, 0.15), transparent 36%),
    #0b1019;
  box-shadow: inset 3px 0 0 rgba(66, 243, 111, 0.84);
}

.leader-row.is-podium.leader-row-down {
  background:
    linear-gradient(90deg, rgba(255, 70, 91, 0.15), transparent 36%),
    #0b1019;
  box-shadow: inset 3px 0 0 rgba(255, 70, 91, 0.84);
}

.leader-row.is-podium.leader-row-up:hover,
.leader-row.is-podium.leader-row-up.is-selected {
  background:
    linear-gradient(90deg, rgba(66, 243, 111, 0.19), transparent 38%),
    #111927;
}

.leader-row.is-podium.leader-row-down:hover,
.leader-row.is-podium.leader-row-down.is-selected {
  background:
    linear-gradient(90deg, rgba(255, 70, 91, 0.19), transparent 38%),
    #111927;
}

.leader-row.is-podium:nth-of-type(3) {
  border-bottom: 2px solid var(--line-strong);
}

.leader-rank {
  display: inline-grid;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: #151d2b;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 950;
}

.leader-row-up.is-podium .leader-rank {
  color: var(--green);
  background: rgba(66, 243, 111, 0.15);
}

.leader-row-down.is-podium .leader-rank {
  color: var(--red);
  background: rgba(255, 70, 91, 0.16);
}

.leader-name {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  display: grid;
  gap: 1px;
  min-width: 0;
}

.leader-name strong,
.leader-name em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-name strong {
  font-size: 0.86rem;
}

.leader-name em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leader-name .leader-badges {
  gap: 3px;
  margin-top: 3px;
}

.leader-name .leader-badge {
  min-height: 16px;
  padding: 1px 5px;
  font-size: 0.58rem;
}

.leader-row > .status {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
}

.leader-count {
  grid-column: 4;
  grid-row: 1;
  align-self: center;
  display: grid;
  justify-items: end;
  line-height: 1;
}

.leader-count strong {
  font-size: 1.06rem;
}

.leader-count em {
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leader-row-up .leader-count strong {
  color: var(--green);
}

.leader-row-down .leader-count strong {
  color: var(--red);
}

.leader-split {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.vote-balance-leader {
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 3px 6px;
  align-items: center;
}

.vote-balance-leader .balance-numbers {
  display: contents;
}

.vote-balance-leader .balance-numbers span:first-child {
  grid-column: 1;
  grid-row: 1;
}

.vote-balance-leader .balance-numbers span:last-child {
  grid-column: 3;
  grid-row: 1;
}

.vote-balance-leader .balance-track {
  grid-column: 2;
  grid-row: 1;
  height: 10px;
}

.vote-balance-leader .balance-labels {
  display: none;
}

.vote-balance-leader .balance-numbers {
  font-size: 0.68rem;
  line-height: 1.1;
}

.market-tags-leader {
  gap: 4px;
}

.market-tags-leader .market-tag {
  min-height: 18px;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 0.63rem;
}

.leader-footer {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.leader-footer .thumb-total {
  justify-content: flex-start;
}

.leader-footer a {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  text-decoration: none;
}

.leader-footer a:hover {
  text-decoration: underline;
}

.leader-empty {
  margin: 0;
  padding: 18px 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.ranking-head,
.row {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(360px, 1.35fr) minmax(170px, 0.6fr);
  gap: 16px;
}

.ranking-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rows {
  display: grid;
}

.row {
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #0b1019;
  cursor: pointer;
  transition: background var(--fast), box-shadow var(--fast);
}

.row.is-top-up {
  background:
    linear-gradient(90deg, rgba(66, 243, 111, 0.12), transparent 28%),
    #0b1019;
}

.row.is-top-down {
  background:
    linear-gradient(90deg, rgba(255, 70, 91, 0.12), transparent 28%),
    #0b1019;
}

.row.is-top-up.is-top-down {
  background:
    linear-gradient(90deg, rgba(66, 243, 111, 0.12), transparent 28%),
    linear-gradient(270deg, rgba(255, 70, 91, 0.12), transparent 30%),
    #0b1019;
}

.row:hover,
.row.is-selected {
  background: #111927;
}

.row.is-top-up:hover,
.row.is-top-up.is-selected {
  background:
    linear-gradient(90deg, rgba(66, 243, 111, 0.16), transparent 30%),
    #111927;
}

.row.is-top-down:hover,
.row.is-top-down.is-selected {
  background:
    linear-gradient(90deg, rgba(255, 70, 91, 0.16), transparent 30%),
    #111927;
}

.row.is-top-up.is-top-down:hover,
.row.is-top-up.is-top-down.is-selected {
  background:
    linear-gradient(90deg, rgba(66, 243, 111, 0.16), transparent 30%),
    linear-gradient(270deg, rgba(255, 70, 91, 0.16), transparent 30%),
    #111927;
}

.row.is-selected {
  box-shadow: inset 4px 0 0 var(--amber);
}

.subnet-cell {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #151d2b;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.name-text {
  min-width: 0;
}

.name-text > strong,
.name-text > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-text > strong {
  font-size: 0.98rem;
}

.name-text > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.leader-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.leader-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.leader-badge-up {
  color: var(--green);
  background: rgba(66, 243, 111, 0.15);
}

.leader-badge-down {
  color: var(--red);
  background: rgba(255, 70, 91, 0.16);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 950;
}

.status.legit {
  color: var(--green);
  background: var(--green-soft);
}

.status.bunk {
  color: var(--red);
  background: var(--red-soft);
}

.status.tie {
  color: var(--blue);
  background: var(--blue-soft);
}

.status.no-votes,
.status.pending {
  color: var(--muted);
  background: rgba(140, 150, 168, 0.14);
}

.split {
  display: grid;
  gap: 7px;
}

.votes {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 0;
}

.thumb-total {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.thumb-total strong {
  font-size: 1.3rem;
  line-height: 1;
}

.thumb-total em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.order-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111927;
  text-align: right;
}

.order-value em,
.order-value b {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.order-value em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.order-value b {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.08;
}

.order-value-legit,
.order-value-positive,
.order-value-high {
  border-color: rgba(66, 243, 111, 0.28);
  background: var(--green-soft);
}

.order-value-legit b,
.order-value-positive b,
.order-value-high b {
  color: var(--green);
}

.order-value-bunk,
.order-value-negative {
  border-color: rgba(255, 70, 91, 0.32);
  background: var(--red-soft);
}

.order-value-bunk b,
.order-value-negative b {
  color: var(--red);
}

.order-value-burn,
.order-value-some {
  border-color: rgba(255, 171, 71, 0.28);
  background: rgba(255, 171, 71, 0.12);
}

.order-value-burn b,
.order-value-some b {
  color: var(--amber);
}

.order-value-emission {
  border-color: rgba(101, 168, 255, 0.3);
  background: var(--blue-soft);
}

.order-value-emission b {
  color: var(--blue);
}

.order-value-muted b,
.order-value-flat b {
  color: var(--faint);
}

.votes span,
.votes small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.votes small {
  font-size: 0.74rem;
}

.votes a {
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

.votes a:hover {
  text-decoration: underline;
}

.empty-state {
  margin: 0;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.analytics-board {
  position: relative;
  overflow: hidden;
  margin-top: 12px;
}

.featured-insight {
  --analytics-panel-height: clamp(280px, 38vh, 420px);
  isolation: isolate;
  border-color: rgba(255, 171, 71, 0.38);
  background:
    linear-gradient(145deg, rgba(255, 171, 71, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(101, 168, 255, 0.1), transparent 42%),
    rgba(11, 16, 25, 0.96);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 171, 71, 0.08) inset;
}

.featured-insight::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 4;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
}

.featured-insight .board-head {
  min-height: 76px;
  background:
    linear-gradient(90deg, rgba(255, 171, 71, 0.14), transparent 46%),
    linear-gradient(180deg, #111927, #0b1019);
}

.featured-insight .scatter-plot {
  background:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    radial-gradient(circle at 50% 8%, rgba(255, 171, 71, 0.1), transparent 34%),
    #05080e;
  background-size: 40px 40px, 40px 40px, auto, auto;
}

.analytics-summary {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.35;
  text-align: right;
}

.analytics-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #0b1019;
}

.axis-control {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  min-height: 0;
}

.scatter-plot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: var(--analytics-panel-height);
  overflow: hidden;
  padding: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    #05080e;
  background-size: 40px 40px;
}

.scatter-plot.is-three {
  padding: 0;
}

.three-lab {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr);
  width: 100%;
  min-height: var(--analytics-panel-height);
  overflow: hidden;
  background:
    radial-gradient(circle at 48% 18%, rgba(101, 168, 255, 0.16), transparent 32%),
    radial-gradient(circle at 80% 78%, rgba(255, 171, 71, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    #05080e;
}

.three-scene {
  position: relative;
  min-height: calc(var(--analytics-panel-height) - 78px);
  cursor: grab;
  touch-action: none;
}

.three-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.three-lab.is-hovering-point .three-scene {
  cursor: pointer;
}

.three-scene:active {
  cursor: grabbing;
}

.three-loading {
  margin: 80px auto 0;
}

.three-hud {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 12px 0;
  pointer-events: none;
}

.three-hud span {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.72);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.three-hud b {
  color: var(--amber);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.three-hud em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.66rem;
}

.three-tooltip {
  position: absolute;
  z-index: 6;
  display: grid;
  gap: 6px;
  width: min(300px, calc(100% - 20px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  color: var(--ink);
  pointer-events: none;
}

.three-tooltip[hidden] {
  display: none;
}

.three-tooltip strong,
.three-tooltip span,
.three-tooltip small {
  overflow-wrap: anywhere;
}

.three-tooltip strong {
  font-size: 0.96rem;
}

.three-tooltip span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.three-tooltip div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.three-tooltip em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 850;
}

.three-tooltip b {
  text-align: right;
  font-size: 0.82rem;
}

.three-tooltip small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.35;
}

.scatter-svg {
  display: block;
  width: 100%;
  max-height: calc(var(--analytics-panel-height) + 80px);
  min-height: min(340px, var(--analytics-panel-height));
}

.scatter-grid line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.trend-line {
  stroke: var(--amber);
  stroke-linecap: round;
  stroke-width: 4;
  opacity: 0.82;
}

.scatter-point {
  fill: var(--faint);
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 1.5;
  opacity: 0.86;
  transition: filter var(--fast), opacity var(--fast), r var(--fast), stroke-width var(--fast);
}

.scatter-hit {
  fill: transparent;
  pointer-events: all;
}

.scatter-pin {
  cursor: pointer;
  outline: none;
}

.scatter-pin.legit .scatter-point {
  fill: var(--green);
}

.scatter-pin.bunk .scatter-point {
  fill: var(--red);
}

.scatter-pin.tie .scatter-point {
  fill: var(--blue);
}

.scatter-pin.quiet .scatter-point {
  fill: #687386;
  opacity: 0.55;
}

.scatter-pin:hover .scatter-point,
.scatter-pin:focus-visible .scatter-point,
.scatter-pin.is-selected .scatter-point {
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.38));
  opacity: 1;
  stroke: #ffffff;
  stroke-width: 3;
}

.scatter-pin.is-selected .scatter-point {
  stroke: var(--amber);
  stroke-width: 4;
}

.scatter-pin-label {
  opacity: 0;
  fill: var(--ink);
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(5, 7, 12, 0.9);
  stroke-width: 4px;
  text-anchor: middle;
  font-size: 15px;
  font-weight: 950;
  transition: opacity var(--fast);
}

.scatter-pin:hover .scatter-pin-label,
.scatter-pin:focus-visible .scatter-pin-label,
.scatter-pin.is-selected .scatter-pin-label {
  opacity: 1;
}

.z-scale {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.82);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.z-dot {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: var(--amber);
}

.z-dot.small {
  width: 7px;
  height: 7px;
}

.z-dot.medium {
  width: 12px;
  height: 12px;
}

.z-dot.large {
  width: 18px;
  height: 18px;
}

.scatter-tooltip {
  position: absolute;
  z-index: 12;
  display: grid;
  gap: 6px;
  width: min(280px, calc(100% - 20px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(7, 11, 18, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  color: var(--ink);
  pointer-events: none;
}

.scatter-tooltip[hidden] {
  display: none;
}

.scatter-tooltip strong,
.scatter-tooltip span,
.scatter-tooltip small {
  overflow-wrap: anywhere;
}

.scatter-tooltip strong {
  font-size: 0.96rem;
}

.scatter-tooltip span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.scatter-tooltip div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.scatter-tooltip em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 850;
}

.scatter-tooltip b {
  text-align: right;
  font-size: 0.82rem;
}

.scatter-tooltip small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.35;
}

.axis-label,
.axis-tick {
  fill: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.axis-label {
  fill: var(--ink);
  font-size: 18px;
  text-anchor: middle;
}

.axis-tick.end {
  text-anchor: end;
}

.analytics-stats {
  display: grid;
  align-content: stretch;
  grid-auto-rows: minmax(46px, auto);
  gap: 8px;
  max-height: var(--analytics-panel-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #0b1019;
}

.analytics-stats span {
  display: grid;
  gap: 3px;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #111927, #070b12);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.analytics-stats strong {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin-top: 16px;
  padding: 14px 2px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.site-footer span {
  color: var(--ink);
}

.site-footer a {
  color: var(--blue);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (min-width: 1380px) {
  .control-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bubbleReveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scanSweep {
  0% {
    transform: translateY(-100%);
  }

  42%,
  100% {
    transform: translateY(100%);
  }
}

@keyframes selectedPulse {
  0% {
    opacity: 0.8;
    transform: scale(0.98);
  }

  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@media (max-width: 1180px) {
  :root {
    --leader-list-height: clamp(300px, 42vh, 460px);
    --map-panel-height: clamp(500px, 64vh, 720px);
    --analytics-panel-height: clamp(340px, 46vh, 440px);
  }

  .intelligence-board {
    grid-template-columns: 1fr 1fr;
  }

  .verdict-card {
    grid-column: 1 / -1;
  }

  .signal-board {
    grid-template-columns: 1fr;
  }

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

  .control-grid > .search-box {
    grid-column: span 2;
  }

  .control-grid > .control-group:nth-child(2) {
    grid-column: span 4;
  }

  .control-grid > .control-group:nth-child(3) {
    grid-column: 1 / -1;
  }

  .control-grid > .control-group:nth-child(n + 4) {
    grid-column: span 2;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-detail {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .analytics-layout {
    grid-template-columns: 1fr;
  }

  .analytics-controls {
    grid-template-columns: 1fr;
  }

  .analytics-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --leader-list-height: clamp(280px, 44vh, 420px);
    --map-panel-height: clamp(440px, 62vh, 620px);
    --analytics-panel-height: clamp(320px, 44vh, 400px);
    --lab-visual-height: clamp(320px, 48vh, 440px);
    --workbench-height: auto;
  }

  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .app-header {
    display: grid;
  }

  .source-panel {
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  .lab-stage {
    grid-template-columns: 1fr;
    height: auto;
    overflow-x: visible;
    overflow-y: visible;
    padding-bottom: 0;
  }

  .lab-stage .market-board,
  .lab-stage .analytics-board {
    height: auto;
    min-width: 0;
  }

  .lab-stage .map-layout,
  .lab-stage .analytics-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .lab-stage .map-shell,
  .lab-stage .bubble-map,
  .lab-stage .map-detail,
  .lab-stage .scatter-plot,
  .lab-stage .three-lab {
    height: auto;
  }

  .lab-stage .map-detail {
    max-height: min(420px, 52vh);
  }

  .lab-stage .bubble-map {
    min-height: var(--lab-visual-height);
  }

  .lab-stage .analytics-stats {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(42px, auto);
  }

  .thumbs-board {
    --leader-list-height: clamp(500px, 64vh, 620px);
  }

  .stats-grid,
  .intelligence-board,
  .leader-columns,
  .ranking-head,
  .row {
    grid-template-columns: 1fr;
  }

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

  .control-grid > .search-box,
  .control-grid > .control-group:nth-child(n) {
    grid-column: 1 / -1;
  }

  .verdict-card {
    grid-column: auto;
  }

  .verdict-metrics,
  .shape-grid,
  .shape-grid.compact,
  .audit-grid {
    grid-template-columns: 1fr 1fr;
  }

  .segmented,
  .sort-buttons,
  .signal-toggle,
  .market-toggle,
  .size-toggle,
  .axis-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-stats {
    grid-template-columns: 1fr;
  }

  .analytics-summary {
    max-width: none;
    text-align: left;
  }

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

  .board-head {
    display: grid;
    align-items: start;
  }

  .board-meta {
    justify-content: flex-start;
  }

  .axis-bar {
    left: 10px;
    right: 10px;
  }

  .ranking-head {
    display: none;
  }

  .subnet-cell {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .subnet-cell .status {
    grid-column: 2;
    justify-self: start;
    margin-top: -4px;
  }

  .leader-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto auto;
  }

  .leader-row > .status {
    grid-column: 2 / 3;
    grid-row: 2;
    justify-self: start;
  }

  .leader-count {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .leader-split {
    grid-row: 3;
  }

  .leader-footer {
    grid-row: 4;
  }

  .leader-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .leader-footer .thumb-total {
    grid-column: 1;
    justify-content: flex-start;
  }

  .leader-footer a {
    grid-column: 2;
    justify-self: end;
  }

  .vote-balance-leader {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .market-tags-leader {
    gap: 4px;
  }

  .votes {
    justify-items: start;
  }

  .thumb-total {
    justify-content: flex-start;
  }

  .order-value {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .brand-mark {
    display: none;
  }

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

  .segmented,
  .sort-buttons,
  .signal-toggle,
  .market-toggle,
  .size-toggle,
  .axis-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment {
    justify-content: center;
  }

  .site-footer {
    display: grid;
    justify-content: start;
  }

  .three-hud {
    gap: 4px;
    padding: 8px 8px 0;
  }

  .three-hud span {
    min-height: 36px;
    padding: 6px;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
