:root {
  --bg: #07050a;
  --bg-mid: #100b17;
  --bg-hover: #1a1322;
  --border: #2c2338;
  --text: #ece7f5;
  --text-dim: #9a8bb0;
  --text-dimmer: #6b5c82;
  --accent: #b388ff;
  --accent-dim: #241a3d;
  --like: #ff4fa3;
  --repost: #7ee787;
  --danger: #ff3860;
  --radius: 14px;
  --maxw: 1250px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* ---------- left nav ---------- */
.nav {
  width: 275px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-right: 1px solid var(--border);
}
.nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  pointer-events: none;
  opacity: .3;
  background:
    repeating-conic-gradient(from 0deg, var(--text-dimmer) 0deg .8deg, transparent .8deg 22.5deg),
    repeating-radial-gradient(circle at 0 0, transparent 0 13px, var(--text-dimmer) 13px 14px);
  -webkit-mask-image: radial-gradient(circle at 0 0, black 55%, transparent 100%);
  mask-image: radial-gradient(circle at 0 0, black 55%, transparent 100%);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 20px;
  color: var(--accent);
}
.nav-logo .wing { font-size: 24px; }
.nav-items { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 12px;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { font-weight: 800; }
.nav-item .ic { position: relative; width: 24px; text-align: center; font-size: 20px; }
.nav-badge {
  display: none;
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--like);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.nav-badge.show { display: block; }
.nav-cta {
  margin: 14px 4px;
  padding: 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.nav-cta:hover { filter: brightness(1.08); }

.nav-compose {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 4px 4px;
  padding: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #2b2b3d, #101018);
  border: 1px solid #3a3a4a;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
.nav-compose:hover { filter: brightness(1.25); }
.nav-compose .ic { font-size: 17px; transition: transform .2s; }
.nav-compose:hover .ic { transform: rotate(-15deg) scale(1.15); }

.compose-fab {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 6;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #2b2b3d, #101018);
  border: 1px solid #3a3a4a;
  color: #fff;
  font-size: 22px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.nav-spacer { flex: 1; }

/* ---------- main column ---------- */
.main {
  flex: 1;
  min-width: 0;
  max-width: 600px;
  border-right: 1px solid var(--border);
  min-height: 100vh;
}
.main-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.main-header h1 { margin: 0; font-size: 20px; }
.main-header .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.back-row { display: flex; align-items: center; gap: 18px; }
.back-btn { font-size: 18px; cursor: pointer; padding: 4px; border-radius: 999px; }
.back-btn:hover { background: var(--bg-hover); }

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  white-space: nowrap;
}
.tab:hover { background: var(--bg-hover); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.feed-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px 8px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.feed-tab:hover { background: var(--bg-hover); }
.feed-tab.active { color: var(--bg); background: var(--text); }

/* ---------- post card ---------- */
.post {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.post:hover { background: var(--bg-mid); }
.post-avatar img, .avatar-img {
  width: 42px; height: 42px; border-radius: 999px; object-fit: cover; background: var(--bg-mid);
}
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; font-size: 14.5px; }
.post-name { font-weight: 700; }
.post-name:hover { text-decoration: underline; }
.post-handle, .post-time, .post-dot { color: var(--text-dim); }
.verify-badge { color: var(--accent); font-size: 13px; }
.post-text { margin-top: 2px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.rt-link, .rt-mention, .rt-tag { color: var(--accent); }
.rt-link:hover, .rt-mention:hover, .rt-tag:hover { text-decoration: underline; }
.reply-context { color: var(--text-dim); font-size: 13px; margin-bottom: 2px; }
.reply-context a { color: var(--accent); }

.post-actions { display: flex; justify-content: space-between; max-width: 425px; margin-top: 8px; color: var(--text-dim); }
.act { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: -6px -8px; border-radius: 999px; font-size: 13px; }
.act[data-href] { cursor: pointer; }
.act:hover { background: var(--bg-hover); }
.act.reply { cursor: pointer; }
.act.reply:hover { color: var(--accent); }
.act.repost:hover { color: var(--repost); }
.act.like:hover { color: var(--like); }
.act.liked { color: var(--like); }
.act.like .like-count { cursor: pointer; }
.act.like .like-icon { display: inline-block; cursor: pointer; filter: grayscale(1) opacity(.6); transition: filter .15s, transform .15s; }
.act.like .like-icon:hover { filter: grayscale(.3) opacity(.85); }
.act.liked .like-icon { filter: none; }
.act.like .like-icon.like-pop { animation: like-pop .4s ease; }
.act.reposted { color: var(--repost); }
.act.repost .repost-count { cursor: pointer; }
.act.repost .repost-icon { display: inline-block; cursor: pointer; transition: transform .15s; }
.act.repost .repost-icon.repost-pop { animation: repost-pop .4s ease; }
.act.witch:hover { color: #ff7a1a; }

/* ---------- witch button (curses a post out of view — no repo write) ---------- */
.post.hexed, .thread-focus.hexed {
  position: relative;
  pointer-events: none;
  animation: witch-burn .9s ease-in forwards;
}
.post.hexed::after, .thread-focus.hexed::after {
  content: "🔥";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  opacity: 0;
  animation: witch-flame .9s ease-in forwards;
}
.post.hex-collapse, .thread-focus.hex-collapse {
  transition: max-height .26s ease, padding .26s ease, border-color .26s ease;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-bottom-color: transparent !important;
}
@keyframes witch-burn {
  0% { filter: none; transform: scale(1) rotate(0deg); opacity: 1; }
  25% { filter: sepia(1) saturate(4) hue-rotate(-25deg) brightness(1.3); transform: scale(1.02) rotate(-1deg); }
  55% { filter: sepia(1) saturate(5) hue-rotate(-30deg) brightness(1.8); transform: scale(.9) rotate(2deg); }
  100% { filter: sepia(1) saturate(6) hue-rotate(-30deg) brightness(2.2) blur(3px); transform: scale(.5) rotate(-6deg) translateY(6px); opacity: 0; }
}
@keyframes witch-flame {
  0% { opacity: 0; transform: scale(.6) translateY(0); }
  45% { opacity: .9; transform: scale(1) translateY(-4px); }
  100% { opacity: 0; transform: scale(1.35) translateY(-18px); }
}
@keyframes like-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.5) rotate(-8deg); }
  60% { transform: scale(.9) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes repost-pop {
  0% { transform: rotate(0); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

/* ---------- embeds ---------- */
.embed { margin-top: 8px; }
.imgs { display: grid; gap: 2px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.imgs img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.imgs.n1 { grid-template-columns: 1fr; max-height: 500px; }
.imgs.n1 img { max-height: 500px; }
.imgs.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2/1.1; }
.imgs.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 2/1.3; }
.imgs.n3 img:first-child { grid-row: 1/3; }
.imgs.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 2/1.3; }
.imgs .sensitive-cover {
  position: relative;
}
.imgs .sensitive-cover::after {
  content: "⚠️ Sensitive content — tap to view";
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(15,20,25,.75); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 8px;
  backdrop-filter: blur(20px);
}
.imgs .sensitive-cover img { filter: blur(30px); }

.ext-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: block; }
.ext-card img { width: 100%; max-height: 260px; object-fit: cover; background: var(--bg-mid); }
.ext-card .ext-body { padding: 10px 12px; }
.ext-card .ext-domain { color: var(--text-dim); font-size: 12px; text-transform: uppercase; }
.ext-card .ext-title { font-weight: 700; margin-top: 2px; font-size: 14px; }
.ext-card .ext-desc { color: var(--text-dim); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.quote { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 6px; cursor: pointer; }
.quote:hover { background: var(--bg-mid); }
.quote-head { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.quote-head img { width: 20px; height: 20px; border-radius: 999px; }
.quote-text { margin-top: 4px; font-size: 14px; white-space: pre-wrap; }
.quote-missing { color: var(--text-dim); font-size: 13px; font-style: italic; }

.video-embed { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #000; }
.video-embed[data-action] { cursor: pointer; }
.video-embed img { width: 100%; max-height: 500px; object-fit: cover; opacity: .85; }
.video-embed .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 46px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.video-embed video { width: 100%; max-height: 500px; background: #000; }

/* ---------- profile ---------- */
.profile-banner { height: 150px; background: linear-gradient(135deg, var(--accent-dim), var(--border)); background-size: cover; background-position: center; }
.profile-head { padding: 12px 16px; position: relative; }
.profile-avatar { width: 92px; height: 92px; border-radius: 999px; border: 4px solid var(--bg); object-fit: cover; margin-top: -58px; background: var(--bg-mid); }
.profile-name { font-size: 21px; font-weight: 800; margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.profile-handle { color: var(--text-dim); font-size: 14px; }
.profile-follow-badge { display: inline-block; font-size: 12px; color: var(--text-dim); background: var(--bg-mid); border-radius: 6px; padding: 2px 6px; margin-top: 4px; }
.profile-bio { margin-top: 10px; white-space: pre-wrap; font-size: 14.5px; }
.profile-stats { display: flex; gap: 18px; margin-top: 10px; font-size: 14px; color: var(--text-dim); }
.profile-stats b { color: var(--text); }
.profile-stats a:hover { text-decoration: underline; }
.profile-guest-note { margin: 10px 0 0; font-size: 13px; color: var(--text-dim); background: var(--bg-mid); border-radius: 10px; padding: 8px 10px; }

/* ---------- elsewhere (sibling-site profile context) ---------- */
.elsewhere-panel { margin: 12px 16px 4px; padding: 10px 12px; background: var(--bg-mid); border: 1px solid var(--border); border-radius: 12px; }
.elsewhere-title { font-size: 12px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.elsewhere-reading { font-size: 13.5px; line-height: 1.4; }
.elsewhere-reading b { color: var(--accent); }
.elsewhere-rank { font-size: 13px; color: var(--text-dim); margin-top: 4px; min-height: 0; }
.elsewhere-rank a { color: var(--accent); }
.elsewhere-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.elsewhere-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text); text-decoration: none; }
.elsewhere-chip:hover { background: var(--bg-hover); border-color: var(--accent); }

/* ---------- thread ---------- */
.thread-parent { opacity: .95; }
.thread-parent .post { border-bottom: none; }
.thread-group { position: relative; }
.thread-group .feed-thread-parent { position: relative; }
.thread-group .feed-thread-parent::after {
  content: "";
  position: absolute;
  left: 37px;
  top: 54px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.thread-focus { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.thread-focus .post-head-full { display: flex; align-items: center; gap: 10px; }
.thread-focus .post-head-full img { width: 46px; height: 46px; border-radius: 999px; }
.thread-focus .post-text { font-size: 19px; margin-top: 12px; }
.thread-focus .thread-time { color: var(--text-dim); font-size: 14px; margin-top: 12px; }
.thread-focus .post-actions { max-width: 100%; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px 0; margin-top: 12px; }
.reply-indent { padding-left: 20px; border-left: 2px solid var(--border); margin-left: 30px; }

/* ---------- feeds / search / lists ---------- */
.card-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.card-row:hover { background: var(--bg-mid); }
.card-row img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--bg-mid); }
.card-row.actor img { border-radius: 999px; }
.card-row .cr-body { flex: 1; min-width: 0; }
.card-row .cr-title { font-weight: 700; font-size: 14.5px; }
.card-row .cr-sub { color: var(--text-dim); font-size: 13px; }
.card-row .cr-desc { font-size: 13.5px; margin-top: 4px; color: var(--text); }
.card-row.notif.unread { background: var(--accent-dim); }
.card-row.notif .cr-title { font-size: 14.5px; }
.card-row.notif .cr-title a { font-weight: 700; }

.search-box { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.search-input-wrap { display: flex; align-items: center; gap: 8px; background: var(--bg-mid); border-radius: 999px; padding: 9px 14px; }
.search-input-wrap input { border: none; background: transparent; outline: none; flex: 1; font-size: 15px; color: var(--text); }

.section-label { padding: 12px 16px 4px; font-size: 13px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- meta-likes (liking a like) ---------- */
.meta-like-btn { flex-shrink: 0; align-self: center; font-size: 17px; text-decoration: none; opacity: .55; filter: grayscale(1); padding: 6px; margin: -6px; border-radius: 999px; transition: opacity .15s, filter .15s, background .15s; }
.meta-like-btn:hover { opacity: 1; filter: none; background: var(--bg-hover); }
.meta-like-card { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.meta-like-card .card-row { padding: 0 0 10px; border-bottom: none; }
.meta-like-card .card-row:hover { background: none; }
.act.like.meta { display: inline-flex; }

/* ---------- right column ---------- */
.aside { width: 350px; flex-shrink: 0; padding: 8px 16px; display: flex; flex-direction: column; gap: 14px; }
.aside-card { background: var(--bg-mid); border-radius: var(--radius); padding: 14px; }
.aside-card h2 { font-size: 17px; margin: 0 0 8px; }
.aside-card p { font-size: 13.5px; color: var(--text-dim); margin: 0 0 8px; line-height: 1.5; }
.aside-card a.link { color: var(--accent); }
.aside-search { display: flex; align-items: center; gap: 8px; background: var(--bg-mid); border-radius: 999px; padding: 10px 16px; }
.aside-search input { border: none; background: transparent; outline: none; flex: 1; font-size: 15px; color: var(--text); }
.aside-feed-item { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.aside-feed-item img { width: 28px; height: 28px; border-radius: 8px; }
.aside-foot { font-size: 12px; color: var(--text-dimmer); line-height: 1.7; padding: 4px; }
.aside-foot a { text-decoration: underline; }

/* ---------- auth (login modal / session chip / toast) ---------- */
.nav-cta.loggedin { display: flex; align-items: center; gap: 8px; background: var(--bg-mid); color: var(--text); border: 1px solid var(--border); }
.nav-cta.loggedin:hover { background: var(--bg-hover); filter: none; }
.nav-avatar { width: 26px; height: 26px; border-radius: 999px; object-fit: cover; flex-shrink: 0; background: var(--border); }
.nav-cta.loggedin .label { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { margin: 0 4px 14px; padding: 6px 12px; text-align: center; font-size: 12.5px; color: var(--text-dim); cursor: pointer; border-radius: 999px; }
.nav-logout:hover { background: var(--bg-hover); color: var(--text); }

.modal-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15, 20, 25, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 20px; width: 100%; max-width: 360px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.modal h2 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.modal input, .modal textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-mid); color: var(--text); font-size: 15px; outline: none; font-family: inherit; }
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal textarea { resize: vertical; min-height: 90px; line-height: 1.4; }
.reply-count-hint { text-align: right; font-size: 12px; color: var(--text-dimmer); margin-top: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-actions button { border: none; }
.modal-status { margin-top: 10px; font-size: 12.5px; color: var(--danger); min-height: 1em; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 12px); z-index: 70;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }
.toast.spider { background: var(--accent); color: #fff; }

/* ---------- spider crawl (fires when a new notification comes in) ---------- */
.spider-crawler {
  position: fixed;
  left: -60px;
  font-size: 34px;
  z-index: 90;
  pointer-events: none;
  animation: spider-crawl 3.2s linear forwards;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6));
}
@keyframes spider-crawl {
  0% { transform: translate(0, 0) rotate(0deg); }
  8% { transform: translate(9vw, -10px) rotate(-8deg); }
  16% { transform: translate(18vw, 6px) rotate(6deg); }
  24% { transform: translate(27vw, -8px) rotate(-5deg); }
  32% { transform: translate(36vw, 8px) rotate(7deg); }
  40% { transform: translate(45vw, -10px) rotate(-6deg); }
  50% { transform: translate(56vw, 6px) rotate(5deg); }
  60% { transform: translate(66vw, -8px) rotate(-7deg); }
  70% { transform: translate(76vw, 8px) rotate(6deg); }
  80% { transform: translate(86vw, -6px) rotate(-5deg); }
  100% { transform: translate(calc(100vw + 70px), 0) rotate(0deg); }
}

/* ---------- misc states ---------- */
.center-msg { padding: 60px 24px; text-align: center; color: var(--text-dim); }
.center-msg h2 { color: var(--text); font-size: 18px; }
.spinner-row { display: flex; justify-content: center; padding: 30px; }
.spinner { width: 26px; height: 26px; border-radius: 999px; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-more { display: block; width: 100%; padding: 16px; text-align: center; color: var(--accent); font-weight: 700; cursor: pointer; border-bottom: 1px solid var(--border); }
.load-more:hover { background: var(--bg-hover); }
.err-box { margin: 16px; padding: 14px; border: 1px solid var(--danger); border-radius: 12px; color: var(--danger); font-size: 14px; }
.pill-btn { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.pill-btn:hover { background: var(--bg-hover); }
.pill-btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill-btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.pill-btn.danger:hover { background: #e02350; }
.pill-btn.danger.blocking { background: transparent; color: var(--danger); }
.pill-btn.danger.blocking:hover { background: var(--danger); color: #fff; }
.skel { background: linear-gradient(90deg, var(--bg-mid) 25%, var(--bg-hover) 37%, var(--bg-mid) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.lightbox {
  display: none; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.9);
  align-items: center; justify-content: center; cursor: zoom-out; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lb-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 26px; cursor: pointer; z-index: 2; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 40px; cursor: pointer; padding: 0 18px; user-select: none; z-index: 2; }
.lb-prev { left: 6px; }
.lb-next { right: 6px; }

/* ---------- goop mode (site-wide default background, surges on notifications) ---------- */
.goop-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: none;
  opacity: 0.38;
  pointer-events: none;
}
.goop-fallback {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #050f05;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% -10%, rgba(62, 203, 53, 0.8), transparent 60%),
    radial-gradient(ellipse 50% 35% at 60% -5%, rgba(47, 174, 42, 0.8), transparent 60%),
    radial-gradient(ellipse 40% 30% at 85% -10%, rgba(75, 224, 63, 0.8), transparent 60%),
    repeating-linear-gradient(180deg, #1a3d17 0, transparent 2px, transparent 40px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 300%;
  animation: goop-drip 6s linear infinite;
}
@keyframes goop-drip {
  0% { background-position: 0 -20%, 0 -10%, 0 -15%, 0 0%; }
  100% { background-position: 0 10%, 0 15%, 0 5%, 0 100%; }
}
html.goop-active {
  --bg: rgba(4, 12, 4, 0.42);
  --bg-mid: rgba(10, 30, 10, 0.5);
  --bg-hover: rgba(18, 45, 15, 0.55);
  --border: rgba(90, 190, 70, 0.35);
  --accent: #6bff5b;
  --accent-dim: rgba(50, 150, 40, 0.35);
}
html.goop-active body { background: transparent; }

/* ---------- mobile top bar / bottom nav ---------- */
.mobile-topbar { display: none; }
.mobile-tabbar { display: none; }

@media (max-width: 1080px) {
  .aside { display: none; }
}
@media (max-width: 800px) {
  .nav { width: 68px; padding: 8px 4px; }
  .nav-item span.label, .nav-cta span.label, .nav-compose span.label, .nav-logo span.word { display: none; }
  .nav-item { justify-content: center; }
  .nav-cta { display: flex; align-items: center; justify-content: center; padding: 12px; }
  .nav-logout { display: none; }
  .main { max-width: none; border-right: none; }
}
@media (max-width: 560px) {
  .shell { display: block; }
  .nav { display: none; }
  .compose-fab { display: flex; }
  .main { max-width: none; border-right: none; padding-bottom: 56px; }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 6; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: 10px 14px; font-weight: 800; color: var(--accent); font-size: 18px;
  }
  .mtb-auth { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
  .mtb-login { cursor: pointer; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; }
  .mtb-logout { cursor: pointer; }
  .mobile-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  .mobile-tabbar .nav-item { flex: 1; justify-content: center; padding: 12px 0; border-radius: 0; }
}
