:root {
  color-scheme: dark;
  --bg: #000000;
  --elevated: #161616;
  --input: #1c1c1e;
  --text: #e7e9ea;
  --muted: #71767b;
  --faint: #2f3336;
  --accent: #22d3ee;
  --accent-ink: #041016;
  --like: #f91880;
  --repost: #00ba7c;
  --danger: #f4212e;
  --radius: 16px;
  --tabbar: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Disable select-to-search / text highlight on Android Chrome */
html, body, .phone {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
html, body { margin: 0; min-height: 100%; background: #050505; color: var(--text); font-family: var(--font); }
body { -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.phone {
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  box-shadow: 0 0 0 1px #111;
  /* Qxopa .app: reserve space under fixed bottom nav */
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 8px);
}
body.keyboard-open .phone {
  padding-bottom: 12px;
}
.phone:not(:has(.tabbar)) {
  padding-bottom: 0;
}

@media (min-width: 800px) {
  body { background: radial-gradient(ellipse at top, #101214, #050505 55%); }
  .phone { min-height: 100dvh; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  min-height: 52px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #121212;
}
.topbar-left, .topbar-right { display: flex; align-items: center; }
.topbar-right { justify-content: flex-end; }
.topbar-title { text-align: center; }
.wordmark {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 18px;
  text-transform: none;
}
.wordmark-lg { font-size: 34px; letter-spacing: 0.06em; }
.wordmark-txt { color: var(--accent); }
.wordmark-rule {
  width: 42px;
  height: 3px;
  background: var(--accent);
  border-radius: 99px;
  margin-left: 4px;
}
.top-label { font-weight: 700; font-size: 16px; }

.main {
  flex: 1;
  padding-bottom: 18px;
  overflow-x: hidden;
  max-width: 100%;
}
.main-compose, .main-welcome { padding-bottom: 24px; }
body.keyboard-open .main-compose {
  padding-bottom: calc(24px + min(var(--kb, 0px), 45vh));
}
body.keyboard-open .main-welcome { padding-bottom: 24px; }
.main-thread { padding-bottom: 76px; }
body.keyboard-open .main-thread { padding-bottom: 76px; }

.tabbar {
  /* Same pattern as Qxopa .nav */
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  width: min(430px, 100%);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  height: auto;
  min-height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.92);
  border-top: 1px solid #141414;
  box-sizing: border-box;
}
.tabbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 220px;
  background: #000;
  pointer-events: none;
}
body.keyboard-open .tabbar {
  display: none;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  padding: 8px 0 6px;
  font-size: 10px;
}
.tab.is-active { color: var(--accent); }
.tab-compose { color: var(--accent); }
.compose-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin-top: -6px;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.28);
}

.feed-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--faint);
}
.feed-tabs[aria-label="Profile tabs"],
.feed-tabs[aria-label="Search tabs"] { grid-template-columns: repeat(3, 1fr); }
.feed-tabs a {
  text-align: center;
  padding: 14px 8px 12px;
  color: var(--muted);
  font-weight: 600;
  position: relative;
}
.feed-tabs a.is-active { color: var(--text); }
.feed-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}

.post {
  padding: 12px 14px 6px;
  border-bottom: 1px solid #121212;
}
.post-row { display: flex; gap: 10px; }
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.post-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  display: block;
  margin: 4px 0 8px;
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
}
.post-link {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 8px;
  word-break: break-all;
}
.repost-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px 42px;
}

.name-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; min-width: 0; }
.display { font-weight: 700; font-size: 15px; }
.meta, .handle { color: var(--muted); font-size: 14px; }
.dot { margin: 0 2px; }
.verified { display: inline-flex; vertical-align: -2px; }

.avatar {
  --avatar: #22d3ee;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--avatar) 22%, #0b0b0b);
  color: var(--avatar);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--avatar) 35%, transparent);
}
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-xl { width: 84px; height: 84px; font-size: 28px; margin: 8px auto 4px; }

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 2px 0 4px;
}
.action {
  background: none;
  border: 0;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 0;
  justify-content: flex-start;
}
.action.is-like { color: var(--like); }
.action.is-repost { color: var(--repost); }
.action:hover { color: var(--text); }

