:root {
  color-scheme: dark;
  --bg: #111315;
  --surface: #191c1f;
  --surface-2: #202429;
  --line: #2d3339;
  --text: #edf0f2;
  --muted: #8f9aa3;
  --soft: #c8d0d6;
  --accent: #58b48b;
  --warn: #d0a34b;
  --bad: #d96565;
  --mono: "SFMono-Regular", "JetBrains Mono", "Roboto Mono", ui-monospace, monospace;
  --sans: "Geist", "Satoshi", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(88, 180, 139, 0.06), transparent 340px),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  background: rgba(17, 19, 21, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 44px);
}

.eyebrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.2;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 42px);
}

h2 {
  font-size: 18px;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(208, 163, 75, 0.12);
}

.dot.ok {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(88, 180, 139, 0.14);
}

.dot.bad {
  background: var(--bad);
  box-shadow: 0 0 0 4px rgba(217, 101, 101, 0.14);
}

.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 34px) 48px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(25, 28, 31, 0.72);
}

.metric {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: clamp(18px, 2.5vw, 30px);
  font-weight: 600;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.4fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(25, 28, 31, 0.82);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.feed-panel {
  margin-top: 18px;
}

.feed-head {
  align-items: flex-start;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-btn {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  cursor: pointer;
  padding: 0 11px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.filter-btn.active {
  border-color: rgba(88, 180, 139, 0.7);
  background: rgba(88, 180, 139, 0.1);
  color: #b6f0d5;
}

.filter-btn:active {
  transform: translateY(1px);
}

.source-line {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  padding: 11px 18px;
  overflow-wrap: anywhere;
}

.scan-form {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 14px;
  padding: 18px;
}

.scan-form label {
  display: grid;
  gap: 7px;
}

.scan-form label span {
  color: var(--muted);
  font-size: 12px;
}

.wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(88, 180, 139, 0.9);
}

.primary-btn,
.ghost-btn {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid rgba(88, 180, 139, 0.55);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.primary-btn {
  background: var(--accent);
  color: #07110d;
  font-weight: 650;
  padding: 0 14px;
}

.ghost-btn {
  background: transparent;
  color: var(--soft);
  padding: 0 12px;
}

.primary-btn:active,
.ghost-btn:active {
  transform: translateY(1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.form-msg {
  min-height: 20px;
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 13px;
}

.watchlist,
.results,
.logs,
.signals,
.legacy-results {
  display: grid;
}

.watch-row,
.result-row,
.log-row {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.watch-row:last-child,
.result-row:last-child,
.log-row:last-child {
  border-bottom: 0;
}

.watch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.label {
  font-weight: 620;
}

.label-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.chain-bsc,
.chain-bnb,
.chain-bnb-chain {
  border-color: rgba(217, 175, 62, 0.82);
  color: #f5d36c;
  background: rgba(217, 175, 62, 0.08);
}

.chain-polygon,
.chain-polygon-pos,
.chain-matic {
  border-color: rgba(131, 126, 236, 0.78);
  color: #bbb8ff;
  background: rgba(131, 126, 236, 0.08);
}

.chain-eth,
.chain-ethereum {
  border-color: rgba(145, 160, 176, 0.72);
  color: #d4dde7;
  background: rgba(145, 160, 176, 0.07);
}

.chain-base {
  border-color: rgba(78, 145, 238, 0.78);
  color: #a9ccff;
  background: rgba(78, 145, 238, 0.08);
}

.chain-arbitrum,
.chain-arbitrum-one {
  border-color: rgba(69, 181, 214, 0.78);
  color: #9be5f8;
  background: rgba(69, 181, 214, 0.08);
}

.chain-optimism,
.chain-op {
  border-color: rgba(222, 90, 90, 0.78);
  color: #ffb6b6;
  background: rgba(222, 90, 90, 0.08);
}

.chain-avalanche,
.chain-avax {
  border-color: rgba(225, 102, 92, 0.78);
  color: #ffc0b8;
  background: rgba(225, 102, 92, 0.08);
}

.chain-solana {
  border-color: rgba(78, 195, 153, 0.78);
  color: #aaf0d8;
  background: rgba(78, 195, 153, 0.08);
}

.subline {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.name {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.reason {
  color: var(--soft);
  font-size: 14px;
  margin-top: 9px;
  overflow-wrap: anywhere;
}

.results-panel,
.legacy-panel,
.log-panel {
  margin-top: 18px;
}

.signal-card {
  display: grid;
  grid-template-columns: 168px minmax(260px, 1.15fr) minmax(360px, 1.35fr);
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.signal-card:last-child {
  border-bottom: 0;
}

.signal-card.dump {
  background: linear-gradient(90deg, rgba(217, 101, 101, 0.08), transparent 42%);
}

.signal-card.range {
  background: linear-gradient(90deg, rgba(131, 126, 236, 0.08), transparent 42%);
}

.signal-card.lp {
  background: linear-gradient(90deg, rgba(88, 180, 139, 0.08), transparent 42%);
}

.signal-side,
.signal-main {
  min-width: 0;
}

.result-row {
  display: grid;
  grid-template-columns: 170px minmax(240px, 1fr) minmax(360px, 1.5fr);
  gap: 18px;
}

.mode {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--soft);
}

.mode.hot {
  border-color: rgba(217, 101, 101, 0.65);
  color: #ffb6b6;
}

.mode.live {
  border-color: rgba(88, 180, 139, 0.65);
  color: #b6f0d5;
}

.mode.dump {
  border-color: rgba(217, 101, 101, 0.72);
  color: #ffb6b6;
}

.mode.range {
  border-color: rgba(131, 126, 236, 0.72);
  color: #c9c7ff;
}

.mode.lp {
  border-color: rgba(88, 180, 139, 0.72);
  color: #b6f0d5;
}

.score {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 28px;
}

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

.stat {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.wick-list {
  display: grid;
  gap: 7px;
}

.wick {
  display: grid;
  grid-template-columns: 120px repeat(4, 1fr);
  gap: 8px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}

.linkbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.fast-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.fast-link:hover {
  border-color: rgba(88, 180, 139, 0.62);
  background: rgba(88, 180, 139, 0.06);
  text-decoration: none;
}

.fast-link:active {
  transform: translateY(1px);
}

.primary-link {
  border-color: rgba(88, 180, 139, 0.7);
  color: #b6f0d5;
}

.shot-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #0f1113;
}

.shot-link:hover {
  border-color: rgba(88, 180, 139, 0.62);
  text-decoration: none;
}

.signal-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: left top;
}

.json-link {
  color: var(--muted);
}

.legacy-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
}

.legacy-row:last-child {
  border-bottom: 0;
}

a {
  color: #9bd7bc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.log-row {
  display: grid;
  grid-template-columns: 150px 80px 1fr;
  gap: 12px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}

.empty {
  color: var(--muted);
  padding: 18px;
}

@media (max-width: 980px) {
  .topbar,
  .status-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .workbench,
  .result-row,
  .signal-card,
  .legacy-row {
    grid-template-columns: 1fr;
  }

  .feed-head {
    flex-direction: column;
  }

  .filters {
    justify-content: flex-start;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scan-form,
  .grid-stats {
    grid-template-columns: 1fr;
  }

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