/* ============================================================
   Zallixor — style.css
   MAIN build: the stable, general-release build of the app.
   Mobile-first; tuned to stay light on low-spec Android browsers.
   ============================================================ */

:root {
  /* ── Flagship palette — mature ink-navy, restrained violet + cyan ──
     Deeper and less saturated than a typical purple social app, so it
     reads sophisticated rather than childish. Surfaces are matte, the
     accent is used sparingly, and depth comes from soft borders. */
  --bg:        #0a0e17;   /* ink navy base            */
  --bg-2:      #070a11;   /* deeper wells (nav, wells)*/
  --panel:     #111725;   /* cards                    */
  --panel-2:   #161d2e;   /* raised chips / inputs    */
  --panel-3:   #1e2739;   /* pressed / hover          */
  --line:      #1f2839;   /* hairline borders         */
  --line-2:    #2a3550;   /* stronger dividers        */
  --text:      #eef1f7;
  --muted:     #8792a8;
  --muted-2:   #5c6579;
  --accent-a:  #7c5cff;   /* electric violet (primary)*/
  --accent-b:  #22c7e0;   /* restrained cyan          */
  --accent-soft: rgba(124,92,255,.14);
  --grad:      linear-gradient(135deg, #7c5cff 0%, #6d5cff 45%, #22c7e0 100%);
  --aurora:    radial-gradient(ellipse at 28% 0%, rgba(124,92,255,.20), transparent 62%),
               radial-gradient(ellipse at 82% 6%, rgba(34,199,224,.12), transparent 58%);
  --bubble-mine: linear-gradient(135deg, #6d5cff, #5b46e0);
  --bubble-mine-text: #f3f1ff;
  --danger:    #ff5d73;
  --ok:        #2fd8a4;
  --amber:     #f6b545;
  --main:  #f6b545;   /* Beta build accent — amber, distinct from Main's violet and Lite's sky blue */
  --radius:    20px;
  --radius-sm: 14px;
  --radius-lg: 26px;
  --shadow:    0 14px 40px rgba(0,0,0,.5);
  --shadow-nav: 0 10px 30px rgba(0,0,0,.55);
  --glow:      0 8px 24px rgba(124,92,255,.38);
  --nav-h:     72px;
  --top-h:     58px;
  --maxw:      680px;
  --dur-fast:  .1s;
  --dur-med:   .18s;
  --dur-slow:  .32s;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── Light mode ── */
:root[data-theme="light"] {
  --bg:        #f4f5fa;
  --bg-2:      #eceef6;
  --panel:     #ffffff;
  --panel-2:   #f2f3f9;
  --panel-3:   #e7e9f2;
  --line:      #e3e5ef;
  --line-2:    #d4d7e6;
  --text:      #141727;
  --muted:     #5f6577;
  --muted-2:   #9298ab;
  --accent-soft: rgba(124,92,255,.12);
  --shadow:    0 14px 40px rgba(20,20,40,.12);
  --shadow-nav: 0 10px 30px rgba(30,30,60,.14);
  --bubble-mine: linear-gradient(135deg, #7c5cff, #6d5cff);
  --bubble-mine-text: #ffffff;
  --aurora:    radial-gradient(ellipse at 28% 0%, rgba(124,92,255,.10), transparent 62%),
               radial-gradient(ellipse at 82% 6%, rgba(34,199,224,.08), transparent 58%);
}

/* Lazy-loaded media: fade in once the real bytes are attached (perf: avoids
   layout jank from pop-in and gives a lighter first paint on slow networks). */
.bg-lazy { background-color: var(--panel-2); }
.bg-lazy.bg-loaded { animation: bgfade var(--dur-slow) ease; }
@keyframes bgfade { from { filter: brightness(.4) blur(6px); } to { filter: none; } }
img[loading="lazy"] { background: var(--panel-2); }
img[loading="lazy"].loaded, img[loading="lazy"]:not([src=""]) { animation: imgfade var(--dur-slow) ease; }
@keyframes imgfade { from { opacity: 0; } to { opacity: 1; } }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior: none;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-b); text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; }
img, video { max-width: 100%; display: block; }
h2 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.025em; margin: 0; }
h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin: 0 0 .5rem; letter-spacing: -.02em; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 .6rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; padding: 2rem 1rem; }
.hidden { display: none !important; }

/* ── Boot loader ── */
#boot { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 999; }
.boot-inner { text-align: center; }
.logo-mark { border-radius: 26%; object-fit: cover; display: block; }
.boot-logo { border-radius: 26%; object-fit: cover; display: block; margin: 0 auto;
  filter: drop-shadow(0 8px 24px rgba(139,92,246,.5)); animation: floaty 1.6s ease-in-out infinite; }

/* ── BETA badge (amber, per spec) — used in the top bar, profile header, and Settings ── */
.beta-badge { display: inline-flex; align-items: center; gap: 3px; background: var(--main); color: #241400;
  font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle; box-shadow: 0 2px 8px rgba(246,181,69,.5); }
.beta-badge.lg { font-size: .72rem; padding: 3px 9px; }
.beta-banner { display: flex; align-items: flex-start; gap: 10px; background: rgba(246,181,69,.14);
  border: 1px solid rgba(246,181,69,.4); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px; }
