:root {
  --bg: #070b10;
  --bg-soft: #0c1219;
  --panel: #0f1720;
  --panel-2: #131d27;
  --line: #1e2b36;
  --text: #e7eef5;
  --dim: #8aa0b4;
  --accent: #3ee6b0;
  --accent-2: #7aa7ff;
  --danger: #ff5d6c;
  --warn: #ffb454;
  --ok: #46d39a;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: radial-gradient(1200px 600px at 80% -10%, #0d2b2b 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(62, 230, 176, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(62, 230, 176, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(60% 50% at 50% 0%, #000 0%, transparent 80%);
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 24px 0 64px;
  flex: 1;
}

/* ------------------------------- top bar ------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  background: rgba(7, 11, 16, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.2px; }
.brand-sub { display: block; font-size: 11px; color: var(--dim); letter-spacing: 0.4px; text-transform: uppercase; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(62, 230, 176, 0.12), inset 0 0 0 6px rgba(62, 230, 176, 0.18);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px rgba(62, 230, 176, 0.8);
}

.tabs { display: flex; gap: 4px; margin-left: 12px; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.tab:hover { color: var(--text); border-color: var(--line); }
.tab.is-active { color: var(--text); background: var(--panel-2); border-color: var(--line); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ghost-link { color: var(--dim); text-decoration: none; font-size: 13px; }
.ghost-link:hover { color: var(--accent); }

.pill {
  font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim);
}
.pill-ok { color: #062018; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.pill-bad { color: #2a0509; background: var(--danger); border-color: var(--danger); font-weight: 700; }
.pill-muted { color: var(--dim); }

/* -------------------------------- views -------------------------------- */
.view { display: none; animation: fade 0.25s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero { padding: 34px 0 10px; text-align: center; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 10px; letter-spacing: -0.8px; }
.lede { color: var(--dim); max-width: 720px; margin: 0 auto 22px; }

.scan-form { display: flex; gap: 10px; max-width: 760px; margin: 0 auto; }
.scan-form input {
  flex: 1; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 14px 16px; border-radius: 12px; font-family: var(--mono); font-size: 13px;
}
.scan-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62, 230, 176, 0.15); }

