/* ---------------------------------------------------------------- tokens */
:root {
  --accent: #7c5cff;
  --accent-soft: #7c5cff22;
  --like: #ff2d78;
  --repost: #00cf8b;
  --quote: #3aa8ff;
  --bookmark: #ffb020;
  --radius: 16px;
  --rail-w: 258px;
  --side-w: 340px;
  --main-w: 620px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}
:root, [data-theme="dark"] {
  --bg: #0a0a10;
  --bg-2: #101018;
  --bg-3: #16161f;
  --hover: #ffffff08;
  --border: #232330;
  --text: #eaeaf2;
  --muted: #8b8b9e;
  --shadow: 0 12px 40px #00000080;
}
[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f7f7fb;
  --bg-3: #eeeef5;
  --hover: #0000000a;
  --border: #e3e3ee;
  --text: #0e0e16;
  --muted: #64647a;
  --shadow: 0 12px 40px #0000001f;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow-y: scroll;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- layout */
.app {
  display: grid; margin: 0 auto; min-height: 100%;
  grid-template-columns: var(--rail-w) minmax(0, var(--main-w)) var(--side-w);
  max-width: calc(var(--rail-w) + var(--main-w) + var(--side-w));
}
.rail { position: sticky; top: 0; height: 100vh; padding: 10px 10px 10px 4px; display: flex; flex-direction: column; }
.main { border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-height: 100vh; min-width: 0; }
.side { padding: 10px 0 40px 22px; }
.side-sticky { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------------ rail */
.brand { display: flex; align-items: center; gap: 10px; padding: 12px; font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #ff5c9d); color: #fff; box-shadow: 0 6px 18px #7c5cff44;
}
.brand .mark svg { width: 19px; height: 19px; stroke-width: 2.2; }
.navlink {
  display: flex; align-items: center; gap: 15px; padding: 11px 14px; border-radius: 999px;
  font-size: 19px; color: var(--text); position: relative; width: fit-content; max-width: 100%;
}
.navlink:hover { background: var(--hover); text-decoration: none; }
.navlink.on { font-weight: 700; }
.navlink.on svg { stroke-width: 2.6; }
.navlink .dot {
  position: absolute; top: 7px; left: 30px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.btn-post {
  margin: 14px 6px 0; padding: 14px; border-radius: 999px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 16px; text-align: center; box-shadow: 0 6px 20px #7c5cff40;
  transition: transform .12s, filter .12s;
}
.btn-post:hover { filter: brightness(1.08); }
.btn-post:active { transform: scale(.97); }
.me-chip {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 999px;
}
.me-chip:hover { background: var(--hover); }
.me-chip .grow { min-width: 0; }
.me-chip b, .me-chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- header */
.head {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px) saturate(1.6);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--border);
}
.head-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; min-height: 56px; }
.head-row h1 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.head-row .sub { color: var(--muted); font-size: 13px; }
.back { padding: 6px; border-radius: 999px; margin-left: -4px; }
.back:hover { background: var(--hover); }
.tabs { display: flex; }
.tab {
  flex: 1; padding: 15px 8px 0; text-align: center; color: var(--muted); font-weight: 600; font-size: 14.5px;
}
.tab:hover { background: var(--hover); }
.tab span { display: inline-block; padding-bottom: 13px; border-bottom: 3.5px solid transparent; border-radius: 3px; }
.tab.on { color: var(--text); }
.tab.on span { border-color: var(--accent); }

