:root {
  /* dark command-center palette (dataviz reference instance, dark steps) */
  --plane:        #0d0d0d;
  --surface-1:    #1a1a19;
  --surface-2:    #201f1e;
  --text-primary: #ffffff;
  --text-secondary:#c3c2b7;
  --muted:        #898781;
  --grid:         #2c2c2a;
  --baseline:     #383835;
  --border:       rgba(255,255,255,0.10);

  --s1:#3987e5; --s2:#199e70; --s3:#c98500; --s4:#008300;
  --s5:#9085e9; --s6:#e66767; --s7:#d55181; --s8:#d95926;
  --good:#0ca30c; --warning:#fab219; --critical:#d03b3b;

  --radius: 14px;
  --gap: 18px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(57,135,229,0.10), transparent 60%),
    var(--plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
a { color: var(--s1); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 20px 80px; }

/* ---- header ---- */
.topbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 22px;
}
.brand { display:flex; align-items:center; gap:10px; }
.brand .dot { width:9px; height:9px; border-radius:50%; background: var(--good); box-shadow:0 0 10px var(--good); }
.brand h1 { font-size: 15px; font-weight: 650; margin:0; letter-spacing:.2px; }
.brand .sub { color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }
.range-pill {
  font-size: 12px; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
  background: var(--surface-1);
}

/* ---- profile hero ---- */
.hero {
  display: flex; gap: 18px; align-items: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: var(--gap);
}
.hero .avatar {
  width: 78px; height: 78px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--s1); flex: none; background: var(--surface-2);
}
.hero .who { min-width: 0; }
.hero .name { font-size: 20px; font-weight: 680; display:flex; align-items:center; gap:8px; }
.hero .badge { color: var(--s1); font-size: 15px; }
.hero .handle { color: var(--muted); font-size: 13px; }
.hero .bio { color: var(--text-secondary); font-size: 13px; margin-top: 6px; max-width: 620px; white-space: pre-line; }
.hero .stats { display:flex; gap: 22px; margin-left: auto; text-align: center; flex-wrap: wrap; }
.hero .stats .v { font-size: 18px; font-weight: 680; }
.hero .stats .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing:.4px; }

/* ---- KPI tiles ---- */
.kpis { display:grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.kpi {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; min-width: 0;
}
.kpi .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing:.4px; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: proportional-nums; }
.kpi .u { font-size: 12px; color: var(--text-secondary); }

/* ---- section + cards ---- */
.section-title { font-size: 13px; font-weight: 640; letter-spacing:.5px; text-transform: uppercase;
  color: var(--text-secondary); margin: 30px 0 12px; display:flex; align-items:center; gap:8px; }
.section-title::before { content:""; width: 4px; height: 15px; background: var(--s1); border-radius: 2px; }

.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 2fr 1fr; }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 12px;
}
.card h3 { margin: 0 0 12px; font-size: 13px; font-weight: 620; color: var(--text-primary); }
.card h3 .hint { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 6px; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }

/* ---- word cloud ---- */
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom: 10px; }
.tab {
  font-size: 12px; color: var(--text-secondary); cursor: pointer; user-select:none;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 13px; background: transparent;
}
.tab.active { background: var(--s1); color: #fff; border-color: transparent; }
#cloud { width: 100%; height: 360px; }
.cloud-wrap { position: relative; }

/* ---- networks ---- */
.net { height: 360px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }

/* ---- top commenters bar list ---- */
.bars { display:flex; flex-direction: column; gap: 8px; }
.barrow { display:grid; grid-template-columns: 130px 1fr 42px; align-items:center; gap: 10px; font-size: 12px; }
.barrow .u { color: var(--text-secondary); overflow:hidden; text-overflow: ellipsis; white-space:nowrap; }
.barrow .track { background: var(--surface-2); border-radius: 5px; height: 12px; overflow: hidden; }
.barrow .fill { height: 100%; background: var(--s2); border-radius: 5px; }
.barrow .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- posts gallery ---- */
.gallery { display:grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.post-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  display:flex; flex-direction: column;
}
.post-card .thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--surface-2); display:block; }
.post-card .meta { padding: 10px 12px; }
.post-card .cap { font-size: 12px; color: var(--text-secondary); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height: 34px; }
.post-card .row { display:flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.post-card .row b { color: var(--text-primary); font-weight: 620; }
.tag { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-secondary); }

/* ---- comments explorer ---- */
.comments { display:flex; flex-direction: column; gap: 2px; max-height: 460px; overflow:auto; }
.cmt { padding: 10px 6px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cmt .u { color: var(--s1); font-weight: 600; }
.cmt .t { color: var(--text-secondary); }
.cmt .m { color: var(--muted); font-size: 11px; margin-top: 3px; display:flex; gap:12px; }

.foot { color: var(--muted); font-size: 11px; margin-top: 40px; text-align:center; border-top:1px solid var(--border); padding-top:16px; }
.loading { color: var(--muted); font-size: 13px; padding: 40px; text-align: center; }
.pill-warn { background: rgba(250,178,25,.12); border:1px solid rgba(250,178,25,.4); color: var(--warning);
  font-size:12px; padding:8px 12px; border-radius:8px; margin-bottom: var(--gap); }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(3,1fr); }
  .g2,.g3 { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2,1fr); }
  .hero { flex-wrap: wrap; }
  .hero .stats { margin-left: 0; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2,1fr); }
  .gallery { grid-template-columns: 1fr; }
}
