:root {
  --bg: #ffffff;
  --bg2: #f7f9f9;
  --fg: #0f1419;
  --muted: #536471;
  --line: #eff3f4;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --link: #1d6fa5;
  --card: #ffffff;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #000000; --bg2: #16181c; --fg: #e7e9ea; --muted: #8b98a5; --line: #2f3336;
    --accent: #f59e0b; --accent-soft: #3a2a06; --link: #6cb6ff; --card: #000000; color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #000000; --bg2: #16181c; --fg: #e7e9ea; --muted: #8b98a5; --line: #2f3336;
  --accent: #f59e0b; --accent-soft: #3a2a06; --link: #6cb6ff; --card: #000000; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 var(--font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; background: var(--bg); padding: 8px; z-index: 10; }

.shell { display: grid; grid-template-columns: 240px minmax(0, 600px) 330px; justify-content: center; min-height: 100vh; }
.leftnav { position: sticky; top: 0; height: 100vh; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.leftnav a, .theme-toggle, .nav-btn { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 999px; color: var(--fg); font-size: 19px; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: start; }
.leftnav a:hover, .theme-toggle:hover, .nav-btn:hover { background: var(--bg2); text-decoration: none; }
.leftnav a[aria-current='page'] { font-weight: 700; }
.brand { margin-bottom: 8px; }
.logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--fg); color: var(--bg); font-weight: 800; font-size: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: 12px; color: var(--muted); }
.disclaimer { font-size: 12px; color: var(--muted); padding: 8px 14px; margin-top: auto; }

.center { border-inline-start: 1px solid var(--line); border-inline-end: 1px solid var(--line); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .back { font-size: 20px; color: var(--fg); }

.rightbar { padding: 12px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.panel { background: var(--bg2); border-radius: var(--radius); padding: 12px 0; margin-bottom: 16px; }
.panel h2 { font-size: 19px; margin: 0 16px 8px; }
.panel p { margin: 4px 16px; font-size: 14px; }
.wtf, .trend { display: flex; gap: 10px; padding: 10px 16px; color: var(--fg); align-items: center; }
.trend { flex-direction: column; align-items: flex-start; gap: 2px; }
.wtf:hover, .trend:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); text-decoration: none; }
.t-meta { color: var(--muted); font-size: 13px; }
.t-title { font-weight: 600; }
.more { display: block; padding: 10px 16px; }
.sitefoot { color: var(--muted); font-size: 12px; padding: 0 8px; }
.sitefoot a { color: var(--muted); }
.muted { color: var(--muted); }

.intro { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: 14px; }

.avatar { --c: #64748b; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--c); background: color-mix(in srgb, var(--c) 85%, #000 0%); color: #fff; font-size: 20px; line-height: 1; box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 20%, transparent); }
.avatar.xs { width: 20px; height: 20px; font-size: 11px; }
.avatar.sm { width: 40px; height: 40px; }
.avatar.md { width: 48px; height: 48px; font-size: 24px; }
.avatar.lg { width: 48px; height: 48px; font-size: 24px; }
.avatar.xl { width: 120px; height: 120px; font-size: 60px; border: 4px solid var(--bg); }

.kind-label { display: inline-block; margin-inline-start: 4px; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--muted) 15%, transparent); vertical-align: 1px; line-height: 16px; }
.handle { color: var(--muted); }