/* ------------------------------------------------------------------ post */
.post {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; position: relative;
}
.post:hover { background: var(--hover); }
.post.focus { cursor: default; grid-template-columns: 1fr; }
.post.new-in { animation: slideIn .45s cubic-bezier(.2,.8,.2,1); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); background: var(--accent-soft); } }
.post .ctx { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; margin: -2px 0 2px 30px; }
.post.focus .ctx { margin-left: 0; }
.post .ctx svg { width: 15px; height: 15px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--bg-3);
  display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; overflow: hidden; user-select: none;
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.lg { width: 132px; height: 132px; font-size: 46px; border: 4px solid var(--bg); }
.av-wrap { position: relative; width: fit-content; }
.av-wrap .online {
  position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%;
  background: var(--repost); border: 2.5px solid var(--bg); box-shadow: 0 0 0 0 #00cf8b88; animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px #00cf8b00; } 100% { box-shadow: 0 0 0 0 #00cf8b00; } }
.who { display: flex; align-items: center; gap: 5px; min-width: 0; flex-wrap: wrap; }
.who .name { font-weight: 700; color: var(--text); }
.who .name:hover { text-decoration: underline; }
.who .at, .who .dot-sep, .who time { color: var(--muted); font-weight: 400; }
.who .badge { width: 16px; height: 16px; color: var(--accent); }
.who .badge svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.post .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 0; }
.post.focus .body { font-size: 22px; line-height: 1.35; margin-top: 10px; }
.post .edited { color: var(--muted); font-size: 12px; }
.reply-hint { color: var(--muted); font-size: 14px; margin-top: 1px; }

