:root {
  --rh-green: #c6ff00;
  --terminal-green: #00ff66;
  --panel-blue: #0346c9;
  --panel-grey: #c7cbcc;
  --black: #050505;
  --red: #ff4040;
  --teal: #00d1c1;
  --yellow: #ffda46;
  --border-dark: #7f8789;
  --mono: "Courier New", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  font-size: 12px;
}

@media (min-width: 900px) {
  body.screener-page {
    zoom: .75;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  color: #060606;
  background:
    radial-gradient(circle at 50% 0%, rgba(184,255,0,.13), transparent 32rem),
    linear-gradient(180deg, #0a0d0a 0, #1a1d1c 3.2rem, #aeb3b4 3.25rem, #c9cdce 100%);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.ticker {
  height: 32px;
  overflow: hidden;
  background: #030303;
  color: var(--terminal-green);
  border-bottom: 2px solid #ddd;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-weight: 900;
  text-shadow: 0 0 8px rgba(0,255,102,.85);
  position: relative;
  z-index: 3;
}

.ticker-track {
  display: flex;
  min-width: max-content;
  gap: 2rem;
  animation: ticker 30s linear infinite;
}

.ticker-track span { white-space: nowrap; }
@keyframes ticker { to { transform: translateX(-50%); } }

.screener-shell {
  width: min(1868px, calc(100% - 52px));
  margin: 22px auto 12px;
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.window {
  background: var(--panel-grey);
  border: 2px solid var(--border-dark);
  border-top-color: #f3f6f7;
  border-left-color: #f3f6f7;
  box-shadow: 3px 3px 0 rgba(0,0,0,.28);
}

.titlebar {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 4px 10px;
  background: linear-gradient(90deg, #092b94, #0e54d0 58%, #1b74ef);
  color: #fff;
  border-bottom: 2px solid #0b1c53;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}

.titlebar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  gap: 3px;
}

.window-controls i {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  background: #d5dadc;
  border: 2px solid #6f7779;
  border-top-color: #fff;
  border-left-color: #fff;
  color: #000;
  font-style: normal;
  line-height: 1;
}

.window-controls i:nth-child(1)::before { content: "-"; }
.window-controls i:nth-child(2)::before { content: "[]"; font-size: 9px; }
.window-controls i:nth-child(3)::before { content: "X"; font-size: 11px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 90px;
  overflow: hidden;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(198,255,0,.65));
}

.brand-lockup h1 {
  margin: 0;
  color: #101410;
  font-family: var(--mono);
  font-size: clamp(1.5rem, 1.7vw, 2.25rem);
  letter-spacing: .02em;
  text-shadow: none;
}

.brand-lockup p {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-weight: 800;
  color: #123717;
}

.top-actions, .detail-actions, .portfolio-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.live-pill, .trade-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-weight: 900;
}

.live-pill b, .live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--terminal-green);
  box-shadow: 0 0 12px var(--terminal-green);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: .45; transform: scale(.86); }
}

.terminal-button, .sort-tabs button, .mini-action, .filter-tabs button, .chart-tabs button, .slippage-row button, .fee-grid button, .swap-tabs button {
  border: 2px solid #5a8200;
  border-top-color: #eaff8a;
  border-left-color: #eaff8a;
  background: var(--rh-green);
  color: #050c02;
  box-shadow: 2px 2px 0 rgba(0,0,0,.38);
  font-family: var(--mono);
  font-weight: 1000;
  min-height: 30px;
  padding: .5rem .72rem;
  cursor: pointer;
}

.terminal-button.black, .filter-tabs button, .chart-tabs button {
  background: #050505;
  color: #fff;
  border-color: #202020;
  border-top-color: #777;
  border-left-color: #777;
}

.terminal-button.full { width: 100%; }
.terminal-button.disabled, button:disabled { opacity: .58; cursor: not-allowed; }

.mini-action {
  min-height: 26px;
  padding: .22rem .48rem;
  font-size: .78rem;
}

.controls-body {
  padding: 12px;
  display: grid;
  gap: 11px;
}

