:root {
  --bg: #0E1116; --panel: #161B22; --panel2: #1C222B; --line: #262D36; --line2: #30363D;
  --text: #E6EDF3; --muted: #8B949E; --faint: #6E7681;
  --up: #3FB950; --down: #F85149; --ours: #58A6FF; --fair: #D29922; --test: #D97706; --live: #DA3633;
  --up-bg: rgba(63,185,80,.12); --down-bg: rgba(248,81,73,.12); --ours-bg: rgba(88,166,255,.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.4 Inter, system-ui, sans-serif; }
a { color: var(--ours); }
.num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); } .fairc { color: var(--fair); } .oursc { color: var(--ours); }
.banner { text-align: center; font-weight: 600; font-size: 12px; padding: 3px 8px; letter-spacing: .03em; }
.banner.test { background: var(--test); color: #111; }
.banner.live { background: var(--live); color: #fff; }
.topnav { display: flex; align-items: center; gap: 4px; padding: 0 12px; height: 40px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
.topnav .logo { font-weight: 700; font-size: 15px; margin-right: 10px; }
.topnav a.nav { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.topnav a.nav:hover { color: var(--text); background: var(--panel2); }
.topnav a.nav.on { color: var(--text); background: var(--panel2); }
.topnav .sp { flex: 1; }
.pill { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; text-decoration: none; display: inline-block; }
.pill:hover { border-color: var(--line2); }
.pill.on { border-color: var(--fair); color: var(--fair); }
.btn { background: var(--panel2); border: 1px solid var(--line2); color: var(--text); border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; }
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: #238636; border-color: #2EA043; }
.btn.danger { background: var(--live); border-color: #F85149; color: #fff; font-weight: 600; }
.btn.warn { background: #9E6A03; border-color: var(--fair); }
.btn.small { padding: 3px 8px; font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.card h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed #20262e; }
.row:last-child { border-bottom: 0; }
.row > span:first-child { color: var(--muted); }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { color: var(--muted); font-weight: 500; font-size: 11px; position: sticky; top: 0; background: var(--panel); cursor: pointer; user-select: none; }
table.t th:first-child, table.t td:first-child, table.t .l { text-align: left; }
table.t tbody tr:hover { background: #1A2029; }
.scroll { overflow: auto; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.test { background: rgba(217,119,6,.18); color: #F0A73A; }
.badge.live { background: rgba(218,54,51,.18); color: #FF7B72; }
.badge.ok { background: var(--up-bg); color: var(--up); }
.badge.err { background: var(--down-bg); color: var(--down); }
.badge.gray { background: #232a33; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #484F58; display: inline-block; vertical-align: middle; }
.dot.on { background: var(--up); box-shadow: 0 0 6px var(--up); }
.dot.warn { background: var(--fair); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line2); color: var(--text); border-radius: 6px; padding: 6px 8px; font: inherit; }
input:focus, select:focus { outline: 1px solid var(--ours); border-color: var(--ours); }
label.f { display: block; color: var(--muted); font-size: 12px; margin: 8px 0 3px; }
.help { color: var(--muted); font-size: 12px; margin: 2px 0 0; }
.page { padding: 10px; max-width: 1400px; margin: 0 auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 8px; }
.toasts { position: fixed; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 1000; max-width: min(380px, calc(100vw - 24px)); }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--ours); border-radius: 6px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.toast.warning { border-left-color: var(--fair); } .toast.error { border-left-color: var(--down); } .toast.trade { border-left-color: var(--up); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 900; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 16px; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 10px; font-size: 16px; }
.modeswitch { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.modeswitch button { background: transparent; border: 0; color: var(--muted); padding: 4px 10px; cursor: pointer; font: inherit; font-weight: 600; }
.modeswitch button.on.test { background: var(--test); color: #111; }
.modeswitch button.on.live { background: var(--live); color: #fff; }
@media (max-width: 700px) { .page { padding: 6px; } .topnav { padding: 0 8px; } }
