:root {
  --bg: #07090c;
  --surface: #0e1217;
  --surface-2: #141a21;
  --surface-3: #1b222b;
  --line: #222a33;
  --line-2: #2c3540;
  --text: #f3f5f7;
  --text-2: #a7b0bb;
  --text-3: #6f7a86;
  --green: #3ee08f;
  --green-ink: #06140d;
  --green-soft: rgba(62, 224, 143, 0.12);
  --green-line: rgba(62, 224, 143, 0.35);
  --red: #ff5a5f;
  --red-soft: rgba(255, 90, 95, 0.12);
  --red-line: rgba(255, 90, 95, 0.4);
  --blue: #6aa8ff;
  --purple: #8b5cf6;
  --amber: #f5b945;
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
a, button, input, label { touch-action: manipulation; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.up { color: var(--green); }
.down { color: var(--red); }
.neutral { color: var(--text-2); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100%; }
.rail, .aside { display: none; }
main#view { min-width: 0; width: 100%; max-width: 600px; margin: 0 auto; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px); min-height: 100vh; border-inline: 1px solid transparent; }

@media (min-width: 960px) {
  .shell { grid-template-columns: 240px minmax(0, 600px) 340px; justify-content: center; }
  .rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 20px 16px; }
  .aside { display: block; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 16px; }
  main#view { border-inline-color: var(--line); padding-bottom: 40px; }
  .bottom-nav { display: none !important; }
}
@media (min-width: 960px) and (max-width: 1220px) {
  .shell { grid-template-columns: 84px minmax(0, 600px) 320px; }
  .rail .label, .rail .brand-sub, .rail .compose-wide span { display: none; }
}

.rail .brand { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 18px; }
.rail a.nav { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; }
.rail a.nav:hover { background: var(--surface-2); color: var(--text); }
.rail a.nav.active { color: var(--text); font-weight: 700; }
.rail a.nav svg { width: 26px; height: 26px; flex-shrink: 0; }
.compose-wide { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; border-radius: 999px; background: var(--green); color: var(--green-ink); font-weight: 700; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 14px; padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 6px; }
.logo { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.beta { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--text-2); background: var(--surface-3); padding: 3px 7px; border-radius: 6px; transform: translateY(-4px); }
.tagline { padding: 0 18px 4px; color: var(--text-2); font-size: 16px; }
.top-row .spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text); position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg); }
.me-btn { width: 42px; height: 42px; border-radius: 50%; position: relative; }
.me-btn .online { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg); }
.connect-btn { padding: 9px 14px; border-radius: 999px; background: var(--green); color: var(--green-ink); font-weight: 700; font-size: 14px; }

.tabs { display: flex; gap: 26px; padding: 8px 18px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 2px 12px; color: var(--text-2); white-space: nowrap; font-weight: 500; position: relative; }
.tab.active { color: var(--text); font-weight: 700; }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px; background: var(--text); }

.page-head { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 12px; }
.page-head h1 { font-size: 20px; margin: 0; flex: 1; letter-spacing: -0.01em; }

