/* ---------- tokens ---------- */
:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f1f1ed;
  --surface-3: #e9e9e4;
  --text: #121216;
  --muted: #6c6c75;
  --faint: #a3a3ab;
  --border: #e7e7e2;
  --border-strong: #d6d6d0;
  --accent: #6a4cff;
  --accent-hover: #5a3bf0;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --accent-ink: #ffffff;
  --like: #f0266f;
  --like-soft: color-mix(in srgb, var(--like) 12%, transparent);
  --ok: #12a150;
  --warn: #e5484d;
  --warn-soft: color-mix(in srgb, var(--warn) 9%, transparent);
  --shadow-sm: 0 1px 2px rgb(16 16 24 / .06);
  --shadow: 0 1px 2px rgb(16 16 24 / .04), 0 8px 24px -8px rgb(16 16 24 / .12);
  --shadow-lg: 0 24px 64px -16px rgb(16 16 24 / .28);
  --grad: linear-gradient(135deg, #7c5cff 0%, #c34dff 55%, #ff4f8b 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0f;
    --surface: #111116;
    --surface-2: #18181f;
    --surface-3: #202029;
    --text: #ededf1;
    --muted: #8f8f9b;
    --faint: #5c5c68;
    --border: #22222b;
    --border-strong: #2e2e39;
    --accent: #8b72ff;
    --accent-hover: #9d88ff;
    --like: #ff4f8b;
    --ok: #3dd68c;
    --warn: #ff6369;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
    --shadow-lg: 0 24px 64px -16px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0f;
  --surface: #111116;
  --surface-2: #18181f;
  --surface-3: #202029;
  --text: #ededf1;
  --muted: #8f8f9b;
  --faint: #5c5c68;
  --border: #22222b;
  --border-strong: #2e2e39;
  --accent: #8b72ff;
  --accent-hover: #9d88ff;
  --like: #ff4f8b;
  --ok: #3dd68c;
  --warn: #ff6369;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
  --shadow-lg: 0 24px 64px -16px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  letter-spacing: -.005em;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 620px) 340px;
  justify-content: center;
  gap: 0 32px;
  min-height: 100vh;
  padding: 0 20px;
}
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 0 20px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 18px; font-weight: 800; font-size: 21px; letter-spacing: -.03em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgb(124 92 255 / .7);
}
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 0; }
.brand:hover .brand-mark svg { animation: trace 1s var(--ease); }
@keyframes trace { from { stroke-dashoffset: 40; } }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  font-size: 16px; font-weight: 500; color: var(--muted); text-align: left; width: fit-content;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 700; }
.nav-item.active svg { stroke-width: 2.4; }
.nav-cta { margin-top: 14px; width: 100%; padding: 13px 18px; font-size: 16px; }
.nav-cta svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.theme-toggle { font-size: 14px; }

.me-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 999px;
  transition: background .15s;
}
.me-card:hover { background: var(--surface-2); }
.me-card .who { flex: 1; min-width: 0; line-height: 1.25; }
.me-card .who b, .me-card .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card .who span { color: var(--muted); font-size: 13px; }
.me-card .avatar { width: 38px; height: 38px; font-size: 15px; }

.main {
  min-width: 0;
  border-inline: 1px solid var(--border);
  background: var(--surface);
  min-height: 100vh;
  padding-bottom: 80px;
}
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 0 24px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }

/* stats: wide, no rail */
body.wide .shell { grid-template-columns: 248px minmax(0, 1180px); }
body.wide .rail { display: none; }
body.wide .main { border: 0; background: none; }

/* auth: no chrome */
body.auth-mode .shell { display: block; padding: 0; }
body.auth-mode .sidebar, body.auth-mode .rail, body.auth-mode .tabbar { display: none; }
body.auth-mode .main { border: 0; background: none; padding: 0; }

