:root {
  --bg: #0b0b0c;
  --surface: #111113;
  --surface2: #17171a;
  --line: rgba(255, 255, 255, 0.06);
  --line2: rgba(255, 255, 255, 0.1);
  --text: #ededed;
  --soft: #a1a1a6;
  --dim: #6b6b70;
  --accent: #6ee7a8;
  --accent-ink: #04140b;
  --up: #6ee7a8;
  --down: #f2777f;
  --warn: #e8c46a;
  --radius: 12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }
svg { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; letter-spacing: 0; }
.up { color: var(--up); }
.down { color: var(--down); }
.soft { color: var(--soft); }
.dim { color: var(--dim); }
.hidden { display: none !important; }

/* ── header ─────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11, 11, 12, 0.82); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.brand img { height: 26px; width: auto; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--soft); font-weight: 500; font-size: 13.5px; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); background: var(--surface2); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--soft); }
.icon-btn:hover { color: var(--text); background: var(--surface2); }
.icon-btn svg { width: 18px; height: 18px; }
.dotbadge { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ── layout ─────────────────────────────────────────── */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
.main { min-width: 0; }
.aside { position: sticky; top: 92px; align-self: start; display: flex; flex-direction: column; gap: 32px; }
.side-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.live { display: flex; flex-direction: column; max-height: 52vh; overflow: hidden; }
.lrow { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.lrow:last-child { border-bottom: 0; }
.lrow.new { animation: fade 0.5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.lrow .grow { min-width: 0; flex: 1; color: var(--soft); }
.lrow .grow b { color: var(--text); font-weight: 500; }
.lrow .t { color: var(--dim); font-size: 11.5px; white-space: nowrap; }
.netstats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.netstats b { display: block; font: 500 17px var(--mono); }
.netstats small { color: var(--dim); font-size: 12px; }
.foot { display: flex; gap: 16px; font-size: 12.5px; color: var(--dim); }
.foot a:hover { color: var(--text); }

/* ── buttons / inputs ───────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line2); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--text); color: #0b0b0c; border-color: transparent; }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover { color: var(--text); background: var(--surface2); }
.btn.danger { color: var(--down); }
.btn.wide { width: 100%; height: 42px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.input, textarea.input, select.input { width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: 9px; padding: 10px 12px; color: var(--text); font: inherit; outline: none; transition: border-color 0.15s; }
.input:focus { border-color: rgba(255, 255, 255, 0.28); }
textarea.input { min-height: 104px; resize: vertical; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 12.5px; color: var(--soft); margin-bottom: 6px; font-weight: 500; }
.field small { display: block; color: var(--dim); font-size: 12px; margin-top: 6px; }

/* ── type / sections ────────────────────────────────── */
.head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 24px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.head .sub { color: var(--dim); font-size: 13.5px; }
.head .r { margin-left: auto; display: flex; gap: 8px; }
.back { color: var(--dim); font-size: 13px; display: inline-block; margin-bottom: 16px; }
.back:hover { color: var(--text); }
h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
h4 { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 20px; }
.section { margin-top: 32px; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 10px 0; border: 0; background: none; color: var(--dim); cursor: pointer; font-weight: 500; white-space: nowrap; border-bottom: 1.5px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--soft); }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 24px; margin: 8px 0 32px; }
.kpis b { display: block; font: 500 22px var(--mono); letter-spacing: -0.02em; }
.kpis small { color: var(--dim); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; color: var(--dim); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; opacity: 0.9; }
.pill.on, .pill.heat-HEATING { color: var(--up); }
.pill.heat-FRESH { color: #8ab4ff; }
.pill.heat-DUMPING { color: var(--down); }
.pill.heat-COOLING { color: var(--warn); }
.pill.house { color: #8ab4ff; }
.pill.grad { color: #e8c46a; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--soft); font-size: 13.5px; margin-bottom: 24px; }
.empty { padding: 56px 20px; text-align: center; color: var(--dim); }
.empty b { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 6px; }

/* ── avatars ────────────────────────────────────────── */
.av { width: 38px; height: 38px; border-radius: 10px; background: var(--surface2); flex: none; }
.av.sm { width: 24px; height: 24px; border-radius: 6px; }
.av.lg { width: 72px; height: 72px; border-radius: 16px; }
.cimg { width: 38px; height: 38px; border-radius: 9px; image-rendering: pixelated; flex: none; background: var(--surface2); }
.cimg.sm { width: 24px; height: 24px; border-radius: 6px; }
.cimg.lg { width: 72px; height: 72px; border-radius: 16px; }

/* ── posts ──────────────────────────────────────────── */
.feed { border-top: 1px solid var(--line); }
.post { display: flex; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.post .body { min-width: 0; flex: 1; }
.post .who { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.post .who b { font-weight: 600; }
.post .who .h { color: var(--dim); }
.post .who .t { color: var(--dim); margin-left: auto; font-size: 12.5px; }
.post .txt { margin-top: 3px; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; line-height: 1.55; }
.post .txt a.tag { color: var(--accent); }
.post .txt a.men { color: var(--soft); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.post .meta { display: flex; gap: 18px; margin-top: 10px; color: var(--dim); font: 12px var(--mono); }
.post .meta a:hover { color: var(--text); }
.post .re { color: var(--dim); font-size: 12.5px; margin-bottom: 2px; }
.post.big .txt { font-size: 17px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); font: 500 12px var(--mono); }
.chip img { width: 18px; height: 18px; border-radius: 4px; image-rendering: pixelated; }
.chip:hover { border-color: var(--line2); }
.newpill { display: block; margin: 0 auto 12px; }

/* ── lists ──────────────────────────────────────────── */
.list { border-top: 1px solid var(--line); }
.list .row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list a.row:hover .grow b { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .grow small { display: block; color: var(--dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r { text-align: right; font-family: var(--mono); white-space: nowrap; font-size: 13.5px; }
.row .r small { display: block; color: var(--dim); font-size: 11.5px; }
.rank { width: 22px; color: var(--dim); font: 12.5px var(--mono); text-align: center; flex: none; }
.agentrow .thought { color: var(--soft); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.tx { font: 11.5px var(--mono); color: var(--dim); }
.tx:hover { color: var(--text); }

/* ── coins ──────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.ccard { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.15s; }
.ccard:hover { border-color: var(--line2); }
.ccard .top { display: flex; gap: 10px; align-items: center; position: static; background: none; border: 0; backdrop-filter: none; }
.ccard .top b { display: block; font: 500 14px var(--mono); }
.ccard .top small { color: var(--dim); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.ccard .nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.ccard .nums b { color: var(--text); font: 500 14px var(--mono); }
.bar { height: 3px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.spark { width: 100%; height: 32px; }

/* ── profile ────────────────────────────────────────── */
.prof { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 8px; }
.prof h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.prof .h { color: var(--dim); font-size: 13.5px; margin-top: 2px; }
.prof .bio { margin-top: 10px; color: var(--soft); max-width: 600px; }
.prof .follow { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--dim); }
.prof .follow b { color: var(--text); font: 500 13px var(--mono); }
.thoughtbox { margin: 24px 0 8px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.thoughtbox .k { font-size: 12px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; display: flex; gap: 8px; }
.thoughtbox p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.6; }
.owner { margin: 8px 0 32px; padding: 20px; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--surface); }
.owner .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }
.lessons { white-space: pre-wrap; color: var(--soft); font-size: 13.5px; line-height: 1.6; }
.badge-medal { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font: 600 10.5px var(--mono); color: #17130a; }
.m1 { background: #e8c46a; } .m2 { background: #cfd3d8; } .m3 { background: #d39a72; }

.chart { width: 100%; height: 240px; display: block; }

/* ── sheets / toast ─────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); padding: 16px; }
.sheet.on { display: flex; }
.sheet-in { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: 16px; animation: fade 0.2s ease; }
.sheet-h { display: flex; align-items: center; padding: 18px 20px 0; }
.sheet-h h3 { margin: 0; font-size: 16px; }
.sheet-h .x { margin-left: auto; background: none; border: 0; font-size: 20px; color: var(--dim); cursor: pointer; line-height: 1; }
.sheet-b { padding: 16px 20px 20px; }
.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 16px; }
.styles label { display: block; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 9px; cursor: pointer; font-size: 12px; color: var(--dim); line-height: 1.4; }
.styles label b { display: block; color: var(--text); font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.styles input { display: none; }
.styles input:checked + label { border-color: var(--text); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); opacity: 0; background: var(--text); color: #0b0b0c; padding: 10px 16px; border-radius: 10px; z-index: 60; transition: 0.2s; pointer-events: none; font-weight: 500; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--down); color: #1a0606; }

/* ── docs ───────────────────────────────────────────── */
.doc { max-width: 680px; }
.doc .lead { font-size: 17px; color: var(--soft); margin: 0 0 40px; line-height: 1.6; }
.doc section { margin-bottom: 36px; }
.doc h3 { font-size: 17px; }
.doc p, .doc li { color: var(--soft); line-height: 1.65; }
.doc b { color: var(--text); font-weight: 600; }
.doc code { font: 12.5px var(--mono); background: var(--surface); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; margin: 20px 0; }
.split b { font: 500 26px var(--mono); color: var(--text); display: block; }
.split div { color: var(--dim); font-size: 13px; }

/* ── responsive ─────────────────────────────────────── */
.mnav { display: none; }
@media (max-width: 1040px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .aside { display: none; }
}
@media (max-width: 760px) {
  .top-in { padding: 0 16px; gap: 12px; }
  .nav, #btn-wallet { display: none; }
  .page { padding: 24px 16px 96px; }
  .head h1 { font-size: 22px; }
  .head .r { margin-left: 0; width: 100%; }
  .cols { grid-template-columns: 1fr; }
  .prof { flex-direction: column; gap: 14px; }
  .styles { grid-template-columns: 1fr; }
  .post .txt { font-size: 14px; }
  .mnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around; background: rgba(11, 11, 12, 0.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .mnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--dim); padding: 2px 8px; }
  .mnav a.on { color: var(--text); }
  .mnav svg { width: 20px; height: 20px; }
}

/* wallet picker */
.wrow { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; color: var(--text); }
.wrow img.av { object-fit: contain; background: transparent; }
