/* ===========================================================================
   Skribl — a Twitter/Bluesky-style microblog.
   A custom dark theme: deep ink background, electric-violet accent.
   =========================================================================== */

/* Dark theme (default). [data-theme="dark"] is also matched explicitly. */
:root,
[data-theme="dark"] {
  --bg:        #0d0f14;
  --bg-elev:   #161a22;
  --bg-hover:  #1c212c;
  --border:    #252b37;
  --text:      #e7e9ea;
  --text-dim:  #8b97a8;
  --accent:    #7c5cff;
  --accent-2:  #5b8cff;
  --accent-ink:#ffffff;
  --like:      #f4326f;
  --repost:    #1bcf8f;
  --danger:    #f4326f;
  --header-bg: rgba(13, 15, 20, 0.7);
  --radius:    16px;
  --maxw:      1180px;
}

/* Light theme. */
[data-theme="light"] {
  --bg:        #ffffff;
  --bg-elev:   #f6f8fa;
  --bg-hover:  #eef1f5;
  --border:    #e1e8ed;
  --text:      #0f1419;
  --text-dim:  #5b7083;
  --accent:    #6b46ff;
  --accent-2:  #4a6ee0;
  --accent-ink:#ffffff;
  --like:      #e0245e;
  --repost:    #149e67;
  --danger:    #e0245e;
  --header-bg: rgba(255, 255, 255, 0.85);
}

html { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

img { max-width: 100%; display: block; }

/* ---------- Layout: left nav | feed | right rail ---------- */
.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 600px) 320px;
  gap: 28px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Left navigation ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 24px;
  padding: 10px 14px;
  letter-spacing: -0.5px;
}
.brand .logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 10px;
  font-size: 20px;
}
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 19px;
  color: var(--text);
  transition: background .15s;
  position: relative;
}
.nav a:hover { background: var(--bg-hover); }
.nav a.active { font-weight: 700; }
.nav a .ico { font-size: 22px; width: 24px; text-align: center; }
.nav .badge {
  position: absolute;
  left: 30px; top: 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid; place-items: center;
}
.nav .post-btn {
  margin-top: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  justify-content: center;
  font-weight: 700;
}
.nav .post-btn:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* Theme toggle in the sidebar. */
.theme-toggle {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; border: none; background: transparent; cursor: pointer;
  color: var(--text); font-family: inherit; font-size: 19px;
  border-radius: 999px; transition: background .15s;
}
.theme-toggle:hover { background: var(--bg-hover); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.sidebar .me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
}
.sidebar .me:hover { background: var(--bg-hover); }
.sidebar .me .meta { min-width: 0; }
.sidebar .me .meta .dn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .meta .un { color: var(--text-dim); font-size: 13px; }

/* ---------- Center column ---------- */
.feed { border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-height: 100vh; }
.feed-header {
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  font-weight: 800;
  font-size: 20px;
  display: flex; align-items: center; gap: 14px;
}
.feed-header .back { color: var(--text-dim); font-size: 22px; }
.feed-header .sub { color: var(--text-dim); font-weight: 400; font-size: 13px; }

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs a {
  flex: 1; text-align: center; padding: 16px 0; color: var(--text-dim);
  font-weight: 600; position: relative;
}
.tabs a:hover { background: var(--bg-hover); }
.tabs a.active { color: var(--text); }
.tabs a.active::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 56px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---------- Avatars ---------- */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, #3a3f4b, #232730);
  object-fit: cover;
  flex-shrink: 0;
  display: grid; place-items: center;
  color: #fff; font-weight: 700;
  overflow: hidden;
}
.avatar.xs { width: 22px; height: 22px; font-size: 11px; }
.avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.avatar.md { width: 48px; height: 48px; font-size: 18px; }
.avatar.lg { width: 84px; height: 84px; font-size: 32px; border: 4px solid var(--bg); }