.sort-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sort-tabs button.active, .filter-tabs button.active, .chart-tabs button.active, .swap-tabs button.active, .slippage-row button.active {
  background: #050505;
  color: var(--rh-green);
}

.search-wrap {
  display: grid;
  gap: 5px;
  font-family: var(--mono);
  font-weight: 900;
}

.search-wrap input, .settings-body input, .settings-body select, .swap-box input {
  width: 100%;
  border: 2px solid #8e9699;
  border-top-color: #fff;
  border-left-color: #fff;
  background: #fff;
  color: #000;
  padding: .58rem .66rem;
  font-family: var(--mono);
}

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

.stat-card {
  background: #070a07;
  color: #fff;
  border: 2px solid #111;
  border-top-color: #343a34;
  border-left-color: #343a34;
  padding: 10px;
  font-family: var(--mono);
}

.stat-card span {
  display: block;
  color: var(--rh-green);
  font-size: .78rem;
  font-weight: 900;
}

.stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 1.1rem;
}

.main-grid {
  --work-panel-height: clamp(1040px, 112vh, 1180px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(430px, 3fr);
  gap: 10px;
  align-items: start;
}

.side-stack {
  display: grid;
  align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
  height: var(--work-panel-height);
}

.trades-window {
  position: static;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: var(--work-panel-height);
  min-height: 0;
}

.token-window {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: var(--work-panel-height);
  min-height: 0;
}

.table-head, .token-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.55fr) minmax(150px, .8fr) minmax(110px, .52fr) minmax(86px, .42fr);
  align-items: center;
}