.more { position: relative; }
.more summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  letter-spacing: 1px;
  padding: 2px 6px;
}
.more summary::-webkit-details-marker { display: none; }
.more-menu {
  position: absolute;
  right: 0;
  top: 22px;
  background: #111;
  border: 1px solid var(--faint);
  border-radius: 12px;
  min-width: 140px;
  padding: 6px;
  z-index: 5;
}
.more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
}
.more-menu button:hover { background: #1c1c1c; }
.danger, .more-menu .danger { color: var(--danger); }

.profile { text-align: center; padding: 8px 20px 16px; }
.profile-name { margin: 8px 0 0; font-size: 22px; }
.bio { margin: 10px 0 0; color: var(--text); line-height: 1.4; }
.profile-meta, .follows {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
  flex-wrap: wrap;
}
.profile-meta span, .follows a { display: inline-flex; align-items: center; gap: 5px; }
.follows strong { color: var(--text); margin-right: 4px; }
.profile .btn { margin-top: 14px; }

.thread-root { padding: 16px 16px 8px; border-bottom: 1px solid #121212; }
.thread-head { display: flex; gap: 10px; align-items: center; }
.thread-body { font-size: 20px; line-height: 1.4; margin: 14px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.thread-time { color: var(--muted); font-size: 14px; margin: 10px 0; }
.thread-stats {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  padding: 10px 0;
  border-top: 1px solid #161616;
  border-bottom: 1px solid #161616;
}
.thread-stats strong { color: var(--text); }
.replies h2 {
  margin: 0;
  padding: 12px 16px 4px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}
.reply-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #000;
  border-top: 1px solid #161616;
  width: min(430px, 100%);
  box-sizing: border-box;
  min-width: 0;
}
body.keyboard-open .reply-bar {
  bottom: 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.reply-bar > .avatar,
.reply-bar > .reply-anon,
.reply-bar > .btn {
  flex-shrink: 0;
}
.reply-bar input#reply-body,
.reply-bar input[name="body"] {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
  background: var(--input);
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
}
.reply-bar .btn {
  flex: 0 0 auto;
}
.reply-anon {
  flex: 0 0 auto;
}
.reply-guest { text-align: center; padding: 16px; color: var(--muted); }
.reply-guest a { color: var(--accent); }

.compose { padding: 8px 16px 24px; }
.compose textarea {
  width: 100%;
  min-height: 180px;
  background: var(--input);
  border: 0;
  border-radius: var(--radius);
  padding: 16px;
  resize: vertical;
  font-size: 18px;
  line-height: 1.4;
  outline: none;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--accent);
}
.counter {
  text-align: right;
  color: var(--accent);
  font-size: 13px;
  margin: 8px 4px 18px;
}
.compose-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 10px 0;
  border-top: 1px solid #161616;
}
.compose-extra > svg {
  flex: 0 0 auto;
  color: var(--muted);
}
input#compose-hashtags,
input#compose-link,
.compose-extra input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  background: var(--input);
  border: 1px solid #222;
  border-radius: 12px;
  outline: none;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent);
  -webkit-user-select: text !important;
  user-select: text !important;
}
.compose-extra input:focus {
  border-color: var(--accent);
}
.compose-extra input::placeholder {
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
  opacity: 1;
}
.compose-extra input:-webkit-autofill,
.compose-extra input:-webkit-autofill:hover,
.compose-extra input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--accent);
  box-shadow: 0 0 0 1000px var(--input) inset;
  transition: background-color 99999s ease-out;
}
.compose-top { grid-template-columns: auto 1fr auto; gap: 8px; }

