:root {
  --bg: #0e1116; --panel: #161b22; --line: #2a313c; --text: #e6edf3; --muted: #8b949e;
  --up: #3ddc84; --down: #ff5252; --head: #ff3df0; --title: #ffe600;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#tabs { display: flex; gap: 4px; flex-wrap: wrap; }
#tabs button { background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 6px; cursor: pointer; font: inherit; }
#tabs button:hover { color: var(--text); }
#tabs button.active { background: var(--bg); color: var(--title); font-weight: 600; }
.status { display: flex; align-items: center; gap: 12px; }
.live { font-size: 12px; color: var(--muted); }
.live.ok { color: var(--up); }
.live.err { color: var(--down); }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
.summary { display: flex; align-items: stretch; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.perf-title { color: var(--title); font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.perf-badge { display: inline-block; margin-left: 12px; padding: 2px 14px; border-radius: 4px; background: #14301f; font-weight: 700; font-size: 24px; }
.kv { display: grid; grid-template-columns: auto auto; gap: 2px 20px; margin-top: 8px; font-size: 13px; }
.kv dt { color: var(--muted); text-transform: uppercase; font-size: 11px; font-weight: 600; align-self: center; }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.kv .pv { color: var(--head); font-weight: 700; }
h2 { font-size: 20px; margin: 28px 0 8px; display: flex; align-items: center; gap: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { color: var(--head); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; text-align: center; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1c232d; }
td.ticker { font-weight: 700; }
td.left, th.left { text-align: left; }
td.tp { color: var(--head); }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
.logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; background: #fff2; vertical-align: middle; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.btn { background: #238636; color: #fff; border: 0; padding: 7px 14px; border-radius: 6px; cursor: pointer; font: inherit; }
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.danger { background: #b62324; }
.row-actions { display: flex; gap: 4px; justify-content: center; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 20px; width: min(460px, 92vw); }
dialog::backdrop { background: #000a; }
dialog h3 { margin: 0 0 12px; }
dialog label { display: block; margin: 8px 0; font-size: 12px; color: var(--muted); }
dialog input, dialog select { width: 100%; margin-top: 3px; padding: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.err { color: var(--down); font-size: 12px; min-height: 16px; }
.disclaimer { max-width: 1400px; margin: 24px auto; padding: 0 16px 24px; color: var(--muted); font-size: 11px; }
@media (max-width: 700px) { .perf-title { font-size: 20px; } .perf-badge { font-size: 18px; } main { padding: 10px; } }

#tabs .back { color: var(--text); border: 1px solid var(--line); margin-right: 8px; }
.profile-name { font-size: 15px; font-weight: 400; color: var(--muted); margin: 0 0 6px; }
.profile-name strong { color: var(--text); font-size: 18px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 12px; }
.profile-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.profile-card:hover, .profile-card:focus-visible { border-color: var(--head); outline: none; }
.profile-card .avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #ff3df022; color: var(--head); font-weight: 700; font-size: 18px; flex: none; }
.profile-card .pname { font-weight: 600; font-size: 16px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results { margin: -2px 0 4px; max-height: 240px; overflow-y: auto; }
.result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.result:hover, .result:focus-visible { background: #1c232d; outline: none; }
.result img, .result .ph { width: 22px; height: 22px; border-radius: 50%; flex: none; background: #fff2; object-fit: cover; }
.result .rn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .rt { color: var(--muted); font-size: 11px; white-space: nowrap; }
.r-info { padding: 8px; color: var(--muted); font-size: 12px; }
.picked { padding: 8px; color: var(--up); font-size: 13px; }