.table-head {
  background: linear-gradient(180deg, #0f5fe2, #07379c);
  color: #fff;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 900;
}

.token-list {
  display: grid;
  align-content: start;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  background: #e8eeee;
}

.token-row {
  border-bottom: 1px solid #b4babc;
  background: #f5f7f7;
  padding: 10px 12px;
  cursor: default;
  width: 100%;
  color: #060606;
  text-align: left;
  min-height: 72px;
  transition: background .12s ease;
}

.token-row:nth-child(even) { background: #e8eeee; }
.token-row:hover { background: #fff; }

.token-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.avatar {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #f7ff8f, var(--rh-green) 52%, #5e8d00);
  border: 1px solid #6c9e00;
  font-family: var(--mono);
  font-weight: 1000;
  color: #061005;
  overflow: hidden;
}

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

.avatar.big {
  width: 58px;
  height: 58px;
  font-size: 1.6rem;
}

.symbol {
  font-family: var(--mono);
  font-weight: 1000;
  font-size: 1.12rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.token-name {
  color: #465050;
  font-size: .95rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.badge {
  background: #071a08;
  color: var(--terminal-green);
  border: 1px solid #1b451c;
  padding: 1px 4px;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 900;
}

.price-cell, .number-cell {
  font-family: var(--mono);
  font-weight: 900;
  font-size: 1.02rem;
  line-height: 1.28;
}

.muted { color: #596162; }
.positive { color: #008a34; }
.negative { color: var(--red); }
.teal { color: var(--teal); }

.trade-status {
  width: calc(100% - 20px);
  margin: 8px 10px;
  justify-content: space-between;
}

.trade-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 0 10px 10px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.trade-row {
  display: grid;
  grid-template-columns: 46px 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  background: #10151d;
  color: #fff;
  border: 1px solid #242d38;
  border-left: 3px solid #2c3742;
  padding: 9px 10px;
  font-family: var(--mono);
  min-height: 62px;
}

.trade-row:hover {
  background: #151d27;
}

.trade-side {
  display: grid;
  place-items: center;
  min-height: 26px;
  border-radius: 4px;
  background: rgba(0,209,193,.13);
  color: var(--teal);
  font-size: .78rem;
  font-weight: 1000;
}

.trade-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #f7ff8f, var(--rh-green) 55%, #5e8d00);
  border: 1px solid rgba(198,255,0,.58);
  color: #061005;
  font-weight: 1000;
}

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

.trade-row.sell {
  border-left-color: var(--red);
}

.trade-row.buy {
  border-left-color: var(--teal);
}

.trade-row.sell .trade-side {
  background: rgba(255,64,64,.14);
  color: var(--red);
}

.trade-row.swap .trade-side {
  background: rgba(255,218,70,.14);
  color: var(--yellow);
}

.trade-token {
  min-width: 0;
}

.trade-row strong {
  display: block;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-row small {
  display: block;
  margin-top: 3px;
  color: #9faab6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-value {
  color: var(--teal);
  font-size: 1rem;
  white-space: nowrap;
}

.trade-row.sell .trade-value {
  color: var(--red);
}

.settings-body {
  padding: 12px;
  display: grid;
  gap: 9px;
  font-family: var(--mono);
}

.settings-body label {
  display: grid;
  gap: 5px;
  font-weight: 900;
}

.settings-body small {
  line-height: 1.35;
  color: #2d3636;
}

.detail-view, .portfolio-view {
  display: block;
}

.hidden { display: none !important; }

.detail-window {
  padding-bottom: 10px;
}

.detail-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.detail-token {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-token h2, .portfolio-head h2 {
  margin: 0;
  font-family: var(--mono);
}

.detail-token p, .portfolio-head p {
  margin: 4px 0 0;
  color: #3d4646;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 10px;
  padding: 0 12px 10px;
}

.terminal-panel {
  background: #050805;
  color: #fff;
  border: 2px solid #202820;
  padding: 10px;
}

.swap-box {
  display: grid;
  gap: 8px;
  font-family: var(--mono);
}

.swap-tabs, .slippage-row, .fee-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.slippage-row { grid-template-columns: repeat(4, 1fr); }
.fee-grid { grid-template-columns: repeat(3, 1fr); }

.swap-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #172117;
  padding-top: 8px;
}

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

.contract-copy {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 2px solid #a6abad;
  padding: 7px;
  font-family: var(--mono);
  font-weight: 900;
}

.contract-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contract-copy button {
  margin-left: auto;
}

.chart-window, .tx-window, .holders-window {
  margin: 0 12px 10px;
}

.chart-tabs, .filter-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.chart-tabs button, .filter-tabs button {
  padding: .25rem .45rem;
  font-size: .75rem;
}

.chart-box {
  min-height: 170px;
  display: grid;
  place-items: center;
  gap: 8px;
  background: #060906;
  color: #fff;
  padding: 14px;
  text-align: center;
}

.tx-table, .holders-table, .portfolio-table {
  padding: 8px;
  overflow-x: auto;
  font-family: var(--mono);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-table th {
  background: #0c45be;
  color: #fff;
  text-align: left;
}

.data-table th, .data-table td {
  border: 1px solid #b8bfc1;
  padding: 7px;
  white-space: nowrap;
}

.data-table tr:nth-child(even) td {
  background: #e9eeee;
}

.holders-window .titlebar a {
  color: #fff;
  text-decoration: underline;
  font-size: .76rem;
}

.portfolio-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.empty-state {
  padding: 14px;
  font-family: var(--mono);
  color: #404848;
}

.screener-footer {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px min(5vw, 72px);
  background: #030603;
  color: #e9f6ea;
  border-top: 2px solid #1d251d;
}

.screener-footer img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.screener-footer p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .main-grid, .detail-grid {
    grid-template-columns: 1fr;
  }

  .trades-window {
    position: static;
    min-height: auto;
  }

  .token-window {
    min-height: auto;
    height: auto;
  }

  .trade-list {
    height: auto;
    max-height: 620px;
    min-height: 0;
  }

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

@media (max-width: 760px) {
  html {
    font-size: 13px;
  }

  .screener-shell {
    width: calc(100% - 14px);
    margin: 8px auto;
  }

  .topbar, .portfolio-head, .detail-top {
    grid-template-columns: 1fr;
    display: grid;
  }

  .table-head { display: none; }

  .token-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sort-tabs, .top-actions, .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

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