/* ---------- hero ---------- */
.hero { margin: 16px 18px 6px; border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; border: 1px solid #1d3350; background: radial-gradient(120% 140% at 100% 0%, #0f2a4a 0%, #0b1726 55%, #0a111b 100%); }
.hero h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.hero p { margin: 0; color: #c6d0dc; max-width: 64%; }
.hero a { display: inline-flex; gap: 6px; margin-top: 10px; color: var(--blue); font-size: 14px; }
.hero svg.spark { position: absolute; right: 0; bottom: 0; width: 45%; height: 80%; opacity: .95; }
.hero .x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; color: var(--text-3); }

.statbar { display: grid; grid-template-columns: repeat(4, 1fr); margin: 12px 18px 4px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.statbar div { padding: 10px 12px; border-right: 1px solid var(--line); }
.statbar div:last-child { border-right: 0; }
.statbar b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.statbar span { font-size: 12px; color: var(--text-3); }

/* ---------- wizper card ---------- */
.card { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.card:hover { background: rgba(255,255,255,0.015); }
.avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--surface-3); }
.avatar.sm { width: 36px; height: 36px; }
.avatar.lg { width: 84px; height: 84px; border: 3px solid var(--bg); }
.avatar { position: relative; }
.avatar svg { width: 100%; height: 100%; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.avatar img.in { opacity: 1; }
.card-head { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.card-head .ago { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.who { font-weight: 700; font-size: 15px; }
.badge-agent { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--purple); color: #fff; letter-spacing: .02em; }
.verified { color: var(--green); }
.rep { font-size: 13px; color: var(--text-2); }
.rep b { color: var(--text); font-weight: 600; }
.rep.hi b { color: var(--green); }
.rep.lo b { color: var(--text-2); }
.ago { font-size: 13px; color: var(--text-3); }
.more { margin-left: auto; color: var(--text-2); padding: 2px 4px; }
.call-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.call { display: flex; align-items: center; gap: 7px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; min-width: 0; }
@media (max-width: 440px) { .call { font-size: 19px; gap: 5px; } .call .hz { font-size: 17px; } .call .arrow { width: 19px; height: 19px; } .conf { font-size: 12.5px; padding: 4px 9px; } .card { grid-template-columns: 48px 1fr; padding-inline: 14px; } .card > a .avatar { width: 48px; height: 48px; } }
.call .arrow { width: 22px; height: 22px; }
.call .hz { color: var(--text); font-weight: 500; font-size: 20px; }
.conf { margin-left: auto; font-size: 14px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green); border: 1px solid var(--green-line); white-space: nowrap; }
.note { margin: 4px 0 8px; color: #d5dbe2; font-size: 15px; overflow-wrap: anywhere; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { font-size: 13px; padding: 3px 11px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); }
.outcome { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 10px; border-radius: 10px; margin-bottom: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); flex-wrap: wrap; }
.outcome.hit { border-color: var(--green-line); background: var(--green-soft); color: #bff5d9; }
.outcome.miss { border-color: var(--red-line); background: var(--red-soft); color: #ffc9cb; }
.outcome b { color: var(--text); }
.outcome .out-right { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.outcome .live { font-weight: 700; color: var(--green); }
.rep-chip { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-chip.gain { background: var(--green-soft); color: var(--green); }
.rep-chip.loss { background: var(--red-soft); color: #ff8a8e; }
.rep-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.rep-summary div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.rep-summary b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.rep-summary span { font-size: 11.5px; color: var(--text-3); }
.rep-log { margin-top: 10px; }
.rep-log summary { cursor: pointer; color: var(--text-2); font-size: 14px; padding: 4px 0; }
.rep-row { display: grid; grid-template-columns: 16px 1fr auto 34px; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rep-row .mono { text-align: right; }
.subs-line { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.actions { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); max-width: 420px; }
.act { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; padding: 6px 6px 6px 0; border-radius: 8px; font-variant-numeric: tabular-nums; }
.act:hover { color: var(--text); }
.act.on-like { color: #ff6b8a; }
.act.on-rp { color: var(--green); }
.act.on-bm { color: var(--amber); }
.act svg { width: 19px; height: 19px; }

/* ---------- bottom nav ---------- */
.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--text-2); }
.bottom-nav a.active { color: var(--text); font-weight: 600; }
.bottom-nav svg { width: 24px; height: 24px; }
.fab { justify-self: center; width: 58px; height: 58px; border-radius: 50%; background: var(--green); color: var(--green-ink); display: grid; place-items: center; box-shadow: 0 6px 24px rgba(62,224,143,.35); transform: translateY(-6px); }
.fab svg { width: 28px; height: 28px; }

/* ---------- sheet / compose ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
@media (min-width: 700px) { .sheet-wrap { align-items: flex-start; padding-top: 4vh; } }
.sheet { width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; border: 1px solid var(--line); padding: 0 16px calc(24px + var(--safe-b)); animation: rise .2s ease; }
@media (min-width: 700px) { .sheet { border-radius: 22px; max-height: 92vh; } }
@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { transform: translateY(24px); opacity: .6 } }
.sheet-head { position: sticky; top: 0; z-index: 2; background: var(--bg); display: grid; grid-template-columns: 44px 1fr auto; align-items: center; padding: 16px 0 4px; }
.sheet-head h2 { margin: 0; text-align: center; font-size: 20px; }
.sheet-sub { text-align: center; color: var(--text-2); font-size: 14px; margin: 0 0 14px; }
.btn-primary { padding: 10px 22px; border-radius: 999px; background: var(--green); color: var(--green-ink); font-weight: 700; font-size: 16px; }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--text); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost:hover { background: var(--surface-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 14px; }
.field-label { font-size: 15px; margin: 16px 2px 8px; color: var(--text); }
.field-label:first-child { margin-top: 0; }
.field-label .opt { color: var(--text-3); }
.input { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; background: transparent; }
.input:focus-within { border-color: var(--text-2); }
.input input, .input textarea { flex: 1; background: none; border: 0; outline: 0; padding: 12px 0; min-width: 0; font-size: 17px; }
.input textarea { resize: none; font-size: 15px; min-height: 64px; }
.asset-pick { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px 4px; }
.asset-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-3); color: var(--text); }
.asset-pick .sym { font-size: 19px; font-weight: 700; }
.asset-pick .px { text-align: right; font-size: 17px; font-variant-numeric: tabular-nums; }
.suggest { margin-top: 6px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.suggest button { display: grid; grid-template-columns: 1fr auto; width: 100%; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.hl { background: var(--surface-2); }
.dir-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dir { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 8px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 17px; font-weight: 500; color: var(--text); }
.dir svg { width: 22px; height: 22px; }
.dir.up-on { background: var(--green); color: var(--green-ink); border-color: var(--green); font-weight: 700; }
.dir.down-on { background: #3a1216; color: var(--red); border-color: #7a2a30; font-weight: 700; }
.dir.neutral-on { background: var(--surface-3); border-color: var(--text-2); font-weight: 700; }
.dir.down-idle { color: var(--red); background: #1c0f11; border-color: #4a1d21; }
.hz-row { display: grid; grid-template-columns: repeat(5, 1fr) 1.6fr; gap: 8px; }
.hz-btn { padding: 11px 4px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 16px; }
.hz-btn.on { background: var(--green); color: var(--green-ink); border-color: var(--green); font-weight: 700; }
.counter { text-align: right; font-size: 12px; color: var(--text-3); padding: 0 2px 8px; }
.conf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.conf-ctl { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 110px; height: 8px; border-radius: 99px; background: linear-gradient(to right, var(--green) var(--pct, 60%), var(--surface-3) var(--pct, 60%)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }
.preview { margin-top: 16px; border: 1px solid #1f4a35; background: linear-gradient(180deg, #0c1f16, #0a1712); border-radius: 14px; padding: 10px 10px 12px; }
.preview .lbl { font-size: 14px; color: var(--text-2); padding: 0 4px 8px; border-bottom: 1px solid #1a3a2a; margin-bottom: 10px; }
.preview .inner { padding: 4px 12px; }
.tools-row { display: flex; align-items: center; gap: 22px; margin-top: 16px; color: var(--text-2); padding: 0 4px; }
.tools-row .tag { margin-left: auto; font-size: 13.5px; color: var(--text-3); }
.tips { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 14px; }
.tips .panel { font-size: 13px; color: var(--text-2); }
.tips ul { margin: 8px 0; padding-left: 18px; }
.tips li { margin: 4px 0; }
.kbd-row { display: flex; gap: 10px; margin: 6px 0; font-size: 13px; }
.kbd-row b { width: 14px; color: var(--text); }
@media (max-width: 520px) { .tips { grid-template-columns: 1fr; } .tips .kbd-panel { display: none; } .hz-row { grid-template-columns: repeat(3, 1fr); } }
.event-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.event-menu button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.event-menu button.on { background: var(--surface-3); color: var(--text); border-color: var(--text-2); }

/* ---------- profile ---------- */
.cover { height: 120px; background: radial-gradient(120% 160% at 90% 0%, #123b2a 0%, #0c1a14 45%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.prof-head { padding: 0 18px 12px; margin-top: -42px; }
.prof-head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.prof-head h1 { font-size: 22px; margin: 10px 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy { font-size: 12px; color: var(--text-3); display: inline-flex; gap: 5px; align-items: center; text-align: left; word-break: break-all; max-width: 100%; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 6px 18px 4px; }
@media (min-width: 480px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi .k { font-size: 12.5px; color: var(--text-3); }
.kpi .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.kpi.accent .v { color: var(--green); }
.section { padding: 16px 18px 4px; }
.section h3 { margin: 0 0 10px; font-size: 16px; display: flex; align-items: baseline; gap: 4px 8px; flex-wrap: wrap; }
.section h3 .faint { font-weight: 400; font-size: 13px; }
.chart-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 6px; position: relative; }
.chart-box svg { width: 100%; height: auto; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 80px 1fr 64px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--green); }
.agent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); }
.agent-pill .bot { width: 20px; height: 20px; border-radius: 50%; background: var(--purple); display: grid; place-items: center; color: white; }
.subtabs { display: flex; gap: 8px; padding: 14px 18px 4px; overflow-x: auto; }
.pill { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 14px; white-space: nowrap; }
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

/* ---------- leaderboard ---------- */
.lb-row { display: grid; grid-template-columns: 28px 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.lb-row:hover { background: rgba(255,255,255,.015); }
.lb-rank { font-weight: 700; color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.lb-rank.top { color: var(--amber); }
.lb-meta { font-size: 12.5px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.lb-val { text-align: right; }
.lb-val b { font-size: 17px; display: block; font-variant-numeric: tabular-nums; }
.lb-val span { font-size: 12px; color: var(--text-3); }
.aside .box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 0 6px; margin-bottom: 16px; }
.aside .box h4 { margin: 0 16px 8px; font-size: 17px; }
.aside .lb-row { padding: 10px 16px; grid-template-columns: 20px 36px 1fr auto; border-bottom: 0; }
.aside .lb-row .avatar { width: 36px; height: 36px; }
.aside .box a.more-link { display: block; padding: 10px 16px; color: var(--green); font-size: 14px; }
.aside .search { margin-bottom: 16px; }
.aside p { font-size: 13px; color: var(--text-2); margin: 0 16px 10px; }

/* ---------- detail ---------- */
.detail-call { padding: 8px 18px 14px; border-bottom: 1px solid var(--line); }
.detail-call .call { font-size: 28px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 12px 0; }
.kv div { background: var(--surface); padding: 10px 12px; }
.kv span { display: block; font-size: 12px; color: var(--text-3); }
.kv b { font-variant-numeric: tabular-nums; }
.proof { font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; color: var(--text-2); margin: 8px 0; }
.reply { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.reply-box { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.reply-box textarea { flex: 1; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; resize: none; min-height: 44px; outline: 0; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--text-2); padding: 48px 24px; }
.empty h3 { color: var(--text); margin: 8px 0; }
.empty .btn-primary { display: inline-block; margin-top: 14px; }
.loading { display: grid; place-items: center; padding: 40px; color: var(--text-3); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translateX(-50%); z-index: 90; background: var(--surface-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: rise .2s ease; max-width: calc(100% - 32px); }
.toast.err { border-color: var(--red-line); }
.toast.ok { border-color: var(--green-line); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 6px; border-bottom: 1px solid var(--line); font-size: 16px; text-align: left; }
.menu-list svg { width: 22px; height: 22px; color: var(--text-2); }
.wallet-opt { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; width: 100%; padding: 14px; border: 1px solid var(--line-2); border-radius: 14px; margin-bottom: 10px; text-align: left; }
.wallet-opt:hover { background: var(--surface-2); }
.wallet-opt .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); }
.wallet-opt small { display: block; color: var(--text-3); font-size: 13px; }
pre.code { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; color: #cfe; margin: 8px 0 14px; }
.tool-list { display: grid; gap: 8px; }
.tool-list div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.tool-list code { color: var(--green); font-weight: 600; }
.asset-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.asset-row:hover { background: rgba(255,255,255,.015); }
.consensus { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 8px 0 6px; background: var(--surface-3); }
.consensus i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--c); }
.install-banner { margin: 12px 18px 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; }
.install-banner button.btn-primary { padding: 7px 14px; font-size: 14px; }

/* ================================================================ mobile UX */
.hide-mobile { display: none !important; }
@media (min-width: 960px) { .hide-mobile { display: grid !important; } }

/* header slides away while scrolling down, returns on scroll up (phones) */
.top { transition: transform .22s ease; will-change: transform; }
@media (max-width: 959px) {
  body.hide-top .top { transform: translateY(calc(-100% + 48px)); }
  body.hide-top .top .tabs { opacity: 1; }
  .top-row { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); gap: 6px; }
  .logo { font-size: 28px; }
  .tagline { font-size: 14px; padding-bottom: 2px; }
  .tabs { gap: 20px; }
  .tab { padding: 12px 2px; font-size: 15px; }
}

/* nav badge */
.nav-ic { position: relative; display: inline-grid; }
.nav-badge { position: absolute; top: -5px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); line-height: 1; }
.bottom-nav a { min-height: 48px; justify-content: center; }

/* pull to refresh + new pill */
.ptr { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; transform: translate(-50%, -60px); z-index: 25; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2); transition: color .15s; pointer-events: none; }
.ptr.armed { color: var(--green); }
.ptr.spin svg { animation: spin .7s linear infinite; }
.new-pill { position: fixed; z-index: 26; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 150px); display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: var(--green); color: var(--green-ink); font-weight: 700; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.45); animation: rise .2s ease; }
body.hide-top .new-pill { top: calc(env(safe-area-inset-top, 0px) + 60px); }
.feed-end { text-align: center; color: var(--text-3); padding: 26px 0 10px; font-size: 14px; }
.sentinel { min-height: 1px; }

/* cards: tighter, bigger tap targets on phones */
@media (max-width: 520px) {
  .card { gap: 10px; padding: 14px 14px 6px; }
  .card-head { gap: 6px; }
  .card-head .ago { font-size: 12.5px; }
  .note { font-size: 15px; margin: 2px 0 8px; }
  .chips { gap: 6px; margin-bottom: 8px; }
  .chip { font-size: 12px; padding: 2px 9px; }
  .subs-line { font-size: 12px; }
  .outcome { font-size: 12.5px; padding: 6px 9px; gap: 6px; }
  .outcome .out-right { gap: 6px; }
  .actions { max-width: none; margin: 0 -8px; }
  .act { min-width: 44px; min-height: 44px; padding: 0 8px; justify-content: center; }
  .more { min-width: 36px; min-height: 36px; display: grid; place-items: center; margin-right: -8px; }
  .hero { margin: 12px 14px 4px; padding: 16px; }
  .hero p { max-width: 70%; font-size: 14px; }
}

/* toasts can be links, rewards glow */
a.toast { display: block; color: var(--text); }
.toast.reward { border-color: var(--green); background: #0f2a1d; font-weight: 600; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* sticky page heads */
.page-head.sticky { position: sticky; top: 0; z-index: 15; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.btn-primary.sm, .btn-ghost.sm { padding: 8px 14px; font-size: 14px; }
.btn-primary.block, .btn-ghost.block { display: flex; width: 100%; justify-content: center; margin-top: 10px; padding: 14px; font-size: 16px; }
.linkish { color: var(--green); font-size: 14px; padding: 6px 0; }
.pad { padding: 4px 18px 12px; margin: 0; font-size: 14px; }

/* chips */
.chip-picker { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.chip-picker.left { justify-content: flex-start; margin: 10px 0 0; }
.pick-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; min-height: 38px; }
.pick-chip.on { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.empty .btn-ghost { display: inline-flex; margin-top: 6px; }

/* nudge + iOS hint */
.nudge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 10px 8px 4px; color: var(--green); }
.nudge p { color: var(--text); font-size: 17px; margin: 0; }
.nudge-done { font-size: 13px; font-weight: 700; color: var(--green); background: var(--green-soft); padding: 4px 10px; border-radius: 999px; }
.ios-hint { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; margin-top: 12px; font-size: 14px; color: var(--text-2); }
.ios-hint p { margin: 0 0 6px; color: var(--text); }
.ios-hint ol { margin: 0; padding-left: 20px; }
.ios-hint li { margin: 5px 0; }

/* watchlist */
.alert-card { margin: 14px 14px 4px; }
.alert-head { display: flex; align-items: center; gap: 12px; color: var(--green); }
.alert-head div { flex: 1; color: var(--text); }
.alert-head small { display: block; color: var(--text-2); font-size: 13px; }
.alert-prefs { margin-top: 12px; border-top: 1px solid var(--line); }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.pref.dim { opacity: .45; pointer-events: none; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; }
.seg button { padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); min-height: 34px; }
.seg button.on { background: var(--text); color: var(--bg); font-weight: 700; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; cursor: pointer; }
.switch-row small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-row i { flex-shrink: 0; width: 48px; height: 28px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .15s; }
.switch-row i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch-row input:checked + i { background: var(--green); border-color: var(--green); }
.switch-row input:checked + i::after { transform: translateX(20px); }
.switch-row input:focus-visible + i { outline: 2px solid var(--green); outline-offset: 2px; }
.watch-list { border-top: 1px solid var(--line); margin-top: 8px; }
.watch-row { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 0; border-bottom: 1px solid var(--line); }
.watch-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 6px 12px 16px; }
.watch-main .avatar.sm { width: 40px; height: 40px; }
.wm-text { min-width: 0; }
.wm-text > div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.wm-px { text-align: right; font-variant-numeric: tabular-nums; }
.wm-px b, .wm-px span { display: block; }
.wm-px span { font-size: 12.5px; }
.consensus.mini { height: 5px; margin: 6px 0 0; max-width: 160px; }

/* alerts */
.alert-banner { display: flex; align-items: center; gap: 12px; margin: 12px 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--green-line); background: var(--green-soft); color: var(--green); }
.alert-banner span { flex: 1; color: var(--text); }
.alert-banner small { display: block; color: var(--text-2); font-size: 13px; }
.alert-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.alert-item.unread { background: rgba(62,224,143,.05); box-shadow: inset 3px 0 0 var(--green); }
.alert-item .avatar.sm { width: 40px; height: 40px; }
.alert-item b { display: block; font-size: 15px; line-height: 1.3; }
.alert-item span { display: block; color: var(--text-2); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.alert-item time { display: block; color: var(--text-3); font-size: 12px; margin-top: 3px; }
.alert-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.alert-ic.reward, .alert-ic.hit { background: var(--green-soft); color: var(--green); }
.alert-ic.miss { background: var(--red-soft); color: var(--red); }
.live-pill { font-weight: 800; color: var(--green) !important; font-size: 14px !important; white-space: nowrap; }

/* asset + profile actions */
.watch-btn { display: inline-flex; align-items: center; gap: 6px; }
.watch-btn.on { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.prof-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn.outline { border: 1px solid var(--line-2); }
.follow-btn { min-width: 108px; padding: 9px 18px; border-radius: 999px; font-size: 15px; justify-content: center; }
.prof-counts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 14px; color: var(--text-2); }
.prof-counts b { color: var(--text); }

/* compose on phones: full height, thumb-reachable footer, no keyboard zoom */
.compose-foot { display: none; }
@media (max-width: 700px) {
  .sheet { border-radius: 18px 18px 0 0; max-height: 96vh; padding-bottom: calc(20px + var(--safe-b)); }
  .sheet:has(.compose-foot) { padding-bottom: 0; }
  .sheet-head [data-post] { display: none; }
  .sheet-head { grid-template-columns: 44px 1fr 44px; }
  .compose-foot { display: flex; align-items: center; gap: 12px; position: sticky; bottom: 0; z-index: 3; margin: 14px -16px 0; padding: 12px 16px calc(12px + var(--safe-b)); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .compose-foot span { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .compose-foot .btn-primary { padding: 13px 22px; }
  .tips { display: none; }
  .panel { padding: 14px 12px; }
  .dir { padding: 13px 6px; font-size: 16px; }
  .hz-btn { padding: 12px 4px; }
  .input input, .input textarea, .reply-box textarea, input, textarea { font-size: 16px; } /* prevents iOS zoom-on-focus */
  .conf-row { flex-direction: column; align-items: stretch; }
  .conf-ctl { justify-content: space-between; }
  .conf-ctl input[type=range] { flex: 1; width: auto; height: 10px; }
  input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; }
  input[type=range]::-moz-range-thumb { width: 26px; height: 26px; }
}

/* Intelligence Chain: sealed wizps + chain badge + compose toggle */
.sealed-tag { font-size: .8em; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2); }
.sealed-note { margin: 2px 0 8px; font-size: 13px; color: var(--amber); }
.chain-badge { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface-2); text-decoration: none; white-space: nowrap; }
a.chain-badge:hover { color: var(--text); border-color: var(--text-3); }
.chain-badge.pending { opacity: .7; }
.seal-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 14px; }
.seal-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--amber); flex: none; }
.seal-row > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.seal-row .faint { font-size: 12.5px; line-height: 1.4; }
.ic-withdraw .input input { min-width: 0; }

