/* ==========================================================================
   Pulse — stylesheet (release 1.0.0)
   Themes: light / dim / dark / auto · Accents: blue yellow pink purple orange green
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Noto Sans Arabic", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --fs: 15px;
  --bg: #ffffff;
  --bg-2: #f5f7f8;
  --bg-3: #e9edef;
  --hover: rgba(16, 20, 24, .03);
  --hover-strong: rgba(16, 20, 24, .07);
  --text: #101418;
  --text-2: #5b6670;
  --border: #e9edef;
  --border-2: #cfd8dc;
  --overlay: rgba(16, 20, 24, .45);
  --header-bg: rgba(255, 255, 255, .86);
  --shadow: 0 8px 28px rgba(16, 20, 24, .14), 0 0 2px rgba(16, 20, 24, .12);
  --accent: #1b8ef2;
  --accent-rgb: 27, 142, 242;
  --accent-ink: #ffffff;
  --verified: #1b8ef2;
  --like: #f4245e;
  --like-rgb: 244, 36, 94;
  --repost: #12b76a;
  --repost-rgb: 18, 183, 106;
  --danger: #e5243b;
  --danger-rgb: 229, 36, 59;
  --radius: 16px;
  --logo-ink: #ffffff;
  color-scheme: light;
}

html[data-theme="dim"] {
  --bg: #141d26; --bg-2: #1b2631; --bg-3: #24323f;
  --hover: rgba(255, 255, 255, .03); --hover-strong: rgba(255, 255, 255, .07);
  --text: #f2f5f7; --text-2: #8a98a6; --border: #2c3a47; --border-2: #3d5162;
  --overlay: rgba(91, 112, 131, .4); --header-bg: rgba(20, 29, 38, .86);
  --shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 0 2px rgba(255, 255, 255, .15);
  color-scheme: dark;
}

html[data-theme="dark"] {
  --bg: #000000; --bg-2: #121416; --bg-3: #1d2023;
  --hover: rgba(255, 255, 255, .03); --hover-strong: rgba(255, 255, 255, .08);
  --text: #e8eaeb; --text-2: #757c82; --border: #262a2e; --border-2: #3a3f44;
  --overlay: rgba(91, 112, 131, .4); --header-bg: rgba(0, 0, 0, .8);
  --shadow: 0 8px 28px rgba(255, 255, 255, .08), 0 0 2px rgba(255, 255, 255, .25);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #000000; --bg-2: #121416; --bg-3: #1d2023;
    --hover: rgba(255, 255, 255, .03); --hover-strong: rgba(255, 255, 255, .08);
    --text: #e8eaeb; --text-2: #757c82; --border: #262a2e; --border-2: #3a3f44;
    --overlay: rgba(91, 112, 131, .4); --header-bg: rgba(0, 0, 0, .8);
    --shadow: 0 8px 28px rgba(255, 255, 255, .08), 0 0 2px rgba(255, 255, 255, .25);
    color-scheme: dark;
  }
}

html[data-accent="yellow"] { --accent: #f5b400; --accent-rgb: 245, 180, 0; --accent-ink: #101418; --logo-ink: #101418; }
html[data-accent="pink"]   { --accent: #ec4899; --accent-rgb: 236, 72, 153; }
html[data-accent="purple"] { --accent: #8b5cf6; --accent-rgb: 139, 92, 246; }
html[data-accent="orange"] { --accent: #f97316; --accent-rgb: 249, 115, 22; }
html[data-accent="green"]  { --accent: #10b981; --accent-rgb: 16, 185, 129; }

html[data-font="sm"] { --fs: 14px; }
html[data-font="lg"] { --fs: 17px; }
html[data-font="xl"] { --fs: 19px; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 var(--fs)/1.3333 var(--font);
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
svg { flex-shrink: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(var(--accent-rgb), .25); }
.muted { color: var(--text-2); }
.small { font-size: .875em; }
.tiny { font-size: 12px; }
.center { justify-content: center; text-align: center; }
.mt { margin-top: 16px; }
.danger-text { color: var(--danger); }
code { background: var(--bg-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 999px; }
.skip-link:focus { left: 8px; }

/* ---------- app layout ---------- */
.app { display: flex; justify-content: center; flex: 1; width: 100%; }
.nav { width: 275px; flex-shrink: 0; }
.nav-inner { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: flex-start; padding: 2px 12px 12px; overflow-y: auto; scrollbar-width: none; }
.nav-logo { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); margin: 2px 0; transition: background .15s; }
.nav-logo:hover { background: rgba(var(--accent-rgb), .1); }
.nav-links { display: flex; flex-direction: column; width: 100%; }
.nav-link { display: inline-flex; align-items: center; gap: 20px; padding: 12px; border-radius: 999px; font-size: 20px; line-height: 24px; width: fit-content; margin: 2px 0; transition: background .15s; }
.nav-link:hover { background: var(--hover-strong); }
.nav-link.active { font-weight: 700; }
.nav-link.active svg, .tabbar-link.active svg { stroke-width: 2.7; }
.nav-icon { position: relative; display: inline-flex; }
.badge { position: absolute; top: -7px; right: -9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 1; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; border: 2px solid var(--bg); }
.nav-post-btn { width: 90%; margin: 16px 0 12px; box-shadow: 0 2px 8px rgba(var(--accent-rgb), .25); }
.nav-post-icon { display: none; }
.nav-account { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 999px; width: 100%; text-align: left; transition: background .15s; }
.nav-account:hover { background: var(--hover-strong); }
.nav-account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 20px; }
.nav-account-text strong, .nav-account-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-account-text span { color: var(--text-2); }
.nav-guest { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; width: 100%; }