button { font-family: inherit; }
.primary {
  background: linear-gradient(180deg, #4af0bb, #2fd39c); color: #04140f; font-weight: 800;
  border: 0; padding: 14px 22px; border-radius: 12px; cursor: pointer; font-size: 14px;
}
.primary:hover { filter: brightness(1.06); }
.primary:disabled { opacity: 0.55; cursor: progress; }
.secondary {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600;
}
.secondary:hover { border-color: var(--accent); }

.scan-hints { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--dim);
  border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 12px; font-family: var(--mono);
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.hint { color: var(--dim); font-size: 12px; }

/* -------------------------------- panels ------------------------------- */
.panel {
  background: linear-gradient(180deg, rgba(19, 29, 39, 0.9), rgba(15, 23, 32, 0.9));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  margin: 18px 0;
}
.panel.tight { padding: 12px 14px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; letter-spacing: 0.2px; }
.panel h3 { font-size: 13px; margin: 16px 0 8px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.6px; }

.empty { text-align: center; color: var(--dim); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.mt { margin-top: 22px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.is-hidden { display: none !important; }

/* ------------------------------- progress ------------------------------ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.steps li {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--dim);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
.steps li .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: #2a3a48; flex: none; }
.steps li.running { color: var(--text); border-color: #27526b; }
.steps li.running .dot { background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); animation: pulse 1.2s infinite; }
.steps li.ok { color: var(--text); }
.steps li.ok .dot { background: var(--ok); }
.steps li.partial .dot { background: var(--warn); }
.steps li.failed .dot { background: var(--danger); }
.steps li.failed { color: #ffd8dc; border-color: #4b2027; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* -------------------------------- report ------------------------------- */
.report { margin-top: 22px; }

.report-head {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start;
  background: radial-gradient(600px 200px at 0% 0%, rgba(62, 230, 176, 0.08), transparent 70%), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.token-title { font-size: 24px; margin: 0; letter-spacing: -0.4px; }
.token-symbol { color: var(--accent); font-family: var(--mono); font-size: 13px; }
.token-mint { margin-top: 4px; }
.copy-btn { background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 6px; padding: 1px 7px; cursor: pointer; font-size: 11px; margin-left: 6px; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.verdict-box { text-align: right; min-width: 190px; }
.verdict { font-size: 26px; font-weight: 800; letter-spacing: 0.5px; }
.verdict.CLEAN { color: var(--ok); }
.verdict.OK { color: var(--accent-2); }
.verdict.RISKY { color: var(--warn); }
.verdict.DANGER { color: var(--danger); }
.verdict.SIN_SCORE { color: var(--dim); }
.score-big { font-family: var(--mono); font-size: 13px; color: var(--dim); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim); background: var(--bg-soft);
}
.tag.good { color: var(--ok); border-color: #1d4b3a; }
.tag.bad { color: #ffb3ba; border-color: #4b2027; background: #1a0d10; }
.tag.warn { color: var(--warn); border-color: #4a3417; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .report-head { grid-template-columns: 1fr; } .verdict-box { text-align: left; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; font-family: var(--mono); word-break: break-all; }

.components { display: grid; gap: 10px; }
.component-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; font-size: 13px; }
.component-bar { grid-column: 1 / -1; height: 7px; background: #16232e; border-radius: 999px; overflow: hidden; }
.component-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; }
.component-bar.missing span { width: 100%; background: repeating-linear-gradient(45deg, #2a3a48 0 6px, #1a2733 6px 12px); }
.component-detail { grid-column: 1 / -1; color: var(--dim); font-size: 11.5px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-soft); }
tr:last-child td { border-bottom: 0; }
tr.excluded td { opacity: 0.55; }
tr.excluded td:last-child { color: var(--warn); font-size: 11px; }
td.num, th.num { text-align: right; font-family: var(--mono); }
td.addr { font-family: var(--mono); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.risk-list { display: grid; gap: 8px; }
.risk {
  display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: start;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft);
}
.sev { font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; text-align: center; font-weight: 700; }
.sev.critical { background: #3a0d13; color: #ff8d98; }
.sev.high { background: #3a1a0d; color: #ffb08d; }
.sev.medium { background: #37290d; color: var(--warn); }
.sev.low, .sev.info { background: #12202a; color: var(--dim); }
.risk strong { display: block; font-size: 13px; }
.risk p { margin: 2px 0 0; color: var(--dim); font-size: 12px; }

canvas.graph { width: 100%; height: 340px; display: block; border: 1px solid var(--line); border-radius: 12px; background: #081018; }

.metric { display: grid; gap: 2px; }
.metric .label { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.metric .value { font-family: var(--mono); font-size: 18px; }

.radar-list { display: grid; gap: 10px; }
.radar-item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel);
}
.radar-item h3 { margin: 0; font-size: 14px; }
.status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.status.passed_filters { color: var(--ok); border-color: #1d4b3a; }
.status.held_by_risk { color: var(--danger); border-color: #4b2027; }
.status.no_liquidity { color: var(--warn); border-color: #4a3417; }
.status.detected { color: var(--accent-2); border-color: #24384f; }

.input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 9px 12px; border-radius: 10px; font-size: 13px; font-family: inherit;
}
.small-input { max-width: 260px; }
.input:focus { outline: none; border-color: var(--accent); }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0 6px; }
.section-head h1 { font-size: 24px; margin: 0; }

.ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ops-grid .panel { margin: 0; }

.footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 24px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.evidence-class { font-size: 10px; letter-spacing: 0.4px; color: var(--dim); font-family: var(--mono); }
.notice { border-left: 3px solid var(--warn); padding: 6px 12px; color: var(--dim); font-size: 12px; background: rgba(255, 180, 84, 0.05); }