.post { display: flex; gap: 12px; padding: 12px 16px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.post:hover { background: color-mix(in srgb, var(--fg) 2.5%, transparent); }
.post.focal { cursor: default; }
.post.focal:hover { background: none; }
.gutter { display: flex; flex-direction: column; align-items: center; }
.connector { flex: 1; width: 2px; background: var(--line); margin-top: 4px; min-height: 12px; }
.has-connector { border-bottom: 0; }
.post-body { min-width: 0; flex: 1; }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-size: 15px; }
.post-head .name { color: var(--fg); font-weight: 700; }
.post-head .time { color: var(--muted); }
.post-head .dot { color: var(--muted); }
.post-head .kind { margin-inline-start: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.replying { color: var(--muted); font-size: 14px; }
.text { margin: 2px 0 8px; white-space: normal; overflow-wrap: anywhere; }
.text-lg { font-size: 19px; line-height: 1.4; margin-top: 10px; }
.cite { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.quote-embed { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin: 4px 0 10px; color: var(--fg); }
.quote-embed:hover { background: var(--bg2); text-decoration: none; }
.media { margin: 12px 0 8px; }
.media-grid { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); }
.media-grid.n1 { width: fit-content; max-width: 100%; background: var(--bg2); }
.media-grid.n2, .media-grid.n3, .media-grid.n4 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-grid.n3 > :first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-rows: 1fr 1fr; }
.media-cell { position: relative; min-height: 0; overflow: hidden; }
.media-cell img, .media-cell video { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-grid.n1 .media-cell { max-height: 510px; }
.media-grid.n1 .media-cell img, .media-grid.n1 .media-cell video { width: auto; max-width: 100%; height: auto; max-height: 510px; object-fit: contain; }
.media-chart img, .media-meme img { background: #fff; }
.media-badge, .alt-badge { position: absolute; bottom: 8px; background: rgba(0, 0, 0, .77); color: #fff; font-family: inherit; font-weight: 700; font-size: 13px; line-height: 1; border-radius: 4px; padding: 3px 5px; border: 0; }
.media-badge { inset-inline-start: 8px; }
.alt-badge { inset-inline-start: 8px; cursor: pointer; }
.media-gif .alt-badge { inset-inline-start: 48px; }
.alt-badge:focus-visible { outline: 2px solid #1d9bf0; outline-offset: 2px; }
.media figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.media figcaption a { color: inherit; }
.link-card { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 12px 0 8px; color: var(--fg); }
.link-card:hover { background: color-mix(in srgb, var(--fg) 3%, transparent); text-decoration: none; }
.lc-icon { flex: none; display: grid; place-items: center; width: 108px; min-height: 108px; background: var(--bg2); color: var(--muted); border-inline-end: 1px solid var(--line); }
.lc-icon svg { width: 30px; height: 30px; }
.lc-body { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 12px; min-width: 0; font-size: 15px; }
.lc-domain { color: var(--muted); font-size: 14px; }
.lc-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lc-desc { color: var(--muted); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.link-card.lc-large { flex-direction: column; }
.lc-img img { display: block; width: 100%; height: auto; aspect-ratio: 1.91 / 1; object-fit: cover; }
.lc-favicon { width: 32px; height: 32px; border-radius: 6px; }
.real-post { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin: 12px 0 8px; color: var(--fg); overflow: hidden; }
.real-post:hover { background: color-mix(in srgb, var(--fg) 3%, transparent); text-decoration: none; }
.rp-head { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.rp-head b { color: var(--fg); }
.rp-avatar { width: 20px; height: 20px; border-radius: 50%; }
.rp-net { margin-inline-start: auto; font-size: 12px; }
.rp-text { display: block; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.real-post .lc-img { display: block; margin: 8px -12px -10px; }
.link-card.lc-large { border: 0; border-radius: 0; background: none; }
.link-card.lc-large:hover { background: none; }
.link-card.lc-large .lc-img { position: relative; display: block; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.link-card.lc-large:hover .lc-img img { filter: brightness(.92); }
.lc-overlay { position: absolute; inset-block-end: 12px; inset-inline-start: 12px; max-inline-size: calc(100% - 24px); padding: 2px 6px; border-radius: 4px; background: rgb(0 0 0 / .77); color: #fff; font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-from { display: block; margin-block-start: 4px; color: var(--muted); font-size: 13px; }
.link-card.lc-large:hover .lc-from { text-decoration: underline; }
.lc-small .lc-icon { width: 130px; min-height: 130px; }
.lc-tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: color-mix(in srgb, #1d9bf0 22%, var(--bg2)); color: var(--fg); font-weight: 800; font-size: 22px; }
.rp-head { flex-wrap: nowrap; min-width: 0; }
.rp-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-handle { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-net { flex: none; display: inline-flex; color: var(--fg); }
.rp-net svg { width: 16px; height: 16px; }
.rp-bsky .rp-net { color: #1185fe; }
.rp-av-tile { display: inline-grid; place-items: center; flex: none; background: var(--bg2); color: var(--fg); font-size: 11px; font-weight: 700; }
.rp-thumb { border-block-start: 1px solid var(--line); }
@media (max-width: 500px) { .lc-small .lc-icon { width: 96px; min-height: 96px; } }
.poll { margin: 12px 0 8px; }
.poll-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.poll-opt { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; padding: 6px 12px; border: 1px solid #1d9bf0; border-radius: 999px; background: none; color: #1d9bf0; font-family: inherit; font-weight: 700; font-size: 15px; line-height: 1.2; cursor: pointer; text-align: start; }
.poll-opt:hover { background: color-mix(in srgb, #1d9bf0 10%, transparent); }
.poll-opt:focus-visible { outline: 2px solid #1d9bf0; outline-offset: 2px; }
.po-bar, .po-pct { display: none; }
.poll.closed .poll-opt, .poll.voted .poll-opt { justify-content: space-between; border: 0; border-radius: 4px; color: var(--fg); font-weight: 400; cursor: default; background: none; padding: 6px 10px; }
.poll.closed .po-bar, .poll.voted .po-bar { display: block; position: absolute; inset: 0 auto 0 0; z-index: -1; border-radius: 4px; background: color-mix(in srgb, var(--muted) 30%, transparent); transition: width .4s ease-out; }
.poll.closed .po-pct, .poll.voted .po-pct { display: block; }
.poll.closed .lead, .poll.voted .lead { font-weight: 700; }
.poll.closed .lead .po-bar, .poll.voted .lead .po-bar { background: color-mix(in srgb, #1d9bf0 55%, transparent); }
.poll-opt.mine .po-label::after { content: " ✓"; }
.poll-meta { color: var(--muted); font-size: 14px; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .po-bar { transition: none !important; } }.qe-head { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.qe-text { display: block; margin-top: 4px; font-size: 14px; }
.thread-link, .participants { display: flex; align-items: center; gap: 4px; font-size: 14px; margin: 2px 0 8px; }
.participants { color: var(--muted); }
.participants .avatar { margin-inline-end: -6px; box-shadow: 0 0 0 2px var(--bg); }
.participants span:last-child { margin-inline-start: 10px; }
.focal-meta { color: var(--muted); font-size: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.actions { display: flex; justify-content: space-between; max-width: 420px; color: var(--muted); font-size: 13px; padding: 2px 0 6px; }
.act { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); padding: 4px 0; }
.act svg { width: 18px; height: 18px; }
.act:hover { color: var(--accent); text-decoration: none; }

.section-h { font-size: 17px; margin: 0; padding: 14px 16px 8px; border-bottom: 1px solid var(--line); }
.replies.nested { margin-inline-start: 34px; border-inline-start: 2px solid var(--line); }
.continue { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.empty { padding: 24px 16px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; padding: 16px; }

.profile { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.banner { --c: #64748b; height: 150px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 40%, #000)); background-size: cover; background-position: center; }
img.avatar { object-fit: cover; padding: 0; background: var(--c, #64748b); }
.credit { color: var(--muted); font-size: 12px; margin: 16px 16px 12px; overflow-wrap: anywhere; }
.profile-top { padding: 0 16px; margin-top: -64px; }
.profile .p-name { margin: 8px 16px 0; font-size: 22px; }
.profile .handle { margin: 0 16px; }
.p-headline { margin: 10px 16px; }
.p-meta, .p-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 16px 8px; color: var(--muted); font-size: 14px; }
.p-stats b { color: var(--fg); }
.about-thinker { padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.about-thinker > p, .about-thinker > ul, .about-thinker h3, .rel { margin-inline-start: 16px; margin-inline-end: 16px; }
.about-thinker h3 { font-size: 15px; margin-top: 16px; margin-bottom: 4px; }
.about-thinker ul { padding-inline-start: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag, .chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 4px; font-size: 13px; color: var(--fg); margin: 0 6px 6px 0; }
.tag { padding-inline-start: 10px; }

.thinker-grid { display: grid; }
.thinker-card { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--fg); }
.thinker-card:hover { background: var(--bg2); text-decoration: none; }
.tc-body { display: flex; flex-direction: column; min-width: 0; }
.tc-body b { display: inline; }
.tc-meta { color: var(--muted); font-size: 13px; }
.tc-head { font-size: 14px; margin-top: 2px; }

.prose { padding: 4px 16px 24px; }
.prose h2 { font-size: 18px; margin-top: 20px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 88px minmax(0, 600px) 300px; }
  .leftnav .nl, .brand-text, .disclaimer { display: none; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 88px minmax(0, 600px); }
  .rightbar { display: none; }
}
/* Mobile chrome (hidden on desktop): drawer, bottom tab bar, compose FAB. */
.menu-btn, .tabbar, .fab, .drawer-scrim { display: none; }
.post-btn { margin-top: 14px; width: 90%; height: 52px; font-size: 17px; background: var(--fg); color: var(--bg); }
.post-btn:hover { opacity: .9; }
.post-btn .pb-icon { display: none; }
.post-btn svg, .fab svg { width: 24px; height: 24px; }
@media (max-width: 1100px) {
  .post-btn { width: 52px; padding: 0; display: grid; place-items: center; }
  .post-btn .pb-icon { display: grid; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .center { border: 0; padding-bottom: calc(53px + env(safe-area-inset-bottom)); }
  .leftnav { position: fixed; z-index: 50; top: 0; bottom: 0; inset-inline-start: 0; width: min(280px, 82vw); height: auto; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); background: var(--bg); overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  [dir='rtl'] .leftnav { transform: translateX(100%); }
  :root[data-drawer='open'] .leftnav { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: 0 0 24px rgba(0, 0, 0, .5); }
  :root[data-drawer='open'] .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(91, 112, 131, .4); }
  :root[data-drawer='open'] { overflow: hidden; }
  .leftnav .nl, .brand-text { display: inline; }
  .brand-text { display: flex; }
  .leftnav a, .theme-toggle, .nav-btn { font-size: 18px; font-weight: 700; padding: 12px 8px; }
  .post-btn { display: none; }
  .disclaimer { display: block; }
  .menu-btn { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--bg2); color: var(--fg); cursor: pointer; }
  .menu-btn svg { width: 20px; height: 20px; }
  .topbar { gap: 16px; padding: 0 16px; min-height: 53px; }
  .topbar h1 { font-size: 17px; }
  .topbar.home-top { padding: 0; }
  .ht-row { display: flex; align-items: center; justify-content: space-between; height: 53px; padding: 0 16px; }
  .ht-row .logo { width: 30px; height: 30px; font-size: 17px; border-radius: 8px; }
  .ht-sp { width: 32px; }
  .tabbar { display: flex; position: fixed; z-index: 30; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; height: calc(53px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .tabbar > * { flex: 1; display: grid; place-items: center; background: none; border: 0; color: var(--fg); cursor: pointer; }
  .tabbar svg { width: 26px; height: 26px; }
  .tabbar [aria-current='page'] svg path, .tabbar [aria-current='page'] svg circle { stroke-width: 2.6; }
  .fab { display: grid; place-items: center; position: fixed; z-index: 31; inset-inline-end: 16px; bottom: calc(53px + 16px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: #1d9bf0; color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); cursor: pointer; }
  .toast { bottom: calc(53px + 24px + env(safe-area-inset-bottom)); }
  .post { gap: 8px; padding: 12px 16px 2px; }
  .post .avatar:not(.xs) { width: 40px; height: 40px; }
  .post-head { font-size: 15px; }
  .actions { max-width: none; padding-inline-end: 0; }
  .post-head .kind { display: none; }
  .replies.nested { margin-inline-start: 16px; }
  .rightbar { display: none; }
}

/* --- engagement, gate modal, auth, welcome (increment 1) --- */
button.act { background: none; border: 0; font: inherit; cursor: pointer; border-radius: 999px; }
.act-end { display: inline-flex; gap: 10px; }
.act-reply:hover { color: #1d9bf0; }
#replies { scroll-margin-block-start: 64px; }
#replies:focus { outline: none; }
#replies:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }
.act-repost:hover, .act-repost.on { color: #00ba7c; }
.act-like:hover, .act-like.on { color: #f91880; }
.act-like.on svg path { fill: currentColor; }
.act-bm:hover, .act-bm.on, .act-share:hover { color: #1d9bf0; }
.act-bm.on svg path { fill: currentColor; }
.act-like.pop svg { animation: heartpop .35s ease-out; }
@keyframes heartpop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .act-like.pop svg { animation: none; } }
.post-head .kind { display: none; }
.btn { font: inherit; font-weight: 700; border-radius: 999px; padding: 8px 16px; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-light { background: #fff; color: #0f1419; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-wide { width: 100%; padding: 12px; }
.modal { border: 0; border-radius: 16px; padding: 28px 32px 24px; max-width: 380px; width: calc(100% - 32px); background: var(--bg); color: var(--fg); text-align: center; position: fixed; }
.modal::backdrop { background: rgba(91, 112, 131, .4); }
.modal-x { position: absolute; top: 8px; inset-inline-start: 10px; background: none; border: 0; color: var(--fg); font-size: 24px; cursor: pointer; line-height: 1; padding: 6px 10px; border-radius: 999px; }
.modal-logo { font-size: 32px; font-weight: 800; }
.modal h2 { margin: 8px 0 6px; font-size: 22px; }
.modal-msg { color: var(--muted); margin: 0 0 20px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: #1d9bf0; color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; font-size: 14px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.intro.welcome { position: relative; padding-inline-end: 40px; }
.welcome-x { position: absolute; top: 8px; inset-inline-end: 8px; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 999px; }
:root[data-welcomed='1'] .intro.welcome { display: none; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; }
.profile-top .follow { margin-bottom: 8px; }
.p-bio { margin: 10px 16px 8px; white-space: pre-line; overflow-wrap: anywhere; }
.p-stats b { color: var(--fg); }
.p-tabs { display: flex; border-bottom: 1px solid var(--line); }
.p-tabs a { flex: 1; display: flex; justify-content: center; color: var(--muted); font-weight: 600; text-decoration: none; }
.p-tabs a:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.p-tabs a { padding: 16px 4px; }
.p-tabs a:focus-visible { outline: 2px solid #1d9bf0; outline-offset: -4px; }
.p-tabs a[aria-current] { color: var(--fg); font-weight: 700; box-shadow: inset 0 -4px 0 #1d9bf0; }
.retaik-head { display: flex; align-items: center; gap: 6px; padding: 8px 16px 0 48px; color: var(--muted); font-size: 13px; font-weight: 700; }
.retaik-head svg { width: 16px; height: 16px; }
.retaik-head a { color: inherit; }
.retaik-row > .post { border-top: 0; }
.media-chart .alt-badge { inset-inline-start: auto; bottom: auto; top: 8px; inset-inline-end: 8px; }

/* Profile header on phones: X proportions (3:1 banner, 80px avatar overlapping by half, 16px gutters). */
.center { min-width: 0; }
.profile .p-name, .profile .handle, .p-headline, .p-meta, .p-stats { overflow-wrap: anywhere; }
@media (max-width: 500px) {
  .banner { height: auto; aspect-ratio: 3 / 1; }
  .profile-top { margin-top: -44px; padding: 0 16px; align-items: flex-end; gap: 12px; }
  .profile-top .avatar.xl { width: 88px; height: 88px; font-size: 44px; border-width: 4px; }
  .profile-top .follow { margin-bottom: 0; }
  .profile .p-name { margin: 10px 16px 0; font-size: 20px; line-height: 1.2; }
  .profile .handle { margin: 2px 16px 0; font-size: 15px; }
  .p-bio { margin: 12px 16px; font-size: 15px; }
  .p-meta { margin: 0 16px 10px; gap: 4px 12px; font-size: 15px; }
  .p-stats { margin: 0 16px; font-size: 14px; }
  .p-tabs a { padding: 16px 4px; font-size: 15px; }
}

/* --- home timelines, follows, hovercards --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.topbar.home-top { display: block; padding: 0; }
.ht-row { display: none; }
.feed-tabs { display: flex; }
.feed-tabs [role='tab'] { flex: 1; background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; font-weight: 500; padding: 0; height: 53px; cursor: pointer; }
.feed-tabs [role='tab']:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.feed-tabs [role='tab'] span { display: inline-flex; align-items: center; height: 100%; position: relative; }
.feed-tabs [role='tab'][aria-selected='true'] { color: var(--fg); font-weight: 700; }
.feed-tabs [role='tab'][aria-selected='true'] span::after { content: ''; position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; height: 4px; border-radius: 999px; background: #1d9bf0; }
.feed-tabs [role='tab']:focus-visible { outline: 2px solid #1d9bf0; outline-offset: -4px; }
.tab-following, :root[data-tab='following'] .tab-foryou { display: none; }
:root[data-tab='following'] .tab-following { display: block; }
.following-empty { display: none; padding: 20px 0 8px; }
:root[data-following='none'] .following-empty { display: block; }
.following-empty h2 { font-size: 26px; line-height: 1.2; margin: 0 16px 8px; }
.following-empty > p { color: var(--muted); margin: 0 16px 16px; }
.section-h { font-size: 20px; margin: 12px 16px 4px; }
.following-feed[aria-busy='true']:empty::before { content: ''; display: block; width: 26px; height: 26px; margin: 32px auto; border-radius: 50%; border: 3px solid color-mix(in srgb, #1d9bf0 25%, transparent); border-top-color: #1d9bf0; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wtf { justify-content: space-between; }
.wtf-link { display: flex; gap: 10px; align-items: center; min-width: 0; color: var(--fg); flex: 1; }
.wtf-link:hover { text-decoration: none; }
.wtf-link:hover b { text-decoration: underline; }
.wtf-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.wtf-names b, .wtf-names .handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wtf-names .handle { color: var(--muted); font-size: 14px; }
.wtf-wide { border-bottom: 1px solid var(--line); }
.wtf-wide .wtf { padding-bottom: 2px; }
.wtf-wide:hover { background: color-mix(in srgb, var(--fg) 3%, transparent); }
.wtf-bio { margin: 0 16px 12px 66px; font-size: 14px; }
.btn-sm { padding: 6px 16px; font-size: 14px; }
.follow-btn { background: var(--fg); color: var(--bg); flex: none; min-width: 78px; }
.follow-btn:hover { opacity: .9; }
.follow-btn .fb-on, .follow-btn .fb-un, .follow-btn.on .fb-off, .follow-btn.on:hover .fb-on { display: none; }
.follow-btn.on { background: transparent; color: var(--fg); border-color: var(--line); min-width: 104px; }
.follow-btn.on .fb-on, .follow-btn.on:hover .fb-un { display: inline; }
.follow-btn.on:hover { color: #f4212e; border-color: color-mix(in srgb, #f4212e 45%, transparent); background: color-mix(in srgb, #f4212e 10%, transparent); opacity: 1; }
.hovercard { position: absolute; z-index: 40; width: 300px; padding: 16px; border-radius: 16px; background: var(--bg); color: var(--fg); box-shadow: 0 0 15px color-mix(in srgb, var(--fg) 20%, transparent), 0 0 3px 1px color-mix(in srgb, var(--fg) 15%, transparent); font-size: 15px; }
.hovercard .hc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hovercard .avatar.md { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.hc-name { display: block; margin-top: 8px; font-weight: 800; color: var(--fg); }
.hovercard .handle { color: var(--muted); }
.hc-bio { margin: 10px 0; }
.hc-stats { display: flex; gap: 16px; color: var(--muted); font-size: 14px; }
.hc-stats b { color: var(--fg); }

/* --- For you ranking --- */
.feed-sentinel { height: 1px; }
.caught-up { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 16px; border-bottom: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; }
.caught-up b { color: var(--fg); font-size: 17px; }
.caught-up:not(.end)::before { content: '✓'; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1d9bf0; color: #fff; font-weight: 800; margin-bottom: 4px; }
.conv-more { display: block; padding: 0 16px 14px 68px; margin-top: -4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.conv:has(.conv-more) > .post:last-of-type { border-bottom: 0; }
/* mobile home header (after the generic .ht-row reset) */
@media (max-width: 640px) {
  .ht-row { display: flex; }
}

/* --- PWA --- */
.offline-msg { display: grid; justify-items: center; gap: 12px; padding: 64px 24px; text-align: center; }
.offline-msg .logo { width: 56px; height: 56px; font-size: 32px; border-radius: 14px; }
.offline-msg h2 { margin: 0; font-size: 24px; }
.offline-msg p { margin: 0; max-width: 34ch; color: var(--muted); }
.nav-install[hidden] { display: none !important; }

/* Search: sidebar box, search page header, results */
.search-form { margin: 0; }
.sbox { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 16px; border-radius: 999px; background: var(--bg2); border: 1px solid transparent; color: var(--muted); cursor: text; }
.sbox:focus-within { border-color: #1d9bf0; background: var(--bg); color: #1d9bf0; }
.sbox svg { width: 18px; height: 18px; flex: none; }
.sbox input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--fg); font: inherit; font-size: 15px; outline: none; }
.sbox input::placeholder { color: var(--muted); }
.sbox input::-webkit-search-cancel-button { filter: grayscale(1); }
.search-side { position: sticky; top: 0; z-index: 2; margin: -12px -20px 12px; padding: 6px 20px; background: var(--bg); }
.search-top { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
.st-row { display: flex; align-items: center; gap: 16px; padding: 6px 16px; }
.st-row .search-form { flex: 1; min-width: 0; }
.st-row .menu-btn + .search-form .sbox { height: 38px; }
.search-tabs[hidden], .search-explore[hidden] { display: none; }
.search-tabs { border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.search-tabs [role='tab'] { min-width: 72px; }
.search-explore .panel { background: none; border-radius: 0; border-bottom: 1px solid var(--line); margin: 0; }
.search-explore .panel h2 { font-size: 20px; margin: 0; padding: 4px 16px 8px; }
.search-results .section-h { border-bottom: 0; font-size: 20px; }
.search-results > .more { border-bottom: 1px solid var(--line); color: #1d9bf0; }
.search-empty { max-width: 340px; margin: 32px auto; padding: 0 16px; }
.search-empty h2 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; overflow-wrap: anywhere; }
.search-empty p { color: var(--muted); margin: 0; }
.search-more { display: block; width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: #1d9bf0; font: inherit; font-size: 15px; cursor: pointer; }
.search-more:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
/* QA pass: profile tabs/lists, image viewer, tap targets, header truncation, bottom chrome clearance */
.p-stats a { color: var(--muted); }
.p-stats a:hover { text-decoration: underline; text-decoration-color: var(--muted); }
.p-stats a:hover b { text-decoration: underline; }
.banner-btn, .p-avatar-btn, .media-zoom { display: block; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.banner-btn { width: 100%; }
.p-avatar-btn { border-radius: 50%; }
.banner-btn:focus-visible, .p-avatar-btn:focus-visible, .media-zoom:focus-visible { outline: 2px solid #1d9bf0; outline-offset: 2px; }
.media-zoom { width: 100%; height: 100%; }
.media-grid.n1 .media-zoom { width: auto; max-width: 100%; height: auto; }
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox figure { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; margin: 0; padding: 56px 12px 16px; box-sizing: border-box; }
.lightbox img { max-width: 100%; max-height: calc(100% - 48px); object-fit: contain; border-radius: 4px; }
.lightbox figcaption { max-width: 600px; font-size: 14px; color: #e7e9ea; text-align: center; }
.lightbox figcaption:empty { display: none; }
.lb-x { position: fixed; top: 12px; inset-inline-start: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(39, 44, 48, .75); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.lb-x:hover { background: rgba(39, 44, 48, .95); }
.link-card.lc-static, .link-card.lc-static:hover { cursor: default; background: none; }
.p-empty { max-width: 340px; margin: 32px auto; padding: 0 16px; }
.p-empty h2 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; overflow-wrap: anywhere; }
.p-empty p { color: var(--muted); margin: 0; }
.fl-note { color: var(--muted); font-size: 13px; padding: 12px 16px; margin: 0; }
.tb-title { min-width: 0; }
.tb-title h1, .topbar .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { background: color-mix(in srgb, var(--bg) 96%, transparent); }
.topbar .back { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-inline-start: -8px; border-radius: 50%; }
.topbar .back:hover { background: color-mix(in srgb, var(--fg) 10%, transparent); text-decoration: none; }
.post-body { min-width: 0; }
.post-head { flex-wrap: nowrap; min-width: 0; white-space: nowrap; }
.post-head .name, .post-head .handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.post-head .handle { color: var(--muted); flex-shrink: 2; }
.post-head .handle:hover { text-decoration: none; }
.post-head .dot, .post-head .time, .post-head .kind-label { flex: none; }
.qe-head { min-width: 0; white-space: nowrap; }
.qe-head b, .qe-head .handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qe-head .avatar { flex: none; }
.act { min-height: 40px; padding: 0 8px; margin: 0 -8px; }
.act-end { gap: 4px; }
.act-end .act { margin: 0; padding: 0 9px; }
.act-end { margin-inline-end: -9px; }
.retaik-head a, .media figcaption a, .sitefoot a, .prose a, .p-meta a { padding-block: 6px; }
.participants, .thread-link { padding-block: 8px; margin-block: -6px 0; }
.pager a { padding: 10px 8px; margin: -10px -8px; }
.ht-logo { padding: 7px; margin: -7px; }
.alt-badge::after { content: ''; position: absolute; inset: -10px; }
@media (max-width: 640px) {
  html { scroll-padding-top: 110px; scroll-padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .center { padding-bottom: calc(53px + 56px + 32px + env(safe-area-inset-bottom)); }
}
/* RTL: mirror direction-bearing glyphs. */
[dir='rtl'] .topbar .back { transform: scaleX(-1); }

/* Profile About (opt-in per pack: site.json profile.about) */
.p-about { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.p-about h2 { font-size: 17px; margin: 0 0 6px; }
.p-about h3 { font-size: 15px; margin: 12px 0 4px; }
.p-about p { margin: 0 0 8px; }
.p-about ul { margin: 0 0 8px; padding-inline-start: 20px; }
.ab-page { border-bottom: 0; line-height: 1.5; }
.ab-page h2 { font-size: 20px; }
.ab-page section { margin-block: 14px; }
.ab-page li { margin-block-end: 4px; }
.ab-note { color: var(--muted); font-size: 13px; }
.ab-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.ab-facts dt { color: var(--muted); font-size: 13px; }
.ab-facts dd { margin: 0; }
.ab-quote { margin: 0 0 12px; padding-inline-start: 12px; border-inline-start: 3px solid var(--line); }
.ab-quote p { margin: 0 0 4px; }
.ab-quote cite { font-size: 13px; font-style: normal; color: var(--muted); }
.ab-pd { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.ab-page .rel { margin-block: 12px; }
.ab-wiki { font-weight: 600; }
/* ---------- discovery: topics, trends, who to follow, onboarding, /connect/, /me/ ---------- */
.trend-f { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 0; }
.trend-f .trend-link { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; padding-block: 10px; padding-inline: 16px 0; color: var(--fg); }
.trend-f .trend-link:hover { text-decoration: none; }
.trend-f .t-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.trend-f .follow-btn { margin-inline-end: 16px; flex: none; }
.ctab-panel > .trend-f { border-bottom: 1px solid var(--line); }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding-block: 6px; padding-inline: 14px 10px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--fg); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.tchip:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.tchip:focus-visible { outline: 2px solid #1d9bf0; outline-offset: 2px; }
.tchip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tchip .tc-tick, .tchip.on .tc-plus { display: none; }
.tchip.on .tc-tick { display: inline; }
.tchip.on { background: #1d9bf0; border-color: #1d9bf0; color: #fff; }
.topic-ctx { padding-block: 10px 0; padding-inline: 68px 16px; font-size: 13px; font-weight: 700; color: var(--muted); }
.topic-ctx a { color: inherit; }
.topic-ctx + .post, .topic-ctx + .conv > .post:first-child { padding-block-start: 4px; }
.wtf-strip, .topic-strip { border-bottom: 1px solid var(--line); padding-block: 12px 0; }
.wtf-strip h2, .topic-strip h2 { font-size: 20px; margin: 0; padding-inline: 16px; }
.ws-cards { display: flex; gap: 12px; overflow-x: auto; padding: 12px 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ws-cards::-webkit-scrollbar { display: none; }
.ws-card { flex: none; width: 150px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 16px; scroll-snap-align: start; text-align: center; }
.ws-link { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--fg); min-width: 0; max-width: 100%; }
.ws-link:hover { text-decoration: none; }
.ws-link .avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-block-end: 6px; font-size: 28px; }
.ws-link b, .ws-link .handle { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-link .handle { color: var(--muted); font-size: 14px; }
.ws-card .follow-btn { align-self: stretch; }
@media (min-width: 961px) { .wtf-strip { display: none; } }
.fe-cta { padding: 8px 16px 20px; margin: 0; }
.connect-top .tb-row { display: flex; align-items: center; gap: 16px; min-height: 53px; padding-inline: 16px; }
.connect-people .wtf-bio { margin-inline: 66px 16px; }
.fl-note { color: var(--muted); font-size: 13px; padding: 12px 16px; margin: 0; }
.me-banner { --c: #1d9bf0; }
.me-avatar { --c: #536471; color: #fff; }
.me-avatar svg { width: 56px; height: 56px; fill: currentColor; }
.me-note { margin-block: 12px 4px; margin-inline: 16px; padding: 10px 12px; border-radius: 12px; background: var(--bg2); color: var(--muted); font-size: 14px; line-height: 1.4; }
.me-tabs { border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.me-tabs [role='tab'] { flex: 1 0 auto; padding-inline: 14px; }
.me-chips { padding-block: 16px; }
.me .profile-top { min-height: 70px; }
.onboard { max-width: 560px; max-height: min(90vh, 760px); overflow-y: auto; text-align: start; padding: 24px 20px 0; }
.onboard h2, .onboard .modal-logo, .onboard .modal-msg { text-align: center; }
.onboard .ob-h { font-size: 15px; margin: 16px 0 4px; color: var(--muted); }
.onboard .topic-chips { padding-inline: 0; }
.ob-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.ob-person { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; padding: 10px 6px; border-radius: 14px; border: 2px solid var(--line); background: none; color: var(--fg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; }
.ob-person .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.ob-person.on { border-color: #1d9bf0; background: color-mix(in srgb, #1d9bf0 14%, transparent); }
.ob-person:focus-visible { outline: 2px solid #1d9bf0; outline-offset: 2px; }
.ob-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.ob-count { margin-inline-end: auto; color: var(--muted); font-size: 14px; }
.ob-done[disabled] { opacity: .5; cursor: default; }
.topbar.connect-top { display: block; padding: 0; }
.ctab-panel .section-h, .following-empty .section-h { margin: 0; }
.ob-foot .btn { white-space: nowrap; padding-inline: 16px; min-height: 44px; }
.ob-foot .ob-skip { background: none; color: var(--fg); border-color: var(--line); }
.ob-count { white-space: nowrap; }
.ob-foot { flex-wrap: wrap; }
@media (max-width: 430px) { .ob-count { flex-basis: 100%; text-align: center; margin-inline-end: 0; } .ob-count:empty { display: none; } .ob-foot .btn { flex: 1; } }
@media (max-width: 500px) { .ob-people { grid-template-columns: repeat(3, 1fr); } .ob-person { font-size: 13px; padding: 8px 4px; } }