.beta-banner .beta-banner-icon { font-size: 1.3rem; line-height: 1; }
.beta-banner strong { color: var(--text); }
.boot-word { margin-top: .8rem; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -.03em;
  background: linear-gradient(120deg, #a78bfa 0%, #22c7e0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-spinner { margin: 1.4rem auto 0; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--panel-3); border-top-color: var(--accent-a); animation: spin .55s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ── App shell ── */
#app { max-width: var(--maxw); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--top-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 16px; padding-right: 12px;
  background: rgba(10,14,23,.86); backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
/* Signature aurora wash behind the top bar. */
.topbar::before { content: ""; position: absolute; inset: 0; background: var(--aurora); pointer-events: none; z-index: -1; }
.topbar-left { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.wordmark { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; font-size: 1.4rem;
  background: linear-gradient(120deg, #a78bfa 0%, #22c7e0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wordmark.sm { font-size: 1.25rem; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.icon-btn { background: transparent; border: 0; color: var(--text); font-size: 1.15rem;
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; position: relative;
  transition: background var(--dur-fast); }
.icon-btn:active { background: var(--panel-2); }
.icon-btn.tb { background: var(--panel-2); border: 1px solid var(--line); }
.bell-badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--accent-b); color: #04222a; font-size: .66rem; font-weight: 800; border-radius: 9px;
  display: grid; place-items: center; border: 2px solid var(--bg); }

/* Content area: reserve space for the top bar (incl. status bar) and the bottom
   nav (incl. gesture bar) so nothing is ever hidden under them while scrolling. */
.view {
  min-height: calc(100dvh - var(--top-h) - var(--safe-top) - var(--nav-h) - var(--safe-bottom));
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 32px);
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
}
/* Cached bottom-nav tab pages (Home/Discover/Messages/Profile) live inside
   .view side by side; only the active one is shown. Kept off-screen instead
   of destroyed so switching tabs back and forth doesn't reload anything. */
.view-page[hidden] { display: none !important; }
.muted.center { overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.page { padding: 14px; display: flex; flex-direction: column; gap: 14px; max-width: 100%; overflow-x: hidden; }
/* Cheap paint containment so long feeds stay smooth on low-spec phones. */
.post-card, .conv-row, .user-row, .group-card, .notif-row { content-visibility: auto; contain-intrinsic-size: 200px; }
.chat-messages { -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
/* Heart burst for double-tap like */
.like-burst { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0);
  font-size: 5rem; pointer-events: none; z-index: 5; animation: burst .45s ease-out forwards; }
@keyframes burst { 0% { transform: translate(-50%,-50%) scale(0); opacity: 0; }
  25% { transform: translate(-50%,-50%) scale(1.15); opacity: 1; }
  70% { opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 0; } }
.refresh-hint { position: fixed; top: calc(var(--top-h) + var(--safe-top) + 6px); left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font-size: .78rem; font-weight: 600; padding: 6px 14px;
  border-radius: 999px; z-index: 45; box-shadow: var(--shadow); animation: dropin var(--dur-slow) ease; }
@keyframes dropin { from { transform: translate(-50%,-14px); opacity: 0; } to { transform: translate(-50%,0); opacity: 1; } }
.receipt { display: block; font-size: .6rem; opacity: .7; margin-top: 2px; text-align: right; }
.chat-presence::first-letter { text-transform: uppercase; }
.conv-seen { flex: 0 0 auto; }
.typing-indicator { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 16px; border-bottom-left-radius: 5px; padding: 12px 14px; display: flex; gap: 4px; }
.typing-indicator span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typing .9s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
/* Pull-to-refresh spinner */
.ptr { text-align: center; overflow: hidden; height: 0; transition: height var(--dur-med); color: var(--muted); font-size: .8rem; }
.ptr.show { height: 40px; line-height: 40px; }
.ptr .icon.spin { animation: ptr-spin .6s linear infinite; }
@keyframes ptr-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Bottom nav — floating pill that lifts off the screen ── */
.bottom-nav {
  position: fixed; bottom: calc(12px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  width: calc(100% - 28px); max-width: 440px; z-index: 40;
  height: 62px;
  display: flex; align-items: center; justify-content: space-around;
  background: rgba(17,23,37,.9); backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow-nav);
  padding: 0 6px;
}
.nav-item { background: transparent; border: 0; color: var(--muted-2); display: flex; flex-direction: column;
  align-items: center; gap: 3px; flex: 1 1 0; padding: 6px 0; border-radius: 14px; position: relative; }
.nav-item .nav-icon { display: flex; position: relative; transition: transform var(--dur-med); }
.nav-item .nav-icon svg { display: block; width: 24px; height: 24px; }
.nav-item .nav-label { display: none; }
.nav-badge { position: absolute; top: -4px; right: -8px; min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: .58rem; font-weight: 700; border-radius: 8px;
  display: grid; place-items: center; border: 2px solid var(--panel); line-height: 1; }
.nav-item.active { color: var(--accent-a); }
.nav-item.active .nav-icon { transform: translateY(-2px); }
/* Glowing dot under the active tab. */
.nav-item.active::after { content: ""; position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-b); box-shadow: 0 0 8px var(--accent-b); }
.nav-create {
  width: 54px; height: 54px; border-radius: 18px; border: 0; margin-top: -22px; flex: 0 0 auto;
  background: var(--grad); color: #fff; font-size: 1.7rem; font-weight: 300;
  box-shadow: var(--glow); display: grid; place-items: center;
  transition: transform var(--dur-fast);
}
.nav-create:active { transform: scale(.92); }

/* ── Buttons ── */
.btn { border: 0; border-radius: 14px; padding: 11px 16px; font-weight: 600; font-size: .92rem;
  background: var(--panel-2); color: var(--text); transition: transform .06s, filter var(--dur-fast); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(255,93,115,.14); color: var(--danger); border: 1px solid rgba(255,93,115,.3); }
.btn-google { background: #fff; color: #1f1f1f; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-block { width: 100%; display: flex; align-items: center; justify-content: center; }
.btn-sm { padding: 7px 13px; font-size: .82rem; border-radius: 11px; }
.btn.busy { opacity: .6; pointer-events: none; }
.gicon { display: inline-flex; }

/* ── Auth screens ── */
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(130% 90% at 50% -20%, rgba(124,92,255,.28), transparent 55%),
              radial-gradient(100% 70% at 90% 10%, rgba(34,199,224,.14), transparent 55%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 26px; padding: 30px 24px; box-shadow: var(--shadow); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-logo .wordmark { font-size: 1.7rem; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form h2 { text-align: center; }
.auth-form .muted { text-align: center; margin: -4px 0 6px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .78rem; color: var(--muted); font-weight: 600; padding-left: 2px; }
.field input, .field-input, .search-input, .comment-input, .chat-input, textarea, select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 13px; padding: 12px 14px; font-size: .95rem; width: 100%; outline: none;
}
.field input:focus, .field-input:focus, textarea:focus, select:focus, .search-input:focus {
  border-color: var(--accent-a); box-shadow: 0 0 0 3px var(--accent-soft); }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; color: var(--muted); padding: 2px; }
.checkbox-row input { margin-top: 3px; accent-color: var(--accent-a); width: 16px; height: 16px; }
.auth-switch { text-align: center; font-size: .85rem; color: var(--muted); }
.verify-icon { font-size: 2.6rem; text-align: center; }
.verify-icon .icon { width: 40px; height: 40px; }

/* ── Greeting + points ── */
.greeting { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.greeting h2 { font-size: 1.55rem; line-height: 1.15; }
.greeting-name { background: linear-gradient(120deg, #4c9aff, #a78bfa 50%, #ff5d9e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.points-bar { display: inline-flex; align-items: center; gap: 6px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .84rem; }
.points-bar .diamond { filter: drop-shadow(0 0 6px rgba(79,124,255,.6)); }
.points-bar strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Composer ── */
.composer { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.composer-top { display: flex; align-items: center; gap: 12px; }
.composer-fake { flex: 1; text-align: left; background: transparent; border: 0;
  color: var(--muted); padding: 4px 0; font-size: 1rem; }
.composer-pen { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 15px; border: 0;
  background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: var(--glow); }
.composer-pen .icon { width: 20px; height: 20px; }
.composer-actions { display: flex; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.composer-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 0; color: var(--text); font-size: .82rem; font-weight: 600; padding: 8px 4px; border-radius: 12px; }
.composer-btn:active { background: var(--panel-2); }
.composer-btn .icon { width: 18px; height: 18px; }
.cb-photo .icon { color: #4c9aff; }
.cb-video .icon { color: #ff5d73; }
.cb-ai .icon { color: #a78bfa; }
.cb-poll .icon { color: #f6b545; }

/* ── Stories ── */
.stories-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.story-tile { flex: 0 0 auto; width: 66px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; cursor: pointer; }
.story-ring { padding: 2.5px; border-radius: 50%; background: linear-gradient(135deg, #7c5cff, #22c7e0); }
.story-ring .avatar { border: 2.5px solid var(--bg); }
.story-tile.seen .story-ring { background: var(--panel-3); }
.story-name { font-size: .7rem; color: var(--text); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-tile.add .story-add-plus { position: absolute; bottom: 20px; right: 8px; width: 20px; height: 20px;
  background: var(--accent-a); border: 2px solid var(--bg); border-radius: 50%; color: #fff; font-size: .8rem;
  display: grid; place-items: center; line-height: 1; }

/* ── Friends row (Messages tab) ── */
.friends-row-wrap { margin-bottom: 10px; }
.friends-row-label { margin: 4px 2px 6px; font-weight: 600; }
.friends-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.friends-row::-webkit-scrollbar { display: none; }
.friend-tile { flex: 0 0 auto; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; cursor: pointer; }

/* ── Trending strip ── */
.trending-strip { display: flex; gap: 10px; overflow-x: auto; align-items: stretch; scrollbar-width: none; padding: 2px 0; }
.trending-strip::-webkit-scrollbar { display: none; }
.trending-label { font-size: .9rem; font-weight: 700; color: var(--text); flex: 0 0 auto; align-self: center;
  font-family: var(--font-display); display: inline-flex; align-items: center; gap: 5px; }
.trend-chip { flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.trend-tag { font-size: .9rem; font-weight: 700; color: var(--accent-a); }
.trend-count { font-size: .72rem; color: var(--muted); }
.trend-chip:nth-child(4n+2) .trend-tag { color: #7c5cff; }
.trend-chip:nth-child(4n+3) .trend-tag { color: #ff5d9e; }
.trend-chip:nth-child(4n+0) .trend-tag { color: #22c7e0; }
.trend-chip:nth-child(4n+1) .trend-tag { color: #4c9aff; }

/* ── Feed / post card ── */
.feed { display: flex; flex-direction: column; gap: 14px; }
.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: relative; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head-clickable { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.post-head-meta { flex: 1; min-width: 0; }
.name-row { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-family: var(--font-display); letter-spacing: -.01em; }
.name-row.clickable { cursor: pointer; }
.name-row.big { font-size: 1.25rem; font-weight: 780; }
.name-row.small { font-size: .82rem; }
.verified-badge { width: 15px; height: 15px; flex: 0 0 auto; vertical-align: middle; }
.plus-badge { width: 15px; height: 15px; flex: 0 0 auto; vertical-align: middle; margin-left: 1px; }
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex: 0 0 auto; }
.icon.inline { width: 13px; height: 13px; vertical-align: -2px; }
.plus-crown-icon { width: 16px; height: 16px; display: inline-block; vertical-align: middle; flex: 0 0 auto;
  filter: drop-shadow(0 0 3px rgba(245,180,41,.5)); }
.plus-crown-icon.inline { width: 14px; height: 14px; vertical-align: -2px; }
.name-row.big .verified-badge { width: 19px; height: 19px; }
.name-row.big .plus-badge { width: 19px; height: 19px; }
.post-body { margin: 10px 0; white-space: pre-wrap; word-break: break-word; }
.hashtag, .mention { color: var(--accent-b); font-weight: 600; }
.post-media-wrap { border-radius: var(--radius-sm); overflow: hidden; margin: 6px 0; border: 1px solid var(--line); }
.post-media { width: 100%; max-height: 520px; object-fit: cover; }
/* Videos must never collapse to 0 height before metadata loads, and must not
   be cropped. Give them a floor height, a dark backdrop, and contain fit. */
.post-video-wrap { position: relative; background: #000; min-height: 220px; display: flex; }
.post-video { width: 100%; max-height: 560px; min-height: 220px; object-fit: contain; background: #000; display: block; }
.post-summary { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px;
  font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.react-summary { display: inline-flex; gap: 4px; }
.post-actions { display: flex; gap: 2px; padding-top: 6px; position: relative; }
.post-action { flex: 1; background: transparent; border: 0; color: var(--muted); font-weight: 600;
  font-size: .82rem; padding: 9px 4px; border-radius: 10px; }
.post-action:active { background: var(--panel-2); }
.post-action.active { color: var(--accent-b); }
.react-wrap { flex: 1; position: relative; display: flex; }
.react-btn { width: 100%; }
.react-picker { position: absolute; bottom: 46px; left: 0; display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 2px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 18px; padding: 8px;
  box-shadow: var(--shadow); z-index: 6; width: 232px; max-width: calc(100vw - 40px); }
.react-opt { background: transparent; border: 0; font-size: 1.5rem; padding: 4px; transition: transform var(--dur-fast);
  border-radius: 10px; display: grid; place-items: center; }
.react-opt:active, .react-opt:hover { transform: scale(1.25) translateY(-2px); background: var(--panel-2); }

/* ── Comments ── */
.comment-thread { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment-composer { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.comment-input { flex: 1; border-radius: 999px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-row { display: flex; gap: 8px; }
.comment-avatar-click { cursor: pointer; flex: 0 0 auto; height: fit-content; }
.comment-bubble { background: var(--panel-2); border-radius: 14px; padding: 8px 12px; flex: 1; }
.comment-text { word-break: break-word; }
.comment-meta { margin-top: 3px; }
.cm-del { color: var(--danger); }

/* ── Avatars ── */
.avatar { border-radius: 50%; position: relative; flex: 0 0 auto; background: var(--panel-3); }
.avatar-media { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; position: relative; }
.avatar-media img, .avatar-media video { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 700;
  color: #fff; background: var(--grad); font-size: .9em; }
.avatar-ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px transparent; border: 2px solid transparent;
  background-image: linear-gradient(var(--panel), var(--panel)), var(--grad);
  background-origin: border-box; background-clip: content-box, border-box; padding: 2px; }
.online-dot { position: absolute; bottom: 0; right: 0; border-radius: 50%; z-index: 2;
  background: var(--ok); border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 6px 1px rgba(34,197,94,.65);
  animation: online-pulse 2.2s ease-in-out infinite; }
@keyframes online-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 6px 1px rgba(34,197,94,.65); }
  50% { box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 9px 3px rgba(34,197,94,.85); }
}
@media (prefers-reduced-motion: reduce) { .online-dot { animation: none; } }

/* ── Empty states ── */
.empty-state { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 100%; }
.empty-icon { font-size: 2.6rem; opacity: .8; }
.empty-icon .icon { width: 40px; height: 40px; }
.big-status-icon { margin-bottom: 8px; }
.big-status-icon .icon { width: 42px; height: 42px; }
.big-status-icon.sm .icon { width: 36px; height: 36px; }
.empty-state h3 { margin: 0; }
.empty-state p { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
.empty-state .btn { margin-top: 8px; }

/* ── User rows / search ── */
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.user-row.selected { border-color: var(--accent-a); background: rgba(139,92,246,.1); }
.bubble-sender { margin-bottom: 2px; font-weight: 600; }
.request-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.request-banner-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.req-row-actions { display: flex; gap: 8px; margin-top: 6px; }
.user-row-meta { flex: 1; min-width: 0; }
.search-head { position: sticky; top: calc(var(--top-h) + var(--safe-top)); z-index: 10; background: var(--bg); padding-bottom: 8px; }
.search-input-wrap { position: relative; }
.msg-tabs { display: flex; gap: 6px; }
.msg-tabs-row { display: flex; align-items: center; gap: 8px; }
.msg-tabs-row .msg-tabs { flex: 1; overflow-x: auto; scrollbar-width: none; }
.msg-tabs-row .msg-tabs::-webkit-scrollbar { display: none; }
.new-group-btn { flex: 0 0 auto; }
.search-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.search-tabs::-webkit-scrollbar { display: none; }
.seg { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 9px; font-size: .82rem; font-weight: 600; }
.search-tabs .seg { flex: 0 0 auto; padding: 9px 16px; }
.seg.active { background: var(--accent-a); color: #fff; border-color: transparent; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.tag-result { display: flex; justify-content: space-between; padding: 12px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; }

/* ── Search suggestions (typeahead dropdown) ── */
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.suggest-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.suggest-row:hover, .suggest-row:active { background: var(--panel-2); }
.suggest-row + .suggest-row { border-top: 1px solid var(--line); }
.suggest-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); color: var(--muted);
  display: grid; place-items: center; font-size: .8rem; flex: 0 0 auto; }
.suggest-meta { flex: 1; min-width: 0; }
.suggest-name { font-size: .87rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-sub { font-size: .72rem; color: var(--muted); }

/* ── Chips ── */
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 8px 15px; font-size: .82rem; font-weight: 600; }
.chip.active { background: var(--accent-soft); color: var(--accent-a); border-color: rgba(124,92,255,.4); }

/* ── Discover ── */
.discover-section h3, .explore-title { margin-bottom: 10px; }
.topic-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.topic-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 15px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; position: relative; overflow: hidden; }
.topic-card::before { content: ""; position: absolute; inset: 0; background: var(--aurora); opacity: .8; pointer-events: none; }
.topic-card strong { color: var(--accent-b); position: relative; font-family: var(--font-display); font-size: 1.05rem; }
.topic-card span { position: relative; }
.discover-columns { display: flex; flex-direction: column; gap: 16px; }
.popular-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.popular-cell { aspect-ratio: 1; background: var(--panel-2); border-radius: 10px; overflow: hidden;
  position: relative; cursor: pointer; }
.popular-cell img, .popular-cell video { width: 100%; height: 100%; object-fit: cover; }
.popular-text { padding: 8px; font-size: .74rem; color: var(--muted); }
.popular-likes { position: absolute; bottom: 4px; left: 4px; font-size: .68rem; background: rgba(0,0,0,.5);
  padding: 2px 6px; border-radius: 6px; }
.discover-side { display: flex; flex-direction: column; gap: 8px; }
.mini-comm { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.explore-cell { aspect-ratio: 1; background: var(--panel-2); border-radius: 10px; overflow: hidden; cursor: pointer; }
.explore-cell img, .explore-cell video { width: 100%; height: 100%; object-fit: cover; }

/* ── Profile ── */
.page-profile { padding: 0 0 20px; gap: 0; }
.profile-cover { height: 168px; background:
    radial-gradient(circle at 20% 30%, rgba(168,139,250,.5), transparent 40%),
    radial-gradient(circle at 75% 20%, rgba(124,92,255,.45), transparent 45%),
    radial-gradient(circle at 90% 60%, rgba(34,199,224,.3), transparent 50%),
    linear-gradient(160deg, #1a1140, #0a0e17 70%);
  background-size: cover; background-position: center; position: relative; }
.profile-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--bg) 100%); pointer-events: none; }
.cover-edit, .avatar-edit { position: absolute; background: rgba(0,0,0,.5); border: 0; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; z-index: 2; }
.cover-edit { bottom: 10px; right: 10px; }
.profile-settings-btn { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.4); border: 0;
  color: #fff; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; z-index: 2;
  backdrop-filter: blur(6px); }
.profile-settings-btn:active { background: rgba(0,0,0,.7); }
.profile-head { display: flex; align-items: flex-end; gap: 14px; padding: 0 16px; margin-top: -48px; position: relative; z-index: 1; }
.profile-avatar-wrap { position: relative; padding: 3px; border-radius: 50%; background: linear-gradient(135deg, #7c5cff, #22c7e0); }
.profile-avatar-wrap .avatar { border: 3px solid var(--bg); }
.avatar-edit { bottom: 0; right: 0; width: 30px; height: 30px; border: 2px solid var(--panel); }
.cover-edit .icon, .avatar-edit .icon, .profile-settings-btn .icon { width: 17px; height: 17px; }
.message-btn { display: inline-flex; align-items: center; gap: 5px; }
.message-btn .icon { width: 15px; height: 15px; }
.profile-id { flex: 1; padding-bottom: 4px; }
.level-badge { display: inline-block; margin-top: 4px; font-size: .72rem; background: var(--accent-soft);
  border: 1px solid rgba(124,92,255,.3); padding: 2px 9px; border-radius: 999px; color: var(--amber); }
.profile-head .btn { margin-bottom: 6px; }
.profile-cta-row { padding: 12px 16px 0; }
.profile-cta-row > .btn { width: 100%; }
.profile-bio { padding: 12px 16px 0; }
.profile-links { padding: 4px 16px 0; }
.profile-link { display: inline-flex; align-items: center; gap: 5px; font-size: .85rem; font-weight: 600; }
.profile-link .icon { width: 14px; height: 14px; }
.about-row { padding: 6px 16px 0; }
.stats-row { display: flex; justify-content: space-between; padding: 16px; gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 4px; }
.stat.clickable { cursor: pointer; }
.stat.clickable:active { background: var(--panel-2); }
.stat strong { font-size: 1.15rem; font-family: var(--font-display); }
.stat span { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.streak-box, .ach-section { margin: 8px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 16px; }
.streak-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.streak-head strong { font-family: var(--font-display); font-size: 1.05rem; }
/* Connected dot track (like the mockup's M-T-W-T-F-S-S row) */
.streak-dots { display: flex; justify-content: space-between; gap: 0; position: relative; }
.streak-dots::before { content: ""; position: absolute; top: 11px; left: 6%; right: 6%; height: 2px; background: var(--line-2); z-index: 0; }
.streak-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; z-index: 1;
  font-size: .72rem; color: var(--muted); background: transparent; border: 0; }
.streak-day::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-3);
  border: 2px solid var(--line-2); box-sizing: border-box; }
.streak-day.on::before { background: var(--accent-a); border-color: var(--accent-a); box-shadow: 0 0 10px rgba(124,92,255,.5); }
.streak-day.on { color: var(--text); }
.streak-day > span { order: 2; }

/* Achievements — glossy hex-ish badges on a shelf */
.ach-section h4 { display: flex; align-items: center; justify-content: space-between; }
.ach-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; }
.ach-row::-webkit-scrollbar { display: none; }
.ach-badge { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0; background: transparent; border: 0; }
.ach-badge .ach-icon { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, var(--panel-3), var(--panel-2));
  border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 6px 16px rgba(0,0,0,.35); }
.ach-badge .ach-icon .icon { width: 30px; height: 30px; color: var(--accent-a);
  filter: drop-shadow(0 2px 4px rgba(124,92,255,.5)); }
.ach-icon-badge { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.ach-icon-badge .icon { width: 46px !important; height: 46px !important; }
.ach-badge.locked { opacity: .45; filter: grayscale(.7); }
.ach-badge.locked .ach-icon .icon { color: var(--muted); filter: none; }
.ach-label { font-size: .68rem; color: var(--muted); text-align: center; font-weight: 500; }

/* Quick tiles — 2-row grid, left-aligned icon + label + sub (mockup style) */
.quick-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 8px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; margin: 8px 16px; }
.quick-tile { background: transparent; border: 0; border-radius: 14px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--text); font-size: .7rem; font-weight: 500; }
.quick-tile:active { background: var(--panel-2); }
.qt-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-a); font-size: 1.1rem; }
.qt-icon .icon { width: 20px; height: 20px; }

/* ── Drafts ── */
.draft-card { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px; }
.draft-thumb { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.draft-thumb img, .draft-thumb video { width: 100%; height: 100%; object-fit: cover; }
.draft-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.draft-text { margin: 0; overflow-wrap: break-word; word-break: break-word; }
.draft-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* ── Analytics ── */
.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.stat-tile-icon { font-size: 1.15rem; }
.stat-tile strong { font-size: 1.05rem; }
.analytics-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 100px; }
.chart-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.chart-bar-fill { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--grad); min-height: 4px;
  transition: height var(--dur-slow) ease; }
.chart-bar-label { position: absolute; bottom: -18px; font-size: .62rem; color: var(--muted); }
.type-breakdown { display: flex; flex-direction: column; gap: 8px; }
.type-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.type-row > span:first-child { flex: 0 0 110px; }
.type-bar-track { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.type-bar-fill { height: 100%; background: var(--grad); border-radius: 999px; }
.interests-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 12px; }
.interests-row .chip { background: transparent; border: 1px solid var(--line-2); color: var(--accent-b); font-weight: 500; }
.interests-row .chip:nth-child(5n+1) { color: #7c5cff; border-color: rgba(124,92,255,.5); }
.interests-row .chip:nth-child(5n+2) { color: #22c7e0; border-color: rgba(34,199,224,.5); }
.interests-row .chip:nth-child(5n+3) { color: #2fd8a4; border-color: rgba(47,216,164,.5); }
.interests-row .chip:nth-child(5n+4) { color: #ff5d9e; border-color: rgba(255,93,158,.5); }
.interests-row .chip:nth-child(5n+5) { color: #f6b545; border-color: rgba(246,181,69,.5); }
.profile-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); position: sticky;
  top: calc(var(--top-h) + var(--safe-top)); background: var(--bg); z-index: 10; overflow-x: auto; scrollbar-width: none; }
.profile-tabs::-webkit-scrollbar { display: none; }
.ptab { background: transparent; border: 0; color: var(--muted); padding: 13px 12px; font-weight: 600;
  font-size: .88rem; border-bottom: 2px solid transparent; white-space: nowrap; font-family: var(--font-display); }
.ptab.active { color: var(--text); border-bottom-color: var(--accent-a); }
.profile-tab-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }

/* ── Messages ── */
.assistant-card { display: flex; flex-direction: column; gap: 14px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 20px; padding: 16px; cursor: pointer; position: relative;
  overflow: hidden; }
.assistant-card::before { content: ""; position: absolute; inset: 0; background: var(--aurora); opacity: .8; pointer-events: none; }
.assistant-card-top { display: flex; align-items: center; gap: 14px; position: relative; }
.assistant-card-top .avatar { box-shadow: 0 0 0 3px rgba(124,92,255,.35), 0 0 24px rgba(124,92,255,.4); }
.assistant-avatar { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); display: grid;
  place-items: center; font-size: 1.5rem; position: relative; flex: 0 0 auto; }
.assistant-avatar.sm { width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; }
.assistant-meta { flex: 1; position: relative; min-width: 0; }
.assistant-meta .name-row { font-family: var(--font-display); font-size: 1.05rem; }
.ai-tag { background: var(--accent-a); color: #fff; font-size: .6rem; font-weight: 800; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 6px; margin-left: 4px; }
.assistant-chat-now { flex: 0 0 auto; align-self: flex-start; }
.assistant-chips { display: flex; gap: 8px; overflow-x: auto; width: 100%; scrollbar-width: none; position: relative; }
.assistant-chips::-webkit-scrollbar { display: none; }
.assistant-chips .chip { flex: 0 0 auto; font-size: .78rem; }
.link-inline { color: var(--accent-b); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.conv-list { display: flex; flex-direction: column; gap: 2px; }
.conv-section-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; padding: 12px 12px 4px; }
.conv-section-label:first-child { padding-top: 2px; }
.conv-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 16px; cursor: pointer;
  -webkit-user-select: none; user-select: none; }
.conv-row:active { background: var(--panel); }
.conv-row.conv-pinned { background: color-mix(in srgb, #0084ff 6%, transparent); }
.conv-meta { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-top .name-row { font-family: var(--font-display); font-weight: 600; }
.conv-row.conv-unread .conv-top .name-row, .conv-row.conv-unread .conv-preview .muted:first-of-type { color: var(--text); font-weight: 700; }
.conv-preview { display: flex; align-items: center; gap: 6px; }
.conv-preview .muted { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge { background: #0084ff; color: #fff; font-size: .68rem; font-weight: 700; min-width: 19px;
  height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
.conv-preview .pin { flex: 0 0 auto; color: var(--muted); display: inline-flex; }
.conv-preview .pin .icon { width: 13px; height: 13px; }
/* Small pin badge sitting on the avatar's corner, Messenger-style */
.avatar.has-pin::after { content: ""; position: absolute; top: -2px; right: -2px; width: 16px; height: 16px;
  border-radius: 50%; background: #0084ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5M9 3h6l1 6 3 2v2H5v-2l3-2 1-6Z'/%3E%3C/svg%3E") center/9px no-repeat;
  border: 2px solid var(--bg); z-index: 3; }

/* ── Chat screen (overlay) ── */
.chat-screen { position: fixed; top: var(--vv-top, 0px); left: 0; right: 0;
  height: 100dvh;
  z-index: 60; background: var(--bg); display: flex; flex-direction: column;
  max-width: var(--maxw); margin: 0 auto; padding-top: var(--safe-top); }
.chat-header { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 4px;
  border-bottom: 1px solid var(--line); background: var(--panel); position: relative; z-index: 2; }
.chat-header .icon-btn { flex: 0 0 auto; }
.chat-title { flex: 1; min-width: 0; }
.chat-name { font-weight: 600; font-size: .98rem; line-height: 1.15; }
.chat-header-id { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.chat-presence { font-size: .74rem; color: var(--muted); line-height: 1.2; margin-top: 1px; }
.chat-presence.is-online { color: var(--ok); }
.chat-presence::first-letter { text-transform: uppercase; }

/* Messages area with a subtle chat wallpaper (flat, theme-aware) */
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--accent-a) 5%, transparent) 0, transparent 42%),
                    radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--accent-b) 5%, transparent) 0, transparent 42%); }

/* Day divider chip */
.chat-day-divider { align-self: center; margin: 10px 0 6px; }
.chat-day-divider span { background: var(--panel-2); color: var(--muted); font-size: .72rem; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Bubbles — Messenger style: solid colour fill, fully rounded corners */
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 18px; font-size: .93rem; line-height: 1.35;
  word-break: break-word; position: relative; }
.bubble.mine { align-self: flex-end; background: linear-gradient(135deg, #0084ff, #0068d6); color: #fff;
  border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: var(--panel-2); color: var(--text); border-bottom-left-radius: 6px; }
/* consecutive bubbles from same side sit tighter */
.bubble + .bubble { margin-top: 2px; }
.bubble-sender { font-size: .76rem; font-weight: 700; margin-bottom: 2px; color: var(--accent-a); }
.bubble-text { white-space: pre-wrap; }

/* Inline meta: time + delivery ticks, floated to the trailing edge */
.bubble-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 -2px 8px;
  font-size: .64rem; opacity: .7; user-select: none; white-space: nowrap; }
.bubble.mine .bubble-meta { opacity: .85; }
.bubble-ticks .icon { width: 15px; height: 15px; vertical-align: middle; }
.bubble-ticks.seen { color: #34b7f1; opacity: 1; }
.bubble.mine .bubble-ticks { color: rgba(255,255,255,.75); }
.bubble.mine .bubble-ticks.seen { color: #fff; }

.bubble-media { padding: 3px 3px 4px; }
.bubble-img-wrap { position: relative; }
.bubble-img { border-radius: 11px; display: block; max-height: 300px; max-width: 100%; cursor: pointer; }
.bubble-media .bubble-img-wrap .bubble-meta { position: absolute; right: 8px; bottom: 6px; float: none; margin: 0;
  background: rgba(0,0,0,.45); color: #fff; padding: 2px 7px; border-radius: 999px; opacity: 1; }
.bubble-media .bubble-img-wrap .bubble-ticks { color: #fff; }
.bubble-caption { margin: 4px 4px 0; font-size: .9rem; line-height: 1.4; }

.bubble-pinned { box-shadow: 0 0 0 2px #0084ff; }
.bubble-flash { animation: bubble-flash 1.2s ease; }
@keyframes bubble-flash { 0%, 100% { box-shadow: none; } 20%, 60% { box-shadow: 0 0 0 3px #0084ff; } }

.msg-reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; clear: both; }
.msg-reaction-chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  font-size: .74rem; padding: 1px 7px; }
.bubble.mine .msg-reaction-chip { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.msg-reaction-chip.mine { border-color: #0084ff; }
.msg-react-row { display: flex; justify-content: space-around; padding: 14px 10px; border-bottom: 1px solid var(--line); }
.msg-react-opt { background: transparent; border: 0; font-size: 1.6rem; padding: 4px; border-radius: 12px;
  transition: transform var(--dur-fast); }
.msg-react-opt.active { background: var(--panel-2); }
.msg-react-opt:active { transform: scale(1.2); }

.pin-banner { display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: color-mix(in srgb, #0084ff 10%, var(--panel)); border-bottom: 1px solid var(--line); }
.pin-banner .icon { color: #0084ff; width: 15px; height: 15px; }
.pin-banner-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .8rem; font-weight: 600; cursor: pointer; }

/* Composer — pill input + circular blue send button, Messenger style */
.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap; padding-bottom: calc(8px + var(--safe-bottom));
  margin-bottom: var(--kb, 0px); }
.chat-pill { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 120px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 24px; padding: 2px 4px; }
.chat-pill .icon-btn { flex: 0 0 auto; width: 38px; height: 38px; color: #0084ff; border-radius: 50%; }
.chat-pill .icon-btn:active { color: #0068d6; }
.chat-input { flex: 1; border: 0; background: transparent; min-width: 60px; padding: 9px 4px; font-size: .95rem; }
.chat-input:focus { outline: none; box-shadow: none; }
.send-btn, .mic-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; }
.send-btn { background: #0084ff; color: #fff; }
.send-btn .icon { width: 20px; height: 20px; }
.mic-btn { background: var(--panel-2); color: #0084ff; }
.mic-btn:active { background: var(--danger); color: #fff; }
.hidden { display: none !important; }

.chat-img-preview { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.chat-img-preview img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.chat-img-preview .muted { flex: 1; }
.chat-img-preview #img-preview-cancel { flex: 0 0 auto; }

.rec-ui { display: flex; align-items: center; gap: 10px; flex: 1; padding: 4px 6px; }
.rec-dot { width: 11px; height: 11px; background: var(--danger); border-radius: 50%; animation: pulse .7s infinite; flex: 0 0 auto; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-ui #rec-cancel { margin-left: auto; }
@keyframes pulse { 50% { opacity: .3; } }

/* Voice note player */
.voice-player { display: flex; align-items: center; gap: 9px; min-width: 168px; padding: 2px 0; }
.voice-play { background: #0084ff; border: 0; color: #fff; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.voice-play .icon { width: 16px; height: 16px; }
.bubble.mine .voice-play { background: rgba(255,255,255,.25); }
.voice-bar { flex: 1; height: 4px; background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 2px;
  overflow: hidden; min-width: 60px; }
.voice-bar i { display: block; height: 100%; width: 0; background: #0084ff; }
.bubble.mine .voice-bar i { background: #fff; }
.voice-time { font-size: .72rem; opacity: .8; font-variant-numeric: tabular-nums; }

/* ── Assistant chat ── */
.ai-disclaimer { font-size: .72rem; color: var(--muted); text-align: center; padding: 6px 12px;
  background: var(--panel); border-top: 1px solid var(--line); }
.assistant-quickrow { display: flex; gap: 6px; overflow-x: auto; width: 100%; scrollbar-width: none; }
.assistant-quickrow::-webkit-scrollbar { display: none; }
.assistant-results { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.assistant-result { background: rgba(255,255,255,.06); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.ar-text { margin: 2px 0; }
.bubble.typing { display: flex; align-items: center; gap: 8px; padding: 12px 14px; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block;
  animation: typingBounce 1.1s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
/* Custom logo spinner shown while the assistant is retrieving/composing —
   behaves like Claude's own thinking indicator: a continuous smooth spin
   plus a gentle "breathing" pulse. Split into two elements because a
   single element can't run two different transform animations (rotate +
   scale) independently without them overwriting each other — the outer
   .ai-spinner handles the pulse/glow, the inner .ai-spinner-inner handles
   the spin. */
.ai-spinner { width: 22px; height: 22px; flex: 0 0 auto; display: inline-block;
  animation: aiPulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(79,124,255,.55)); }
.ai-spinner-inner { display: block; width: 100%; height: 100%;
  background: url("icons/ai-thinking.png") center / contain no-repeat;
  animation: aiSpin 1.6s linear infinite; }
@keyframes aiSpin { to { transform: rotate(360deg); } }
@keyframes aiPulse { 0%, 100% { transform: scale(.92); opacity: .82; } 50% { transform: scale(1.06); opacity: 1; } }
.typing-label { font-size: .78rem; color: var(--muted); }
.reveal-in { animation: revealIn .18s ease-out; }
@keyframes revealIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Groups ── */
.page-head-row { display: flex; justify-content: space-between; align-items: center; }
.group-grid { display: flex; flex-direction: column; gap: 12px; }
.group-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.group-cover { height: 90px; background: var(--grad); background-size: cover; background-position: center; }
.group-body { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.group-body .name-row { font-family: var(--font-display); font-weight: 600; }
.group-body .btn { margin-top: 8px; align-self: flex-start; }

/* ── Notifications ── */
/* ── Notifications ── */
.page-notifs { padding-top: 4px; }
.notifs-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.notifs-head h2 { margin: 0; }
.notifs-readall { color: var(--muted); }
.notifs-readall:active { color: var(--accent-b); }

.notifs-tabs { display: flex; gap: 6px; margin: 0 0 12px; position: sticky; top: 0; z-index: 3;
  background: var(--bg); padding: 2px 0 6px; }
.notif-tab { border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 7px 15px; font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.notif-tab:active { transform: scale(.97); }
.notif-tab.active { background: var(--accent-soft); border-color: rgba(124,92,255,.4); color: var(--accent-a); }
.notif-tab-hidden { margin-left: auto; }
.notif-tab-hidden .icon { width: 14px; height: 14px; }

.notif-section-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; margin: 14px 4px 6px; }
.notif-section-head:first-child { margin-top: 2px; }

.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid transparent; position: relative;
  transition: background var(--dur-fast); cursor: pointer; }
.notif-row:active { background: var(--panel-2); }
.notif-row.unread { background: color-mix(in srgb, var(--accent-b) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--accent-b) 22%, transparent); }
/* Unread accent dot on the far edge */
.notif-row.unread::after { content: ""; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-b); }
.notif-row.security.unread::after { background: #ffb420; }

.notif-avatar-wrap { position: relative; flex: 0 0 auto; }
.notif-avatar-wrap.clickable { cursor: pointer; }
.notif-emoji { width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2); display: grid;
  place-items: center; }
.notif-emoji .icon { width: 20px; height: 20px; color: var(--muted); }
.notif-meta { flex: 1; min-width: 0; padding-right: 6px; }
.notif-text { line-height: 1.35; font-size: .92rem; }
.notif-text strong { font-weight: 700; }

/* Colored type badge on the avatar corner */
.notif-type-badge { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px;
  border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--panel);
  background: var(--panel-3); }
.notif-row.unread .notif-type-badge { border-color: color-mix(in srgb, var(--accent-b) 9%, var(--panel)); }
.notif-type-badge .icon { width: 11px; height: 11px; color: #fff; }
.notif-type-badge.t-like { background: #ff5d73; }
.notif-type-badge.t-comment { background: #4c9aff; }
.notif-type-badge.t-follow { background: #7c5cff; }
.notif-type-badge.t-mention { background: #2fd8a4; }
.notif-type-badge.t-message { background: #22c7e0; }
.notif-type-badge.t-security { background: #f6b545; }
.notif-type-badge.t-boost { background: #f59f00; }

/* Grouping ("5 new likes") */
.notif-avatar-stack { display: flex; flex: 0 0 auto; }
.notif-avatar-stack .avatar { margin-left: -16px; border: 2px solid var(--panel); }
.notif-avatar-stack .avatar:first-child { margin-left: 0; }
.notif-row.unread .notif-avatar-stack .avatar { border-color: color-mix(in srgb, var(--accent-b) 9%, var(--panel)); }
.notif-count-badge { flex: 0 0 auto; font-size: .72rem; font-weight: 800; color: #fff;
  background: var(--accent-b); border-radius: 999px; padding: 2px 8px; min-width: 20px; text-align: center; }

/* Per-row options menu (Hide / Unhide / Delete) */
.notif-menu-btn { flex: 0 0 auto; color: var(--muted); width: 34px; height: 34px; }
.notif-menu-btn:active { color: var(--text); }
.notif-menu { position: fixed; z-index: 500;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 5px;
  box-shadow: 0 12px 30px rgba(0,0,0,.28); min-width: 156px; display: flex; flex-direction: column; }
.notif-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: 0; color: var(--text); font-size: .88rem; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; }
.notif-menu-item:active { background: var(--panel-2); }
.notif-menu-item .icon { width: 16px; height: 16px; color: var(--muted); }
.notif-menu-item.danger { color: var(--danger); }
.notif-menu-item.danger .icon { color: var(--danger); }

/* "Who" sheet for grouped notifications */
.notif-people-sheet { max-width: 460px; }
.notif-people-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }

/* ── Swipe-left-to-delete / swipe-right-to-hide (kept as a secondary gesture) ── */
.notif-swipe-wrap { position: relative; overflow: hidden; border-radius: 14px; }
.notif-swipe-wrap .notif-swipe-content { position: relative; z-index: 1; transition: transform .18s ease; touch-action: pan-y; }
.notif-delete-btn { position: absolute; top: 0; right: 0; bottom: 0; width: 84px; border: 0; cursor: pointer;
  background: var(--danger); color: #fff; font-weight: 700; font-size: .82rem; display: flex; align-items: center; justify-content: center; }
.notif-delete-btn:disabled { opacity: .6; }
.notif-hide-btn { position: absolute; top: 0; left: 0; bottom: 0; width: 84px; border: 0; cursor: pointer;
  background: #64748b; color: #fff; font-weight: 700; font-size: .82rem; display: flex; align-items: center; justify-content: center; }
.notif-hide-btn:disabled { opacity: .6; }

/* ── Settings ── */
.settings-section { margin: 0 0 18px; }
.page-settings { padding: 16px 14px calc(28px + var(--safe-bottom)); }
.settings-title { margin: 2px 2px 14px; }

/* Profile header card */
.settings-profile-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 16px;
  margin: 0 0 18px; cursor: pointer; transition: background var(--dur-fast); position: relative; overflow: hidden; }
.settings-profile-card::before { content: ""; position: absolute; inset: 0; background: var(--aurora); opacity: .7; pointer-events: none; }
.settings-profile-card:active { background: var(--panel-2); }
.settings-profile-card > * { position: relative; }
.settings-profile-meta { flex: 1; min-width: 0; }
.settings-profile-name { font-weight: 600; font-size: 1.1rem; font-family: var(--font-display); }
.settings-profile-handle { font-size: .85rem; color: var(--accent-b); }
.settings-profile-sub { margin-top: 2px; }
.settings-profile-chev { flex: 0 0 auto; color: var(--muted); }
.settings-profile-chev .icon { width: 20px; height: 20px; }

/* Section = grouped card with an icon header (iOS/Android style) */
.settings-section-head { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; }
.settings-section-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: var(--accent-soft); flex: 0 0 auto; }
.settings-section-icon .icon { width: 16px; height: 16px; color: var(--accent-a); }
.settings-section h4 { margin: 0; font-size: .74rem; letter-spacing: .08em; }
.settings-section > .settings-row,
.settings-section > .link-row,
.settings-section > label.settings-row { display: flex; }
.settings-section > :not(.settings-section-head) { background: var(--panel); }
.settings-section > :not(.settings-section-head):first-of-type { border-top-left-radius: 16px; border-top-right-radius: 16px; }
.settings-section > :not(.settings-section-head):last-child { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.settings-section > .settings-note,
.settings-section > .btn-block { border-radius: 16px; }

.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; 
  border-bottom: 1px solid var(--line); width: 100%; background: var(--panel); border-left: 0; border-right: 0;
  border-top: 0; color: var(--text); font-size: .93rem; text-align: left; transition: background var(--dur-fast); }
.settings-section > .settings-row:last-of-type { border-bottom: 0; }
.link-row { cursor: pointer; }
.link-row:active { background: var(--panel-2); }
.settings-row .info-val, .settings-chevron { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

.switch { width: 46px; height: 27px; appearance: none; -webkit-appearance: none; background: var(--panel-3); border-radius: 999px;
  position: relative; transition: background var(--dur-med); flex: 0 0 auto; cursor: pointer; }
.switch:checked { background: var(--accent-a); }
.switch::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; transition: transform var(--dur-med); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch:checked::after { transform: translateX(19px); }

/* In-section note (safety / info callout) */
.settings-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.settings-note-icon { flex: 0 0 auto; margin-top: 1px; }
.settings-note-icon .icon { width: 20px; height: 20px; color: var(--accent-a); }
.settings-note strong { font-size: .9rem; }

.contacts { padding: 10px 14px; }

/* ── Modals / sheets / toast / lightbox ── */
.modal-overlay { position: fixed; top: var(--vv-top, 0px); left: 0; right: 0; height: var(--vvh, 100dvh);
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 80;
  display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-actions .btn { flex: 1; }
.composer-modal { gap: 10px; }
.composer-textarea { resize: none; }
.composer-preview img, .composer-preview video { border-radius: 12px; max-height: 260px; width: 100%; object-fit: cover; }
.composer-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.composer-modal-actions .btn-primary { flex: 1; min-width: 100px; }
.composer-safety-note { display: flex; align-items: flex-start; gap: 8px; font-size: .78rem; line-height: 1.4;
  color: var(--muted); background: color-mix(in srgb, var(--accent-a) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-a) 22%, transparent); border-radius: 10px; padding: 8px 10px; }
.composer-safety-icon .icon { width: 16px; height: 16px; color: var(--accent-a); flex: 0 0 auto; }
.composer-safety-icon { flex: 0 0 auto; margin-top: 1px; }
.poll-fields { display: flex; flex-direction: column; gap: 8px; }
.report-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.post-modal { padding: 12px; position: relative; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(0,0,0,.4); }
.legal-modal { max-width: 560px; }
.legal-text { white-space: pre-wrap; font-family: inherit; font-size: .82rem; color: var(--muted);
  line-height: 1.6; margin: 0; }
.sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 80; display: flex; align-items: flex-end; }
.sheet { width: 100%; max-width: var(--maxw); margin: 0 auto; background: var(--panel); border-radius: 20px 20px 0 0;
  padding: 8px; border-top: 1px solid var(--line); }
.sheet-item { width: 100%; background: transparent; border: 0; color: var(--text); text-align: left;
  padding: 14px 16px; border-radius: 12px; font-size: .95rem; }
.sheet-item:active { background: var(--panel-2); }
.sheet-item.danger { color: var(--danger); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 90; display: grid; place-items: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
#toast-host { position: fixed; bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px); left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: 90vw; }
.toast { background: var(--panel-3); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 16px; font-size: .85rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px);
  transition: opacity var(--dur-med), transform var(--dur-med); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-color: rgba(255,84,112,.4); background: #2a1620; }
.toast-info { }

/* Offline banner — slides down from the top while the device has no network */
.offline-banner { position: fixed; top: var(--safe-top, 0px); left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #b45309; color: #fff; font-size: .82rem; font-weight: 600;
  padding: 8px 12px; transform: translateY(-110%); transition: transform var(--dur-med, .2s) ease; }
.offline-banner.show { transform: translateY(0); }
.offline-banner .icon { width: 16px; height: 16px; }

/* ── Story viewer ── */
.story-viewer { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; flex-direction: column; }
.story-bars { display: flex; gap: 4px; padding: calc(10px + var(--safe-top)) 12px 4px; }
.story-bar { flex: 1; height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.story-bar i { display: block; height: 100%; width: 0; background: #fff; }
.story-vhead { display: flex; align-items: center; gap: 10px; padding: 6px 14px; color: #fff; }
.story-vhead span { flex: 1; font-weight: 600; font-size: .9rem; }
.story-vhead .icon-btn { color: #fff; }
.story-stage { flex: 1; display: grid; place-items: center; overflow: hidden; }
.story-stage img, .story-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ── Focus visibility + reduced motion ── */
:focus-visible { outline: 2px solid var(--accent-b); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Larger screens: keep it phone-width, centered ── */
@media (min-width: 700px) {
  .discover-columns { flex-direction: row; }
  .discover-main { flex: 2; }
  .discover-side { flex: 1; }
  body { background: var(--bg); }
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100dvh; }
}

/* ── Poll widget ── */
.poll-widget { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.poll-opt-row { position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); font-size: .9rem; overflow: hidden; text-align: left; }
.poll-opt-row.voted { cursor: default; }
.poll-opt-row:not(.voted):active { background: var(--panel-3); }
.poll-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(192,38,211,.28), rgba(79,124,255,.28));
  transition: width var(--dur-slow) ease; z-index: 0; }
.poll-opt-row.mine .poll-fill { background: linear-gradient(90deg, rgba(192,38,211,.5), rgba(79,124,255,.5)); }
.poll-label, .poll-pct { position: relative; z-index: 1; }
.poll-pct { font-weight: 700; font-size: .82rem; }
.poll-total { padding-left: 2px; }

/* ── Profile CTA (follow + friend) ── */
.profile-cta { display: flex; gap: 6px; }
.profile-cta > * { flex: 1; }
.profile-cta .message-btn { justify-content: center; }

/* ── Pinned posts ── */
.pinned-section { margin: 14px 16px 0; }
.pinned-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--muted);
  font-size: .82rem; }
.pinned-head .icon { width: 15px; height: 15px; }
.pinned-list { display: flex; flex-direction: column; gap: 14px; }
.post-pinned { border-color: var(--accent-a); }
.pinned-tag { display: flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700;
  color: var(--accent-a); margin-bottom: 2px; }
.pinned-tag .icon { width: 12px; height: 12px; }

/* ── Friend request actions in notifications ── */
.notif-actions { display: flex; gap: 6px; margin-left: auto; }

/* ── Group detail screen ── */
.group-screen { background: var(--bg); }
.group-detail { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 40px; }
.group-cover.big { height: 130px; }
.group-detail-head { padding: 14px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.group-detail-head .btn { align-self: flex-start; }
.group-composer-zone { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  border-bottom: 1px solid var(--line); }
.group-composer-zone .composer-fake { width: 100%; }
.group-detail .feed { padding: 14px; }
.group-card-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ── Settings extras ── */
.mini-select { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 7px 10px; font-size: .82rem; max-width: 55%; }
.settings-row.link-row .info-val { font-size: .84rem; }
.settings-chevron .icon, .info-val .icon { width: 15px; height: 15px; vertical-align: -3px; opacity: .7; }
.settings-row.no-tap { opacity: .9; }
.session-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.session-row:last-child { border-bottom: 0; }
.session-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; font-size: 1rem; }
.session-meta { flex: 1; min-width: 0; }

/* ── Security notification accent ── */
.notif-row.security .notif-emoji { background: rgba(255,180,32,.15); }

/* ── Group/page avatar + cover ── */
.group-avatar-wrap { position: relative; width: 72px; height: 72px; margin-top: -40px; }
.group-avatar { width: 72px; height: 72px; border-radius: 22px; background: var(--grad); background-size: cover;
  background-position: center; display: grid; place-items: center; font-weight: 700; font-size: 1.6rem; color: #fff;
  font-family: var(--font-display); border: 3px solid var(--bg); }
.group-head-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.group-card-title { display: flex; align-items: center; gap: 8px; }
.group-card-avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); background-size: cover;
  background-position: center; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .9rem; flex: 0 0 auto; }

/* ── Create community photo pickers ── */
.create-cover { height: 90px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--line);
  overflow: hidden; cursor: pointer; margin-bottom: 8px; }
.create-cover-prev { width: 100%; height: 100%; background-size: cover; background-position: center; display: grid; place-items: center; }
.create-avatar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.create-photo { width: 56px; height: 56px; flex: 0 0 auto; cursor: pointer; }
.create-photo-prev { width: 56px; height: 56px; border-radius: 16px; background: var(--panel-2); border: 1px dashed var(--line);
  background-size: cover; background-position: center; display: grid; place-items: center; font-size: 1.4rem; color: var(--muted); }

/* ── Accent variants (synced appearance setting) ── */
:root[data-accent="magenta"] { --grad: linear-gradient(135deg, #c026d3 0%, #e0459b 100%); --accent-b: #e0459b; }
:root[data-accent="blue"] { --grad: linear-gradient(135deg, #4f7cff 0%, #22d3ee 100%); --accent-a: #4f7cff; }

/* ── Reaction breakdown modal ── */
.react-summary.tappable { cursor: pointer; }
.react-summary.tappable:active { opacity: .7; }
.reaction-modal { max-height: 80vh; }
.react-filter-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.react-filter-row::-webkit-scrollbar { display: none; }
.react-filter { flex: 0 0 auto; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font-size: .82rem; font-weight: 600; }
.react-filter.active { background: var(--grad); color: #fff; border-color: transparent; }
.react-people { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; overflow-y: auto; }
.react-person { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 12px; cursor: pointer; }
.react-person:active { background: var(--panel-2); }
.react-person-meta { flex: 1; min-width: 0; }
.react-person-emoji { font-size: 1.3rem; }

/* ── Composer audience selector ── */
.composer-audience-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 0 8px; }
.audience-select { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 7px 12px; font-size: .84rem; font-weight: 600; }

/* ── Contact & Payment modal ── */
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
.contact-info { min-width: 0; }
.contact-label { margin-bottom: 1px; }
.contact-value { font-weight: 600; word-break: break-all; }
.copy-btn { flex: 0 0 auto; background: var(--panel-2); border: 1px solid var(--line); color: var(--accent-b);
  border-radius: 999px; padding: 5px 12px; font-size: .78rem; font-weight: 600; }
.copy-btn:active { background: var(--panel-3); }
.pay-block { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin: 8px 0; }
.pay-block strong { display: block; margin-bottom: 4px; }
.pay-block .contact-row:last-child { border-bottom: 0; }
.social-links { display: flex; flex-direction: column; gap: 2px; }
.social-link { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 4px; color: var(--text); }
.social-link span:first-child { font-weight: 600; }
.legal-modal h4 { margin-top: 16px; }

/* ============================================================
   Pages tab + Reels tab (added feature) — keeps the existing
   purple/black neon theme, radii, glow and motion tokens.
   ============================================================ */

/* ── Bottom nav: 7 slots (Home · Discover · Pages · ＋ · Reels · Messages · Profile).
   Items flex instead of the old fixed 60px so everything fits on 320–420px
   phones without changing the bar's height, blur, or glow. ── */
.bottom-nav { padding-left: 4px; padding-right: 4px; }
.nav-item { width: auto; flex: 1 1 0; min-width: 0; }
.nav-item .nav-label { font-size: .58rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-create { flex: 0 0 50px; width: 50px; height: 50px; }

/* ── Pages tab ── */
.fp-head { display: flex; align-items: center; justify-content: space-between; }
.fp-section-title { margin: 4px 0 2px; font-size: 1rem; color: var(--muted); font-weight: 700; }
#fp-mine, #fp-all { display: flex; flex-direction: column; gap: 12px; }
.fp-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fp-owner-chip { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--accent-a);
  background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.35); border-radius: 999px; padding: 4px 10px; }
.fp-owner-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* Create/edit page image pickers */
.fp-pick-row { display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--panel-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.fp-pick-row:active { filter: brightness(1.15); }
.fp-pick-thumb { background: var(--panel-3) center/cover; border: 1px solid var(--line); flex: 0 0 auto; }
.fp-pick-thumb.cover { width: 84px; height: 44px; border-radius: 10px; }
.fp-pick-thumb.avatar { width: 44px; height: 44px; border-radius: 50%; }

/* Analytics modal */
.fp-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.fp-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fp-stat-icon { color: var(--accent-a); }
.fp-stat-icon .icon { width: 22px; height: 22px; }
.fp-stat-num { font-size: 1.3rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Reels tab ── */
/* Fixed layer that fills the space between the top bar and bottom nav —
   independent of the outer view scroll, so snapping is buttery. */
.reels-screen {
  position: fixed; z-index: 10;
  top: calc(var(--top-h) + var(--safe-top));
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  background: #000; overflow: hidden;
}
.reels-scroller {
  height: 100%; overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.reels-scroller::-webkit-scrollbar { display: none; }
.reels-sentinel { height: 2px; }
.feed-sentinel { height: 2px; }

.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  background: #000; overflow: hidden; display: grid; place-items: center; }
.reel-empty { place-items: center; padding: 24px; }
.reel-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.reel-tapzone { position: absolute; inset: 0 76px 90px 0; }

/* Big play badge when paused */
.reel-pause-badge { position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-med); filter: drop-shadow(0 4px 14px rgba(0,0,0,.6)); }
.reel-pause-badge.show { opacity: .9; }

/* Double-tap heart burst */
.reel-heart-burst { position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; color: #ff4d6d; opacity: 0; }
.reel-heart-burst .icon { width: 84px; height: 84px; stroke-width: 0; fill: #ff4d6d;
  filter: drop-shadow(0 6px 24px rgba(255,77,109,.6)); }
.reel-heart-burst.pop { animation: reelHeart .8s ease forwards; }
@keyframes reelHeart {
  0% { opacity: 0; transform: scale(.4); }
  20% { opacity: 1; transform: scale(1.15); }
  45% { transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25) translateY(-14px); }
}

/* Right-side action rail */
.reel-rail { position: absolute; right: 8px; bottom: 96px; display: flex; flex-direction: column;
  gap: 16px; align-items: center; z-index: 3; }
.reel-rail-btn { background: rgba(17,23,37,.5); border: 1px solid rgba(124,92,255,.28);
  color: #fff; border-radius: 16px; width: 52px; padding: 9px 0 7px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; backdrop-filter: blur(8px);
  transition: transform var(--dur-fast), background var(--dur-med); }
.reel-rail-btn:active { transform: scale(.9); }
.reel-rail-btn .icon { width: 22px; height: 22px; }
.reel-rail-btn.liked { color: #ff5d73; border-color: rgba(255,93,115,.5);
  box-shadow: 0 0 18px rgba(255,93,115,.35); }
.reel-rail-btn.liked .icon { fill: #ff5d73; }
.reel-rail-label { font-size: .62rem; font-weight: 700; color: #fff; }

/* Creator + caption overlay */
.reel-meta { position: absolute; left: 12px; right: 76px; bottom: 18px; z-index: 3;
  display: flex; flex-direction: column; gap: 8px; color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.reel-author { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.reel-author-name { font-weight: 700; font-family: var(--font-display); font-size: .98rem; display: flex; align-items: center; gap: 4px; }
.reel-follow { margin-left: 6px; }
.reel-desc { font-size: .88rem; line-height: 1.35; max-height: 4.2em; overflow: hidden; }
.reel-music { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: #d6dbe7;
  background: rgba(17,23,37,.55); border: 1px solid rgba(124,92,255,.3); border-radius: 999px;
  padding: 4px 12px; width: fit-content; max-width: 100%; backdrop-filter: blur(8px); }
.reel-music-icon .icon { width: 14px; height: 14px; }
.reel-music-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Progress indicator */
.reel-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255,255,255,.14); z-index: 4; }
.reel-progress-fill { height: 100%; width: 0%; background: var(--grad);
  box-shadow: 0 0 10px rgba(124,92,255,.8); }

/* Floating create-reel button (top-right of the reels screen) */
.reels-create-btn { position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 42px; height: 42px; border-radius: 14px; border: 0; color: #fff;
  background: var(--grad); box-shadow: var(--glow);
  display: grid; place-items: center; }
.reels-create-btn:active { transform: scale(.92); }
.reels-create-btn .icon { width: 20px; height: 20px; }
.reel-create-preview video { max-height: 320px; object-fit: contain; background: #000; }

/* Reel comments bottom sheet */
.reel-comments-overlay { place-items: end center; padding: 16px 0 0; }
.reel-comments-sheet { width: 100%; max-width: var(--maxw); margin: 0; border-radius: 22px 22px 0 0;
  max-height: 72dvh; display: flex; flex-direction: column;
  animation: sheetUp var(--dur-slow) cubic-bezier(.2,.9,.3,1); }
@keyframes sheetUp { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.reel-comment-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 10px 0; min-height: 160px; }
.comment-author { font-weight: 700; font-size: .82rem; margin-bottom: 2px; display: flex; align-items: center; gap: 4px; }
.comment-del { color: var(--danger); cursor: pointer; }

/* ── Friend-request notification: answered state (replaces Accept/Decline) ── */
.notif-req-status { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700;
  border-radius: 999px; padding: 5px 12px; border: 1px solid var(--line); color: var(--muted); background: var(--panel-2); }
.notif-req-status .icon { width: 14px; height: 14px; }
.notif-req-status.accepted { color: var(--ok); border-color: rgba(41,192,147,.4); background: rgba(41,192,147,.1); }
.notif-req-status.declined { color: var(--danger); border-color: rgba(255,84,112,.35); background: rgba(255,84,112,.08); }

/* ── Full-screen image/video preview: X close button + tappable hints ── */
.lightbox video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.lightbox-close { position: absolute; top: calc(12px + var(--safe-top)); right: 14px; z-index: 2;
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid rgba(139,92,246,.35);
  background: rgba(20,12,46,.6); color: #fff; backdrop-filter: blur(8px);
  display: grid; place-items: center; transition: transform var(--dur-fast); }
.lightbox-close:active { transform: scale(.9); }
.lightbox-close .icon { width: 20px; height: 20px; }
.profile-cover.previewable, .avatar.previewable { cursor: zoom-in; }
.avatar.previewable:active { filter: brightness(1.15); }

/* ============================================================
   Monetization: Boost / Sponsored / Get Verified / Admin panel
   ============================================================ */

/* "Sponsored" label on injected feed cards and reels */
.sponsored-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; color: #ffd76b;
  background: rgba(255,176,32,.12); border: 1px solid rgba(255,176,32,.35);
  border-radius: 999px; padding: 4px 11px; margin: 10px 14px 0; width: fit-content; }
.sponsored-chip .icon { width: 12px; height: 12px; }
.post-card.sponsored { border-color: rgba(255,176,32,.28); }

/* ── Skeleton loading cards (shown while the feed/lists are fetching) ──
   Mirrors the real .post-card layout so there's no layout shift on swap-in. */
.skel-card { pointer-events: none; }
.skel-head { display: flex; align-items: center; gap: 10px; }
.skel-avatar { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; }
.skel-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.skel-body { margin: 12px 0; display: flex; flex-direction: column; gap: 7px; }
.skel-actions { display: flex; gap: 8px; padding-top: 10px; }
.skel-block { border-radius: 999px; background: var(--panel-2); position: relative; overflow: hidden; }
.skel-block::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel-block::after { animation: none; } }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 10px; }
.sponsored-chip.on-reel { margin: 0 0 2px; backdrop-filter: blur(8px); background: rgba(20,12,46,.6); }

/* Boost plan picker */
.promo-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.promo-plan { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); padding: 12px 6px; display: flex; flex-direction: column; gap: 4px; align-items: center;
  transition: transform var(--dur-fast), border-color var(--dur-med), box-shadow var(--dur-med); }
.promo-plan:active { transform: scale(.96); }
.promo-plan.active { border-color: var(--accent-a); box-shadow: 0 0 18px rgba(139,92,246,.35); background: var(--panel-3); }
.promo-price { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Manual payment box */
.promo-pay { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.promo-pay.hidden { display: none; }
.promo-pay-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.promo-pay-title { font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.promo-pay-line { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; }
.promo-pay-method { display: flex; flex-direction: column; gap: 6px; padding: 8px 0;
  border-top: 1px solid var(--line); }
.promo-pay-method:first-of-type { border-top: none; }
.promo-ref-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px dashed var(--line); padding-top: 8px; }
.promo-ref { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: .08em; font-size: 1.05rem;
  color: var(--accent-a); }
.promo-status { text-align: center; padding: 16px 6px; display: flex; flex-direction: column; gap: 8px; align-items: center; }

/* Admin panel */
.adm-section { margin-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.adm-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.adm-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.adm-ref { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--accent-a); font-weight: 700; }
.adm-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

/* ── Create sheet (from the raised center nav button) ── */
.create-sheet-overlay { position: fixed; inset: 0; height: 100dvh; background: rgba(4,6,12,.6);
  backdrop-filter: blur(4px); z-index: 90; display: flex; align-items: flex-end; }
.create-sheet { width: 100%; max-width: var(--maxw); margin: 0 auto; background: var(--panel);
  border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 10px 16px calc(24px + var(--safe-bottom)); animation: sheetup var(--dur-med) ease; }
@keyframes sheetup { from { transform: translateY(30px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.create-sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--line-2); margin: 4px auto 12px; }
.create-sheet-title { font-family: var(--font-display); margin: 0 4px 12px; }
.create-opts { display: flex; flex-direction: column; gap: 8px; }
.create-opt { display: flex; align-items: center; gap: 14px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; text-align: left; color: var(--text); }
.create-opt:active { background: var(--panel-3); }
.create-opt-ico { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-a); }
.create-opt-ico .icon { width: 23px; height: 23px; }
.create-opt-meta { display: flex; flex-direction: column; gap: 1px; }
.create-opt-title { font-weight: 600; font-family: var(--font-display); }
.create-opt-sub { font-size: .78rem; color: var(--muted); }

/* ── Discover quick links (Pages / Communities) ── */
.disc-quick { display: flex; gap: 10px; }
.disc-quick-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 13px;
  color: var(--text); font-weight: 600; font-family: var(--font-display); font-size: .92rem; }
.disc-quick-btn:active { background: var(--panel-2); }
.dq-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-a); }
.dq-ico .icon { width: 17px; height: 17px; }

/* ── Saved Collections (main-only upgrade) ── */
.saved-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.collections-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.collections-row::-webkit-scrollbar { display: none; }
.col-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px;
  font-size: .85rem; font-weight: 600; font-family: var(--font-display); }
.col-chip.active { background: var(--accent-soft); color: var(--accent-a); border-color: rgba(124,92,255,.4); }
.col-chip-count { font-size: .72rem; background: var(--panel-2); color: var(--muted); border-radius: 999px;
  min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }
.col-chip.active .col-chip-count { background: rgba(124,92,255,.2); color: var(--accent-a); }
#saved-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }

/* Save-to-collection picker */
.col-picker-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; max-height: 46vh; overflow-y: auto; }
.col-picker-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); text-align: left; }
.col-picker-row:active { background: var(--panel-3); }
.col-picker-row.on { border-color: rgba(124,92,255,.4); }
.cp-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent-a); flex: 0 0 auto; }
.cp-ico .icon { width: 18px; height: 18px; }
.cp-name { flex: 1; font-weight: 600; }
.cp-check { color: var(--accent-a); }
.cp-check .icon { width: 20px; height: 20px; }

/* ── Discover / Explore header ── */
.disc-sub { margin: 2px 0 0; font-size: .82rem; max-width: 240px; }
.disc-search { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 13px 16px; color: var(--muted); text-align: left; }
.disc-search .icon { width: 19px; height: 19px; }
.disc-search-ph { font-size: .92rem; }
