:root {
  --bg: #0A0A0A; --panel: #121212; --panel-2: #1A1A1A; --line: #262626;
  --fg: #F2F2F2; --muted: #8C8C8C; --accent: #FFCC00; --up: #3DDC84; --down: #FF5C5C; --comp: #5AC8FA;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.5 Inter, system-ui, sans-serif; }
[hidden] { display: none !important; }
h2 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h3 { margin: 0 0 14px; font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--down); min-height: 1.2em; margin: 0; font-size: 14px; }

/* Brand: the eye drawn in CSS (ring + pupil) */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.02em; }
.brand-lg { font-size: 26px; }
.eye { width: 34px; height: auto; flex: none; display: block; }
.brand-lg .eye { width: 46px; }
.badge { font-size: 11px; background: var(--accent); color: #000; padding: 2px 8px; border-radius: 99px; letter-spacing: 0.1em; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 70% 10%, #2a2200 0%, transparent 60%), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select { background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn { background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font: 600 14px Inter, sans-serif; cursor: pointer; }
.btn:hover { border-color: #3a3a3a; }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; background: rgba(10,10,10,0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 7px; font: 600 13px Inter; cursor: pointer; }
.seg button.on { background: var(--accent); color: #000; }
.vs { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.vs select { padding: 7px 10px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px; display: grid; gap: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }

/* Hero */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.hero-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; position: relative; overflow: hidden; }
.hero-card.self { border-color: #4a3d00; background: linear-gradient(135deg, #1d1800, var(--panel) 60%); }
.hero-name { font-weight: 700; }
.hero-note { font-size: 13px; color: var(--muted); }
.hero-num { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 10px; }
.hero-sub { font-size: 13px; color: var(--muted); }
.delta { font-weight: 700; font-size: 13px; }
.delta.up { color: var(--up); } .delta.down { color: var(--down); } .delta.flat { color: var(--muted); }

/* Network cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); flex: none; }
.ico svg { width: 18px; height: 18px; }
.card-title { font-weight: 700; }
.card-src { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.card-row { display: flex; justify-content: space-between; align-items: baseline; }
.card-num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.card-comp { font-size: 13px; color: var(--muted); }
.card-comp b { color: var(--comp); }
.spark { width: 100%; height: 44px; }
.lead { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #2a2400; color: var(--accent); font-weight: 700; }
.lead.them { background: #0f2633; color: var(--comp); }

.chart-box { position: relative; height: 320px; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.table td.me { color: var(--accent); font-weight: 700; }
.table td.them { color: var(--comp); font-weight: 700; }

.stale { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.stale li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; font-size: 14px; }
.stale button { font-size: 12px; padding: 5px 10px; }
.foot { font-size: 12px; text-align: center; padding-bottom: 24px; }

/* Dialogs */
.dlg { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(420px, calc(100vw - 32px)); }
.dlg-wide { width: min(760px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0,0,0,0.7); }
.dlg form { display: grid; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.prof-edit { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.prof-edit legend { padding: 0 6px; color: var(--accent); font-weight: 700; }
.prof-list { display: grid; gap: 8px; }
.prof-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; }
.prof-item .dot { width: 10px; height: 10px; border-radius: 50%; }
.prof-item .grow { flex: 1; }
.prof-item button { font-size: 12px; padding: 5px 10px; }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .wrap { padding: 16px; gap: 18px; }
  .hero-num { font-size: 36px; }
}

/* Particle field behind everything; panels keep their own solid backgrounds */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.login, #app { position: relative; z-index: 1; }
.login { background: radial-gradient(1200px 600px at 70% 10%, rgba(42,34,0,0.55) 0%, transparent 60%); }
.hero-card, .card, .panel { backdrop-filter: blur(2px); }

/* Live indicators */
.live { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; }
.live.on { color: var(--up); border-color: #1d4a33; background: #0d1f16; }
.live i, .fresh i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
.fresh { display: inline-flex; align-items: center; gap: 5px; }
.fresh.live { color: var(--up); }
.fresh.export, .fresh.manual { color: #b8902a; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }
.flash-up { animation: flashUp 1.8s ease-out; }
.flash-down { animation: flashDown 1.8s ease-out; }
@keyframes flashUp { 0% { color: var(--up); text-shadow: 0 0 18px rgba(61,220,132,0.7); } 100% { color: var(--fg); } }
@keyframes flashDown { 0% { color: var(--down); text-shadow: 0 0 18px rgba(255,92,92,0.7); } 100% { color: var(--fg); } }
@media (prefers-reduced-motion: reduce) { .live i, .fresh i, .flash-up, .flash-down { animation: none; } }