.main { width: 600px; max-width: 100%; min-width: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-height: 100vh; flex-shrink: 0; position: relative; }
.wide-main .main { width: 990px; max-width: calc(100vw - 88px); }
.sidebar { width: 350px; margin-left: 30px; flex-shrink: 0; }
.sidebar-inner { position: sticky; top: 0; padding: 0 0 48px; display: flex; flex-direction: column; gap: 16px; max-height: 100vh; overflow-y: auto; scrollbar-width: none; }
.sidebar-inner::-webkit-scrollbar { display: none; }
.sidebar-inner > :first-child:not(.search-box) { margin-top: 12px; }
.sidebar-inner > .search-box { position: sticky; top: 0; z-index: 5; margin-top: 6px; box-shadow: 0 0 0 6px var(--bg); }

/* ---------- search ---------- */
.search-box { position: relative; display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid transparent; border-radius: 999px; padding: 0 16px; height: 44px; color: var(--text-2); transition: border-color .15s, background .15s; }
.search-box:focus-within { border-color: var(--accent); background: var(--bg); color: var(--accent); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.search-box input::-webkit-search-cancel-button { filter: grayscale(1); }
.typeahead { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--bg); border-radius: 10px; box-shadow: var(--shadow); z-index: 60; max-height: 420px; overflow-y: auto; padding: 4px 0; color: var(--text); }
.ta-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; width: 100%; text-align: left; line-height: 1.25; }
.ta-item:hover, .ta-item.active { background: var(--hover-strong); }
.ta-item .ta-text { min-width: 0; }
.ta-item strong { display: flex; align-items: center; gap: 2px; overflow: hidden; white-space: nowrap; }
.ta-item span.muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-empty { padding: 16px; color: var(--text-2); text-align: center; }
.typeahead-results .ta-item { padding: 10px 0; }

