:root {
  --bg: #0b0e14;
  --panel: #131823;
  --panel-2: #1a2030;
  --line: #232b3d;
  --text: #e6ebf5;
  --muted: #8b97ae;
  --accent: #4ea1ff;
  --green: #3fd68b;
  --red: #ff5f6d;
  --amber: #ffb648;
  --star: #ffd24a;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 20px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  max-width: 1500px;
  margin-inline: auto;
}

h1, h2 { margin: 0; }
h1 { font-size: 19px; letter-spacing: -0.01em; }
h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }

.sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-size: 28px; }

.statuses { display: flex; gap: 8px; flex-wrap: wrap; }

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  color: var(--muted);
}
.status b { color: var(--text); font-weight: 600; }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.connected { background: var(--green); box-shadow: 0 0 0 3px rgb(63 214 139 / 0.15); }
.dot.connecting { background: var(--amber); }
.dot.error { background: var(--red); box-shadow: 0 0 0 3px rgb(255 95 109 / 0.15); }
.dot.disabled { background: #4a5468; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

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

.count { color: var(--muted); font-size: 12.5px; }

.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 16px;
  align-items: start;
}
.boards .panel { margin-bottom: 0; }

.rows { max-height: 620px; overflow-y: auto; }

.row {
  display: grid;
  grid-template-columns: 34px 34px 1fr auto auto;
  gap: 11px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--panel-2); }
.row.watched { background: rgb(255 210 74 / 0.07); box-shadow: inset 3px 0 0 var(--star); }
.row.fresh { animation: flash 2.4s ease-out; }
/* Пропал из выдачи, но сессия ещё жива — приглушаем, чтобы не путать с активными. */
.row.gone { opacity: 0.45; }
.row.gone .timer { color: var(--amber); }

@keyframes flash {
  from { background: rgb(78 161 255 / 0.28); }
  to { background: transparent; }
}

.rank {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.rank.top { color: var(--accent); font-weight: 700; }

.logo {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
}

.meta { min-width: 0; }
.sym {
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sym a { color: inherit; text-decoration: none; }
.sym a:hover { color: var(--accent); }
.net {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border, #333);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 14px;
}
.nm {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nums { text-align: right; font-variant-numeric: tabular-nums; }
.mcap { font-size: 12.5px; }
.chg { font-size: 11.5px; color: var(--muted); }
.chg.up { color: var(--green); }
.chg.down { color: var(--red); }

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 13px;
  text-align: right;
  min-width: 82px;
  color: var(--green);
}
.timer small { display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); }

.star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: #3d4759;
  padding: 0 2px;
  line-height: 1;
}
.star.on { color: var(--star); }

/* ── Мои токены ─────────────────────────────────────────────────────────── */

.watch-form { display: flex; gap: 8px; flex-wrap: wrap; }
.watch-form input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
}
#watch-mint { width: 330px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.watch-form input:focus { outline: none; border-color: var(--accent); }
.watch-form button {
  background: var(--accent);
  color: #04121f;
  border: none;
  border-radius: 8px;
  padding: 7px 15px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
}
.watch-form button:hover { filter: brightness(1.1); }

.watchlist { display: flex; flex-direction: column; }

.watch-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.watch-row:last-child { border-bottom: none; }
.watch-mint {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
}
.watch-label { font-weight: 650; margin-bottom: 2px; }

.badges { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge.live {
  border-color: rgb(63 214 139 / 0.4);
  background: rgb(63 214 139 / 0.12);
  color: var(--green);
  font-weight: 650;
}

.drop {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 12px;
}
.drop:hover { color: var(--red); border-color: var(--red); }

/* ── Журнал ─────────────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 6px; }
.tab {
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.tab.is-active { background: var(--bg); color: var(--text); border-color: var(--line); font-weight: 600; }

.only-mine { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; cursor: pointer; }

.log-body { max-height: 460px; overflow-y: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel-2);
}
td { padding: 9px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.watched-row td { background: rgb(255 210 74 / 0.06); }
.num { font-variant-numeric: tabular-nums; }

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  white-space: nowrap;
}
.tag.enter { background: rgb(63 214 139 / 0.15); color: var(--green); }
.tag.exit { background: rgb(255 95 109 / 0.15); color: var(--red); }
.tag.rank_up { background: rgb(78 161 255 / 0.15); color: var(--accent); }
.tag.rank_down { background: rgb(255 182 72 / 0.15); color: var(--amber); }
.tag.resume { background: var(--panel-2); }

.empty { padding: 26px 16px; color: var(--muted); text-align: center; font-size: 13px; }
.empty code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--text);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b3448; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a465e; }

@media (max-width: 720px) {
  body { padding: 12px; }
  #watch-mint { width: 100%; }
  .row { grid-template-columns: 28px 28px 1fr auto; }
  .nums { display: none; }
}