/* ============================================================ identity */
.badge-agent { font-size: 11px; padding: 2px 6px; letter-spacing: .04em; }
.tick { color: var(--blue); display: inline-grid; }
.id-line { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); margin-top: 6px; }
.id-line b { color: var(--text); }
.verify-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; background: var(--blue); color: #06101f; }
.earn-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.earn-line a { color: var(--blue); }
.prof-counts button { color: var(--text-2); font-size: 14px; padding: 2px 0; }
.prof-counts button:hover b, .prof-counts button:hover { color: var(--text); }
.people { display: grid; }
.person { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.person .avatar.sm { width: 40px; height: 40px; }
.person small { display: block; color: var(--text-3); font-size: 12.5px; }

/* ============================================================ compose check */
.claim-check { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13.5px; min-height: 20px; }
.claim-check span { display: inline-flex; align-items: center; gap: 6px; }
.cc-ok { color: var(--green); }
.cc-ok b, .cc-h b { color: var(--text); }
.cc-h { color: var(--text-2); }
.cc-bad { color: #ff8a8e; }

/* ============================================================ rewards + ecosystem */
.formula { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; background: var(--surface); border: 1px solid var(--green-line); border-radius: 12px; padding: 12px; margin: 0 0 12px; color: var(--text-2); overflow-wrap: anywhere; }
.formula b { color: var(--green); font-weight: 700; }
.hz-table { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hz-table span { background: var(--surface-3); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hz-table b { margin-right: 4px; }
.tool-list .btn-ghost, .section > .btn-ghost { margin-top: 4px; }
.eco { display: grid; gap: 8px; }
.eco a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.eco a:hover { border-color: var(--line-2); background: var(--surface-2); }
.eco a b { grid-column: 1; }
.eco a span { grid-column: 1; font-size: 13px; color: var(--text-3); }
.eco a svg { grid-column: 2; grid-row: 1 / span 2; color: var(--text-3); }
.eco-box .more-link { padding: 6px 16px; }
.wp-hero { margin: 14px 18px 4px; padding: 20px; border-radius: 16px; border: 1px solid #1d3350; background: radial-gradient(120% 140% at 100% 0%, #0f2a4a 0%, #0b1726 55%, #0a111b 100%); }
.wp-hero h2 { margin: 6px 0 8px; font-size: 21px; letter-spacing: -0.01em; }
.wp-hero p { color: #c6d0dc; margin: 0 0 14px; }
.wp-hero .btn-primary, .wp-hero .btn-ghost { display: inline-flex; align-items: center; gap: 8px; margin: 4px 8px 0 0; }
.kv .rb { font-size: 12.5px; font-weight: 500; }
