:root {
  --bg: #0b0d12; --panel: #141720; --panel2: #1b1f2b; --line: #262b38;
  --text: #e7e9ee; --muted: #8b93a7; --accent: #7c5cff; --accent2: #3ba7ff;
  --green: #35d07f; --chip: #222738;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(11,13,18,.9); backdrop-filter: blur(8px); z-index: 5;
}
.brand { font-weight: 600; letter-spacing: .5px; font-size: 16px; }
.brand b { color: var(--accent); }
.logo { color: var(--accent); margin-right: 6px; }
.stats { color: var(--muted); font-size: 13px; }
.stats b { color: var(--text); }

.tabs { display: flex; gap: 6px; padding: 14px 22px 0; }
.tab {
  background: none; border: none; color: var(--muted); font-size: 15px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer;
}
.tab.active { color: var(--text); border-bottom: 2px solid var(--accent); }

.toolbar { display: flex; gap: 10px; padding: 14px 22px; flex-wrap: wrap; align-items: center; }
.search {
  flex: 1; min-width: 200px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); padding: 10px 14px; border-radius: 10px; outline: none;
}
.search:focus { border-color: var(--accent); }
.filter {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.hide { display: none !important; }

main { padding: 0 22px 60px; }

/* ---- feed ---- */
.event {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--panel2);
  display: grid; place-items: center; font-weight: 700; color: var(--accent2); flex: none;
}
.event .mid { flex: 1; min-width: 0; }
.event .kp { font-weight: 600; }
.event .arrow { color: var(--green); font-weight: 600; margin: 0 4px; }
.event .sub { color: var(--muted); font-size: 12.5px; }
.event .time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---- project cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
}
.card .head { display: flex; align-items: center; gap: 12px; }
.card .name { font-weight: 700; font-size: 16px; }
.card .handle { color: var(--muted); font-size: 13px; }
.card .count { margin-left: auto; text-align: right; }
.card .count b { font-size: 22px; color: var(--accent); }
.card .count span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  background: var(--chip); color: #c7cde0; border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 999px; font-size: 12px;
}
.chip.token { color: var(--green); border-color: rgba(53,208,127,.3); }
.chip.org { color: var(--accent2); border-color: rgba(59,167,255,.3); }
.card .followers { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; }
.mini { width: 22px; height: 22px; border-radius: 50%; background: var(--panel2);
  display: inline-grid; place-items: center; font-size: 10px; color: var(--accent2); font-weight: 700; }

/* ---- feed table (ala Alphagate Followings) ---- */
.feed-table { width: 100%; border-collapse: collapse; }
.feed-table th {
  text-align: left; color: var(--muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.feed-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.feed-table tbody tr:hover { background: var(--panel); }
.cell-profile { display: flex; align-items: center; gap: 10px; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.pname { font-weight: 600; }
.phandle { color: var(--muted); font-size: 12.5px; }
.chips-sm { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.col-num { font-weight: 600; white-space: nowrap; }
.kf { color: var(--accent); }
.col-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.xlink { display: inline-grid; place-items: center; width: 30px; height: 30px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.xlink:hover { border-color: var(--accent); }
@media (max-width: 680px) {
  .feed-table .col-num:nth-child(4), .feed-table th:nth-child(4) { display: none; }
  .feed-table td, .feed-table th { padding: 10px 6px; }
}

/* foto profil */
img.avatar { object-fit: cover; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.clickable { cursor: pointer; }
.clickable:hover { opacity: .85; }
a.cell-profile { color: inherit; }
.cell-profile:hover .pname { color: var(--accent2); }

/* modal detail */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: grid; place-items: start center; z-index: 50; overflow-y: auto; padding: 40px 16px;
}
.modal-box {
  position: relative; width: 100%; max-width: 640px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 40px;
}
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.modal-x:hover { color: var(--text); }
.pd-head { display: flex; gap: 14px; align-items: center; padding-right: 36px; }
.pd-name { font-weight: 700; font-size: 20px; }
.pd-title .phandle { color: var(--muted); font-size: 13px; }
.pd-title .chips-sm { margin-top: 6px; }
.pd-stats { display: flex; gap: 10px; margin: 18px 0; }
.pd-stats .stat {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.pd-stats .stat span { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.pd-stats .stat b { font-size: 22px; }
.pd-stats .stat b.g { color: var(--green); }
.pd-h { font-weight: 600; margin: 6px 0 10px; }
.pd-h .muted, .muted { color: var(--muted); }
.kf-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.kf-tab {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.kf-tab.active { color: var(--text); border-color: var(--accent); }
.kf-list { max-height: 50vh; overflow-y: auto; }
.kf-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 6px;
  border-bottom: 1px solid var(--line); color: inherit;
}
.kf-row:hover { background: var(--panel); }
.kf-id { flex: 1; min-width: 0; }
.kf-foll { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.kf-time { color: var(--muted); font-size: 12px; white-space: nowrap; width: 64px; text-align: right; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

@media (max-width: 560px) {
  .stats { display: none; }
  .cards { grid-template-columns: 1fr; }
}