.welcome {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px 48px;
}
.welcome h1 { font-size: 32px; line-height: 1.15; margin: 18px 0 10px; }
.lede { color: var(--muted); line-height: 1.45; margin: 0 0 14px; font-size: 16px; }
.welcome-benefits {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.welcome-benefits li {
  position: relative;
  padding-left: 18px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}
.welcome-benefits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.welcome-actions { display: grid; gap: 10px; }
.demo-hint { color: var(--muted); font-size: 13px; margin-top: 28px; }

.auth-form, .search-form { padding: 16px; display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-form input, .auth-form textarea {
  background: var(--input);
  border: 1px solid #222;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.auth-form input:focus, .auth-form textarea:focus { border-color: var(--accent); }
.auth-form em { font-style: normal; color: #555; }
.auth-switch, .logout-form { text-align: center; color: var(--muted); }
.auth-switch a { color: var(--accent); }
.form-error { color: #fda4af; background: #2a0f14; padding: 10px 12px; border-radius: 10px; margin: 0 0 8px; }

.search-form {
  grid-template-columns: auto 1fr;
  align-items: center;
  background: var(--input);
  margin: 12px 16px;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
}
.search-form input { background: none; border: 0; outline: none; color: var(--text); }

.person-row, .tag-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #121212;
}
.person-row .handle, .tag-row .muted { display: block; color: var(--muted); font-size: 13px; }
.person-row { justify-content: space-between; }
.person-row > a:nth-child(2), .person-row > div { flex: 1; }
.hash { color: var(--accent); font-weight: 700; }
.hash-lead { color: var(--muted); padding: 12px 16px 0; }

.suggest { padding: 8px 16px 24px; }
.suggest h2 { font-size: 16px; margin: 8px 0; }

.empty { padding: 36px 24px; text-align: center; }
.empty-title { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.empty-detail { color: var(--muted); margin: 0 0 16px; line-height: 1.4; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  background: #222;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px #333;
}
.btn-block { width: 100%; }
.btn-pill { padding: 7px 16px; font-size: 14px; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.text-btn { background: none; border: 0; color: var(--muted); font-weight: 600; }
.icon-btn {
  background: none;
  border: 0;
  color: var(--text);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.entity { color: var(--accent); }
.muted { color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.toast {
  position: sticky;
  top: calc(8px + env(safe-area-inset-top));
  margin: 8px 12px;
  background: #12262b;
  color: var(--accent);
  border: 1px solid #164e63;
  padding: 10px 12px;
  border-radius: 12px;
  z-index: 40;
  font-size: 14px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast-error { background: #2a0f14; color: #fda4af; border-color: #7f1d1d; }
.toast-hide {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
.toast-sent {
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.toast-sent.toast-hide {
  opacity: 0;
  transform: translateY(-4px);
}
.toast-sent {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
  min-height: 48px;
  position: relative;
  padding: 10px 12px;
  text-align: left;
  background: #22d3ee;
  color: #0f172a;
  border-color: #0891b2;
}
.toast-sent .toast-label {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #0f172a;
  clip-path: inset(0 100% 0 0);
  -webkit-clip-path: inset(0 100% 0 0);
  animation: toast-raven-wipe 1s linear forwards;
}
@keyframes toast-raven-wipe {
  0% {
    clip-path: inset(0 100% 0 0);
    -webkit-clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast-sent .toast-label {
    animation: none;
    clip-path: none;
    -webkit-clip-path: none;
  }
}
.toast-bird {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  z-index: 2;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  animation: toast-bird-fly 1.5s linear forwards;
  will-change: transform, opacity;
  pointer-events: none;
}
.toast-bird-img {
  display: block;
  width: 56px;
  height: 56px;
  background-image: url("/static/raven-flap-strip.png?v=raven7");
  background-repeat: no-repeat;
  background-size: 1200% 100%;
  background-position: 0% 0;
  animation: toast-raven-flap-frames 0.9s steps(11) infinite;
}
@media (min-resolution: 2dppx) {
  .toast-bird-img {
    background-image: url("/static/raven-flap-strip-2x.png?v=raven7");
  }
}
@keyframes toast-raven-flap-frames {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}
@keyframes toast-bird-fly {
  0% {
    left: 4%;
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    left: 92%;
    transform: translateY(0) scale(1);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast-bird,
  .toast-bird-img {
    animation: none;
  }
  .toast-bird {
    left: auto;
    right: 12px;
    opacity: 1;
    transform: none;
  }
}

.js-action { display: inline; margin: 0; }

/* Install app strip on login */
.install-apps {
  margin-top: 36px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
}
.install-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}
.install-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.install-cards {
  display: grid;
  gap: 10px;
}
.install-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--elevated, #0a0a0a);
}
.install-os {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.install-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.install-hint:last-child { margin-bottom: 0; }
.install-hint strong { color: var(--text); font-weight: 600; }

.section-label {
  margin: 16px 16px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.trending-section { padding-bottom: 8px; }
.feed-tabs[aria-label="Trending"] { grid-template-columns: repeat(2, 1fr); }

.main-welcome .install-apps {
  margin: 28px 16px 24px;
  padding-top: 20px;
}

/* Qxopa-style PWA install cards */
.auth-install-stack {
  width: 100%;
  margin: 20px 0 8px;
  display: grid;
  gap: 10px;
}
.main-welcome .auth-install-stack {
  margin-top: 28px;
}
.auth-install {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  background: var(--elevated);
  border: 1px solid var(--faint);
  border-radius: 18px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.auth-install:hover { border-color: #3f3f46; }
.auth-install-icon {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #0a1a1f;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
.auth-install-icon img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.auth-install strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}
.auth-install .tiny {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.auth-install[hidden] { display: none; }
.auth-install-tip {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: end center;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}
.auth-install-tip[hidden] { display: none !important; }
.auth-install-tip.is-open { display: grid !important; }
.auth-install-tip-card {
  width: 100%;
  max-width: 420px;
  background: var(--elevated);
  border: 1px solid var(--faint);
  border-radius: 18px;
  padding: 18px 16px 16px;
}
.auth-install-tip-card p {
  margin: 0 0 12px;
  font-size: 15px;
}
.auth-install-tip-card ol {
  margin: 0 0 16px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
.auth-install-tip-card ol strong { color: var(--text); }

.avatar.has-photo {
  background: #0b0b0b;
  color: transparent;
  overflow: hidden;
  padding: 0;
  border: none;
  box-shadow: none;
}
.avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.avatar-edit {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 8px 0 18px;
  text-align: center;
}
.avatar-upload-btn { cursor: pointer; }
.avatar-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.avatar-remove input { accent-color: var(--danger); }
.tiny { font-size: 12px; line-height: 1.35; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}
.post-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, #0b0b0b);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.post-tag:hover { background: color-mix(in srgb, var(--accent) 22%, #0b0b0b); }
.thread-root .post-tags { margin: 10px 0 4px; }

.avatar-anon {
  background: #1a1a1a;
  color: #a1a1aa;
  border: 1px solid #2a2a2a;
}
.compose-anon {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.compose-anon input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.reply-anon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.reply-anon input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.thread-head { position: relative; }
.thread-head .more { margin-left: auto; }

.compose-anon-hint {
  margin: 4px 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.compose-top-spacer { width: 52px; }

.compose-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 16px;
}
.compose-actions .btn {
  width: 100%;
  min-height: 46px;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 10px;
}
.compose-post-anon {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.kb-fill {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(430px, 100%);
  height: min(var(--kb, 0px), 45vh);
  max-height: 45vh;
  background: #000;
  z-index: 25;
  pointer-events: none;
}
body.keyboard-open .kb-fill { display: block; }
/* Compose has no tabbar — black fill isn't needed and can cover the fields */
.phone:not(:has(.tabbar)) .kb-fill,
body.keyboard-open .phone:not(:has(.tabbar)) .kb-fill {
  display: none !important;
}


/* Branded delete / confirm dialog */
.pt-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.64);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  animation: pt-confirm-fade 0.16s ease-out;
}
.pt-confirm {
  width: min(100%, 340px);
  background: var(--elevated);
  border: 1px solid var(--faint);
  border-radius: 20px;
  padding: 20px 18px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  animation: pt-confirm-pop 0.18s ease-out;
}
.pt-confirm-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.pt-confirm-body {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.pt-confirm-actions {
  display: flex;
  gap: 10px;
}
.pt-confirm-actions button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 15px;
}
.pt-confirm-cancel {
  background: var(--input);
  color: var(--text);
}
.pt-confirm-ok {
  background: var(--danger);
  color: #fff;
}
.pt-confirm-ok:active,
.pt-confirm-cancel:active {
  opacity: 0.88;
}
@keyframes pt-confirm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pt-confirm-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .pt-confirm-backdrop,
  .pt-confirm {
    animation: none;
  }
}
