:root {
  --bg: #0e1116;
  --panel: #151a21;
  --panel2: #1b212a;
  --line: #262d38;
  --text: #e7e9ec;
  --muted: #8b94a3;
  --green: #26b67f;
  --red: #ee5d6c;
  --amber: #f3a72e;
  --blue: #5b93ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
b { font-weight: 600; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.top {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-size: 17px; font-weight: 600; }
.brand .muted { font-size: 13px; font-weight: 400; margin-left: 8px; }
.status { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--muted); }
.status b { color: var(--text); }

.tabs { display: flex; gap: 4px; padding: 8px 12px 0; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs button {
  background: none; border: 0; color: var(--muted); padding: 9px 12px; font: inherit; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--blue); }

main { padding: 14px 16px 40px; max-width: 1400px; margin: 0 auto; }
h2 { font-size: 15px; margin: 22px 0 8px; font-weight: 600; }
h2:first-child { margin-top: 4px; }
.empty { color: var(--muted); padding: 18px; background: var(--panel); border: 1px dashed var(--line); border-radius: 8px; }
.note { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 13px; color: var(--muted); }
.chip b { color: var(--text); }

.tbl { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--panel2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel2); }
tr.click { cursor: pointer; }
td.r, th.r { text-align: right; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.pill.buy { color: var(--green); border-color: rgba(38, 182, 127, .4); background: rgba(38, 182, 127, .1); }
.pill.sell { color: var(--red); border-color: rgba(238, 93, 108, .4); background: rgba(238, 93, 108, .1); }
.pill.ok { color: var(--green); background: rgba(38, 182, 127, .12); }
.pill.hot { color: #111; background: var(--amber); }
.pill.bad { color: #fff; background: var(--red); }
.pill.ban { color: var(--muted); border-color: var(--line); }
.pill.live { color: #fff; background: var(--green); }
.pill.dead { color: #fff; background: var(--red); }
.pos { color: var(--green); }
.neg { color: var(--red); }

.bar { position: relative; height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; min-width: 70px; margin-top: 4px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 3px; }
.bar.full > i { background: var(--amber); }

button.act {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
button.act:hover { border-color: var(--blue); }
input.search {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 13px; min-width: 240px;
}
input.search:focus { outline: none; border-color: var(--blue); }
label.toggle { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

.feed { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.feed .row { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.feed .row:last-child { border-bottom: 0; }
.feed .t { color: var(--muted); min-width: 64px; }
.feed .s { min-width: 110px; font-weight: 600; }
.feed .row.hot { background: rgba(243, 167, 46, .08); }
.feed .row.bad { background: rgba(238, 93, 108, .08); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.kv { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-size: 18px; font-weight: 600; margin-top: 2px; }

.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal[hidden] { display: none; }
.modal .card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-width: 720px; width: 100%; max-height: 85vh; overflow: auto; padding: 16px 18px; position: relative; }
.modal .close { position: absolute; right: 10px; top: 6px; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.chrono { list-style: none; padding: 0; margin: 10px 0 0; }
.chrono li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chrono li:last-child { border-bottom: 0; }
.chrono .t { color: var(--muted); min-width: 72px; }

button.act.danger { border-color: rgba(238, 93, 108, .5); color: #fff; background: rgba(238, 93, 108, .18); }
button.act.danger:hover { border-color: var(--red); }
.mt-form {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; align-items: end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
}
.mt-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.mt-form input {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 8px; font: inherit; font-size: 14px; min-width: 0; width: 100%;
}
.mt-form input:focus { outline: none; border-color: var(--blue); }
.mt-tps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mt-btns { display: flex; gap: 8px; }
.mt-btns button { padding: 7px 14px; }
.mt-res { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 10px; }
.mt-res.ok { border-color: rgba(38, 182, 127, .5); }
.mt-res.bad { border-color: rgba(238, 93, 108, .6); }
.mt-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel); }
.mt-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.mt-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.mt-card td { white-space: normal; }
.rt-out { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Consolas, monospace; margin: 8px 0 0; color: var(--text); }

.top #logout { margin-left: auto; }
.login { max-width: 360px; margin: 14vh auto 0; padding: 0 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card label { font-size: 13px; color: var(--muted); }
.login-card input {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 10px; font: inherit; font-size: 16px;
}
.login-card input:focus { outline: none; border-color: var(--blue); }
.login-card button { padding: 9px 14px; font-size: 15px; }
.login-card .neg { min-height: 1.2em; margin: 0; font-size: 13px; }

@media (max-width: 640px) {
  main { padding: 10px 10px 30px; }
  .top { padding: 10px; }
  th, td { padding: 7px 8px; }
}
