:root {
  color-scheme: dark;
  --bg: #070907;
  --panel: #0c0f0c;
  --panel-2: #101410;
  --line: #1d221c;
  --line-2: #262d24;
  --muted: #6b7468;
  --text: #d8dfd4;
  --green: #86ff6a;
  --red: #ff776f;
  --amber: #ffd166;
  --cyan: #72d8ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
a { color: var(--amber); text-decoration: none; }
a:hover, a:focus-visible { color: var(--text); text-decoration: underline; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* ── radar bar: tek satır durum ─────────────────────────────────────── */
.radar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 40px; padding: 7px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.radar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.radar-right { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; letter-spacing: .04em; white-space: nowrap; }
.radar-right b { color: var(--text); }
.radar-right .coins { max-width: 380px; overflow: hidden; text-overflow: ellipsis; color: var(--cyan); }
.paper { padding: 3px 6px; border: 1px solid var(--line-2); color: var(--amber); font-size: 9px; letter-spacing: .1em; }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px #ffd16688; }
.status.live .pulse, .status.live { color: var(--green); }
.status.live .pulse { background: var(--green); box-shadow: 0 0 10px #86ff6a88; }
.status.error .pulse, .status.error { color: var(--red); }
.status.error .pulse { background: var(--red); box-shadow: 0 0 10px #ff776f88; }

/* ── ana düzen ──────────────────────────────────────────────────────── */
main { width: min(1760px, 100%); min-width: 0; margin: 0 auto; padding: 14px 20px 30px; }
.eyebrow { margin: 0 0 6px; color: var(--amber); font-size: 9px; letter-spacing: .1em; }

  .eyebrow.weights-eyebrow { margin-top: 14px; }
h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }

/* ── araştırma paneli: skor doğrulama + geçmiş ──────────────────────── */
.research { margin-bottom: 10px; border: 1px solid var(--line); background: var(--panel); }
.research-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 14px; }
.bt-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.verdict { font-weight: 700; letter-spacing: .05em; }
.verdict.ok { color: var(--green); }
.verdict.weak { color: var(--amber); }
.verdict.no { color: var(--red); }
.research-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.research-detail > section { min-width: 0; padding: 13px 14px; background: var(--panel); }
.research-detail .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 14px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #181d17; color: var(--muted); }
.kv b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.kv b.up { color: var(--green); }
.kv b.down { color: var(--red); }
.kv b.warn { color: var(--amber); }
.hist-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hist-chip { padding: 3px 7px; border: 1px solid var(--line-2); color: var(--muted); font-size: 10px; }
.hist-chip b { color: var(--text); margin-right: 4px; }
.hist-chip.candidate b, .hist-chip.uygun b { color: var(--green); }
.hist-chip.early_candidate b, .hist-chip.izle b { color: var(--cyan); }
.hist-chip.collecting b { color: var(--amber); }
.tier-table { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 11px; }
.tier-table td { padding: 3px 8px 3px 0; border-bottom: 1px dashed #181d17; }
.tier-table td:first-child { text-align: left; }

/* ── filtre kontrolleri ─────────────────────────────────────────────── */
.controls {
  display: grid; grid-template-columns: minmax(220px, 1.6fr) auto repeat(4, minmax(118px, 1fr)) auto auto;
  align-items: end; gap: 7px; margin-bottom: 12px; padding: 11px;
  border: 1px solid var(--line); background: var(--panel);
}
.controls label { display: grid; gap: 5px; min-width: 0; }
.controls label > span { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.controls input, .controls select, .control-button {
  width: 100%; height: 33px; padding: 0 10px; border: 1px solid #2b322a;
  border-radius: 0; background: var(--bg); color: var(--text);
}
.controls select { cursor: pointer; }
.control-button { width: auto; color: var(--cyan); cursor: pointer; white-space: nowrap; }
.control-button:hover { border-color: var(--cyan); }
.control-button.secondary { color: var(--muted); }
.controls output { grid-column: 1 / -1; min-height: 13px; color: var(--muted); font-size: 9px; letter-spacing: .04em; }

/* ── çalışma alanı: aday listesi + tape ─────────────────────────────── */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 322px; gap: 12px; }
.ledger, .tape, .detail { border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.section-head > span { color: var(--muted); font-size: 11px; }
.table-wrap { width: 100%; overflow: auto; max-height: 600px; min-height: 300px; }
.section-head .eyebrow { margin-bottom: 2px; }
table { width: 100%; min-width: 1600px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.detail table, .sim-table { min-width: 0; }
thead { position: sticky; top: 0; z-index: 2; background: #0e120e; }
th, td { padding: 7px 9px; border-bottom: 1px solid #151a14; text-align: right; white-space: nowrap; }
th { color: var(--muted); font-size: 9px; letter-spacing: .05em; font-weight: 500; }
.sort-button { padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; letter-spacing: inherit; }
.sort-button:hover, .sort-button.active { color: var(--cyan); }
.sort-button.active::after { content: " " attr(data-direction); }
th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5) { text-align: left; }
.group-head th { padding-block: 6px; text-align: center; color: var(--amber); border-bottom-color: var(--line); }
.group-head th:last-child { color: var(--cyan); }
tbody tr:hover { background: var(--panel-2); }
tbody tr { cursor: pointer; }
tbody tr.selected { background: #131d12; }
tbody tr.fit-uygun td.fit { color: var(--green); font-weight: 700; }
tbody tr.fit-izle td.fit { color: var(--amber); }
tbody tr.fit-degil td.fit { color: var(--red); }
tbody tr.fit-uygun { box-shadow: inset 2px 0 0 var(--green); }
tbody tr.fit-izle, tbody tr.fit-degil { box-shadow: inset 2px 0 0 var(--line); }
tbody tr.fit-uygun:hover, tbody tr.fit-uygun.selected { background: #0f1710; }
.score { color: var(--cyan); font-weight: 700; }
.wallet { color: var(--text); }
.wallet.copyable { cursor: copy; }
.wallet.copyable:hover { text-decoration: underline dotted; }
.wallet.copied { color: var(--green); }
.tier { font-size: 9px; letter-spacing: .04em; }
.tier.candidate { color: var(--green); }
.tier.early_candidate { color: var(--cyan); }
.tier.scalper, .tier.market_maker, .tier.negative, .tier.vault { color: var(--red); }
.tier.collecting { color: var(--amber); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.pf-ok { color: var(--green); }
.empty { padding: 40px; text-align: center !important; color: var(--muted); cursor: default; }
.fit-tag, .tier-tag { font-size: 9px; letter-spacing: .04em; }

/* ── tape ───────────────────────────────────────────────────────────── */
.tape ol { list-style: none; margin: 0; padding: 0; max-height: 600px; overflow: auto; }
.tape li { display: grid; gap: 4px; padding: 10px 12px; border-bottom: 1px solid #151a14; cursor: pointer; }
.tape li:hover { background: var(--panel-2); }
.tape .row { display: flex; justify-content: space-between; gap: 8px; }
.tape .coin { color: var(--cyan); }
.tape .buy { color: var(--green); }
.tape .sell { color: var(--red); }
.tape .when { font-size: 10px; }

/* ── detay paneli ───────────────────────────────────────────────────── */
.detail { margin-top: 12px; }
.detail-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.badge { padding: 3px 8px; border: 1px solid var(--line-2); color: var(--muted); font-size: 10px; }
.badge b { margin-right: 4px; }
.badge.uygun, .badge.candidate { border-color: #33501f; color: var(--green); }
.badge.izle, .badge.early_candidate { border-color: #52471a; color: var(--amber); }
.badge.degil, .badge.negative, .badge.scalper, .badge.market_maker, .badge.vault { border-color: #54301f; color: var(--red); }
.badge.collecting { border-color: #52471a; color: var(--amber); }

  .algo-lbl.algo { color: var(--red); border-color: #54301f; }
  .algo-lbl.karisik { color: var(--amber); }
  .algo-lbl.manuel { color: var(--green); }
.detail-actions { display: flex; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); list-style: none; }
.chips li { padding: 4px 8px; border: 1px solid var(--line-2); color: var(--muted); font-size: 10px; }
  .chips li.block { color: var(--red); border-color: #54301f; }
  .chips li.top { color: var(--green); border-color: #33501f; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.detail-grid > section { padding: 13px 14px; background: var(--panel); min-width: 0; }
.detail-grid .table-wrap { max-height: 260px; min-height: 70px; }
.detail-address { margin: 7px 0 0; overflow-wrap: anywhere; font-size: 11px; cursor: pointer; }
.detail-address:hover { color: var(--cyan); }

/* simülasyon bloğu */
.sim-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; }
.frag { font-weight: 700; letter-spacing: .04em; }
.frag.robust { color: var(--green); }
.frag.thin { color: var(--amber); }
.frag.fragile { color: var(--red); }
.frag.no_edge { color: var(--muted); }
.sim-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.sim-table td { padding: 4px 6px; border-bottom: 1px dashed #181d17; }
.sim-table tr.ok td { color: var(--green); }
.sim-table tr.kill td { color: var(--red); }

/* ── alt bilgi ──────────────────────────────────────────────────────── */
.foot-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.55; background: var(--panel); }
.foot-strip ul { margin: 0; padding: 0; list-style: none; }
.foot-strip li::before { content: "▸ "; color: var(--amber); }

@media (max-width: 1100px) {
  .workspace, .detail-grid, .research-detail { grid-template-columns: 1fr; }
  .tape ol { max-height: 260px; }
}
@media (max-width: 900px) {
  .radar { align-items: flex-start; flex-direction: column; padding-block: 10px; }
  .radar-right { flex-wrap: wrap; row-gap: 6px; }
  main { padding: 12px 12px 26px; }
  .metrics-cards { grid-template-columns: repeat(2, 1fr); }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls .search-control { grid-column: 1 / -1; }
  .controls output { grid-column: 1 / -1; }
  .table-wrap { max-height: none; }
}