.media { display: grid; gap: 3px; margin-top: 10px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.media.n2 { grid-template-columns: 1fr 1fr; }
.media.n3 { grid-template-columns: 1fr 1fr; }
.media.n3 img:first-child { grid-row: span 2; height: 100%; }
.media.n4 { grid-template-columns: 1fr 1fr; }
.media img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; display: block; background: var(--bg-3); }
.media.n1 img { max-height: 560px; object-fit: contain; background: #000; }

.quoted { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.quoted:hover { background: var(--hover); }
.quoted .body { font-size: 14.5px; }
.quoted .media { margin-top: 8px; max-height: 260px; }
.quoted .media img { max-height: 260px; }

.actions { display: flex; justify-content: space-between; max-width: 460px; margin-top: 10px; color: var(--muted); }
.act { display: flex; align-items: center; gap: 6px; padding: 6px; margin: -6px; border-radius: 999px; font-size: 13px; transition: color .15s; }
.act:hover { color: var(--accent); background: var(--accent-soft); }
.act .n { min-width: 12px; text-align: left; font-variant-numeric: tabular-nums; }
.act.like:hover, .act.like.on { color: var(--like); }
.act.like:hover, .act.like.on { background: #ff2d7818; }
.act.repost:hover, .act.repost.on { color: var(--repost); background: #00cf8b18; }
.act.reply:hover { color: var(--quote); background: #3aa8ff18; }
.act.bm:hover, .act.bm.on { color: var(--bookmark); background: #ffb02018; }
.act.on svg { fill: currentColor; stroke: currentColor; }
.act.like.on svg { animation: pop .35s cubic-bezier(.3,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } }
.act .n.bump { animation: bump .4s ease; }
@keyframes bump { 50% { transform: translateY(-4px); color: var(--accent); } }
.menu-btn { position: absolute; top: 10px; right: 10px; padding: 5px; border-radius: 999px; color: var(--muted); }
.menu-btn:hover { background: var(--accent-soft); color: var(--accent); }

.stat-row { display: flex; gap: 18px; padding: 14px 0; margin-top: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.stat-row b { color: var(--text); }
.meta-time { color: var(--muted); font-size: 14px; margin-top: 14px; }

/* ------------------------------------------------------------------ poll */
.poll { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.poll-opt {
  position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-weight: 600; font-size: 14px; overflow: hidden; text-align: left; width: 100%;
}
.poll-opt:not(.voted):hover { border-color: var(--accent); color: var(--accent); }
.poll-opt .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.poll-opt.win .fill { background: #7c5cff38; }
.poll-opt .lbl { position: relative; display: flex; justify-content: space-between; gap: 10px; }
.poll-opt .pct { font-variant-numeric: tabular-nums; }
.poll-meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; }

/* -------------------------------------------------------------- composer */
.composer { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.composer textarea {
  width: 100%; border: 0; background: none; resize: none; font-size: 19px; line-height: 1.4;
  padding: 10px 0 0; outline: none; min-height: 54px; overflow: hidden;
}
.composer textarea::placeholder { color: var(--muted); }
.composer-bar { display: flex; align-items: center; gap: 4px; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.tool { padding: 8px; border-radius: 999px; color: var(--accent); }
.tool:hover { background: var(--accent-soft); }
.tool[disabled] { opacity: .4; cursor: not-allowed; }
.ring { width: 26px; height: 26px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2.5; }
.ring .bg { stroke: var(--border); }
.ring .fg { stroke: var(--accent); transition: stroke-dashoffset .2s, stroke .2s; stroke-linecap: round; }
.ring.warn .fg { stroke: var(--bookmark); }
.ring.over .fg { stroke: var(--like); }
.btn {
  padding: 9px 18px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700;
  transition: filter .12s, transform .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: none; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 6px 15px; font-size: 14px; }
.btn.danger { background: var(--like); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; background: #000a; color: #fff; border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; }
.thumb button svg { width: 13px; height: 13px; }
.poll-editor { margin-top: 12px; border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.poll-editor input, .poll-editor select {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2);
}

/* ------------------------------------------------------------------ side */
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card h3 { margin: 0; padding: 13px 16px 6px; font-size: 18px; letter-spacing: -.01em; }
.card .row { display: block; padding: 10px 16px; }
.card a.row:hover, .card button.row:hover { background: var(--hover); text-decoration: none; }
.card .row small { display: block; color: var(--muted); font-size: 12.5px; }
.card .row .tag { font-weight: 700; color: var(--text); }
.card .more { padding: 12px 16px; color: var(--accent); display: block; }
.searchbox { position: relative; }
.searchbox input {
  width: 100%; padding: 12px 14px 12px 44px; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg-2); outline: none;
}
.searchbox input:focus { border-color: var(--accent); background: var(--bg); }
.searchbox svg { position: absolute; left: 15px; top: 12px; color: var(--muted); }
.pulse-card { display: flex; gap: 14px; padding: 14px 16px; align-items: center; }
.pulse-num { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pulse-lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--repost); display: inline-block; animation: pulse 2s infinite; }
.user-row { display: flex; align-items: center; gap: 11px; padding: 11px 16px; }
.user-row:hover { background: var(--hover); }
.user-row .grow { min-width: 0; flex: 1; }
.user-row .grow b, .user-row .grow span, .user-row .grow p { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.user-row .grow span { color: var(--muted); font-size: 14px; }
.user-row .grow p { color: var(--muted); font-size: 13.5px; }

/* --------------------------------------------------------------- profile */
.banner { height: 200px; background: linear-gradient(120deg, var(--accent), #ff5c9d); background-size: cover; background-position: center; }
.profile-top { padding: 0 16px 16px; }
.profile-av { margin-top: -68px; display: flex; justify-content: space-between; align-items: flex-end; }
.profile-name { margin-top: 12px; }
.profile-name h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; display: flex; align-items: center; gap: 6px; }
.profile-name .at { color: var(--muted); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--bg-3); padding: 1px 6px; border-radius: 5px; vertical-align: middle; }
.profile-bio { margin: 12px 0 0; white-space: pre-wrap; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 14px; margin-top: 12px; }
.profile-facts span { display: flex; align-items: center; gap: 5px; }
.profile-facts svg { width: 17px; height: 17px; }
.counts { display: flex; gap: 18px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.counts b { color: var(--text); }

/* ----------------------------------------------------------------- misc */
.empty { padding: 60px 30px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 22px; margin: 0 0 8px; letter-spacing: -.02em; }
.spinner { width: 26px; height: 26px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; margin: 34px auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.newpill {
  position: sticky; top: 62px; z-index: 15; margin: 10px auto -46px; display: block; width: fit-content;
  background: var(--accent); color: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow); animation: drop .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } }
.sep { height: 10px; background: var(--bg-2); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); }
.thread-line { position: absolute; left: 37px; top: 62px; bottom: 0; width: 2px; background: var(--border); }

.toasts { position: fixed; bottom: 22px; left: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--border);
  padding: 11px 15px; border-radius: 14px; box-shadow: var(--shadow); max-width: 340px; animation: rise .3s ease;
  cursor: pointer;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.toast b { display: block; font-size: 14px; }
.toast small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }

.modal-root:empty { display: none; }
.scrim { position: fixed; inset: 0; background: #000000a8; backdrop-filter: blur(3px); z-index: 200; display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; width: min(600px, 100%); max-height: 86vh; overflow: auto; box-shadow: var(--shadow); animation: rise .22s cubic-bezier(.2,.9,.3,1.1); }
.sheet-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.sheet-head h2 { font-size: 18px; margin: 0; flex: 1; }
.icon-btn { padding: 7px; border-radius: 999px; }
.icon-btn:hover { background: var(--hover); }
.lightbox { position: fixed; inset: 0; background: #000000ee; z-index: 250; display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; }
.menu { position: absolute; z-index: 220; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; min-width: 210px; }
.menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 15px; text-align: left; font-weight: 600; font-size: 14.5px; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--like); }

/* ------------------------------------------------------------------ auth */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.gate-art { background: radial-gradient(900px 700px at 25% 25%, #7c5cff, #ff5c9d 55%, #0a0a10 100%); display: grid; place-items: center; color: #fff; }
.gate-art .mark-lg { width: 190px; height: 190px; opacity: .95; filter: drop-shadow(0 20px 50px #0006); }
.gate-form { display: grid; place-items: center; padding: 40px; }
.gate-form .inner { width: min(400px, 100%); }
.gate-form h1 { font-size: 42px; letter-spacing: -.035em; margin: 0 0 8px; }
.gate-form p.lede { color: var(--muted); margin: 0 0 26px; font-size: 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-2); outline: none; transition: border-color .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.err { background: #ff2d7818; border: 1px solid #ff2d7844; color: #ff87b4; padding: 10px 13px; border-radius: 12px; font-size: 14px; margin-bottom: 12px; }
.gate .btn { width: 100%; padding: 13px; font-size: 16px; }
.switch { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* -------------------------------------------------------------- messages */
.dm-wrap { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
.dm-list { overflow-y: auto; }
.dm-msgs { overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 4px; }
.bubble { max-width: 78%; padding: 9px 14px; border-radius: 20px; background: var(--bg-3); align-self: flex-start; overflow-wrap: anywhere; animation: rise .25s ease; }
.bubble.mine { background: var(--accent); color: #fff; align-self: flex-end; }
.bubble + .bubble { margin-top: 2px; }
.bubble-meta { font-size: 11.5px; color: var(--muted); align-self: flex-start; margin: 2px 0 8px; }
.bubble-meta.mine { align-self: flex-end; }
.dm-form { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.dm-form textarea { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px; padding: 10px 14px; resize: none; max-height: 120px; outline: none; }
.typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.3s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; } .typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ------------------------------------------------------------ responsive */
.tabbar, .fab { display: none; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 88px minmax(0, 1fr); max-width: 100%; }
  .side { display: none; }
  .navlink span, .brand span, .me-chip .grow, .me-chip .more { display: none; }
  .btn-post { padding: 13px; margin: 14px 4px 0; }
  .btn-post span { display: none; }
  .btn-post::after { content: "＋"; font-size: 20px; }
}
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .main { border: 0; padding-bottom: 66px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { flex: 1; padding: 13px 0; display: grid; place-items: center; color: var(--muted); position: relative; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a .dot { position: absolute; top: 7px; right: calc(50% - 18px); min-width: 16px; height: 16px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
  .fab {
    display: grid; place-items: center; position: fixed; right: 18px; bottom: 82px; width: 56px; height: 56px;
    border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 8px 26px #7c5cff55; z-index: 41;
  }
  .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .gate { grid-template-columns: 1fr; }
  .gate-art { display: none; }
  .post.focus .body { font-size: 19px; }
  .banner { height: 140px; }
  .avatar.lg { width: 96px; height: 96px; font-size: 34px; }
  .profile-av { margin-top: -50px; }
  .toasts { left: 12px; right: 12px; bottom: 82px; }
  .dm-wrap { height: calc(100vh - 66px); }
}

.focus-head { display: flex; align-items: center; gap: 12px; }
.focus-head .focus-who { flex: 1; min-width: 0; }
.focus-head .focus-who .who { display: block; }
.focus-head .focus-who .name { display: block; }
.focus-head .focus-who .at { display: block; }

.linkish { color: var(--accent); }
.linkish:hover { text-decoration: underline; }
code { background: var(--bg-3); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.empty svg.big { width: 44px; height: 44px; color: var(--muted); margin-bottom: 12px; stroke-width: 1.5; }

.trend-strip { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.trend-strip::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--text); }
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip b { color: var(--muted); font-weight: 600; }
.conn { display: grid; place-items: center; width: 20px; }

.btn.icon-only { padding: 8px 10px; }
.btn.icon-only svg { display: block; }

.notif { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:hover { background: var(--hover); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notif.new-in { animation: slideIn .45s cubic-bezier(.2,.8,.2,1); }
.notif .nicon { display: grid; place-items: start center; padding-top: 2px; }
.notif .nicon svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; }
.notif .ntext { margin-top: 8px; }
.notif time { color: var(--muted); font-size: 13px; }

.dm-badge { background: var(--accent); color: #fff; min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.user-row.unread-dm .grow p { color: var(--text); font-weight: 600; }
.dm-form textarea:focus { border-color: var(--accent); }

.section-head { padding: 14px 16px 6px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.card-more { display: block; padding: 12px 16px; color: var(--accent); }
.card-more:hover { background: var(--hover); text-decoration: none; }
.banner-edit { height: 170px; background: linear-gradient(120deg, var(--accent), #ff5c9d); background-size: cover; background-position: center; display: grid; place-items: center; }
.pickr { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; background: #000000a0; color: #fff; padding: 9px 15px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.pickr.round { position: relative; padding: 0; background: none; border-radius: 50%; }
.pickr.round .overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #00000070; border-radius: 50%; color: #fff; opacity: 0; transition: opacity .15s; }
.pickr.round:hover .overlay { opacity: 1; }
.avatar-edit { margin-top: -62px; margin-bottom: 14px; }
.settings .field textarea { resize: vertical; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid transparent; }
.swatch.on { border-color: var(--text); }
.row-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border-radius: 12px; font-weight: 600; }
.row-btn:hover { background: var(--hover); }
.row-btn.danger { color: var(--like); }

.pulse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 8px; padding: 6px 16px 16px; }
.card h3 .live-dot { margin-right: 6px; }
.side-foot { color: var(--muted); font-size: 12.5px; padding: 0 12px; line-height: 1.6; }
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; }
kbd { background: var(--bg-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 7px; padding: 3px 9px; font-size: 12.5px; font-family: var(--font); font-weight: 700; text-align: center; }
body.bare .rail, body.bare .side, body.bare .tabbar, body.bare .fab { display: none; }
body.bare .app { grid-template-columns: 1fr; max-width: 100%; }
body.bare .main { border: 0; }


/* --- fixes ------------------------------------------------------------- */
/* our display rules outrank the UA [hidden] rule, so restate it; SVG needs
   it spelled out because Chrome's UA sheet only matches HTML elements */
.poll-editor[hidden], .thumbs[hidden], .ring[hidden], [hidden] { display: none !important; }
/* keep the presence dot pinned to the avatar, not the line box around it */
.av-wrap { display: inline-block; line-height: 0; }
.av-wrap > a { display: block; }
/* name + badge on one line, handle beneath, in the thread header */
.focus-head .focus-who .who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.focus-head .focus-who .name { display: inline; }
.focus-head .focus-who .at { flex-basis: 100%; }
/* notification actor sits on the same line as its text */
.notif > div:last-child { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.notif .ntext { margin-top: 0; align-self: center; }
.notif .notif-body { grid-column: 2; }
/* grid items stretch by default, which dragged the presence dot to the row
   bottom instead of the avatar's corner */
.post > .av-wrap { align-self: start; }
/* keep the overflow menu clear of the follow button on a thread's subject */
.post.focus .focus-head { padding-right: 30px; }
/* the badge gets its spacing from flex gap inside .who; in plain text runs
   (notifications, bios) it needs its own */
.ntext .badge, .grow .badge { margin: 0 4px 0 2px; vertical-align: -2px; }