/* ---------- Composer ---------- */
.composer {
  display: flex; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.composer textarea {
  width: 100%; border: none; outline: none; resize: none;
  background: transparent; color: var(--text);
  font-size: 19px; font-family: inherit; line-height: 1.4;
  min-height: 52px;
}
.composer .composer-body { flex: 1; min-width: 0; }
.composer-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px;
}
.composer-actions .tools { display: flex; gap: 4px; color: var(--accent); }
.tool-btn {
  display: inline-grid; place-items: center; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: transparent; color: var(--accent); font-family: inherit;
}
.tool-btn:hover { background: rgba(124,92,255,.14); }
.tool-btn.gif-btn { font-weight: 800; font-size: 12px; letter-spacing: .5px; }
.charcount { color: var(--text-dim); font-size: 13px; margin-right: 12px; }
.charcount.warn { color: #ffae42; }
.charcount.over { color: var(--danger); }
.img-preview { margin-top: 10px; position: relative; display: none; width: fit-content; }
.img-preview img { border-radius: var(--radius); border: 1px solid var(--border); max-height: 320px; width: auto; }
.img-preview-remove {
  position: absolute; top: 8px; left: 8px; width: 28px; height: 28px;
  border-radius: 50%; border: none; cursor: pointer; font-size: 18px; line-height: 1;
  background: rgba(13,15,20,.8); color: #fff;
}
.img-preview-remove:hover { background: rgba(13,15,20,.95); }

/* ---------- Emoji / GIF pickers ---------- */
.picker-panel {
  z-index: 60; width: 320px; max-height: 360px; overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.55); padding: 8px;
}
.picker-cat { font-size: 12px; font-weight: 700; color: var(--text-dim); padding: 8px 6px 4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.emoji {
  border: none; background: transparent; cursor: pointer; font-size: 20px;
  padding: 4px 0; border-radius: 8px; line-height: 1.4;
}
.emoji:hover { background: var(--bg-hover); }
.gif-panel { width: 340px; }
.gif-search {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 9px 14px; outline: none;
  font-family: inherit; font-size: 14px; margin-bottom: 8px;
}
.gif-search:focus { border-color: var(--accent); }
.gif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gif-item { width: 100%; border-radius: 8px; cursor: pointer; display: block; }
.gif-item:hover { outline: 2px solid var(--accent); }
.gif-loading { grid-column: 1 / -1; text-align: center; color: var(--text-dim); padding: 24px; }

/* ---------- Buttons ---------- */
.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  border-radius: 999px; padding: 9px 20px; font-size: 15px;
  background: var(--accent); color: #fff; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.full { width: 100%; padding: 12px; font-size: 16px; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--bg-hover); filter: none; }
.btn.outline {
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
}
.btn.outline:hover { background: rgba(124,92,255,.1); filter: none; }
.btn.sm { padding: 6px 16px; font-size: 14px; }

/* ---------- Post card ---------- */
.post {
  display: block; padding: 12px 18px; border-bottom: 1px solid var(--border);
  transition: background .12s; cursor: pointer;
}
.post:hover { background: var(--bg-elev); }
.repost-label, .reply-label {
  color: var(--text-dim); font-size: 13px; font-weight: 600;
  margin-left: 38px; display: flex; align-items: center; gap: 8px; padding-bottom: 2px;
}
.post-main { display: flex; gap: 12px; }
.post-content { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-head .dn { font-weight: 700; }
.post-head .dn:hover { text-decoration: underline; }
.post-head .un, .post-head .dot, .post-head .time { color: var(--text-dim); }
.post-head .time:hover { text-decoration: underline; }
.post-head .menu { margin-left: auto; color: var(--text-dim); }
.post-head .edited { color: var(--text-dim); font-size: 13px; }

/* ---------- Verified badge ---------- */
.verified {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 17px; height: 17px; margin: 0 1px 0 3px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 11px; font-weight: 900; line-height: 1;
}
.profile-name .verified { width: 22px; height: 22px; font-size: 14px; margin-left: 6px; }
.post-body { margin: 2px 0 6px; white-space: pre-wrap; word-wrap: break-word; }
.post-body a.link { color: var(--accent-2); }
.post-image { margin: 8px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }
.alt-badge {
  position: absolute; bottom: 8px; left: 8px; font-size: 11px; font-weight: 800;
  letter-spacing: .5px; padding: 2px 6px; border-radius: 6px; cursor: help;
  background: rgba(13,15,20,.85); color: #fff;
}

/* ---------- Image editor modal ---------- */
.imgedit-overlay {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: rgba(0,0,0,.6); padding: 20px; overflow-y: auto;
  place-items: center;
}
.imgedit-overlay.open { display: grid; }
.imgedit {
  width: min(520px, 96vw); background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 18px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.imgedit-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 18px; }
.imgedit-x { background: none; border: none; color: var(--text-dim); font-size: 26px; cursor: pointer; line-height: 1; }
.imgedit-stage { display: grid; place-items: center; background: #000; border-radius: 12px; padding: 8px; }
.imgedit-canvas { max-width: 100%; border-radius: 8px; cursor: grab; touch-action: none; }
.imgedit-canvas:active { cursor: grabbing; }
.imgedit-ratios { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.imgedit-ratio {
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.imgedit-ratio:hover { background: var(--bg-hover); }
.imgedit-ratio.active { border-color: var(--accent); color: var(--accent); background: rgba(124,92,255,.12); }
.imgedit-zoom { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 14px; }
.imgedit-zoom-input { flex: 1; accent-color: var(--accent); }
.imgedit-alt-label { display: block; color: var(--text-dim); font-size: 13px; margin: 12px 0 0; }
.imgedit-alt {
  width: 100%; margin-top: 6px; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px; padding: 10px 12px; font-family: inherit;
  font-size: 14px; outline: none; resize: vertical;
}
.imgedit-alt:focus { border-color: var(--accent); }
.imgedit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- Inline video embeds ---------- */
.video-embed {
  position: relative; margin: 10px 0; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-file {
  margin: 10px 0; max-height: 420px; width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); background: #000;
}

/* ---------- Action bar ---------- */
.actions { display: flex; justify-content: space-between; max-width: 420px; margin-top: 6px; }
.action {
  display: flex; align-items: center; gap: 7px; color: var(--text-dim);
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: 13px;
  padding: 6px; border-radius: 999px; transition: color .12s, background .12s;
}
.action .ico { font-size: 17px; line-height: 1; }
.action.reply:hover   { color: var(--accent-2); background: rgba(91,140,255,.12); }
.action.repost:hover, .action.quote:hover { color: var(--repost); background: rgba(27,207,143,.12); }
.action.like:hover    { color: var(--like); background: rgba(244,50,111,.12); }
.action.bookmark:hover, .action.share:hover { color: var(--accent-2); background: rgba(91,140,255,.12); }
.action.repost.on { color: var(--repost); }
.action.like.on { color: var(--like); }
.action.bookmark.on { color: var(--accent-2); }
.action.delete:hover { color: var(--danger); background: rgba(244,50,111,.12); }
.action.report:hover { color: var(--danger); background: rgba(244,50,111,.12); }

/* ---------- Quoted (embedded) post ---------- */
.quoted {
  display: block; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin: 8px 0; transition: background .12s;
}
.quoted:hover { background: var(--bg-hover); }
.quoted-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.quoted-head .dn { font-weight: 700; }
.quoted-head .un, .quoted-head .dot, .quoted-head .time { color: var(--text-dim); }
.quoted-body { margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; }
.quoted-image { margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.quoted-image img { max-height: 240px; width: auto; }

/* ---------- Trending rail ---------- */
.trend { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
.trend:last-child { border-bottom: none; }
.trend:hover .trend-tag { text-decoration: underline; }
.trend-tag { font-weight: 700; }
.trend-n { color: var(--text-dim); font-size: 13px; }

/* ---------- Detail view ---------- */
.detail .post { cursor: default; }
.detail .post:hover { background: transparent; }
.detail .big-body { font-size: 23px; line-height: 1.4; margin: 12px 0; white-space: pre-wrap; word-wrap: break-word; }
.detail .stat-row {
  display: flex; gap: 22px; padding: 14px 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); color: var(--text-dim); margin-top: 12px;
}
.detail .stat-row b { color: var(--text); }
.thread-line { width: 2px; background: var(--border); margin: 0 auto; flex: 1; min-height: 12px; }

/* ---------- Profile header ---------- */
.profile-banner { height: 200px; background: linear-gradient(135deg, #2a2350, #1a2440); }
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-top { padding: 0 18px 14px; border-bottom: 1px solid var(--border); }
.profile-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; margin-top: -42px;
}
.profile-row .avatar { margin-bottom: 6px; flex-shrink: 0; }
/* Action buttons sit bottom-right and wrap instead of overflowing the column. */
.profile-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  justify-content: flex-end; min-width: 0;
}
.profile-actions .btn { padding: 7px 14px; }
/* Icon-only action buttons render as tidy circles. */
.profile-actions form > .btn,
.profile-actions > .btn { white-space: nowrap; }
.profile-name { font-size: 22px; font-weight: 800; margin-top: 10px; }
.profile-handle { color: var(--text-dim); }
.profile-bio { margin: 12px 0; }
.profile-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-dim); font-size: 14px; margin-bottom: 10px; }
.profile-meta a { color: var(--accent-2); }
.profile-stats { display: flex; gap: 20px; }
.profile-stats a:hover { text-decoration: underline; }
.profile-stats b { color: var(--text); }
.profile-stats span { color: var(--text-dim); }

/* ---------- Right rail ---------- */
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 0; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--bg-elev);
  border: 1px solid transparent; border-radius: 999px; padding: 10px 16px;
}
.search:focus-within { border-color: var(--accent); background: var(--bg); }
.search input { background: none; border: none; outline: none; color: var(--text); width: 100%; font-size: 15px; font-family: inherit; }
.card { background: var(--bg-elev); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.card h3 { margin: 0 0 12px; font-size: 19px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.who .meta { flex: 1; min-width: 0; }
.who .meta .dn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .meta .dn:hover { text-decoration: underline; }
.who .meta .un { color: var(--text-dim); font-size: 13px; }

/* ---------- Rail footer links (Feedback · Privacy · Terms · Help) ---------- */
.rail-links {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  padding: 14px 16px 0; font-size: 13px;
}
.rail-links a { color: var(--text-dim); }
.rail-links a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Info / legal pages (privacy, terms, help, feedback) ---------- */
.page { max-width: 680px; }
.page .prose h1 { font-size: 27px; margin: 0 0 6px; }
.page .prose h2 { font-size: 19px; margin: 26px 0 8px; }
.page .prose p, .page .prose li { color: var(--text); line-height: 1.6; }
.page .prose .muted { color: var(--text-dim); font-size: 14px; }
.page .prose ul { margin: 8px 0; padding-left: 22px; }
.page .prose li { margin: 4px 0; }
.page .prose a { color: var(--accent); }
.page .prose a:hover { text-decoration: underline; }
.page .form-row { margin: 14px 0; }
.page label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 14px; }
.page select, .page textarea, .page input[type="email"] {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  font-family: inherit; font-size: 15px; outline: none;
}
.page select:focus, .page textarea:focus, .page input[type="email"]:focus { border-color: var(--accent); }
.page textarea { resize: vertical; min-height: 120px; }

/* ---------- Reactivation banner ---------- */
.reactivate-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; background: rgba(244,50,111,.12);
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.reactivate-banner > div { font-size: 14px; }

/* ---------- Flash messages ---------- */
.flashes { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(420px, 92vw); }
.flash {
  padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; font-weight: 600;
  background: var(--bg-elev); border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: drop .25s ease;
}
.flash.success { border-color: var(--repost); }
.flash.danger { border-color: var(--danger); }
.flash.info { border-color: var(--accent-2); }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: min(420px, 100%); background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 32px;
}
.auth-card .brand { justify-content: center; padding: 0 0 8px; }
.auth-card h1 { font-size: 26px; margin: 6px 0 4px; text-align: center; }
.auth-card .muted { color: var(--text-dim); text-align: center; margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; font-family: inherit; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field select, .dm-select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 15px;
  font-family: inherit; outline: none;
}
.field select:focus, .dm-select:focus { border-color: var(--accent); }
.auth-alt { text-align: center; color: var(--text-dim); margin-top: 18px; }
.auth-alt a { color: var(--accent-2); font-weight: 600; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 14px; margin-bottom: 14px; }
/* Consent checkbox row on the signup form. */
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--text-dim); font-size: 14px; margin: 4px 0 18px; line-height: 1.4; }
.check input { margin-top: 2px; flex-shrink: 0; }
.check a { color: var(--accent-2); font-weight: 600; }
/* Honeypot field — visually hidden, off-screen for real users. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Link-styled button (e.g. onboarding "Skip for now"). */
.linkbtn { background: none; border: none; color: var(--accent-2); font-weight: 600; cursor: pointer; font-family: inherit; font-size: inherit; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- Onboarding "who to follow" ---------- */
.onboard-list { max-height: 46vh; overflow-y: auto; margin: 6px 0 18px; border: 1px solid var(--border); border-radius: 14px; }
.onboard-user { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.onboard-user:last-child { border-bottom: none; }
.onboard-user:hover { background: var(--bg-hover); }
.onboard-user .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onboard-user .meta .dn { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onboard-user .meta .un { color: var(--text-dim); font-size: 13px; }
.onboard-user .meta .bio { color: var(--text-dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onboard-user input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }

/* ---------- Landing (logged-out) ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.landing .hero { background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; }
.landing .hero .glyph { font-size: 180px; }
.landing .panel { display: grid; place-content: center; padding: 40px; max-width: 460px; }
.landing h1 { font-size: 52px; line-height: 1.05; letter-spacing: -1.5px; margin: 0 0 12px; }
.landing h2 { font-size: 28px; margin: 28px 0 18px; }
.landing .cta { display: flex; flex-direction: column; gap: 12px; width: min(320px, 100%); }

/* ---------- Notifications ---------- */
.note { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.note.unread { background: rgba(124,92,255,.06); }
.note .nico { font-size: 24px; width: 28px; text-align: center; }
.note .nico.like { color: var(--like); }
.note .nico.repost { color: var(--repost); }
.note .nico.follow { color: var(--accent-2); }
.note .nico.reply { color: var(--accent); }
.note .ntext .dn { font-weight: 700; }
.note .ntext .snippet { color: var(--text-dim); margin-top: 4px; }

/* ---------- Direct messages: inbox ---------- */
.dm-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.dm-row:hover { background: var(--bg-elev); }
.dm-row.unread { background: rgba(124,92,255,.06); }
.dm-meta { flex: 1; min-width: 0; }
.dm-top { display: flex; align-items: center; gap: 6px; }
.dm-top .dn { font-weight: 700; }
.dm-top .un, .dm-top .time { color: var(--text-dim); font-size: 14px; }
.dm-preview {
  color: var(--text-dim); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-top: 2px;
}
.dm-row.unread .dm-preview { color: var(--text); font-weight: 500; }
.dm-preview .you { color: var(--text-dim); }
.dm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ---------- Direct messages: thread ---------- */
.dm-thread {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  height: calc(100vh - 140px); overflow-y: auto;
}
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble-row.theirs { justify-content: flex-start; }
.bubble {
  max-width: 75%; padding: 9px 14px; border-radius: 18px; word-wrap: break-word;
}
.bubble-row.mine .bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-bottom-right-radius: 5px;
}
.bubble-row.theirs .bubble {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.bubble-sender { font-size: 12px; font-weight: 700; color: var(--accent-2); margin-bottom: 2px; }
.bubble-body { white-space: pre-wrap; }
.bubble-body a.link { color: inherit; text-decoration: underline; }
.bubble-time { font-size: 11px; opacity: .7; margin-top: 3px; text-align: right; }
.dm-composer {
  display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--bg);
}
.dm-composer input[type=text] {
  flex: 1; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 999px; padding: 10px 16px; color: var(--text);
  font-size: 15px; font-family: inherit; outline: none;
}
.dm-composer input[type=text]:focus { border-color: var(--accent); }
.dm-request {
  padding: 16px 18px; border-top: 1px solid var(--border); text-align: center;
}
.dm-request p { color: var(--text-dim); margin: 0 0 12px; }

/* ---------- Group member picker ---------- */
.member-picker {
  max-height: 360px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: 6px;
}
.member-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.member-option:last-child { border-bottom: none; }
.member-option:hover { background: var(--bg-hover); }
.member-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.member-option .meta { display: flex; flex-direction: column; }
.member-option .meta .dn { font-weight: 700; }
.member-option .meta .un { color: var(--text-dim); font-size: 13px; }
.member-option:has(input:checked) { background: rgba(124,92,255,.10); }

/* ---------- Lists ---------- */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.list-row:hover { background: var(--bg-elev); }
.list-meta { min-width: 0; }
.list-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.list-sub { color: var(--text-dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-banner { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.list-banner p { margin: 0 0 8px; }
.pill {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  background: var(--bg-hover); border-radius: 6px; padding: 2px 6px;
}

/* ---------- Reports & moderation ---------- */
.radio-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); cursor: pointer; color: var(--text);
}
.radio-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.report { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-reason { font-weight: 800; }
.report-head .time { color: var(--text-dim); font-size: 13px; margin-left: auto; }
.report-status {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 2px 7px; border-radius: 6px;
}
.report-status.open { background: rgba(124,92,255,.18); color: var(--accent); }
.report-status.actioned { background: rgba(244,50,111,.16); color: var(--like); }
.report-status.dismissed { background: var(--bg-hover); color: var(--text-dim); }
.report-by { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.report-target {
  display: block; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); transition: background .12s;
}
.report-target:hover { background: var(--bg-hover); }
.report-target-head { display: flex; align-items: center; gap: 8px; }
.report-target-head .dn { font-weight: 700; }
.report-target-head .un { color: var(--text-dim); }
.report-target-body { margin-top: 6px; white-space: pre-wrap; word-wrap: break-word; }
.report-details { color: var(--text-dim); font-style: italic; margin: 6px 0; }
.report-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.report-actions form { display: inline; }
.mod-inline { display: flex; gap: 6px; align-items: center; }
.mod-reason {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-family: inherit; outline: none;
}
.mod-reason:focus { border-color: var(--accent); }

/* Severity badges (report triage). */
.sev { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 8px; border-radius: 999px; }
.sev-3 { background: rgba(244,50,111,.18); color: var(--like); }
.sev-2 { background: rgba(255,170,40,.18); color: #e8920a; }
.sev-1 { background: var(--bg-hover); color: var(--text-dim); }
.sev-summary { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }

/* Moderation sub-navigation: a tidy, wrapping pill toolbar. */
.mod-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.mod-nav a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 13px; border-radius: 999px; background: var(--bg-elev);
  color: var(--text-dim); font-size: 13px; font-weight: 700;
}
.mod-nav a:hover { background: var(--bg-hover); color: var(--text); }
.mod-nav a.active { background: var(--accent); color: #fff; }
.mod-nav .modnav-n {
  background: rgba(0,0,0,.18); border-radius: 999px; padding: 0 6px;
  font-size: 11px; min-width: 16px; text-align: center;
}
.mod-nav a:not(.active) .modnav-n { background: var(--accent); color: #fff; }

/* Sensitive content: blur the body behind a click-to-reveal cover. */
.reveal-wrap { position: relative; }
.reveal-wrap.sensitive > *:not(.sensitive-cover) { filter: blur(22px); pointer-events: none; user-select: none; }
.reveal-wrap:not(.sensitive) .sensitive-cover { display: none; }
.sensitive-cover {
  position: absolute; inset: 0; z-index: 2; width: 100%;
  display: grid; place-items: center; gap: 6px; cursor: pointer;
  background: var(--bg-elev); border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-dim); font-weight: 700; font-size: 14px; font-family: inherit;
  min-height: 80px;
}
.sensitive-cover:hover { color: var(--text); border-color: var(--accent); }

/* Post-time "are you sure?" nudge. */
.nudge-warn {
  background: rgba(244,50,111,.12); border: 1px solid rgba(244,50,111,.4);
  color: var(--like); border-radius: var(--radius); padding: 12px 14px;
  font-weight: 700; margin-bottom: 10px;
}
.confirm-preview {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-top: 12px; background: var(--bg-elev);
}

/* ---------- Communities ---------- */
.community-banner {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124,92,255,.08), rgba(91,140,255,.05));
}
.community-emoji {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px;
  display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.community-name { font-size: 20px; font-weight: 800; }
.community-desc { margin: 4px 0 6px; color: var(--text); }
.community-tag {
  display: inline-block; margin: 12px 18px 0; padding: 6px 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--accent-2);
}
.community-tag:hover { background: var(--bg-hover); }

/* ---------- Premium page ---------- */
.premium-hero {
  text-align: center; padding: 32px 18px 20px;
  background: linear-gradient(135deg, rgba(124,92,255,.14), rgba(91,140,255,.08));
  border-bottom: 1px solid var(--border);
}
.premium-badge {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.premium-hero h1 { font-size: 28px; margin: 0 0 6px; }
.premium-price { font-size: 20px; font-weight: 800; color: var(--accent-2); }
.premium-demo {
  margin-top: 12px; display: inline-block; font-size: 13px; color: var(--text-dim);
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px;
}
.premium-benefits { list-style: none; margin: 0; padding: 18px; }
.premium-benefits li {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border); font-size: 16px;
}
.premium-benefits .tick {
  display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%; background: rgba(124,92,255,.15); color: var(--accent);
  font-weight: 900; font-size: 13px;
}

/* ---------- Empty states ---------- */
.empty { text-align: center; color: var(--text-dim); padding: 60px 24px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.empty h3 { color: var(--text); margin: 0 0 6px; }

/* ---------- Pagination ---------- */
.pager { display: flex; justify-content: space-between; padding: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .app { grid-template-columns: 88px minmax(0, 1fr); }
  .rail { display: none; }
  /* Collapse to icons only: hide the text labels but KEEP the .ico glyphs
     (and the .badge counters) so the nav still renders. */
  .brand span:not(.logo),
  .nav a span:not(.ico):not(.badge),
  .sidebar .me .meta,
  .theme-toggle span { display: none; }
  .nav a, .theme-toggle { justify-content: center; }
  .nav .badge { left: 50%; top: 4px; margin-left: 2px; }
  .nav .post-btn { padding: 14px; }
  .nav .post-btn .ico { display: inline; }
}
@media (max-width: 620px) {
  .landing { grid-template-columns: 1fr; }
  .landing .hero { display: none; }
  .app { grid-template-columns: 1fr; padding: 0; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto;
    flex-direction: row; align-items: center;
    background: var(--bg); border-top: 1px solid var(--border);
    z-index: 20; padding: 2px;
    overflow-x: auto; scrollbar-width: none;   /* keep every item reachable */
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand, .sidebar .me { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; margin: 0; gap: 0; }
  .nav a { padding: 10px 6px; }
  .nav .post-btn { display: none; }
  .theme-toggle { padding: 10px 6px; margin: 0; }
  .feed { border: none; padding-bottom: 64px; }
}