.enter > * { animation: rise .35s var(--ease) both; }
.enter > *:nth-child(2) { animation-delay: .03s; }
.enter > *:nth-child(3) { animation-delay: .06s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- page header ---------- */
.page-head {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--border);
}
.page-head-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; min-height: 58px; }
.page-head h1 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .mobile-brand { display: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--text); transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tabs { display: flex; }
.tabs a {
  flex: 1; text-align: center; padding: 14px 8px; color: var(--muted); font-weight: 600; position: relative;
  transition: background .15s, color .15s;
}
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a.active { color: var(--text); }
.tabs a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 56px; height: 4px; border-radius: 4px; background: var(--accent);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-weight: 650; font-size: 14.5px; white-space: nowrap;
  background: var(--text); color: var(--bg);
  transition: transform .12s var(--ease), background .15s, opacity .15s, box-shadow .15s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.primary:hover { background: var(--accent-hover); opacity: 1; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); opacity: 1; }
.btn.danger { background: var(--warn); color: #fff; }
.btn.sm { padding: 6px 14px; font-size: 13.5px; }
.btn.lg { padding: 13px 22px; font-size: 16px; }
.btn.block { width: 100%; }

.follow-btn .off { display: none; }
.follow-btn.secondary:hover { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.follow-btn.secondary:hover .on { display: none; }
.follow-btn.secondary:hover .off { display: inline; }

/* ---------- avatar ---------- */
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px;
  background: linear-gradient(140deg, hsl(var(--h) 88% 66%), hsl(calc(var(--h) + 50) 78% 46%));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14);
  text-shadow: 0 1px 2px rgb(0 0 0 / .18);
  transition: filter .15s;
}
a.avatar:hover { filter: brightness(1.08); }
.avatar.sm { width: 34px; height: 34px; font-size: 14px; }
.avatar.xl { width: 120px; height: 120px; font-size: 48px; box-shadow: 0 0 0 5px var(--surface); }

/* ---------- composer ---------- */
.composer { display: flex; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.composer-main { flex: 1; min-width: 0; }
.composer textarea {
  width: 100%; min-height: 52px; max-height: 360px; resize: none; border: 0; outline: none; background: none;
  font-size: 18px; line-height: 1.45; padding: 8px 0; letter-spacing: -.01em;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--border); }