/* ---------- cards & sidebar ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.card-pad { padding: 16px; }
.card-title { font-size: 20px; font-weight: 800; line-height: 24px; margin: 0; padding: 12px 16px; }
.card-pad .card-title { padding: 0 0 12px; }
.card-item, .trend-row { display: block; padding: 12px 16px; transition: background .15s; }
.card-item:hover, .trend-row:hover { background: var(--hover); }
.card-more { display: block; padding: 16px; color: var(--accent); transition: background .15s; }
.card-more:hover { background: var(--hover); }
.trend-meta { display: block; font-size: 13px; color: var(--text-2); line-height: 16px; }
.trend-tag { display: block; font-weight: 700; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; }
.footer-links { padding: 0 16px; font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- page header & tabs ---------- */
.page-header { position: sticky; top: 0; z-index: 20; background: var(--header-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.ph-row { display: flex; align-items: center; gap: 20px; min-height: 53px; padding: 0 16px; }
.ph-search { gap: 12px; padding: 6px 16px; }
.ph-search .search-box { flex: 1; }
.ph-back { margin-left: -8px; }
.ph-titles { flex: 1; min-width: 0; }
.ph-title { font-size: 20px; font-weight: 800; line-height: 24px; margin: 0; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-sub { font-size: 13px; color: var(--text-2); line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-right { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; display: flex; justify-content: center; align-items: center; min-height: 53px; padding: 0 16px; color: var(--text-2); font-weight: 500; transition: background .15s; }
.tab:hover { background: var(--hover-strong); }
.tab span { position: relative; padding: 16px 0; white-space: nowrap; }
.tab.active { color: var(--text); font-weight: 700; }
.tab.active span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 2px; background: var(--accent); }
.page-header .tabs { margin-top: -4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 15px; line-height: 1; border: 1px solid transparent; white-space: nowrap; cursor: pointer; transition: background .15s, opacity .15s, filter .15s, color .15s, border-color .15s; user-select: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(.92); }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover:not(:disabled) { opacity: .88; }
.btn-outline { border-color: var(--border-2); color: var(--text); background: transparent; }
.btn-outline:hover:not(:disabled) { background: var(--hover-strong); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-danger-text { color: var(--danger); background: transparent; }
.btn-danger-text:hover { background: rgba(var(--danger-rgb), .1); }
.btn-ghost { color: var(--accent); background: transparent; }
.btn-ghost:hover { background: rgba(var(--accent-rgb), .1); }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.follow-btn[data-state="following"]:hover, .follow-btn[data-state="requested"]:hover { color: var(--danger); border-color: rgba(var(--danger-rgb), .45); background: rgba(var(--danger-rgb), .1); }
.follow-btn[data-state="following"], .follow-btn[data-state="requested"] { min-width: 102px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text); flex-shrink: 0; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover-strong); }
.icon-btn-outline { border: 1px solid var(--border-2); }

/* ---------- avatars & badges ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--bg-3); flex-shrink: 0; }
.verified { display: inline-flex; color: var(--verified); margin-left: 2px; flex-shrink: 0; }
.lock-badge { display: inline-flex; color: var(--text); margin-left: 2px; flex-shrink: 0; }
.follows-you { display: inline-block; background: var(--bg-3); color: var(--text-2); font-size: 12px; line-height: 16px; padding: 0 4px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); margin-left: 4px; }
.pill-danger { background: rgba(var(--danger-rgb), .12); color: var(--danger); }

/* ---------- posts ---------- */
.feed { min-height: 1px; }
.post { position: relative; padding: 12px 16px 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.post:hover { background: var(--hover); }
.post.is-new { animation: flash-in .8s ease-out; }
.post-context { display: flex; align-items: center; gap: 12px; margin: -4px 0 4px; padding-left: 24px; font-size: 13px; font-weight: 700; line-height: 16px; color: var(--text-2); }
.post-context a:hover { text-decoration: underline; }
.post-row { display: flex; gap: 12px; }
.post-aside { flex-shrink: 0; width: 40px; display: flex; flex-direction: column; align-items: center; }
.post-avatar { display: block; border-radius: 50%; transition: filter .15s; }
.post-avatar:hover { filter: brightness(.9); }
.thread-line { width: 2px; flex: 1; min-height: 12px; background: var(--border-2); margin-top: 4px; }
.has-thread-below { border-bottom: 0; }
.has-thread-below + .post::before, .has-thread-below + .post-unavailable::before, .has-thread-below + .post-detail::before { content: ""; position: absolute; left: 35px; top: 0; height: 12px; width: 2px; background: var(--border-2); }
.post-main { flex: 1; min-width: 0; padding-bottom: 4px; }
.post-head { display: flex; align-items: center; gap: 4px; line-height: 20px; white-space: nowrap; min-width: 0; }
.post-name { display: inline-flex; align-items: center; min-width: 0; font-weight: 700; overflow: hidden; flex-shrink: 1; }
.name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-name:hover .name-text, .uc-name:hover .name-text { text-decoration: underline; }
.post-handle { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1000; }
.dot, .post-time, .edited-tag { color: var(--text-2); flex-shrink: 0; }
.post-time:hover { text-decoration: underline; }
.post-more { margin-left: auto; margin-right: -8px; width: 34px; height: 34px; color: var(--text-2); }
.post-more:hover { color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.post-reply-to { color: var(--text-2); margin-top: 2px; }
.mention, .hashtag, .ext-link, .post-text a, .uc-bio a, .profile-bio a, .notif-snippet a, .qc-text a, .prose a, .announcement a, .list-hero a.mention { color: var(--accent); }
.post-text a:hover, .uc-bio a:hover, .profile-bio a:hover, .qc-text a:hover, .prose a:hover, .mention:hover { text-decoration: underline; }
.post-text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.post-unavailable { position: relative; margin: 12px 16px 0; padding: 14px 16px; background: var(--bg-2); border-radius: 12px; color: var(--text-2); }
.post-unavailable .thread-line { display: none; }

/* media */
.media-grid { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: grid; gap: 2px; background: var(--border); }
.media-grid.n1 { display: block; background: transparent; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-grid.n3, .media-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.media-grid.n3 .media-item:first-child { grid-row: span 2; }
.media-item { position: relative; display: block; overflow: hidden; background: var(--bg-3); min-height: 0; min-width: 0; }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-grid.n1 .media-item { width: 100%; max-height: 510px; }
.media-grid.n1 .media-item img { max-height: 510px; }
.media-badge { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; padding: 0 5px; border-radius: 4px; }
.media-alt { left: auto; right: 8px; }
.media-video video { width: 100%; max-height: 510px; background: #000; }
.media-small.n1 .media-item, .media-small.n1 .media-item img { max-height: 280px; }

/* poll */
.poll { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.poll-choice { width: 100%; min-height: 36px; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; font-weight: 700; padding: 6px 16px; transition: background .15s; overflow-wrap: anywhere; }
.poll-choice:hover { background: rgba(var(--accent-rgb), .1); }
.poll-result { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 0 12px; border-radius: 6px; overflow: hidden; }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bg-3); border-radius: 6px; transition: width .4s ease-out; }
.poll-result.winner { font-weight: 700; }
.poll-result.winner .poll-bar { background: rgba(var(--accent-rgb), .35); }
.poll-label, .poll-pct { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.poll-label { overflow-wrap: anywhere; }
.poll-foot { margin-top: 2px; }

/* quote card */
.quote-card { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; cursor: pointer; transition: background .15s; overflow: hidden; }
.quote-card:hover { background: var(--hover); }
.qc-head { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; line-height: 20px; }
.qc-head .avatar { margin-right: 2px; }
.qc-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.qc-handle { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; flex-shrink: 1000; }
.qc-time { color: var(--text-2); flex-shrink: 0; }
.qc-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.quote-card .media-grid { margin: 12px -12px -12px; border-radius: 0; border-width: 1px 0 0; }
.qc-poll { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.quote-unavailable { padding: 14px 16px; color: var(--text-2); background: var(--bg-2); cursor: default; }
.quote-unavailable:hover { background: var(--bg-2); }

/* action bar */
.post-actions { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 0 -8px; }
.act { display: inline-flex; align-items: center; color: var(--text-2); font-size: 13px; min-width: 0; }
.act-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; transition: background .15s, color .15s; }
.act-count { padding: 0 6px 0 2px; min-width: 2ch; font-variant-numeric: tabular-nums; }
.act-group { display: flex; }
.act-reply:hover, .act-views:hover, .act-bookmark:hover, .act-share:hover { color: var(--accent); }
.act-reply:hover .act-icon, .act-views:hover .act-icon, .act-bookmark:hover .act-icon, .act-share:hover .act-icon { background: rgba(var(--accent-rgb), .1); }
.act-repost:hover:not(:disabled), .act-repost.on { color: var(--repost); }
.act-repost:hover:not(:disabled) .act-icon { background: rgba(var(--repost-rgb), .1); }
.act-like:hover, .act-like.on { color: var(--like); }
.act-like:hover .act-icon { background: rgba(var(--like-rgb), .1); }
.act-like.on svg, .act-bookmark.on svg { fill: currentColor; }
.act-bookmark.on { color: var(--accent); }
.act:disabled { opacity: .45; cursor: not-allowed; }
.act.pop svg { animation: pop .35s ease-out; }
.post-actions-big { justify-content: space-around; margin: 0; padding: 4px 0; border-bottom: 1px solid var(--border); }
.post-actions-big .act-icon { width: 40px; height: 40px; }
.post-actions-big .act-group { display: contents; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes flash-in { from { background: rgba(var(--accent-rgb), .12); } to { background: transparent; } }

/* post detail */
.post-detail { cursor: default; padding: 12px 16px 0; }
.post-detail:hover { background: transparent; }
.pd-head { display: flex; align-items: center; gap: 12px; }
.pd-names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 20px; }
.pd-names .post-handle { flex-shrink: 1; }
.pd-head .post-more { margin-left: 0; }
.pd-text { font-size: 1.2em; line-height: 1.4; margin-top: 12px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 4px; padding: 16px 0; color: var(--text-2); border-bottom: 1px solid var(--border); }
.pd-meta a:hover { text-decoration: underline; }
.pd-meta strong, .pd-stats strong { color: var(--text); }
.pd-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 16px 0; color: var(--text-2); border-bottom: 1px solid var(--border); }
.pd-stats a:hover { text-decoration: underline; }
.reply-blocked { display: flex; align-items: center; gap: 8px; padding: 16px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.reply-blocked a { color: var(--accent); }

/* ---------- composer ---------- */
.composer { padding: 4px 16px 8px; border-bottom: 1px solid var(--border); }
.composer-row { display: flex; gap: 12px; }
.composer-avatar { padding-top: 8px; }
.composer-main { flex: 1; min-width: 0; }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font-size: 20px; line-height: 24px; padding: 12px 0; min-height: 48px; overflow: hidden; }
.composer textarea::placeholder { color: var(--text-2); }
.composer-modal { border-bottom: 0; padding: 0 16px 12px; }
.composer-modal textarea { min-height: 120px; }
.composer-reply textarea { min-height: 48px; }
.composer-context { padding: 4px 0 8px; }
.composer-context .quote-card { margin-top: 0; cursor: default; }
.composer-context .ctx-replying { color: var(--text-2); margin: 8px 0 0 52px; }
.composer-context .ctx-replying a { color: var(--accent); }
.composer-quote .quote-card { cursor: default; margin: 0 0 12px; }
.composer-policy { padding: 0 0 12px; border-bottom: 1px solid var(--border); }
.policy-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; font-size: 14px; padding: 2px 12px 2px 8px; margin-left: -8px; border-radius: 999px; transition: background .15s; }
.policy-btn:hover { background: rgba(var(--accent-rgb), .1); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; gap: 8px; }
.composer-tools { display: flex; margin-left: -8px; }
.tool { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); cursor: pointer; transition: background .15s, opacity .15s; }
.tool:hover { background: rgba(var(--accent-rgb), .1); }
.tool.disabled { opacity: .4; pointer-events: none; }
.composer-submit { display: flex; align-items: center; gap: 12px; }
.char-ring circle { fill: none; stroke-width: 2.2; }
.ring-bg { stroke: var(--border); }
.ring-fg { stroke: var(--accent); transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .1s; }
.char-ring.warn .ring-fg { stroke: #f5a700; }
.char-ring.over .ring-fg { stroke: var(--danger); }
.char-count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.char-count.over { color: var(--danger); }
.composer-media { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.composer-media.one { grid-template-columns: 1fr; }
.cm-item { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); aspect-ratio: 4 / 3; }
.composer-media.one .cm-item { aspect-ratio: auto; max-height: 420px; }
.cm-item img, .cm-item video { width: 100%; height: 100%; object-fit: cover; }
.cm-remove, .cm-alt { position: absolute; background: rgba(15, 20, 25, .75); color: #fff; transition: background .15s; }
.cm-remove { top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.cm-alt { left: 6px; bottom: 6px; border-radius: 999px; font-size: 13px; font-weight: 700; padding: 3px 10px; }
.cm-remove:hover, .cm-alt:hover { background: rgba(15, 20, 25, .9); }
.cm-alt.has-alt::before { content: "✓ "; }
.poll-builder { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.poll-options { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.poll-length { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.poll-length .input { width: auto; padding: 6px 8px; font-size: 14px; }
.composer.dragover { box-shadow: inset 0 0 0 2px var(--accent); }
.composer.busy { opacity: .6; pointer-events: none; }
.home-composer .composer { padding-top: 4px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1; min-width: 140px; }
.field-label { font-size: 14px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--text-2); }
.field-error { font-size: 13px; color: var(--danger); }
.input { width: 100%; border: 1px solid var(--border-2); border-radius: 6px; background: var(--bg); padding: 10px 12px; color: var(--text); font-size: 16px; line-height: 1.35; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
textarea.input { resize: vertical; }
.has-error .input, .has-error .input-prefix { border-color: var(--danger); }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: 6px; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.input-prefix > span { padding-left: 12px; color: var(--text-2); }
.input-prefix .input { border: 0; box-shadow: none !important; padding-left: 4px; }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check a { color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; cursor: pointer; }
.switch-row > span, .radio-row > span { display: flex; flex-direction: column; gap: 3px; }
.switch { appearance: none; -webkit-appearance: none; width: 44px !important; height: 26px !important; border-radius: 13px; background: var(--border-2); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.radio-row { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; cursor: pointer; }
.alert { padding: 12px 16px; border-radius: 12px; background: var(--bg-2); font-size: 14px; }
.alert-error { background: rgba(var(--danger-rgb), .1); color: var(--danger); }
.alert-success { background: rgba(var(--repost-rgb), .12); color: var(--repost); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 160px; }

/* ---------- people ---------- */
.user-cell { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background .15s; }
.user-cell:hover { background: var(--hover); }
.uc-main { flex: 1; min-width: 0; }
.uc-top { display: flex; align-items: center; gap: 12px; }
.uc-names { flex: 1; min-width: 0; line-height: 20px; }
.uc-name { display: flex; align-items: center; font-weight: 700; min-width: 0; }
.uc-handle { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-bio { margin-top: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.uc-action { flex-shrink: 0; display: flex; gap: 4px; align-items: center; }
.user-cell.compact .uc-handle .follows-you { display: none; }

/* ---------- profile ---------- */
.profile-banner { position: relative; aspect-ratio: 3 / 1; background: var(--bg-3) center / cover no-repeat; }
.banner-link { position: absolute; inset: 0; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 16px 0; }
.profile-avatar { position: relative; z-index: 1; display: block; flex-shrink: 0; width: 25%; min-width: 72px; max-width: 142px; aspect-ratio: 1; margin-top: calc(-15% - 12px); border-radius: 50%; border: 4px solid var(--bg); background: var(--bg); overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; }
.profile-actions { display: flex; gap: 8px; align-items: center; min-height: 40px; flex-wrap: wrap; justify-content: flex-end; }
.profile-info { padding: 4px 16px 0; }
.profile-name { display: flex; align-items: center; font-size: 20px; font-weight: 800; line-height: 24px; margin: 4px 0 0; min-width: 0; }
.profile-name .name-text { white-space: normal; }
.profile-handle { color: var(--text-2); }
.profile-bio { margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; color: var(--text-2); }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta a { color: var(--accent); }
.profile-meta a:hover { text-decoration: underline; }
.profile-counts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; color: var(--text-2); }
.profile-counts strong { color: var(--text); }
.profile-counts a:hover { text-decoration: underline; }
.known-followers { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--text-2); font-size: 13px; line-height: 16px; }
.known-followers:hover span:last-child { text-decoration: underline; }
.known-avatars { display: flex; flex-shrink: 0; }
.known-avatars img { border: 2px solid var(--bg); margin-left: -8px; }
.known-avatars img:first-child { margin-left: 0; }
.profile-tabs { margin-top: 16px; border-bottom: 1px solid var(--border); }
.profile-suspended { margin: 24px 0; }
.profile-suspended h3 { margin: 0 0 4px; font-size: 20px; }

/* edit profile */
.edit-profile { padding-bottom: 8px; }
.ep-banner { position: relative; aspect-ratio: 3 / 1; background: var(--bg-3) center / cover no-repeat; display: flex; align-items: center; justify-content: center; gap: 16px; }
.ep-photo-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(15, 20, 25, .6); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.ep-photo-btn:hover { background: rgba(15, 20, 25, .8); }
.ep-avatar { position: relative; width: 112px; height: 112px; margin: -48px 0 0 16px; border-radius: 50%; border: 4px solid var(--bg); overflow: hidden; background: var(--bg); }
.ep-avatar img { width: 100%; height: 100%; }
.ep-avatar .ep-photo-btn { position: absolute; inset: 0; margin: auto; }
.ep-fields { padding: 16px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- notifications ---------- */
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.notif:hover { background: var(--hover); }
.notif.unread, .notif-post.unread .post { background: rgba(var(--accent-rgb), .06); }
.notif-icon { width: 40px; display: flex; justify-content: flex-end; flex-shrink: 0; color: var(--accent); }
.notif-like .notif-icon { color: var(--like); }
.notif-like .notif-icon svg, .notif-follow .notif-icon svg { fill: currentColor; }
.notif-repost .notif-icon { color: var(--repost); }
.notif-main { flex: 1; min-width: 0; }
.notif-avatars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.notif-text { line-height: 1.4; }
.notif-actor { font-weight: 700; }
.notif-actor:hover { text-decoration: underline; }
.notif-snippet { color: var(--text-2); margin-top: 8px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notif-actions { display: flex; gap: 8px; margin-top: 12px; }
.notif-label { display: flex; align-items: center; gap: 6px; padding: 12px 16px 0 68px; margin-bottom: -6px; font-size: 13px; color: var(--text-2); }
.notif-label.unread { background: rgba(var(--accent-rgb), .06); }
.notif-label a { font-weight: 700; color: var(--text); }
.notif-requests { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); color: var(--accent); }
.notif-requests span { flex: 1; color: var(--text); }
.notif-requests:hover { background: var(--hover); }

/* ---------- messages ---------- */
.dm { display: flex; height: 100vh; height: 100dvh; }
.dm-inbox { width: 390px; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; }
.dm-thread { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.dm-list { display: flex; flex-direction: column; }
.dm-conv { position: relative; display: flex; gap: 12px; padding: 16px; transition: background .15s; }
.dm-conv:hover { background: var(--hover); }
.dm-conv.active { background: var(--bg-2); box-shadow: inset -2px 0 0 var(--accent); }
.dm-conv-main { flex: 1; min-width: 0; padding-right: 12px; }
.dm-conv-top { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; line-height: 20px; }
.dm-conv-name { display: inline-flex; align-items: center; font-weight: 700; min-width: 0; overflow: hidden; }
.dm-conv-handle { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1000; }
.dm-conv-top time, .dm-conv-top .dot { color: var(--text-2); flex-shrink: 0; }
.dm-conv-preview { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.dm-conv.unread .dm-conv-preview { color: var(--text); font-weight: 600; }
.unread-dot { position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: var(--accent); }
.dm-placeholder { margin: auto; max-width: 400px; padding: 32px; }
.dm-placeholder h2 { font-size: 31px; font-weight: 800; line-height: 36px; margin: 0 0 8px; }
.dm-placeholder p { margin: 0 0 28px; }
.dm-head-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; line-height: 1.25; }
.dm-head-user > span { min-width: 0; overflow: hidden; }
.dm-back { display: none; }
.dm-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.dm-intro { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 20px 16px 24px; margin: -16px -16px 16px; border-bottom: 1px solid var(--border); transition: background .15s; }
.dm-intro:hover { background: var(--hover); }
.dm-intro strong { display: inline-flex; align-items: center; margin-top: 4px; }
.dm-intro-bio { max-width: 360px; }
.dm-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; margin-top: 8px; }
.dm-msg.mine { align-self: flex-end; align-items: flex-end; }
.dm-bubble { background: var(--bg-3); padding: 10px 14px; border-radius: 22px 22px 22px 6px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.dm-msg.mine .dm-bubble { background: var(--accent); color: var(--accent-ink); border-radius: 22px 22px 6px 22px; }
.dm-msg.mine .dm-bubble a { color: inherit; text-decoration: underline; }
.dm-msg + .dm-msg .dm-bubble { margin-top: 0; }
.dm-img img { border-radius: 16px; max-height: 320px; width: auto; height: auto; margin-bottom: 4px; }
.dm-shared { width: 320px; max-width: 100%; margin-bottom: 4px; }
.dm-shared .quote-card { margin-top: 0; background: var(--bg); }
.dm-time { font-size: 12px; color: var(--text-2); margin: 4px 6px 0; }
.dm-seen { align-self: flex-end; display: flex; gap: 4px; align-items: center; margin: 4px 6px 0; }
.dm-composer { border-top: 1px solid var(--border); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); }
.dm-composer-row { display: flex; align-items: flex-end; gap: 2px; background: var(--bg-2); border-radius: 18px; padding: 4px; }
.dm-composer textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; resize: none; padding: 8px 8px; min-height: 36px; max-height: 160px; line-height: 20px; color: var(--text); font-size: 15px; }
.dm-send { color: var(--accent); }
.dm-send:disabled { opacity: .45; cursor: default; }
.dm-send:hover:not(:disabled) { background: rgba(var(--accent-rgb), .1); }
.dm-attach-preview { position: relative; display: inline-block; margin-bottom: 8px; }
.dm-attach-preview img { max-height: 140px; border-radius: 12px; }
.dm-attach-preview .cm-remove { top: 4px; right: 4px; width: 28px; height: 28px; }
.dm-blocked { padding: 16px; text-align: center; border-top: 1px solid var(--border); }

/* ---------- lists ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; transition: background .15s; }
.list-row:hover { background: var(--hover); }
.list-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-main strong { display: inline-flex; align-items: center; gap: 4px; }
.list-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px; text-align: center; border-bottom: 1px solid var(--border); }
.list-hero-icon { width: 80px; height: 80px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.list-hero h2 { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 20px; font-weight: 800; }
.list-hero p { margin: 0; white-space: pre-wrap; }
.list-owner { display: inline-flex; align-items: center; gap: 6px; }
.list-owner:hover strong, .list-members-link:hover { text-decoration: underline; }
.list-members-link { color: var(--text-2); }
.list-members-link strong { color: var(--text); }
.list-picker { display: flex; flex-direction: column; }
.list-pick { display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; transition: background .15s; }
.list-pick:hover { background: var(--hover); }
.list-pick .list-icon { width: 40px; height: 40px; border-radius: 10px; }
.list-pick .check-mark { margin-left: auto; color: var(--accent); visibility: hidden; }
.list-pick.on .check-mark { visibility: visible; }

/* ---------- menus, modals, toasts ---------- */
.menu { position: fixed; z-index: 1000; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); padding: 4px 0; overflow: hidden; animation: menu-in .12s ease-out; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; font-weight: 700; font-size: 15px; color: var(--text); transition: background .1s; }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover-strong); outline: none; }
.menu-item.danger { color: var(--danger); }
.menu-item small { display: block; font-weight: 400; color: var(--text-2); font-size: 13px; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade-in .15s; }
.modal { position: relative; width: 100%; max-width: 600px; margin-bottom: 5vh; background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); animation: modal-in .18s ease-out; }
.modal-sm { max-width: 420px; }
.modal-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 20px; min-height: 53px; padding: 0 16px; background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; }
.modal-title { flex: 1; font-size: 20px; font-weight: 800; margin: 0; }
.modal-body { padding: 0 16px 16px; }
.modal-body.flush { padding: 0; }
.modal-body .form { padding-top: 4px; }
.modal-confirm { max-width: 340px; padding: 32px; }
.modal-confirm h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; line-height: 24px; }
.modal-confirm p { color: var(--text-2); margin: 0 0 24px; }
.modal-confirm .btn { width: 100%; min-height: 44px; margin-top: 12px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.lightbox { position: fixed; inset: 0; z-index: 1100; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; animation: fade-in .15s; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.lb-btn { position: absolute; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); }
.lb-btn:hover { background: rgba(255, 255, 255, .26); }
.lb-close { top: 12px; left: 12px; }
.lb-prev { left: 12px; top: 50%; margin-top: -20px; }
.lb-next { right: 12px; top: 50%; margin-top: -20px; }
.lb-open { right: 12px; top: 12px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { pointer-events: auto; background: var(--accent); color: var(--accent-ink); padding: 12px 20px; border-radius: 8px; font-size: 15px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast-error { background: var(--danger); color: #fff; }
.toast a { color: inherit; font-weight: 700; text-decoration: underline; margin-left: 12px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.emoji-picker { position: fixed; z-index: 1000; width: 320px; max-width: calc(100vw - 16px); height: 330px; background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: menu-in .12s ease-out; }
.ep-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ep-tab { flex: 1; padding: 8px 0; font-size: 18px; }
.ep-tab.active { box-shadow: inset 0 -3px 0 var(--accent); }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); align-content: start; gap: 2px; padding: 8px; overflow-y: auto; }
.ep-grid button { height: 36px; border-radius: 8px; font-size: 22px; line-height: 1; }
.ep-grid button:hover { background: var(--hover-strong); }

/* ---------- misc blocks ---------- */
.empty-state { max-width: 420px; margin: 0 auto; padding: 32px 32px 48px; }
.empty-state h2 { font-size: 31px; font-weight: 800; line-height: 36px; margin: 0 0 8px; }
.empty-state p { color: var(--text-2); margin: 0 0 24px; }
.error-state { text-align: center; }
.error-code { font-size: 72px; font-weight: 800; color: var(--accent); opacity: .3; line-height: 1; margin-bottom: 8px; }
.section { border-bottom: 1px solid var(--border); }
.section > .section-title { padding: 12px 16px; }
.section-title { font-size: 20px; font-weight: 800; line-height: 24px; margin: 0; padding: 12px 0 8px; }
.section-title-pad { padding: 16px 16px 4px; }
.section-pad { padding: 12px 16px 16px; }
.section-pad > .section-title { padding-left: 0; }
.feed-more { display: grid; place-items: center; padding: 28px; }
.spinner { width: 26px; height: 26px; border: 3px solid rgba(var(--accent-rgb), .22); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.new-posts-pill { position: sticky; top: 118px; z-index: 15; display: flex; align-items: center; gap: 6px; width: fit-content; margin: 8px auto -44px; padding: 8px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 999px; box-shadow: var(--shadow); }
.announcement { padding: 12px 16px; background: rgba(var(--accent-rgb), .1); border-bottom: 1px solid var(--border); font-size: 14px; white-space: pre-wrap; }
.prose { padding: 16px; line-height: 1.55; }
.prose p { margin: 0 0 16px; overflow-wrap: anywhere; }
.kv { display: flex; flex-direction: column; gap: 8px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.kv > div > span:first-child { color: var(--text-2); }
.danger-box { border: 1px solid rgba(var(--danger-rgb), .3); background: rgba(var(--danger-rgb), .06); border-radius: 12px; padding: 16px; }
.danger-box h2 { font-size: 17px; margin: 0 0 8px; }
.danger-box p { margin: 0; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; }
.chip button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.chip button:hover { background: var(--hover-strong); }
.settings-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 16px; text-align: left; transition: background .15s; color: var(--text); }
.settings-item:hover { background: var(--hover); }
.settings-icon { display: flex; color: var(--text-2); }
.settings-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-item.danger, .settings-item.danger .settings-icon { color: var(--danger); }
.settings-item-form { margin: 0; }
.form .settings-item { padding-left: 0; padding-right: 0; }
.session-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-item { position: relative; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span { display: inline-flex; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border-2); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.seg-item input:checked + span, .seg-item.active span { background: rgba(var(--accent-rgb), .12); border-color: var(--accent); color: var(--accent); }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-links { margin-bottom: 4px; }
.display-preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.preview-logo { width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); background: transparent; }
.accent-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.accent-swatch { position: relative; }
.accent-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.accent-swatch span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sw); color: transparent; cursor: pointer; transition: transform .15s; }
.accent-swatch span:hover { transform: scale(1.06); }
.accent-swatch input:checked + span { color: #fff; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sw); }
.accent-swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }
.accent-blue { --sw: #1b8ef2; } .accent-yellow { --sw: #f5b400; } .accent-pink { --sw: #ec4899; }
.accent-purple { --sw: #8b5cf6; } .accent-orange { --sw: #f97316; } .accent-green { --sw: #10b981; }
.theme-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-option { position: relative; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option span { display: flex; align-items: center; justify-content: center; height: 60px; border-radius: 10px; border: 2px solid var(--border-2); font-weight: 700; cursor: pointer; transition: border-color .15s; padding: 0 8px; text-align: center; }
.theme-light span { background: #fff; color: #101418; }
.theme-dim span { background: #141d26; color: #f2f5f7; }
.theme-dark span { background: #000; color: #e8eaeb; }
.theme-auto span { background: linear-gradient(135deg, #ffffff 0 50%, #000000 50% 100%); }
.theme-option em { font-style: normal; }
.theme-auto em { background: var(--bg); color: var(--text); padding: 3px 10px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.theme-option input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- admin ---------- */
.admin-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.stat strong { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--text-2); font-size: 14px; }
.stat-sub { color: var(--text-2); font-size: 13px; }
a.stat:hover { background: var(--hover); }
.stat-alert { border-color: rgba(var(--danger-rgb), .5); }
.stat-alert strong { color: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: 2px; }
.bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; }
.bar-a, .legend i.bar-a { background: var(--accent); }
.bar-b, .legend i.bar-b { background: var(--repost); }
.bar-label { font-size: 11px; color: var(--text-2); }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.card .admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.admin-post-text { white-space: pre-wrap; margin: 4px 0; }
.admin-user { padding-bottom: 12px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding: 0 16px; }
.admin-actions form { margin: 0; }
.report .admin-actions { padding: 0; }
.admin-more summary { list-style: none; }
.admin-more summary::-webkit-details-marker { display: none; }
.admin-more[open] { display: flex; flex-direction: column; gap: 8px; width: 100%; padding-top: 4px; }
.admin-more[open] summary { width: fit-content; }
.admin-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-filter .input { flex: 1; min-width: 200px; }
.admin-filter select.input { flex: 0 0 auto; width: auto; min-width: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; }
.report { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-head .pill { margin-left: 0; }
.report-details { margin: 0; font-style: italic; color: var(--text-2); overflow-wrap: anywhere; }
.report-target { display: block; padding: 12px; border: 1px solid var(--border); border-radius: 12px; transition: background .15s; overflow-wrap: anywhere; }
.report-target:hover { background: var(--hover); }

/* ---------- auth & landing ---------- */
body.bare { background: var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-logo { align-self: center; color: var(--accent); }
.auth-title { font-size: 31px; font-weight: 800; line-height: 36px; margin: 0; }
.auth-switch { margin: 0; color: var(--text-2); }
.auth-switch a { color: var(--accent); }
.landing { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
.landing-art { display: flex; align-items: center; justify-content: center; color: var(--accent); background: radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), .18), rgba(var(--accent-rgb), .04) 60%); }
.landing-art svg { width: min(58%, 380px); height: auto; filter: drop-shadow(0 18px 40px rgba(var(--accent-rgb), .35)); }
.landing-main { display: flex; flex-direction: column; justify-content: center; padding: 32px 48px; max-width: 640px; }
.landing-logo { display: none; color: var(--accent); margin-bottom: 32px; }
.landing-title { font-size: clamp(38px, 5vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; margin: 0 0 40px; }
.landing-sub { font-size: 31px; font-weight: 800; line-height: 36px; margin: 0 0 28px; }
.landing-actions { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.landing-actions .tiny { margin: 0; }
.landing-actions .tiny a { color: var(--accent); }
.landing-have { font-size: 17px; font-weight: 700; margin: 32px 0 6px; }
.landing-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; padding: 12px 16px; font-size: 13px; color: var(--text-2); }
.landing-foot a:hover { text-decoration: underline; }

/* ---------- mobile chrome ---------- */
.mobile-top { display: none; order: -1; position: relative; align-items: center; justify-content: space-between; min-height: 53px; padding: 6px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.mobile-logo { position: absolute; left: 50%; transform: translateX(-50%); color: var(--accent); }
.mobile-avatar { display: block; border-radius: 50%; }
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; justify-content: space-around; align-items: center; height: calc(53px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--border); }
.tabbar-link { flex: 1; display: grid; place-items: center; height: 53px; color: var(--text); }
.fab { display: none; position: fixed; right: 16px; bottom: calc(53px + 16px + env(safe-area-inset-bottom)); z-index: 55; width: 56px; height: 56px; border-radius: 50%; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px rgba(var(--accent-rgb), .45); }
.drawer { position: fixed; inset: 0; z-index: 950; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade-in .15s; }
.drawer-panel { position: absolute; top: 0; bottom: 0; left: 0; width: 290px; max-width: 86vw; background: var(--bg); padding: 16px 0; overflow-y: auto; animation: slide-in .2s ease-out; }
.drawer-head { padding: 0 16px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.drawer-names { margin-top: 8px; }
.drawer-names strong { font-size: 17px; }
.drawer-counts { display: flex; gap: 16px; margin-top: 12px; color: var(--text-2); }
.drawer-counts strong { color: var(--text); }
.drawer-link { display: flex; align-items: center; gap: 20px; width: 100%; padding: 14px 16px; font-size: 19px; font-weight: 700; transition: background .15s; }
.drawer-link:hover { background: var(--hover); }
@keyframes slide-in { from { transform: translateX(-100%); } }

/* ---------- responsive ---------- */
@media (max-width: 1264px) {
  .nav { width: 88px; }
  .nav-inner { align-items: center; padding: 2px 8px 12px; }
  .nav-label, .nav-account-text, .nav-account-more, .nav-post-label { display: none; }
  .nav-link { margin: 2px auto; }
  .nav-post-btn { width: 52px; height: 52px; min-height: 52px; padding: 0; margin: 16px auto 12px; }
  .nav-post-icon { display: inline-flex; }
  .nav-account { width: auto; padding: 8px; margin-left: auto; margin-right: auto; }
  .nav-guest .btn { font-size: 0; width: 52px; min-height: 52px; padding: 0; }
  .nav-guest .btn::before { font-size: 20px; line-height: 1; }
  .nav-guest .btn-primary::before { content: "+"; }
  .nav-guest .btn-outline::before { content: "→"; }
}
@media (max-width: 1100px) {
  .sidebar { display: none; }
  .dm-inbox { width: 330px; }
}
@media (max-width: 900px) {
  .dm-inbox { width: 100%; border-right: 0; }
  .dm-thread { display: none; }
  .dm.dm-open .dm-inbox { display: none; }
  .dm.dm-open .dm-thread { display: flex; }
  .dm-back { display: inline-grid; }
  .landing { grid-template-columns: 1fr; }
  .landing-art { display: none; }
  .landing-logo { display: block; }
  .landing-main { padding: 32px 24px; margin: 0 auto; width: 100%; }
}
@media (max-width: 700px) {
  .nav { display: none; }
  .main, .wide-main .main { width: 100%; max-width: 100%; border: 0; }
  .mobile-top { display: flex; }
  body.is-auth .tabbar { display: flex; }
  body.is-auth .fab { display: grid; }
  body.is-auth .main { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .page-messages .main { padding-bottom: 0 !important; }
  .page-messages .dm { height: calc(100dvh - 53px - 53px - env(safe-area-inset-bottom)); }
  .page-messages .dm-thread { height: 100%; }
  .page-messages.has-thread .tabbar, .page-messages.has-thread .mobile-top { display: none; }
  .page-messages.has-thread .dm { height: 100vh; height: 100dvh; }
  .modal-backdrop { padding: 0; }
  .modal { max-width: none; min-height: 100%; margin: 0; border-radius: 0; }
  .modal-head { border-radius: 0; }
  .modal.modal-confirm, .modal.modal-sm { min-height: 0; margin: auto 16px; border-radius: var(--radius); }
  .modal-backdrop:has(.modal-confirm), .modal-backdrop:has(.modal-sm) { padding: 16px; align-items: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .theme-picker { grid-template-columns: repeat(2, 1fr); }
  .empty-state { padding: 28px 20px 40px; }
  .empty-state h2, .dm-placeholder h2, .auth-title { font-size: 26px; line-height: 31px; }
  .post-actions { margin-right: -4px; }
  .act-count { padding-right: 2px; }
  .new-posts-pill { top: 112px; }
}
@media (max-width: 380px) {
  .act-icon { width: 30px; height: 30px; }
  .act-views { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .nav, .sidebar, .tabbar, .fab, .mobile-top, .post-actions, .composer { display: none !important; }
  .main { border: 0; width: 100%; }
}
