:root, [data-theme="dark"] {
  --bg: #07090c; --card: rgba(18, 24, 30, .72); --line: #1f2a33; --text: #d8e4ea; --mute: #6c7f8c; --grid: #131b22; --acc: #00e5ff;
}
[data-theme="light"] {
  --bg: #eef1ea; --card: rgba(255, 255, 255, .8); --line: #d4dbd0; --text: #11181c; --mute: #6a7770; --grid: #e3e8df; --acc: #006d7a;
}
body {
  font-family: 'Vazirmatn', sans-serif; color: var(--text); background: var(--bg);
  background-image: radial-gradient(circle at 15% 0%, rgba(0,229,255,.08), transparent 40%), radial-gradient(circle at 90% 100%, rgba(43,255,136,.06), transparent 40%),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px; min-height: 100vh;
}
.num, .tbl td { font-family: 'JetBrains Mono', monospace; direction: ltr; unicode-bidi: plaintext; }
.brand { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 2.2rem; letter-spacing: -2px; direction: ltr; }
.brand span { font-weight: 300; color: var(--acc); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; backdrop-filter: blur(8px); }
.ttl { font-weight: 900; font-size: .95rem; letter-spacing: .3px; }
.lbl { color: var(--mute); font-size: .78rem; }
.pos { color: #2bff88; } .neg { color: #ff3b6b; } .warn-t { color: #f5c518; }
[data-theme="light"] .pos { color: #0a9a4c; }
.badge { font-family: 'JetBrains Mono', monospace; font-size: .68rem; padding: 2px 8px; border-radius: 3px; font-weight: 800; border: 1px solid; display: inline-block; }
.badge.ok { color: #2bff88; border-color: #2bff8855; background: #2bff8812; }
.badge.warn { color: #f5c518; border-color: #f5c51855; background: #f5c51812; }
.badge.crit { color: #ff3b6b; border-color: #ff3b6b66; background: #ff3b6b14; }
.badge.shd { color: #8a7dff; border-color: #8a7dff55; background: #8a7dff12; }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs button { padding: .55rem 1rem; font-size: .85rem; color: var(--mute); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-color: var(--acc); font-weight: 800; }
.btn { font-size: .8rem; padding: .4rem .9rem; border: 1px solid var(--acc); color: var(--acc); border-radius: 4px; font-weight: 800; }
.btn:hover { background: var(--acc); color: var(--bg); }
.btn.crit { border-color: #ff3b6b; color: #ff3b6b; } .btn.crit:hover { background: #ff3b6b; color: #fff; }
.inp { width: 100%; background: transparent; border: 1px solid var(--line); padding: .45rem; border-radius: 4px; color: var(--text); direction: ltr; }
input[type=range].inp { padding: 0; accent-color: var(--acc); }
.obrow { position: relative; display: flex; justify-content: space-between; padding: 1px 4px; direction: ltr; }
.obrow .bar { position: absolute; top: 0; bottom: 0; right: 0; opacity: .18; }
.bar.ask { background: #ff3b6b; } .bar.bid { background: #2bff88; }
.gauge, .ci { position: relative; height: 10px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 4px; direction: ltr; }
.gauge i { position: absolute; top: 0; bottom: 0; right: 0; transition: width .5s; }
.gauge b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .4; }
.ci i { position: absolute; top: 0; bottom: 0; }
.ci b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #f5c518; }
.tbl { width: 100%; font-size: .78rem; }
.tbl th { text-align: right; color: var(--mute); font-weight: 400; padding: 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 5px 6px; border-bottom: 1px solid var(--grid); text-align: right; }
.logrow { display: grid; grid-template-columns: 70px 70px 1fr; gap: 8px; padding: 4px 6px; border-right: 2px solid var(--line); }
.lv-warn { border-color: #f5c518; } .lv-crit { border-color: #ff3b6b; background: #ff3b6b0d; }
.tagx { font-size: .7rem; color: var(--acc); }
.sup-ok { color: #2bff88; } .sup-warn { color: #f5c518; } .sup-crit { color: #ff3b6b; } .sup-info { color: #8a7dff; }
.banner { background: repeating-linear-gradient(45deg, #ff3b6b22 0 10px, transparent 10px 20px); border: 1px solid #ff3b6b; color: #ff3b6b; padding: .5rem; text-align: center; font-family: 'JetBrains Mono', monospace; font-weight: 800; margin-bottom: .75rem; animation: pulse 1.4s infinite; }
.halt { position: fixed; inset: 0; background: rgba(60, 0, 12, .92); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; font-family: 'JetBrains Mono', 'Vazirmatn', monospace; }
.halt .btn { color: #fff; border-color: #fff; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--acc); color: var(--bg); padding: .7rem 1.4rem; font-weight: 900; border-radius: 4px; z-index: 60; animation: pop .4s; }
.fade { animation: up .5s both; } .d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
@keyframes pulse { 50% { opacity: .6; } }
@keyframes pop { from { transform: translate(-50%, 20px) scale(.8); opacity: 0; } }