.composer-tools { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.composer-tools .icon-btn { color: var(--accent); }
.composer-tools .icon-btn:hover { background: var(--accent-soft); }
.composer-tools input { display: none; }
.composer-send { display: flex; align-items: center; gap: 12px; }
.ring { width: 24px; height: 24px; transform: rotate(-90deg); transition: opacity .2s; }
.ring circle { fill: none; stroke-width: 2.5; }
.ring .track { stroke: var(--border-strong); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .15s, stroke .15s; }
.ring.near .bar { stroke: #f5a524; }
.ring.over .bar { stroke: var(--warn); }
.ring-wrap { position: relative; display: grid; place-items: center; }
.ring-wrap span { position: absolute; font-size: 11px; font-weight: 600; color: var(--muted); }
.preview-wrap { position: relative; margin-top: 8px; width: fit-content; max-width: 100%; }
.preview { max-height: 280px; max-width: 100%; border-radius: 16px; display: block; border: 1px solid var(--border); }
.preview-wrap .icon-btn { position: absolute; top: 8px; right: 8px; background: rgb(0 0 0 / .6); color: #fff; backdrop-filter: blur(6px); }
.preview-wrap .icon-btn:hover { background: rgb(0 0 0 / .8); }

/* ---------- posts ---------- */
.post {
  display: flex; gap: 12px; padding: 14px 18px 8px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.post.clickable { cursor: pointer; }
.post.clickable:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.post.removing { animation: fold .3s var(--ease) forwards; }
@keyframes fold { to { opacity: 0; transform: scale(.98); } }
.post.fresh { animation: flash 1.4s var(--ease); }
@keyframes flash { from { background: var(--accent-soft); } }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; gap: 6px; align-items: baseline; min-width: 0; white-space: nowrap; }
.post-head .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.post-head .name:hover { text-decoration: underline; }
.post-head .meta { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.post-body { margin: 2px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.5; }
.mention { color: var(--accent); font-weight: 500; }
.mention:hover { text-decoration: underline; }
.post-image {
  display: block; width: 100%; max-height: 520px; object-fit: cover; border-radius: 16px;
  border: 1px solid var(--border); margin-bottom: 8px; background: var(--surface-2);
}
.post-actions { display: flex; align-items: center; gap: 28px; margin-left: -9px; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.post-actions .act {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
  transition: color .15s;
}
.post-actions .act i {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; transition: background .15s;
}
.post-actions svg { width: 19px; height: 19px; }
.post-actions .act span { min-width: 2ch; text-align: left; }
.post-actions .act.c:hover { color: var(--accent); }
.post-actions .act.c:hover i { background: var(--accent-soft); }
.post-actions .act.like:hover, .post-actions .act.like.liked { color: var(--like); }
.post-actions .act.like:hover i { background: var(--like-soft); }
.post-actions .act.like.pop svg { animation: pop .45s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }
.post-actions .act.del { margin-left: auto; }
.post-actions .act.del:hover { color: var(--warn); }
.post-actions .act.del:hover i { background: var(--warn-soft); }

/* single post */
.post.big { flex-direction: column; gap: 0; padding: 16px 18px 4px; }
.post.big .post-by { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post.big .post-by .name { font-weight: 700; display: block; line-height: 1.25; }
.post.big .post-by .name:hover { text-decoration: underline; }
.post.big .post-body { font-size: 19px; line-height: 1.45; letter-spacing: -.012em; margin: 0 0 14px; }
.post.big .post-image { max-height: 640px; object-fit: contain; }
.post.big .stamp { color: var(--muted); font-size: 14px; padding: 4px 0 14px; border-bottom: 1px solid var(--border); }
.post.big .post-actions { padding: 4px 0; justify-content: space-around; margin: 0; }
.post.big .post-actions .act.del { margin-left: 0; }

/* ---------- comments ---------- */
.reply-form { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.reply-form input {
  flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 16px; padding: 8px 0;
}
.reply-form input::placeholder { color: var(--faint); }
.comment { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.comment .body { flex: 1; min-width: 0; }
.comment .post-body { margin: 1px 0 0; font-size: 15px; }
.comment.fresh { animation: flash 1.4s var(--ease); }
.section-label { padding: 14px 18px 6px; font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- profile ---------- */
.banner {
  height: 190px; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, hsl(var(--h) 90% 66%) 0%, transparent 55%),
    radial-gradient(120% 140% at 100% 100%, hsl(calc(var(--h) + 60) 85% 55%) 0%, transparent 60%),
    linear-gradient(135deg, hsl(calc(var(--h) + 20) 70% 40%), hsl(calc(var(--h) + 80) 70% 30%));
}
.banner svg { position: absolute; inset: auto 0 18px 0; width: 100%; height: 80px; opacity: .45; }
.banner path { fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.profile { padding: 0 18px 16px; border-bottom: 1px solid var(--border); }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -60px; min-height: 76px; position: relative; }
.profile-top .btn { margin-bottom: 4px; }
.profile h2 { margin: 12px 0 0; font-size: 23px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.profile .handle { color: var(--muted); }
.profile .bio { margin: 12px 0 0; font-size: 15.5px; white-space: pre-wrap; }
.profile .joined { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 10px; }
.profile .joined svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.profile-stats { display: flex; gap: 18px; font-size: 14.5px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.profile-stats b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- users ---------- */
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; transition: background .15s; }
.user-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.user-row .grow { flex: 1; min-width: 0; line-height: 1.3; }
.user-row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .grow b:hover { text-decoration: underline; }
.user-row .grow span { display: block; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list > .user-row + .user-row { border-top: 1px solid var(--border); }

/* ---------- rail widgets ---------- */
.search-form {
  display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 46px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 999px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.search-form:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-form svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-form input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 15px; }
.search-form input::placeholder { color: var(--muted); }
.rail-search { position: sticky; top: 0; z-index: 2; box-shadow: 0 0 0 10px var(--bg); }
.rail-search:focus-within { box-shadow: 0 0 0 10px var(--bg), 0 0 0 4px var(--accent-soft); }
#rail-widgets { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.widget-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; padding: 14px 18px 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.widget .user-row { padding: 10px 18px; }
.widget-more { display: block; padding: 14px 18px; color: var(--accent); font-size: 14.5px; transition: background .15s; }
.widget-more:hover { background: var(--surface-2); }
.widget.cta { padding: 20px; background: var(--surface); position: relative; }
.widget.cta::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.widget.cta h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.02em; }
.widget.cta p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }
.widget.cta .btn + .btn { margin-top: 8px; }
.rail-foot { color: var(--faint); font-size: 12.5px; padding: 0 18px; line-height: 1.6; }
.rail-foot a:hover { color: var(--muted); text-decoration: underline; }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-block: 1px solid var(--border); margin-top: 8px; }
.mini-stats div { background: var(--surface); padding: 10px 14px; }
.mini-stats span { display: block; font-size: 12px; color: var(--muted); }
.mini-stats b { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mini-stats b.bad { color: var(--warn); }
.mini-spark { display: block; width: 100%; height: 56px; }
.mini-spark path { vector-effect: non-scaling-stroke; }

.live { font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: beacon 1.8s infinite; }
.live.off i { background: var(--faint); animation: none; }
@keyframes beacon { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- states ---------- */
.skel { display: flex; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.skel .b { background: var(--surface-2); border-radius: 8px; position: relative; overflow: hidden; }
.skel .b::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel .av { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.skel .lines { flex: 1; display: flex; flex-direction: column; gap: 9px; padding-top: 4px; }

.empty { text-align: center; color: var(--muted); padding: 56px 28px; }
.empty .glyph {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty .glyph svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 19px; letter-spacing: -.02em; }
.empty p { margin: 0 auto; max-width: 340px; }
.empty .btn { margin-top: 18px; }
.end { text-align: center; color: var(--faint); font-size: 13px; padding: 24px; }

/* ---------- toast & dialog ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 16px) scale(.96);
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px;
  font-size: 14.5px; font-weight: 550; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.dialog {
  border: 0; padding: 26px; width: min(360px, calc(100vw - 32px)); border-radius: 22px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: dlg .22s var(--ease); }
@keyframes dlg { from { opacity: 0; transform: scale(.95); } }
.dialog::backdrop { background: rgb(10 10 16 / .45); backdrop-filter: blur(3px); }
.dialog h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
.dialog p { margin: 0 0 20px; color: var(--muted); }
.dialog .btn { width: 100%; padding: 12px; }
.dialog .btn + .btn { margin-top: 10px; }

/* ---------- auth ---------- */
.auth-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 40px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(80% 60% at 20% 10%, #9b7bff 0%, transparent 60%),
              radial-gradient(70% 70% at 100% 100%, #ff4f8b 0%, transparent 60%),
              #1a0f3d;
}
.auth-art .brand { padding: 0; color: #fff; }
.auth-art .brand-mark { background: rgb(255 255 255 / .16); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); backdrop-filter: blur(8px); }
.auth-art h2 { font-size: clamp(34px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -.045em; margin: 0; font-weight: 800; max-width: 11ch; position: relative; }
.auth-art p { margin: 16px 0 0; font-size: 17px; opacity: .78; max-width: 38ch; position: relative; }
.ekg { position: absolute; left: 0; right: 0; top: 46%; width: 100%; height: 160px; opacity: .9; }
.ekg path { fill: none; stroke: rgb(255 255 255 / .85); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 8px rgb(255 255 255 / .6)); }
.ekg .ghost { stroke: rgb(255 255 255 / .12); filter: none; }
.ekg .beat { stroke-dasharray: 260 2000; animation: ekg 3.2s linear infinite; }
@keyframes ekg { from { stroke-dashoffset: 260; } to { stroke-dashoffset: -2000; } }
.auth-feats { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.auth-feats span { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .18); backdrop-filter: blur(8px); }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth { width: 100%; max-width: 380px; }
.auth h1 { margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: -.035em; }
.auth .lede { color: var(--muted); margin: 0 0 26px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); outline: none; font-size: 15.5px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth .btn.block { margin-top: 8px; padding: 13px; font-size: 15.5px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-btn { justify-content: space-between; padding: 11px 14px; border-radius: var(--radius-sm); }
.demo-btn code { background: none; border: 0; padding: 0; color: var(--muted); }
.error {
  color: var(--warn); font-size: 14px; background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; margin-top: 12px;
}
.error:empty { display: none; }
.switch { text-align: center; color: var(--muted); font-size: 14.5px; margin-top: 22px; }
.switch a { color: var(--accent); font-weight: 600; }
.switch a:hover { text-decoration: underline; }

/* ---------- stats dashboard ---------- */
.dash { padding: 22px 0 40px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.chip b { color: var(--text); font-weight: 600; }
.dash-head .live { padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }

.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 0; position: relative; overflow: hidden; transition: border-color .2s, background .2s;
}
.tile-l { font-size: 12.5px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.tile-l i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.tile-v { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1.25; margin-top: 2px; }
.tile-v small { font-size: 14px; color: var(--muted); font-weight: 550; margin-left: 2px; letter-spacing: 0; }
.tile svg { display: block; width: calc(100% + 32px); margin: 6px -16px 0; height: 34px; }
.tile svg path { vector-effect: non-scaling-stroke; }
.tile.warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: linear-gradient(var(--warn-soft), var(--warn-soft)), var(--surface); }
.tile.warn .tile-v { color: var(--warn); }
.tile.warn .tile-l i { background: var(--warn); }

#st-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px 14px; min-width: 0; }
.panel.span { grid-column: 1 / -1; }
.chart-title { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.chart-title span { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.chart { position: relative; touch-action: pan-y; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .yl {
  position: absolute; left: 0; font-size: 10.5px; color: var(--muted); font-family: var(--mono); pointer-events: none; line-height: 1;
  background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 1px 4px 1px 0; border-radius: 4px;
}
.chart .xl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); font-family: var(--mono); margin-top: 6px; }
.chart .collecting { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.xhair { position: absolute; top: 0; bottom: 18px; width: 0; pointer-events: none; display: none; }
.xhair::before { content: ""; position: absolute; top: 0; bottom: 0; left: -.5px; border-left: 1px dashed var(--border-strong); }
.xhair i { position: absolute; left: -4.5px; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); margin-top: -4.5px; }
.tip {
  position: absolute; top: 4px; z-index: 2; display: none; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  padding: 8px 10px; font-size: 12px; min-width: 130px; white-space: nowrap;
}
.tip .t { color: var(--muted); margin-bottom: 4px; font-size: 11.5px; }
.tip div { display: flex; align-items: center; gap: 6px; }
.tip div b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.tip i, .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .shell { grid-template-columns: 248px minmax(0, 620px); }
  .rail { display: none; }
  .only-narrow { display: block; }
}
@media (min-width: 1241px) { .only-narrow { display: none; } }
@media (max-width: 1080px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .shell, body.wide .shell { grid-template-columns: 76px minmax(0, 1fr); gap: 0 20px; max-width: 800px; margin: 0 auto; }
  body.wide .shell { max-width: none; }
  .sidebar { align-items: center; }
  .brand { padding: 6px 0 18px; }
  .brand-name, .nav-item .lbl, .me-card .who, .nav-cta .lbl { display: none; }
  .nav { align-items: center; }
  .nav-item { padding: 12px; }
  .nav-cta { width: 52px; height: 52px; padding: 0; border-radius: 50%; }
  .nav-cta svg { display: block; }
  .theme-toggle { justify-content: center; }
  .me-card { padding: 6px; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { min-height: 300px; padding: 28px 24px; }
  .auth-art h2 { font-size: 38px; }
  .ekg { top: 38%; }
}
@media (max-width: 640px) {
  .shell, body.wide .shell { display: block; padding: 0; }
  .sidebar { display: none; }
  .main { border: 0; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.wide .main { padding-inline: 16px; }
  .page-head .mobile-brand { display: grid; }
  .page-head-row { padding: 10px 16px; }
  .post, .composer, .comment, .reply-form, .user-row, .skel { padding-inline: 16px; }
  .profile { padding-inline: 16px; }
  .banner { height: 140px; }
  .avatar.xl { width: 92px; height: 92px; font-size: 36px; box-shadow: 0 0 0 4px var(--surface); }
  .profile-top { margin-top: -46px; min-height: 60px; }
  .post-actions { gap: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-v { font-size: 22px; }
  .dash-head h1 { font-size: 26px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .auth-art { min-height: 250px; }
  .auth-art p, .auth-feats { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--border);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
    color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 12px;
  }
  .tabbar a.active { color: var(--text); }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active svg { stroke-width: 2.4; }
  .tabbar .avatar { width: 24px; height: 24px; font-size: 11px; box-shadow: none; }
  .tabbar a.active .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
