/* ==========================================================================
   Glassay — glass UI
   Light theme is the base; dark overrides follow. Tokens drive everything.
   ========================================================================== */

:root {
  --app-version: "2.9.0"; /* must match APP_VERSION — lets pages detect an outdated cached stylesheet */
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #eef0fb;
  --blob-1: #c4b5fd;
  --blob-2: #a5f3fc;
  --blob-3: #fbcfe8;
  --blob-4: #bfdbfe;
  --blob-opacity: .75;

  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .72);
  --glass-hover: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .85);
  --glass-edge: rgba(15, 23, 42, .06);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 10px 30px -12px rgba(49, 46, 129, .18), 0 2px 6px -2px rgba(49, 46, 129, .08);
  --input: rgba(255, 255, 255, .7);
  --input-border: rgba(15, 23, 42, .1);

  --text: #141428;
  --text-soft: #3b3b55;
  --muted: #6a6a85;
  --line: rgba(15, 23, 42, .08);

  --accent: #7c3aed;
  --accent-2: #0891b2;
  --accent-3: #db2777;
  --accent-ink: #6d28d9;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 55%, #ec4899 110%);
  --grad-soft: linear-gradient(135deg, rgba(139,92,246,.14), rgba(6,182,212,.12));
  --like: #e11d48;
  --danger: #dc2626;
  --success: #059669;
  --focus: 0 0 0 3px rgba(124, 58, 237, .35);

  --blur: 22px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Dark palette — applied by data-theme, or by the OS when JS is off. */
:root[data-theme="dark"] {
  --bg: #07070f;
  --blob-1: #6d28d9;
  --blob-2: #0e7490;
  --blob-3: #be185d;
  --blob-4: #1d4ed8;
  --blob-opacity: .55;
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(18, 18, 34, .62);
  --glass-hover: rgba(255, 255, 255, .09);
  --glass-border: rgba(255, 255, 255, .11);
  --glass-edge: rgba(255, 255, 255, .04);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 20px 40px -20px rgba(0,0,0,.6);
  --input: rgba(255, 255, 255, .06);
  --input-border: rgba(255, 255, 255, .12);
  --text: #f3f3fb;
  --text-soft: #cfd0e6;
  --muted: #9a9bb8;
  --line: rgba(255, 255, 255, .08);
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --accent-ink: #c4b5fd;
  --grad-soft: linear-gradient(135deg, rgba(167,139,250,.18), rgba(34,211,238,.12));
  --like: #fb7185;
  --danger: #f87171;
  --success: #34d399;
  --focus: 0 0 0 3px rgba(167, 139, 250, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #07070f; --blob-1: #6d28d9; --blob-2: #0e7490; --blob-3: #be185d; --blob-4: #1d4ed8; --blob-opacity: .55;
    --glass: rgba(255,255,255,.055); --glass-strong: rgba(18,18,34,.62); --glass-hover: rgba(255,255,255,.09);
    --glass-border: rgba(255,255,255,.11); --glass-edge: rgba(255,255,255,.04);
    --glass-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 20px 40px -20px rgba(0,0,0,.6);
    --input: rgba(255,255,255,.06); --input-border: rgba(255,255,255,.12);
    --text: #f3f3fb; --text-soft: #cfd0e6; --muted: #9a9bb8; --line: rgba(255,255,255,.08);
    --accent: #a78bfa; --accent-2: #22d3ee; --accent-3: #f472b6; --accent-ink: #c4b5fd;
    --like: #fb7185; --danger: #f87171; --success: #34d399; color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .3s var(--ease);
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }
p { margin: 0 0 .75em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
code { font-size: .88em; padding: .1em .4em; border-radius: 6px; background: var(--input); border: 1px solid var(--input-border); }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--glass-strong); }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.right { text-align: right; }
[hidden] { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: var(--blob-opacity);
  transition: background-color .6s var(--ease), opacity .6s var(--ease);
  animation: drift 28s ease-in-out infinite alternate;
}
.b1 { background: var(--blob-1); top: -18vmax; left: -12vmax; }
.b2 { background: var(--blob-2); top: 20vh; right: -18vmax; animation-duration: 34s; animation-delay: -6s; }
.b3 { background: var(--blob-3); bottom: -22vmax; left: 18vw; animation-duration: 38s; animation-delay: -12s; }
.b4 { background: var(--blob-4); top: 40vh; left: -20vmax; width: 30vmax; height: 30vmax; animation-duration: 30s; animation-delay: -3s; }
.grain {
  position: absolute; inset: 0; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vw, 4vh) scale(1.08); }
  100% { transform: translate(-4vw, 8vh) scale(.95); }
}

/* ---------- Glass surfaces ---------- */
.glass, .glass-strong {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  border-radius: var(--r-lg);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.glass-strong { background: var(--glass-strong); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: .95rem;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 140% 140%;
  box-shadow: 0 8px 22px -10px rgba(124, 58, 237, .7), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-primary:hover { box-shadow: 0 10px 28px -8px rgba(124, 58, 237, .8), inset 0 1px 0 rgba(255,255,255,.35); background-position: 100% 0; }
.btn-ghost {
  background: var(--glass);
  border-color: var(--glass-border);
  color: var(--text);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: var(--glass-hover); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 0; background: transparent;
  color: var(--text-soft);
  transition: background-color .2s var(--ease), color .2s, transform .15s;
  flex: none;
}
.icon-btn:hover { background: var(--glass-hover); color: var(--text); text-decoration: none; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.accent { color: var(--accent); }
.icon-btn.tiny { width: 26px; height: 26px; }
.icon-btn.tiny .icon { width: 14px; height: 14px; }
.glass-btn { background: var(--glass); border: 1px solid var(--glass-border); }

/* Theme toggle shows the icon for the current preference. */
.theme-toggle .ti { display: none; }
:root:not([data-theme-pref]) .theme-toggle .ti-system,
:root[data-theme-pref="system"] .theme-toggle .ti-system,
:root[data-theme-pref="light"] .theme-toggle .ti-light,
:root[data-theme-pref="dark"] .theme-toggle .ti-dark { display: grid; }
.theme-toggle .ti { animation: spin-in .35s var(--ease); }
@keyframes spin-in { from { transform: rotate(-60deg) scale(.6); opacity: 0; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--text-soft); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--input-border);
  background: var(--input);
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea { resize: vertical; min-height: 44px; }
fieldset { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 12px; }
legend { font-weight: 750; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-prefix { display: flex; align-items: center; border-radius: var(--r-sm); border: 1px solid var(--input-border); background: var(--input); }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.input-prefix > span { padding-left: 14px; color: var(--muted); font-weight: 600; }
.input-prefix input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 4px !important; }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 500 !important; }
.checks:empty { display: none; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: var(--input); border: 1px solid var(--input-border); width: fit-content; }
.seg label { display: flex !important; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600 !important; font-size: .88rem; color: var(--text-soft); transition: background-color .2s, color .2s; }
.seg label .icon { width: 16px; height: 16px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--glass-strong); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0,0,0,.25); }
.seg label:has(input:focus-visible) { box-shadow: var(--focus); }

/* ---------- Alerts / pills / badges ---------- */
.alert { padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
.alert-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.alert-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: #fff; background: var(--grad); vertical-align: middle; }
.pill-soft { background: var(--input); color: var(--text-soft); border: 1px solid var(--input-border); }
.pill-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.badge {
  position: absolute; top: -6px; right: -9px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px;
  font-size: .68rem; font-weight: 800; line-height: 1;
  color: #fff; background: linear-gradient(135deg, #f43f5e, #ec4899);
  box-shadow: 0 0 0 2px var(--bg), 0 4px 10px -2px rgba(236, 72, 153, .6);
  animation: pop .35s var(--ease);
}
.badge.inline { position: static; display: inline-grid; box-shadow: none; margin-left: 4px; }
@keyframes pop { from { transform: scale(.4); } 60% { transform: scale(1.15); } }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--input); }
.avatar-sm { width: 34px; height: 34px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-xl { width: 112px; height: 112px; }
.avatar-initial {
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 750;
  background: linear-gradient(135deg, hsl(var(--h) 80% 62%), hsl(calc(var(--h) + 50) 85% 55%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.avatar-sm.avatar-initial { font-size: .85rem; }
.avatar-md.avatar-initial { font-size: 1.05rem; }
.avatar-xl.avatar-initial { font-size: 2.6rem; }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 620px) 320px;
  gap: 24px;
  max-width: 1290px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  align-items: start;
}
.shell.no-right { grid-template-columns: 250px minmax(0, 1fr); max-width: 1150px; }
.main { min-width: 0; outline: none; display: grid; gap: 14px; align-content: start; }

.sidebar { position: sticky; top: 20px; height: calc(100vh - 40px); }
.sidebar-inner { height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; color: var(--text); padding: 4px 8px 14px; }
.brand:hover { text-decoration: none; }
.logo-mark { filter: drop-shadow(0 4px 10px rgba(124,58,237,.45)); }
.nav { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--text-soft);
  font-weight: 600;
  transition: background-color .2s var(--ease), color .2s, transform .15s;
}
.nav-link:hover { background: var(--glass-hover); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--grad-soft); color: var(--text); font-weight: 750; box-shadow: inset 0 0 0 1px var(--glass-border); }
.nav-link[aria-current="page"] .icon { color: var(--accent); }
.nav-icon { position: relative; display: grid; place-items: center; }
.nav-icon .icon { width: 22px; height: 22px; }
.compose-btn { margin: 10px 4px 0; }
.sidebar-me { margin-top: auto; display: flex; align-items: center; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-me-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; color: var(--text); }
.sidebar-me-link:hover { background: var(--glass-hover); text-decoration: none; }
.sidebar-me-link span { min-width: 0; display: grid; line-height: 1.25; }
.sidebar-me-link strong, .sidebar-me-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-me-link small { color: var(--muted); font-size: .8rem; }
.sidebar-me form { margin: 0; }
.sidebar-me > .muted { flex: 1; padding-left: 8px; }

.rightbar { position: sticky; top: 20px; display: grid; gap: 14px; }
.panel { padding: 18px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 750; margin-bottom: 12px; }
.panel-title .icon { width: 18px; height: 18px; color: var(--accent); }
.search-pill { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 16px; border-radius: 999px; }
.search-pill .icon { color: var(--muted); width: 18px; height: 18px; }
.search-pill input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 9px 4px !important; }
.trend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.trend-list a { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; border-radius: 10px; color: var(--text); font-weight: 650; }
.trend-list a:hover { background: var(--glass-hover); text-decoration: none; }
.trend-list small { color: var(--muted); font-weight: 500; }
.footer-note { color: var(--muted); font-size: .78rem; text-align: center; margin: 0; }

.topbar, .tabbar { display: none; }

/* ---------- Page bits ---------- */
.page-head { display: flex; align-items: center; gap: 12px; padding: 2px 4px; }
.page-head h1 { font-size: 1.5rem; font-weight: 800; }
.section-title { font-size: 1.05rem; font-weight: 750; margin: 8px 4px 0; }
.tabs { display: flex; padding: 5px; gap: 4px; border-radius: 999px; }
.tab { flex: 1; text-align: center; padding: 9px 12px; border-radius: 999px; color: var(--muted); font-weight: 650; font-size: .92rem; transition: background-color .2s, color .2s; }
.tab:hover { color: var(--text); text-decoration: none; background: var(--glass-hover); }
.tab[aria-selected="true"] { color: var(--text); background: var(--glass-strong); box-shadow: 0 4px 14px -6px rgba(0,0,0,.25), inset 0 0 0 1px var(--glass-border); }
.empty { padding: 40px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty h2 { font-size: 1.15rem; }
.empty p { margin: 0; }
.empty-icon { width: 44px; height: 44px; color: var(--accent); opacity: .85; margin-bottom: 4px; }
.feed { display: grid; gap: 14px; }
.load-more { justify-self: center; margin: 4px auto; }
.feed-end { text-align: center; margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; font-weight: 650; color: var(--text); }
.chip small { color: var(--muted); margin-left: 4px; }
.chip:hover { text-decoration: none; background: var(--glass-hover); }
.search-hero { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px; border-radius: 999px; }
.search-hero > .icon { color: var(--muted); }
.search-hero input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 4px !important; font-size: 1rem !important; }

/* ---------- Composer ---------- */
.composer { padding: 16px 16px 12px; }
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer textarea {
  border: 0 !important; background: transparent !important; box-shadow: none !important;
  padding: 10px 2px !important; font-size: 1.08rem !important; resize: none; min-height: 48px; max-height: 360px;
}
.composer-preview { position: relative; margin: 8px 0 4px 56px; border-radius: var(--r-md); overflow: hidden; width: fit-content; max-width: calc(100% - 56px); }
.composer-preview img { max-height: 320px; border-radius: var(--r-md); }
.composer-remove { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; }
.composer-remove:hover { background: rgba(0,0,0,.75); color: #fff; }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-left: 50px; padding-top: 8px; border-top: 1px solid var(--line); }
.composer-bar label.icon-btn { cursor: pointer; }
.char-count { margin-left: auto; font-size: .8rem; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.warn { color: #d97706; }
.char-count.over { color: var(--danger); }

/* ---------- Posts ---------- */
.post { padding: 16px 18px 10px; }
.post:hover { border-color: color-mix(in srgb, var(--accent) 22%, var(--glass-border)); }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-avatar { display: block; border-radius: 50%; }
.post-meta { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.post-name { color: var(--text); font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-sub { color: var(--muted); font-size: .85rem; }
.post-sub a { color: inherit; }
.post-body { margin: 10px 0 4px; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; color: var(--text); }
.post-body a, .profile-bio a, .comment-bubble a, .msg-bubble a { font-weight: 600; }
.post-image {
  display: block; width: 100%; margin: 12px 0 4px; padding: 0;
  border: 1px solid var(--glass-border); border-radius: var(--r-md); overflow: hidden; background: var(--input);
  cursor: zoom-in;
}
.post-image img { width: 100%; max-height: 560px; object-fit: cover; transition: transform .6s var(--ease); }
.post-image:hover img { transform: scale(1.02); }
.post-actions { display: flex; gap: 6px; margin-top: 8px; margin-left: -8px; }
.action {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px; border: 0; background: transparent;
  color: var(--muted); font-weight: 650; font-size: .88rem;
  transition: background-color .2s, color .2s;
}
.action:hover { background: var(--glass-hover); color: var(--text); text-decoration: none; }
.action .icon { width: 19px; height: 19px; }
.action-share { margin-left: auto; }
.like:hover { color: var(--like); }
.like.is-liked { color: var(--like); }
.like.is-liked .icon { fill: currentColor; }
.like.pulse .icon { animation: heart .45s var(--ease); }
@keyframes heart { 30% { transform: scale(1.35); } 60% { transform: scale(.9); } }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 40px; z-index: 20;
  min-width: 190px; padding: 6px; border-radius: var(--r-md);
  display: grid; gap: 2px;
  animation: menu-in .18s var(--ease);
}
.menu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-weight: 600; font-size: .9rem; color: var(--text); }
.menu button:hover { background: var(--glass-hover); }
.menu button .icon { width: 17px; height: 17px; color: var(--muted); }
.menu .danger, .menu .danger .icon { color: var(--danger); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

.comments { margin: 8px -6px 4px; padding: 12px 6px 4px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.comment-list { display: grid; gap: 10px; }
.comment { display: flex; gap: 10px; align-items: flex-start; animation: rise .3s var(--ease); }
.comment-bubble { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 4px 16px 16px 16px; background: var(--input); border: 1px solid var(--input-border); }
.comment-head { display: flex; align-items: center; gap: 8px; }
.comment-head .post-name { font-size: .9rem; }
.comment-head .icon-btn { margin-left: auto; }
.comment-bubble p { margin: 2px 0 0; font-size: .93rem; overflow-wrap: anywhere; }
.comment-form { display: flex; align-items: center; gap: 8px; }
.comment-form input { border-radius: 999px !important; padding: 9px 14px !important; }
.empty-comments { margin: 0; padding: 2px 4px; }

/* ---------- People ---------- */
.user-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.user-row + .user-row { border-top: 1px solid var(--line); }
.user-row-meta { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.user-row-meta .post-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list { padding: 8px 16px; }

/* ---------- Profile ---------- */
.profile { overflow: hidden; padding: 0; }
.profile-cover {
  height: 200px;
  background: var(--grad);
  background-size: cover; background-position: center;
  position: relative;
}
.profile-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.25)); }
.profile-main { padding: 0 22px 20px; position: relative; }
.profile-avatar { margin-top: -58px; position: relative; z-index: 1; width: fit-content; border-radius: 50%; padding: 5px; background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.profile-actions { position: absolute; top: 14px; right: 22px; display: flex; gap: 8px; align-items: center; }
.profile-name { font-size: 1.5rem; font-weight: 800; margin-top: 12px; }
.profile-handle { color: var(--muted); margin: 2px 0 10px; font-weight: 500; }
.profile-bio { font-size: 1rem; color: var(--text); white-space: pre-line; }
.profile-facts { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .9rem; }
.profile-facts li { display: flex; align-items: center; gap: 6px; }
.profile-facts .icon { width: 16px; height: 16px; }
.profile-stats { display: flex; gap: 22px; }
.profile-stats a { color: var(--muted); font-size: .92rem; }
.profile-stats strong { color: var(--text); font-weight: 800; margin-right: 3px; }

/* ---------- Notifications ---------- */
.notif-list { display: grid; gap: 10px; }
.notif { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.notif:hover { text-decoration: none; background: var(--glass-hover); }
.notif.unread { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-border)); background: var(--grad-soft), var(--glass); }
.notif-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.notif-icon .icon { width: 17px; height: 17px; }
.notif-like { color: var(--like); background: color-mix(in srgb, var(--like) 14%, transparent); }
.notif-like .icon { fill: currentColor; }
.notif-comment { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.notif-follow { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.notif-mention { color: var(--accent-3); background: color-mix(in srgb, var(--accent-3) 14%, transparent); }
.notif-text { flex: 1; min-width: 0; font-size: .94rem; }
.notif-text time { color: var(--muted); }
.notif-snippet { display: block; color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

/* ---------- Messages ---------- */
.dm { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; height: calc(100vh - 40px); min-height: 480px; }
.dm-list { display: flex; flex-direction: column; overflow: hidden; }
.dm-list-head { padding: 18px 18px 10px; }
.dm-list-head h1 { font-size: 1.35rem; font-weight: 800; }
.dm-convos { overflow-y: auto; padding: 4px 8px 12px; display: grid; gap: 2px; align-content: start; }
.dm-convo { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: var(--text); position: relative; }
.dm-convo:hover { background: var(--glass-hover); text-decoration: none; }
.dm-convo.is-active { background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--glass-border); }
.dm-convo-text { min-width: 0; flex: 1; display: grid; line-height: 1.35; }
.dm-convo-text strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-convo-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.dm-convo.is-unread .dm-convo-text small { color: var(--text); font-weight: 650; }
.dot-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--grad); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.dm-empty { padding: 20px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.dm-thread { display: flex; flex-direction: column; overflow: hidden; }
.dm-thread-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dm-who { display: flex; align-items: center; gap: 10px; color: var(--text); }
.dm-who:hover { text-decoration: none; }
.dm-who span { display: grid; line-height: 1.25; }
.dm-who small { font-size: .8rem; }
.dm-back { display: none; }
.dm-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; }
.dm-start { margin: auto 0 12px; }
.msg { display: flex; flex-direction: column; max-width: 76%; animation: rise .25s var(--ease); }
.msg-out { align-self: flex-end; align-items: flex-end; }
.msg-in { align-self: flex-start; align-items: flex-start; }
.msg-bubble { padding: 9px 14px; border-radius: 18px; font-size: .95rem; overflow-wrap: anywhere; line-height: 1.45; }
.msg-in .msg-bubble { background: var(--glass-strong); border: 1px solid var(--glass-border); border-bottom-left-radius: 6px; }
.msg-out .msg-bubble { background: var(--grad); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 6px 18px -10px rgba(124,58,237,.8); }
.msg-out .msg-bubble a { color: #fff; text-decoration: underline; }
.msg-time { font-size: .7rem; color: var(--muted); margin: 2px 6px 4px; }
.dm-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.dm-compose textarea { border-radius: 22px !important; resize: none; max-height: 160px; padding: 11px 16px !important; }
.send-btn { width: 44px; height: 44px; background: var(--grad); color: #fff !important; box-shadow: 0 6px 16px -8px rgba(124,58,237,.9); }
.send-btn:hover { background: var(--grad); filter: brightness(1.08); }
.dm-placeholder { margin: auto; text-align: center; display: grid; justify-items: center; gap: 8px; padding: 24px; }

/* ---------- Settings ---------- */
.settings-section { scroll-margin-top: 90px; }
.settings-media { position: relative; margin-bottom: 52px; }
.settings-cover { height: 140px; border-radius: var(--r-md); background: var(--grad); background-size: cover; background-position: center; }
.settings-avatar { position: absolute; left: 18px; bottom: -48px; padding: 4px; border-radius: 50%; background: var(--glass-strong); }
.settings-avatar .avatar { width: 96px; height: 96px; }
.file-btn { cursor: pointer; display: inline-flex !important; grid-template-columns: none; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--glass-border)); }
.danger-zone .panel-title .icon { color: var(--danger); }
.mobile-only { display: none; }

/* ---------- Admin ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 18px; display: grid; gap: 2px; }
.stat-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); margin-bottom: 8px; }
.stat-label { color: var(--muted); font-weight: 650; font-size: .85rem; }
.stat-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; }
.table-wrap { overflow-x: auto; padding: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table th.right, .table td.right { text-align: right; }
.table-user { display: flex; align-items: center; gap: 10px; color: var(--text); }
.table-user span { display: grid; line-height: 1.25; }
.inline-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin: 0; }
.admin-search { max-width: 460px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; }
.report { padding: 16px; display: grid; gap: 10px; }
.report-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.report-reasons { margin: 0; padding-left: 18px; font-size: .9rem; color: var(--text-soft); }
.report-post .post { box-shadow: none; }

/* ---------- Auth & install ---------- */
.auth-page { display: grid; min-height: 100vh; }
.auth-theme { position: fixed; top: 16px; right: 16px; z-index: 5; }
.auth-theme .icon-btn { background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.auth-shell { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; max-width: 1080px; width: 100%; margin: auto; padding: 48px 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.4rem; letter-spacing: -.03em; margin-bottom: 26px; }
.hero-title { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.05; }
.hero-sub { font-size: 1.12rem; color: var(--text-soft); margin-top: 18px; max-width: 30ch; }
.hero-cards { position: relative; height: 210px; margin-top: 30px; }
.hero-card { position: absolute; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 18px; animation: float 7s ease-in-out infinite; }
.hero-card p { margin: 0; font-size: .9rem; color: var(--text-soft); }
.hero-card strong { font-size: .9rem; }
.hero-card.c1 { top: 0; left: 0; }
.hero-card.c2 { top: 70px; left: 300px; animation-delay: -2s; }
.hero-card.c3 { top: 130px; left: 60px; animation-delay: -4s; }
.hero-like { display: flex; align-items: center; gap: 6px; color: var(--like); font-weight: 800; }
.hero-like .icon { fill: currentColor; }
@keyframes float { 50% { transform: translateY(-10px); } }
.auth-card { padding: 30px; width: 100%; max-width: 440px; justify-self: center; }
.auth-card h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 18px; }
.auth-switch { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: .92rem; }
.install-card { grid-column: 1 / -1; max-width: 560px; }
.install-card .auth-brand h1 { font-size: 1.5rem; }
.checklist { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist .icon { width: 18px; height: 18px; }
.checklist .ok { color: var(--success); }
.checklist .bad { color: var(--danger); }

/* ---------- Overlays ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(5, 5, 15, .72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: fade .2s; cursor: zoom-out; }
.lightbox img { max-width: min(1100px, 100%); max-height: 88vh; border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); animation: zoom-in .25s var(--ease); }
.lightbox-close { position: absolute; top: 16px; right: 16px; color: #fff; background: rgba(255,255,255,.12); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 999px; font-weight: 650; font-size: .9rem; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 14px 30px -12px rgba(0,0,0,.4); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: toast-in .3s var(--ease); }
.toast.error { color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom-in { from { transform: scale(.94); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(14px); opacity: 0; } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
.reveal { animation: rise .45s var(--ease) both; }
.post.removing { opacity: 0; transform: scale(.98); transition: .3s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 230px minmax(0, 620px); justify-content: center; }
  .rightbar { display: none; }
}

@media (max-width: 820px) {
  body { font-size: 15px; }
  .shell, .shell.no-right { grid-template-columns: minmax(0, 1fr); padding: 76px 12px 96px; gap: 12px; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    height: 60px; padding: 0 12px 0 14px;
    padding-top: env(safe-area-inset-top);
    border-radius: 0; border-width: 0 0 1px;
  }
  .topbar .brand { padding: 0; font-size: 1.12rem; }
  .topbar-actions { display: flex; align-items: center; gap: 2px; }
  .topbar-me { margin-left: 6px; border-radius: 50%; }
  .tabbar {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 6px; border-radius: 24px;
  }
  .tabbar .nav-link { flex-direction: column; gap: 2px; padding: 7px 10px; font-size: .68rem; border-radius: 16px; min-width: 56px; }
  .tabbar .nav-link[aria-current="page"] { box-shadow: none; }
  .tab-compose .nav-icon { width: 44px; height: 44px; border-radius: 16px; background: var(--grad); color: #fff; box-shadow: 0 8px 20px -8px rgba(124,58,237,.9); }
  .tab-compose:hover { background: transparent; }
  .post { padding: 14px 14px 8px; border-radius: 20px; }
  .composer-bar { margin-left: 0; }
  .composer-preview { margin-left: 0; max-width: 100%; }
  .profile-cover { height: 140px; }
  .profile-main { padding: 0 16px 18px; }
  .profile-actions { right: 16px; top: 10px; }
  .avatar-xl { width: 92px; height: 92px; }
  .profile-avatar { margin-top: -48px; }
  .dm { grid-template-columns: 1fr; height: calc(100vh - 76px - 96px); height: calc(100dvh - 76px - 96px); }
  .dm.has-thread .dm-list { display: none; }
  .dm:not(.has-thread) .dm-thread { display: none; }
  .dm-back { display: grid; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  .mobile-only { display: flex; }
  .toasts { bottom: 100px; }
  .auth-shell { grid-template-columns: 1fr; gap: 20px; padding: 70px 16px 32px; }
  .auth-hero { text-align: center; }
  .auth-hero .auth-brand { justify-content: center; margin-bottom: 14px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cards { display: none; }
  .hero-title { font-size: 2.1rem; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.form > .btn:not(.btn-block) { justify-self: start; }

/* ==========================================================================
   App experience: transitions, touch, install, pull-to-refresh
   ========================================================================== */

/* Page changes: the browser keeps the old page on screen until the new one is ready, and only the page
   content fades in — the dock and top bar are never snapshotted, faded or redrawn, so they stay put. */
@view-transition { navigation: none; }
#main { animation: page-in .2s ease-out backwards; } /* no fill afterwards: a lasting animation would trap sheets inside the page under the dock */
@keyframes page-in { from { opacity: 0; } }

/* Touch: no grey flash, no double-tap zoom delay, no accidental text selection on controls */
html { -webkit-tap-highlight-color: transparent; }
a, button, label, input, textarea, select, summary { touch-action: manipulation; }
.nav-link, .tab, .btn, .icon-btn, .action, .brand, .chip, .dm-convo, .notif, .tabbar, .topbar {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
img { -webkit-user-drag: none; }
.nav-link:active, .action:active, .tab:active, .chip:active, .dm-convo:active, .notif:active { transform: scale(.97); }
@media (hover: none) {
  .post:hover { border-color: var(--glass-border); }
  .post-image:hover img { transform: none; }
  .nav-link:hover, .action:hover, .tab:hover { background: transparent; }
  .nav-link[aria-current="page"]:hover { background: var(--grad-soft); }
}

/* Installed app (standalone window) */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
}
.is-standalone [data-install], .is-standalone [data-install-banner] { display: none !important; }

/* Notch & home-indicator safe areas */
@media (max-width: 820px) {
  .topbar { height: calc(60px + env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .shell, .shell.no-right { padding-top: calc(76px + env(safe-area-inset-top)); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .dm { height: calc(100dvh - 76px - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  /* iOS zooms into inputs smaller than 16px — keep them at 16px */
  input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select { font-size: 16px !important; }
}
.auth-theme { top: calc(16px + env(safe-area-inset-top)); }

/* Tablet portrait: a centered column instead of edge-to-edge cards */
@media (min-width: 600px) and (max-width: 820px) {
  .shell, .shell.no-right { max-width: 680px; margin: 0 auto; }
  .tabbar { left: max(12px, calc(50% - 300px)); right: max(12px, calc(50% - 300px)); }
}

/* Install */
.install-side { margin: 6px 4px 0; }
.install-banner {
  position: fixed; z-index: 40;
  left: 12px; right: 12px; bottom: calc(100px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: 20px;
  animation: toast-in .4s var(--ease);
}
.install-banner img { border-radius: 12px; flex: none; }
.install-banner div { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.install-banner small { color: var(--muted); font-size: .8rem; }
@media (min-width: 821px) { .install-banner { left: auto; right: 24px; bottom: 24px; width: 380px; } }

.sheet-backdrop { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 5, 15, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s; }
.sheet {
  width: 100%; max-width: 480px;
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0; border-bottom: 0;
  display: grid; justify-items: center; gap: 12px; text-align: center;
  animation: sheet-up .35s var(--ease);
}
@media (min-width: 600px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 28px; border-bottom: 1px solid var(--glass-border); padding-bottom: 22px; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin-bottom: 6px; }
.sheet-icon { border-radius: 16px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.sheet h2 { font-size: 1.2rem; font-weight: 800; }
.sheet-steps { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 12px; text-align: left; width: 100%; }
.sheet-steps li { display: flex; align-items: center; gap: 12px; font-size: .95rem; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: var(--grad); }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--input); color: #0a84ff; vertical-align: middle; }
.ios-share svg { width: 16px; height: 16px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }

/* Pull to refresh (installed app) */
.ptr {
  position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; z-index: 35;
  width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.4);
  color: var(--accent);
  opacity: 0; transform: translateY(-60px); pointer-events: none;
}
.ptr .icon { transform: rotate(-90deg); transition: transform .2s; }
.ptr.ready .icon { transform: rotate(90deg); }
.ptr.loading .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 821px) { .ptr { top: 20px; } }

.offline-shell { grid-template-columns: 1fr; }

/* ==========================================================================
   Glints — 24-hour photos, clips and notes
   ========================================================================== */

.gbg-0 { background: linear-gradient(150deg, #7c3aed, #06b6d4); }
.gbg-1 { background: linear-gradient(150deg, #f97316, #db2777); }
.gbg-2 { background: linear-gradient(150deg, #1d4ed8, #0d9488); }
.gbg-3 { background: linear-gradient(150deg, #65a30d, #047857); }
.gbg-4 { background: linear-gradient(150deg, #0f172a, #5b21b6); }
.gbg-5 { background: linear-gradient(150deg, #fb7185, #f59e0b); }

/* Tray */
.glint-tray { padding: 14px 6px 10px; overflow: hidden; }
.glint-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 0 8px 2px; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.glint-scroll::-webkit-scrollbar { display: none; }
.glint-item { position: relative; flex: none; width: 76px; display: grid; justify-items: center; gap: 6px; scroll-snap-align: start; }
.glint-name { max-width: 74px; font-size: .74rem; font-weight: 650; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glint-ring {
  position: relative; display: grid; place-items: center;
  width: 70px; height: 70px; padding: 3px; border: 0; border-radius: 50%;
  background: var(--line); cursor: pointer;
  transition: transform .2s var(--ease);
}
.glint-ring:active { transform: scale(.94); }
.glint-ring.is-unseen { background: conic-gradient(from 210deg, #a78bfa, #22d3ee, #f472b6, #fbbf24, #a78bfa); }
.glint-ring.is-unseen::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: inherit; filter: blur(8px); opacity: .45; z-index: -1;
}
.glint-ring.is-seen { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.glint-ring.is-empty { background: transparent; border: 2px dashed color-mix(in srgb, var(--muted) 60%, transparent); padding: 3px; }
.glint-ring .avatar { box-shadow: 0 0 0 3px var(--bg); }
.glint-ring.is-empty .avatar { box-shadow: none; opacity: .9; }
.avatar-glint { width: 62px; height: 62px; }
.avatar-glint.avatar-initial { font-size: 1.4rem; }
.glint-add {
  position: absolute; top: 48px; left: 50px;
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bg);
  display: grid; place-items: center; padding: 0;
  background: var(--grad); color: #fff; box-shadow: 0 4px 10px -4px rgba(124,58,237,.8);
}
.glint-add .icon { width: 14px; height: 14px; stroke-width: 3; }
.glint-hint { align-self: center; margin: 0 0 18px 8px; max-width: 34ch; line-height: 1.4; }

/* Profile photo with a live Glint */
.profile-avatar.glint-ring { width: auto; height: auto; padding: 4px; cursor: pointer; backdrop-filter: none; -webkit-backdrop-filter: none; }
.profile-avatar.glint-ring .avatar { box-shadow: 0 0 0 4px var(--bg); }

/* Creator */
.glint-create { max-width: 460px; gap: 12px; text-align: left; justify-items: stretch; max-height: 96dvh; overflow-y: auto; }
.glint-create .sheet-grip { justify-self: center; }
.glint-create-head { display: flex; align-items: center; justify-content: space-between; }
.glint-create-head h2 { font-size: 1.2rem; font-weight: 800; }
.glint-mode { justify-self: center; }
.glint-canvas {
  position: relative; justify-self: center;
  width: min(100%, calc(50dvh * 9 / 16)); aspect-ratio: 9 / 16;
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.15);
}
.glint-pick { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: #fff; text-align: center; cursor: pointer; padding: 16px; }
.glint-pick .icon { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.glint-pick small { opacity: .85; }
.glint-canvas .glint-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.glint-text-input {
  position: absolute !important; inset: 0; width: 100% !important; height: 100% !important;
  border: 0 !important; background: transparent !important; box-shadow: none !important; resize: none;
  color: #fff !important; text-align: center; font-weight: 800; font-size: 1.45rem !important; line-height: 1.3;
  padding: 38% 20px 20px !important; text-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.glint-text-input::placeholder { color: rgba(255,255,255,.75) !important; }
.glint-clear { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.5); color: #fff; }
.glint-swatches { display: flex; justify-content: center; gap: 10px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); transition: transform .15s; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(input:checked) { transform: scale(1.15); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.glint-progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.glint-progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.glint-note { margin: 0; }

/* Player */
.gv {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: rgba(4, 4, 12, .9);
  -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%);
  animation: fade .2s;
  color: #fff;
  touch-action: none;
}
.gv-stage {
  position: relative; overflow: hidden; background: #000;
  height: min(92dvh, 900px); aspect-ratio: 9 / 16; max-width: 100vw;
  border-radius: 24px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), inset 0 0 0 1px rgba(255,255,255,.08);
  animation: zoom-in .25s var(--ease);
  -webkit-user-select: none; user-select: none;
}
.gv-stage.swiping { transition: none; }
.gv-bars { position: absolute; z-index: 4; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 4px; }
.gv-bar { flex: 1; height: 3px; border-radius: 9px; background: rgba(255,255,255,.32); overflow: hidden; }
.gv-bar span { display: block; height: 100%; width: 0; background: #fff; border-radius: 9px; }
.gv-head {
  position: absolute; z-index: 4; top: calc(20px + env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 22px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.45), transparent);
}
.gv-who { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 750; font-size: .95rem; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.gv-who:hover { text-decoration: none; }
.gv-who .avatar { width: 32px; height: 32px; }
.gv-time { color: rgba(255,255,255,.75); font-size: .85rem; font-weight: 600; }
.gv-spacer { flex: 1; }
.gv-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: #fff; display: grid; place-items: center; }
.gv-btn:hover { background: rgba(255,255,255,.15); }
.gv-btn .icon { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.gv-media { position: absolute; inset: 0; display: grid; place-items: center; }
.gv-media img, .gv-media video { width: 100%; height: 100%; object-fit: contain; }
.gv-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 28px; text-align: center; font-size: clamp(1.4rem, 4.4dvh, 2.1rem); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; text-shadow: 0 2px 16px rgba(0,0,0,.25); }
.gv-caption {
  position: absolute; z-index: 3; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom));
  padding: 10px 14px; border-radius: 16px; text-align: center; font-weight: 600; font-size: .95rem; overflow-wrap: anywhere;
  background: rgba(0,0,0,.38); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.gv-tap { position: absolute; z-index: 2; top: 80px; bottom: 80px; border: 0; background: transparent; -webkit-tap-highlight-color: transparent; }
.gv-tap:focus-visible { box-shadow: none; }
.gv-tap-prev { left: 0; width: 32%; }
.gv-tap-next { right: 0; width: 68%; }
.gv-foot {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 26px 12px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0,0,0,.5), transparent);
}
.gv-reply { flex: 1; display: flex; }
.gv-reply input {
  flex: 1; border-radius: 999px !important; padding: 11px 16px !important;
  background: rgba(255,255,255,.12) !important; border: 1px solid rgba(255,255,255,.35) !important; color: #fff !important;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.gv-reply input::placeholder { color: rgba(255,255,255,.75) !important; }
.gv-heart.is-on { color: #fb7185; }
.gv-heart.is-on .icon { fill: currentColor; animation: heart .45s var(--ease); }
.gv-seen { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 0; color: #fff; font-weight: 700; font-size: .9rem; background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.gv-seen .icon { width: 18px; height: 18px; }
.gv-foot .gv-spacer { flex: 1; }
.gv-viewers { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; max-height: 62%; overflow-y: auto; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; color: var(--text); animation: sheet-up .3s var(--ease); }
.gv-viewers h3 { font-size: 1rem; font-weight: 800; margin: 8px 0 6px; display: flex; justify-content: space-between; align-items: center; }
.gv-arrow { position: fixed; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.gv-arrow:hover { background: rgba(255,255,255,.2); }
.gv-arrow-prev { left: max(20px, calc(50% - min(92dvh, 900px) * 9 / 32 - 80px)); }
.gv-arrow-next { right: max(20px, calc(50% - min(92dvh, 900px) * 9 / 32 - 80px)); }
.gv-arrow-next .icon { transform: rotate(180deg); }
.gv-loading .gv-media::after { content: ""; width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; position: absolute; }
.gv-paused .gv-bar span { opacity: .75; }

@media (max-width: 820px), (max-aspect-ratio: 3/4) {
  .gv { background: #000; }
  .gv-stage { width: 100vw; height: 100dvh; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .gv-arrow { display: none; }
}

/* Admin: reported Glints */
.report-glint { display: grid; gap: 8px; justify-items: start; }
.report-glint img, .report-glint video { max-height: 340px; border-radius: 14px; background: #000; }
.report-glint-text { width: 190px; aspect-ratio: 9 / 16; border-radius: 14px; display: grid; place-items: center; padding: 14px; text-align: center; color: #fff; font-weight: 800; }
/* Photos that don't fill the frame sit on a blurred, glassy copy of themselves */
.gv-media::before { content: ""; position: absolute; inset: -60px; background: var(--gv-backdrop, none) center / cover no-repeat; filter: blur(42px) saturate(140%) brightness(.55); transform: scale(1.15); }
.gv-media > * { position: relative; }
.gv-media .gv-text { position: absolute; }

/* ---------- Fixes from iPad testing ---------- */
/* Installed app on iPad: keep content clear of the status bar / window controls,
   and size the sidebar to the visible screen (Safari's toolbars made 100vh too tall). */
@media (min-width: 821px) {
  .shell {
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .sidebar, .rightbar { top: calc(20px + env(safe-area-inset-top)); }
  .sidebar {
    height: calc(100vh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .sidebar-inner { overflow-y: auto; scrollbar-width: none; }
  .sidebar-inner::-webkit-scrollbar { display: none; }
  .dm { height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .install-banner { bottom: calc(24px + env(safe-area-inset-bottom)); }
}
/* iPadOS windowed apps put the close/resize controls in the top-left corner */
@media (min-width: 821px) and (display-mode: standalone) {
  .shell { padding-top: calc(28px + env(safe-area-inset-top)); }
}

/* ---------- Platform rule: every letter is lowercase (not a setting) ---------- */
html { text-transform: lowercase; }
input, textarea, select, button, option { text-transform: inherit; }
::placeholder { text-transform: lowercase; }
input[type="password"] { text-transform: none; }

/* ---------- Glints camera ---------- */
.glint-cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.glint-cam.is-mirrored { transform: scaleX(-1); }
.glint-cam-ui { position: absolute; inset: 0; pointer-events: none; }
.glint-cam-ui > * { pointer-events: auto; }
.glint-flip { position: absolute; top: 10px; right: 10px; color: #fff; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.glint-flip:hover { background: rgba(0,0,0,.5); color: #fff; }
.glint-rec-time { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 99px; background: #ef4444; color: #fff; font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; animation: pop .3s var(--ease); }
.glint-shutter {
  position: absolute; left: 50%; bottom: 34px; width: 78px; height: 78px; margin-left: -39px;
  border: 0; padding: 0; border-radius: 50%; background: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.glint-shutter svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.glint-shutter .ring-bg { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 5; }
.glint-shutter .ring-fg { fill: none; stroke: #ef4444; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 227; stroke-dashoffset: 227; opacity: 0; }
.glint-shutter-core { position: absolute; inset: 11px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 4px 16px rgba(0,0,0,.35); transition: inset .2s var(--ease), border-radius .2s, background-color .2s; }
.glint-shutter:active .glint-shutter-core { inset: 14px; }
.is-recording .glint-shutter .ring-bg { stroke: rgba(255,255,255,.4); }
.is-recording .glint-shutter .ring-fg { opacity: 1; }
.is-recording .glint-shutter-core { inset: 24px; border-radius: 8px; background: #ef4444; }
.glint-cam-hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: rgba(255,255,255,.85); font-size: .75rem; font-weight: 650; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.is-recording .glint-cam-hint, .is-recording .glint-flip { opacity: 0; pointer-events: none; }
.glint-cam-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; color: #fff; text-align: center; }
.glint-cam-msg > .icon { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: rgba(255,255,255,.18); }
.glint-canvas::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .25s; }
.flash .glint-canvas::after { opacity: .85; transition: none; }
.glint-mode label { padding: 8px 12px; }

/* ---------- Mobile polish (1.4) ---------- */
.install-banner.is-inline { position: relative; left: auto; right: auto; bottom: auto; width: auto; z-index: 1; }
/* Comfortable 44px touch targets on phones and tablets */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn.tiny { width: 32px; height: 32px; }
  .action { padding: 9px 12px; min-height: 40px; }
  .comment-form input { min-height: 44px; }
  .btn-sm { padding: 9px 15px; }
}
/* Bigger invisible hit area for the small "+" on your Glint */
.glint-add::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
/* Inside a chat on phones: hide the tab bar (like native messaging apps) so the reply box sits at the bottom */
@media (max-width: 820px) {
  .page-messages:has(.dm.has-thread) .tabbar { display: none; }
  .page-messages:has(.dm.has-thread) .shell { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .page-messages .dm.has-thread { height: calc(100dvh - 76px - 10px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   1.5 — Profile header, movable blocks, customize mode, photo editor
   ========================================================================== */

/* Profile themes (MySpace-style personal colors) */
.pf-theme-aurora   { --pf-grad: linear-gradient(135deg, #7c3aed, #06b6d4 60%, #ec4899); --pf-accent: #a78bfa; }
.pf-theme-sunset   { --pf-grad: linear-gradient(135deg, #f97316, #db2777 60%, #7c3aed); --pf-accent: #fb923c; }
.pf-theme-ocean    { --pf-grad: linear-gradient(135deg, #1d4ed8, #0891b2 60%, #14b8a6); --pf-accent: #38bdf8; }
.pf-theme-forest   { --pf-grad: linear-gradient(135deg, #166534, #65a30d 60%, #0d9488); --pf-accent: #4ade80; }
.pf-theme-midnight { --pf-grad: linear-gradient(135deg, #0f172a, #312e81 60%, #581c87); --pf-accent: #818cf8; }
.pf-theme-candy    { --pf-grad: linear-gradient(135deg, #f472b6, #c084fc 60%, #fbbf24); --pf-accent: #f472b6; }

.pf { display: grid; gap: 16px; }
.pf .panel-title .icon { color: var(--pf-accent, var(--accent)); }
.pf .pf-block { border-top: 2px solid color-mix(in srgb, var(--pf-accent, var(--accent)) 55%, transparent); }

/* Header: the cover fills the whole block, info sits on a soft scrim */
.pf-header {
  position: relative; overflow: hidden; padding: 0; isolation: isolate;
  min-height: 360px; display: flex; flex-direction: column; justify-content: flex-end;
  border-radius: 26px;
}
.pf-cover {
  position: absolute; inset: 0; z-index: -2;
  background: var(--pf-grad); background-size: cover; background-position: center;
  transform: scale(1.01);
}
.pf-scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.08) 35%, rgba(6,6,16,.72) 100%); }
.pf-header:not(.has-cover) .pf-scrim { background: linear-gradient(180deg, transparent 30%, rgba(6,6,16,.45) 100%); }
.pf-top-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.pf-glass-btn {
  color: #fff !important; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.pf-glass-btn:hover { background: rgba(255,255,255,.26); }
.pf-cover-edit {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(0,0,0,.28); color: #fff; font-weight: 700; font-size: .82rem;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.pf-cover-edit .icon { width: 16px; height: 16px; }
.pf-identity { display: flex; align-items: flex-end; gap: 18px; padding: 90px 24px 22px; color: #fff; }
.pf-avatar-wrap { position: relative; flex: none; }
.pf-identity .profile-avatar { margin-top: 0; background: rgba(255,255,255,.18); }
.pf-identity .profile-avatar .avatar { box-shadow: 0 0 0 4px rgba(10,10,20,.35); }
.pf-avatar-edit {
  position: absolute; right: 2px; bottom: 6px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid rgba(255,255,255,.85); color: #fff;
  background: var(--grad); box-shadow: 0 6px 16px -6px rgba(0,0,0,.6);
}
.pf-avatar-edit .icon { width: 17px; height: 17px; }
.pf-text { min-width: 0; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.pf-text .profile-name { margin-top: 0; color: #fff; font-size: 1.7rem; }
.pf-text .profile-handle { color: rgba(255,255,255,.78); }
.pf-text .profile-bio { color: #fff; }
.pf-text .profile-bio a, .pf-text .profile-facts a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.pf-text .profile-facts { color: rgba(255,255,255,.8); }
.pf-text .profile-stats a { color: rgba(255,255,255,.8); }
.pf-text .profile-stats strong { color: #fff; }
.pill-glass { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.3); }

/* Columns */
.shell.wide.no-right { max-width: 1240px; }
.pf-cols { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-arrange-side-right .pf-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 330px); }
.pf-arrange-side-right .pf-side { order: 2; }
.pf-arrange-single .pf-cols { grid-template-columns: minmax(0, 1fr); }
.lcol { display: grid; gap: 14px; align-content: start; min-width: 0; }
.pf-about { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.panel-title .panel-more { margin-left: auto; font-size: .8rem; font-weight: 650; }
.friend-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.friend { display: grid; justify-items: center; gap: 6px; color: var(--text); font-size: .8rem; font-weight: 650; text-align: center; min-width: 0; }
.friend span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend:hover { text-decoration: none; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-lg.avatar-initial { font-size: 1.25rem; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--input); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.photo-grid a:hover img { transform: scale(1.05); }
.pf-posts, .home-feed { display: grid; gap: 14px; }
.customize-link { justify-self: center; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 650; padding: 8px 14px; border-radius: 999px; }
.customize-link .icon { width: 16px; height: 16px; }
.customize-link:hover { background: var(--glass-hover); text-decoration: none; color: var(--text); }

/* "Your profile" card block */
.me-card { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 2px; padding: 0 16px 16px; text-align: center; color: var(--text); }
.me-card:hover { text-decoration: none; }
.me-cover { display: block; width: calc(100% + 32px); height: 76px; margin: 0 -16px 0; background: var(--pf-grad); background-size: cover; background-position: center; }
.me-card .avatar { margin-top: -30px; box-shadow: 0 0 0 4px var(--bg); }
.me-card small { color: var(--muted); }
.me-stats { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.me-stats b { color: var(--text); }

/* ---------- Customize mode ---------- */
.customize-bar {
  position: sticky; top: calc(10px + env(safe-area-inset-top)); z-index: 25;
  display: grid; gap: 10px; padding: 14px 16px; border-radius: 20px;
}
@media (max-width: 820px) { .customize-bar { top: calc(68px + env(safe-area-inset-top)); } }
.customize-head { display: grid; gap: 2px; }
.customize-head strong { display: flex; align-items: center; gap: 8px; }
.customize-head strong .icon { color: var(--accent); width: 18px; height: 18px; }
.grip-hint .icon { width: 14px; height: 14px; vertical-align: -2px; }
.customize-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.customize-label { font-size: .78rem; font-weight: 750; color: var(--muted); min-width: 56px; }
.seg-sm label { padding: 6px 11px; font-size: .8rem; }
.theme-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-swatch { background: var(--pf-grad); }
.customize-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.zone-label { font-size: .75rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); padding: 4px 6px 0; }
.layout-edit .lcol { min-height: 90px; padding: 10px; border-radius: 20px; border: 2px dashed color-mix(in srgb, var(--muted) 35%, transparent); transition: background-color .2s, border-color .2s; }
.layout-edit .lcol:hover, .is-dragging-block .layout-edit .lcol { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.layout-edit .lcol.no-drop { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.layout-edit .lcol.is-empty::after { content: "drop blocks here"; display: grid; place-items: center; min-height: 64px; color: var(--muted); font-size: .85rem; font-weight: 650; }
.layout-edit .lcol-hidden { background: color-mix(in srgb, var(--muted) 6%, transparent); }
.layout-edit .lblock { position: relative; border-radius: 22px; transition: transform .2s var(--ease), opacity .2s; }
.layout-edit .lblock > :not(.lb-bar) { pointer-events: none; user-select: none; -webkit-user-select: none; }
.layout-edit .lblock.is-hidden-block > :not(.lb-bar) { opacity: .45; filter: grayscale(.6); max-height: 160px; overflow: hidden; }
.layout-edit .lblock.is-dragging { transform: scale(1.02); opacity: .92; z-index: 10; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); outline: 2px solid var(--accent); }
.layout-edit .lblock.just-moved { animation: lb-flash .5s var(--ease); }
@keyframes lb-flash { 0% { transform: scale(.98); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); } 100% { transform: none; box-shadow: none; } }
.lb-bar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 6px 8px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.lb-grip { touch-action: none; cursor: grab; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--input); color: var(--text-soft); }
.lb-grip:active { cursor: grabbing; background: var(--grad-soft); }
.lb-name { flex: 1; min-width: 0; font-weight: 750; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-actions { display: flex; gap: 2px; }
.lb-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); }
.lb-btn:hover:not(:disabled) { background: var(--glass-hover); color: var(--text); }
.lb-btn:disabled { opacity: .3; cursor: default; }
.lb-btn .icon, .lb-grip .icon { width: 18px; height: 18px; }
.is-dragging-block, .is-dragging-block * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.lblock-empty { padding: 18px; text-align: center; }

/* ---------- Photo editor ---------- */
.pe { max-width: 560px; gap: 12px; text-align: left; justify-items: stretch; max-height: 96dvh; overflow-y: auto; }
.pe-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pe-head h2 { font-size: 1.05rem; font-weight: 800; }
.pe-stage {
  position: relative; justify-self: center; overflow: hidden; touch-action: none; cursor: grab;
  width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; background: #000;
  -webkit-user-select: none; user-select: none;
}
.pe-avatar .pe-stage { width: min(100%, 340px); aspect-ratio: 1; }
.pe-stage:active { cursor: grabbing; }
.pe-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pe-frame { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.pe-frame::before, .pe-frame::after { content: ""; position: absolute; background: rgba(255,255,255,.25); }
.pe-frame::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left: 1px solid rgba(255,255,255,.3); border-right: 1px solid rgba(255,255,255,.3); background: none; }
.pe-frame::after { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-top: 1px solid rgba(255,255,255,.3); border-bottom: 1px solid rgba(255,255,255,.3); background: none; }
.pe-avatar .pe-frame { box-shadow: none; background: radial-gradient(circle at center, transparent 0, transparent calc(50% - 1px), rgba(0,0,0,.55) 50%); }
.pe-avatar .pe-frame::before, .pe-avatar .pe-frame::after { display: none; }
.pe-empty, .pe-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.4); }
.pe-busy span { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; }
.pe-hint { margin: 0; text-align: center; }
.pe-tools { display: flex; align-items: center; gap: 8px; }
.pe-slider { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pe-slider .icon { width: 18px; height: 18px; flex: none; }
.pe input[type=range] { flex: 1; width: 100%; accent-color: var(--accent); height: 28px; }
.pe-filters { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.pe-filters::-webkit-scrollbar { display: none; }
.pe-filter { flex: none; display: grid; justify-items: center; gap: 4px; font-size: .74rem; font-weight: 650; color: var(--text-soft); cursor: pointer; }
.pe-filter input { position: absolute; opacity: 0; pointer-events: none; }
.pe-filter-thumb { width: 62px; height: 62px; border-radius: 14px; background: var(--input) center / cover; box-shadow: inset 0 0 0 1px var(--glass-border); transition: transform .15s; }
.pe-filter:has(input:checked) .pe-filter-thumb { box-shadow: 0 0 0 3px var(--accent); transform: scale(1.04); }
.pe-filter:has(input:checked) { color: var(--text); }
.pe-adjust summary { cursor: pointer; font-weight: 700; font-size: .9rem; padding: 6px 0; }
.pe-adjust label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; color: var(--text-soft); margin: 6px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .pf-cols, .pf-arrange-side-right .pf-cols { grid-template-columns: minmax(0, 1fr); }
  .pf-arrange-side-right .pf-side { order: 0; }
  .pf-header { min-height: 420px; border-radius: 22px; }
  .pf-identity { flex-direction: column; align-items: flex-start; gap: 12px; padding: 80px 18px 18px; }
  .pf-text .profile-name { font-size: 1.45rem; }
  .pf-top-actions { top: 12px; right: 12px; }
  .pf-cover-edit span { display: none; }
  .pf-cover-edit { padding: 9px; }
  .friend-grid { grid-template-columns: repeat(4, 1fr); }
  .lb-btn { width: 36px; height: 36px; }
}
.pf-avatar-edit { z-index: 3; }
/* Customize mode on phones: options scroll with the page, save/cancel live in a slim bottom bar */
@media (max-width: 820px) {
  .customize-bar { position: relative; top: auto; }
  .customize-actions {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
    padding: 10px; border-radius: 20px; justify-content: space-between;
    background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 14px 34px -14px rgba(0,0,0,.6);
    -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  }
  .customize-actions .btn { flex: 1; }
  body:has(.customize-bar) .tabbar { display: none; }
  body:has(.customize-bar) .shell { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
}
/* Don't let the browser scroll to follow a block while it's being dragged */
html:has(.customize-bar), html:has(.customize-bar) body { overflow-anchor: none; }
/* A blurred parent traps "fixed" children; keep the phone toolbar unblurred so the save bar pins to the screen */
@media (max-width: 820px) {
  .customize-bar { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--bg) 82%, transparent); }
}
/* While customizing, the header shrinks so the blocks are within reach */
.layout-edit .pf-header { min-height: 0; }
.layout-edit .pf-identity { padding-top: 64px; }
@media (max-width: 820px) {
  .customize-columns { display: none; } /* phones always show one column */
  .layout-edit .pf-header .profile-bio, .layout-edit .pf-header .profile-facts { display: none; }
  .layout-edit .pf-identity { flex-direction: row; align-items: center; padding: 56px 16px 16px; }
  .layout-edit .pf-identity .avatar-xl { width: 64px; height: 64px; }
}
.profile-stats { flex-wrap: wrap; gap: 6px 18px; }
.profile-stats a { white-space: nowrap; }
/* Previews stay short while customizing, so long feeds don't bury the other blocks */
.layout-edit .lblock > :not(.lb-bar) { max-height: 320px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent); mask-image: linear-gradient(180deg, #000 75%, transparent); }

/* ==========================================================================
   1.6 — Liquid glass: edge light, sheen, deeper blur, glossy controls
   ========================================================================== */
:root {
  --glass: rgba(255, 255, 255, .40);
  --glass-strong: rgba(255, 255, 255, .62);
  --glass-tint: rgba(255, 255, 255, .30);
  --edge-hi: rgba(255, 255, 255, .95);
  --edge-lo: rgba(255, 255, 255, .40);
  --sheen: rgba(255, 255, 255, .55);
  --depth: 0 18px 40px -20px rgba(49, 46, 129, .35), 0 3px 10px -4px rgba(49, 46, 129, .12);
  --blur: 26px;
}
:root[data-theme="dark"] {
  --glass: rgba(255, 255, 255, .045);
  --glass-strong: rgba(22, 22, 40, .55);
  --glass-tint: rgba(255, 255, 255, .07);
  --edge-hi: rgba(255, 255, 255, .26);
  --edge-lo: rgba(255, 255, 255, .06);
  --sheen: rgba(255, 255, 255, .09);
  --depth: 0 24px 50px -24px rgba(0, 0, 0, .75), 0 3px 10px -4px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --glass: rgba(255,255,255,.045); --glass-strong: rgba(22,22,40,.55); --glass-tint: rgba(255,255,255,.07);
    --edge-hi: rgba(255,255,255,.26); --edge-lo: rgba(255,255,255,.06); --sheen: rgba(255,255,255,.09);
    --depth: 0 24px 50px -24px rgba(0,0,0,.75), 0 3px 10px -4px rgba(0,0,0,.35);
  }
}

/* Every glass surface: light catches the top edge, a soft sheen sweeps across, depth below */
.glass, .glass-strong {
  background-color: var(--glass);
  background-image:
    radial-gradient(120% 80% at var(--mx, 12%) var(--my, -10%), var(--sheen), transparent 58%),
    linear-gradient(165deg, var(--glass-tint), transparent 42%);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 -1px 0 var(--edge-lo),
    inset 1px 0 0 var(--edge-lo),
    inset -1px 0 0 var(--edge-lo),
    var(--depth);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(190%) brightness(1.03);
  backdrop-filter: blur(var(--blur)) saturate(190%) brightness(1.03);
}
.glass-strong { background-color: var(--glass-strong); }

/* Navigation bars: thicker "liquid" glass */
.topbar, .tabbar, .sidebar-inner {
  -webkit-backdrop-filter: blur(32px) saturate(210%) brightness(1.05);
  backdrop-filter: blur(32px) saturate(210%) brightness(1.05);
}
.tabbar { border-radius: 30px; }
.tabbar .nav-link[aria-current="page"], .nav-link[aria-current="page"] {
  background:
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.04)),
    var(--grad-soft);
  box-shadow: inset 0 1px 0 var(--edge-hi), inset 0 -1px 0 var(--edge-lo), 0 6px 16px -10px rgba(124,58,237,.6);
}

/* Glossy buttons — a highlight on the upper half, like light on a glass bead */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 1px; height: 52%;
  border-radius: 999px 999px 60% 60% / 999px 999px 30% 30%;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.04));
  pointer-events: none; z-index: -1;
}
.btn-ghost, .glass-btn, .chip, .search-pill, .search-hero {
  background-image: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 0 var(--edge-hi), inset 0 -1px 0 var(--edge-lo), 0 6px 18px -12px rgba(0,0,0,.4);
}
.send-btn, .tab-compose .nav-icon, .glint-add, .pf-avatar-edit { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 8px 20px -8px rgba(124,58,237,.8); }

/* Inputs look like recessed glass */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), textarea, select, .input-prefix {
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08), inset 0 -1px 0 var(--edge-lo);
}
.composer textarea, .search-pill input, .search-hero input, .input-prefix input { box-shadow: none !important; }

/* Tabs and segmented controls: a glass "bead" for the selected item */
.tab[aria-selected="true"], .seg label:has(input:checked) {
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.06)), var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--edge-hi), inset 0 -1px 0 var(--edge-lo), 0 6px 16px -8px rgba(0,0,0,.35);
}

/* Avatars get a thin glass rim */
.avatar { box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 4px 12px -6px rgba(0,0,0,.4); }
.glint-ring .avatar, .pf-identity .profile-avatar .avatar { box-shadow: 0 0 0 3px var(--bg); }

/* Background: a slow light sweep across the whole scene */
.bg::after {
  content: ""; position: absolute; inset: -20%;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.07) 48%, rgba(255,255,255,.02) 52%, transparent 62%);
  animation: light-sweep 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes light-sweep { from { transform: translateX(-25%); } to { transform: translateX(25%); } }
.b1, .b2, .b3 { filter: blur(70px) saturate(140%); }

/* Toasts, menus and sheets share the same glass */
.toast, .menu, .sheet {
  background-image: radial-gradient(120% 90% at 20% -10%, var(--sheen), transparent 60%);
  box-shadow: inset 0 1px 0 var(--edge-hi), inset 0 -1px 0 var(--edge-lo), var(--depth);
}

@media (prefers-reduced-motion: reduce) { .bg::after { animation: none; } }
/* Keep the busiest glass lighter on phones so scrolling stays smooth */
@media (max-width: 820px) {
  .post.glass { -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); }
}
.remember-me { margin-top: -4px; }
/* Save / cancel float at the bottom of the screen on every device */
.customize-actions {
  position: fixed; z-index: 40; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; padding: 10px; border-radius: 22px;
}
@media (max-width: 820px) {
  .customize-actions { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); justify-content: space-between; }
}
body:has(.customize-bar) .shell { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

/* ==========================================================================
   1.7 — Create menu, composer sheet, rich media posts, backgrounds, GIFs, memes
   ========================================================================== */

/* Post backgrounds (gradients + bundled pictures) */
.pbg-aurora   { background: linear-gradient(135deg, #7c3aed, #06b6d4); }
.pbg-sunset   { background: linear-gradient(135deg, #f97316, #db2777); }
.pbg-ocean    { background: linear-gradient(135deg, #1e3a8a, #0891b2); }
.pbg-forest   { background: linear-gradient(135deg, #14532d, #65a30d); }
.pbg-midnight { background: linear-gradient(135deg, #0f172a, #4c1d95); }
.pbg-candy    { background: linear-gradient(135deg, #f472b6, #a78bfa); }
.pbg-peach    { background: linear-gradient(135deg, #fb923c, #fde68a); }
.pbg-mint     { background: linear-gradient(135deg, #10b981, #a7f3d0); }
.pbg-img-nebula { background: #1e1b4b url("backgrounds/img-nebula.webp") center / cover; }
.pbg-img-bokeh  { background: #2e1065 url("backgrounds/img-bokeh.webp") center / cover; }
.pbg-img-waves  { background: #0c4a6e url("backgrounds/img-waves.webp") center / cover; }
.pbg-img-dunes  { background: #c2410c url("backgrounds/img-dunes.webp") center / cover; }
.pbg-img-marble { background: #e5e7eb url("backgrounds/img-marble.webp") center / cover; }
.pbg-img-prism  { background: #0b0b18 url("backgrounds/img-prism.webp") center / cover; }

.post-bg-card {
  margin: 12px 0 4px; min-height: 220px; border-radius: 18px; overflow: hidden;
  display: grid; place-items: center; padding: 28px 24px; text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 1px rgba(255,255,255,.12);
}
.post-bg-card p { margin: 0; color: #fff; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.post-bg-card a { color: #fff; text-decoration: underline; }
.pbg-size-xl p, .ps-canvas.pbg-size-xl textarea { font-size: 1.9rem !important; }
.pbg-size-lg p, .ps-canvas.pbg-size-lg textarea { font-size: 1.45rem !important; }
.pbg-size-md p { font-size: 1.15rem; }
.post-bg-card.pbg-img-marble p, .post-bg-card.pbg-peach p, .post-bg-card.pbg-mint p { color: #1f1235; text-shadow: 0 1px 8px rgba(255,255,255,.5); }
.post-bg-card.pbg-img-marble a { color: #1f1235; }

/* Media gallery: 1–4 photos / videos / GIFs */
.post-media { display: grid; gap: 4px; margin: 12px 0 4px; border-radius: 18px; overflow: hidden; }
.media-1 { grid-template-columns: 1fr; }
.media-2 { grid-template-columns: 1fr 1fr; }
.media-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.media-3 .pm-item:first-child { grid-row: span 2; }
.media-4 { grid-template-columns: 1fr 1fr; }
.pm-item { position: relative; display: block; padding: 0; border: 0; background: #000; overflow: hidden; cursor: zoom-in; min-height: 0; }
.media-1 .pm-item img { width: 100%; max-height: 560px; object-fit: cover; }
.media-2 .pm-item, .media-4 .pm-item { aspect-ratio: 1; }
.media-3 .pm-item { aspect-ratio: auto; min-height: 140px; }
.media-3 .pm-item:first-child { aspect-ratio: 3 / 4; }
.media-2 img, .media-3 img, .media-4 img { width: 100%; height: 100%; object-fit: cover; }
.pm-item img { transition: transform .5s var(--ease); }
.pm-item:hover img { transform: scale(1.02); }
.pm-video { cursor: default; }
.pm-video video { width: 100%; height: 100%; max-height: 560px; display: block; background: #000; object-fit: contain; }
.media-2 .pm-video video, .media-3 .pm-video video, .media-4 .pm-video video { object-fit: cover; }
.gif-badge {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px;
  font-size: .7rem; font-weight: 900; letter-spacing: .04em; color: #fff;
  background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.giphy-credit { margin: 2px 2px 0; font-size: .72rem; color: var(--muted); text-align: right; }

/* Create menu */
.create-menu { max-width: 520px; }
.create-menu h2 { font-size: 1.15rem; font-weight: 800; }
.create-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.create-tile {
  display: grid; justify-items: center; gap: 4px; padding: 16px 8px 14px; border-radius: 20px;
  border: 1px solid var(--glass-border); color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.02)), var(--glass);
  box-shadow: inset 0 1px 0 var(--edge-hi), var(--depth);
  transition: transform .15s var(--ease), background-color .2s;
}
.create-tile:active { transform: scale(.96); }
.create-tile:hover { background-color: var(--glass-hover); }
.create-tile strong { font-size: .9rem; }
.create-tile small { font-size: .72rem; color: var(--muted); line-height: 1.25; }
.ct-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; margin-bottom: 4px; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 18px -10px rgba(0,0,0,.6); }
.ct-icon .icon { width: 24px; height: 24px; }
.ct-post { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.ct-media { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.ct-glint { background: conic-gradient(from 210deg, #a78bfa, #22d3ee, #f472b6, #fbbf24, #a78bfa); }
.ct-gif { background: linear-gradient(135deg, #10b981, #84cc16); }
.ct-meme { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.ct-bg { background: linear-gradient(135deg, #ec4899, #f97316); }
.ct-gif-text, .ps-gif { font-weight: 900; font-size: .78rem; letter-spacing: .04em; border: 2px solid currentColor; border-radius: 6px; padding: 0 4px; line-height: 1.3; }
.ct-gif-text { font-size: .95rem; }

/* Composer sheet */
.post-sheet { max-width: 600px; gap: 12px; text-align: left; justify-items: stretch; max-height: 96dvh; overflow-y: auto; }
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ps-head h2 { font-size: 1.05rem; font-weight: 800; }
.ps-compose { display: flex; gap: 12px; align-items: flex-start; }
.ps-canvas { flex: 1; min-width: 0; border-radius: 18px; transition: background .3s, padding .3s; }
.ps-canvas textarea {
  border: 0 !important; background: transparent !important; box-shadow: none !important; resize: none;
  font-size: 1.08rem !important; min-height: 96px; max-height: 40dvh; padding: 8px 2px !important;
}
.ps-canvas.has-bg { min-height: 220px; display: grid; place-items: center; padding: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.ps-canvas.has-bg textarea { color: #fff !important; text-align: center; font-weight: 800; font-size: 1.15rem !important; text-shadow: 0 2px 12px rgba(0,0,0,.35); min-height: 120px; }
.ps-canvas.has-bg textarea::placeholder { color: rgba(255,255,255,.8) !important; }
.ps-canvas.pbg-img-marble textarea, .ps-canvas.pbg-peach textarea, .ps-canvas.pbg-mint textarea { color: #1f1235 !important; text-shadow: none; }
.ps-media { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ps-media:empty { display: none; }
.ps-item { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #000; animation: pop .25s var(--ease); }
.ps-item img, .ps-item video { width: 100%; height: 100%; object-fit: cover; }
.ps-remove { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.6); }
.ps-remove .icon { width: 14px; height: 14px; }
.ps-panel { display: grid; gap: 10px; padding: 12px; border-radius: 18px; background: var(--input); border: 1px solid var(--input-border); animation: rise .2s var(--ease); }
.ps-panel-title { font-weight: 750; font-size: .88rem; }
.bg-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.bg-swatch { position: relative; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); display: grid; place-items: center; transition: transform .15s; }
.bg-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.bg-swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); transform: scale(1.06); }
.bg-swatch:has(input:disabled) { opacity: .35; cursor: not-allowed; }
.bg-none { background: var(--glass-strong); color: var(--muted); }
.bg-none .icon { width: 18px; height: 18px; }
.ps-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.ps-tool {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 0;
  background: transparent; color: var(--accent); font-weight: 700; font-size: .82rem; cursor: pointer;
}
.ps-tool:hover, .ps-tool.is-on { background: var(--grad-soft); }
.ps-tool .icon { width: 18px; height: 18px; }
.ps-tools .char-count { margin-left: auto; }
.ps-progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ps-progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.composer-more { width: 36px; height: 36px; }
.composer-more .ps-gif { font-size: .66rem; }
@media (max-width: 480px) {
  .ps-tool span:not(.ps-gif) { display: none; }
  .ps-tool { padding: 10px; }
  .composer-more { display: none; } /* phones use the + menu */
}

/* GIF search */
.gif-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.gif-search .icon { width: 18px; height: 18px; color: var(--muted); }
.gif-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 2px !important; }
.gif-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 300px; overflow-y: auto; border-radius: 12px; }
.gif-pick { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--line); cursor: pointer; }
.gif-pick img { width: 100%; height: 100%; object-fit: cover; }
.gif-pick:hover { outline: 3px solid var(--accent); }

/* Meme maker */
.meme-stage { position: relative; border-radius: 16px; overflow: hidden; background: #111; justify-self: center; width: min(100%, 360px); }
.meme-stage canvas { display: block; width: 100%; height: auto; }
.meme-pick { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: #fff; cursor: pointer; text-align: center; padding: 16px; background: linear-gradient(135deg, #1f2937, #312e81); }
.meme-pick .icon { width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: rgba(255,255,255,.18); }
.meme-pick small { opacity: .8; }
.meme-bgs { display: flex; gap: 8px; overflow-x: auto; }
.meme-bg { flex: none; width: 52px; height: 52px; border-radius: 12px; border: 0; background-size: cover; background-position: center; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.meme-text { text-align: center; font-weight: 800; }

/* ==========================================================================
   1.8 — No whole-app zoom, one composer everywhere, in-app alerts, notification settings
   ========================================================================== */

/* Double-tap never zooms the app (pinch is handled in app.js) */
html { touch-action: manipulation; }

/* Home composer card: opens the full composer, with every post option one tap away */
.composer-launch { padding: 14px 16px 10px; }
.composer-launch .composer-row { align-items: center; }
.composer-field {
  flex: 1; min-width: 0; text-align: left; padding: 12px 16px; border-radius: 999px; cursor: text;
  border: 1px solid var(--input-border); background: var(--input); color: var(--muted);
  font-weight: 500; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
  transition: border-color .2s, background-color .2s;
}
.composer-field:hover { border-color: var(--accent); }
.composer-launch .composer-bar { margin-left: 0; margin-top: 10px; gap: 4px; justify-content: space-between; }
.composer-opt {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-soft); font-weight: 650; font-size: .86rem; cursor: pointer;
  transition: background-color .2s, transform .15s var(--ease);
}
.composer-opt:hover { background: var(--glass-hover); }
.composer-opt:active { transform: scale(.94); }
.co-ic {
  width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 14px -8px rgba(0,0,0,.6);
}
.co-ic .icon { width: 17px; height: 17px; }
.co-ic .ps-gif { font-size: .6rem; border-width: 1.5px; padding: 0 3px; }
.co-media { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.co-gif { background: linear-gradient(135deg, #10b981, #84cc16); }
.co-meme { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.co-bg { background: linear-gradient(135deg, #ec4899, #f97316); }
.co-glint { background: conic-gradient(from 210deg, #a78bfa, #22d3ee, #f472b6, #fbbf24, #a78bfa); }
@media (max-width: 640px) {
  .composer-launch .composer-bar { justify-content: space-around; }
  .composer-opt { flex-direction: column; gap: 4px; padding: 4px 6px; font-size: .7rem; }
  .co-ic { width: 38px; height: 38px; border-radius: 13px; }
}
@media (max-width: 340px) { .co-l { display: none; } }

/* In-app alert banner (slides down like a native notification) */
.notice-banners {
  position: fixed; z-index: 120; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 10px);
  display: grid; justify-items: center; padding: 0 12px; pointer-events: none;
}
.notice-banner {
  pointer-events: auto; width: min(100%, 440px); display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 22px; color: var(--text); text-decoration: none !important;
  box-shadow: 0 22px 50px -18px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.35);
  animation: nb-in .45s var(--ease) both;
}
.notice-banner.out { animation: nb-out .35s var(--ease) both; }
.nb-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.nb-text strong { font-size: .95rem; }
.nb-text span { color: var(--text-soft); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb-kind { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); flex: none; box-shadow: 0 0 0 4px rgba(124,58,237,.18); }
@keyframes nb-in { from { opacity: 0; transform: translateY(-120%) scale(.96); } }
@keyframes nb-out { to { opacity: 0; transform: translateY(-120%) scale(.96); } }

/* Notification settings */
.push-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 6px 0 12px; }
.push-row + .push-row, .push-types + .push-row, [data-push-test] + .push-row { border-top: 1px solid var(--line); padding-top: 14px; }
.push-row p { margin: 2px 0 0; }
.push-types { display: grid; gap: 8px; margin: 0 0 12px; transition: opacity .2s; }
.push-types.is-off { opacity: .55; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--glass-border); background: var(--glass); font-weight: 650; font-size: .86rem;
}
.chip-check:has(input:checked) { background: var(--grad-soft); border-color: var(--accent); }
[data-push-test] { margin-bottom: 12px; }

/* iOS-style switch */
.switch { position: relative; flex: none; width: 52px; height: 32px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line); border: 1px solid var(--glass-border);
  transition: background .25s; pointer-events: none;
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.3); transition: transform .25s var(--ease);
}
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* "Turn on notifications" card on the notifications page */
.push-promo { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; }
.push-promo[hidden] { display: none; }
.push-promo-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.push-promo-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.push-promo-actions { display: flex; align-items: center; gap: 4px; }
@media (max-width: 480px) {
  .push-promo { flex-wrap: wrap; }
  .push-promo-actions { width: 100%; justify-content: flex-end; }
}
/* banner sits over the top bar, so it gets a denser pane than ordinary glass */
.notice-banner {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(246,244,255,.9));
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.7);
}
:root[data-theme="dark"] .notice-banner { background: linear-gradient(180deg, rgba(40,36,72,.94), rgba(24,22,46,.92)); border-color: rgba(255,255,255,.14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .notice-banner { background: linear-gradient(180deg, rgba(40,36,72,.94), rgba(24,22,46,.92)); border-color: rgba(255,255,255,.14); }
}
.chip-check input { width: 15px; height: 15px; }

/* ==========================================================================
   1.9 — Reactions, menu drawer, compact feed switch, GIF grid fix, sparkle burst
   ========================================================================== */

/* GIF results: fixed square tiles (Safari ignored aspect-ratio on buttons, so tiles overlapped) */
.gif-grid { grid-auto-rows: auto; align-content: start; }
.gif-pick { position: relative; display: block; width: 100%; height: 0; padding: 0 0 100% !important; aspect-ratio: auto; }
.gif-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* No character counter on posts */
[data-ps-count] { display: none !important; }

/* Reaction button + summary */
.react-group { display: inline-flex; align-items: center; gap: 2px; }
.react-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.react-face { display: grid; place-items: center; width: 20px; height: 20px; }
.react-emoji { font-size: 1.15rem; line-height: 1; }
.react-btn.is-on { color: var(--text); background: var(--grad-soft); }
.react-btn.react-heart { color: var(--like); }
.react-btn.pulse .react-face { animation: heart .45s var(--ease); }
.react-sum {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-weight: 700; font-size: .85rem; cursor: pointer;
  transition: background-color .2s;
}
.react-sum:hover { background: var(--glass-hover); }
.react-sum.is-empty { display: none; }
.rs-emojis { display: inline-flex; }
.rs-e { display: grid; place-items: center; width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; font-size: .78rem; background: var(--glass-strong); box-shadow: 0 0 0 2px var(--bg); }
.rs-e:first-child { margin-left: 0; }
@media (max-width: 380px) { .react-label { display: none; } }

/* Emoji picker */
.react-picker {
  position: fixed; z-index: 200; display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  box-shadow: 0 20px 50px -16px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.35);
  transform-origin: 50% 100%; opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .18s, transform .25s var(--ease);
}
.react-picker.below { transform-origin: 50% 0; }
.react-picker.open { opacity: 1; transform: none; }
.rp-btn {
  position: relative; width: 46px; height: 46px; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  display: grid; place-items: center; transition: transform .18s var(--ease), background-color .15s;
}
.rp-btn span { font-size: 1.75rem; line-height: 1; }
.react-picker.open .rp-btn span { animation: rp-in .4s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }
.rp-btn small { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.75); color: #fff; font-size: .68rem; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.rp-btn:hover { transform: translateY(-6px) scale(1.25); }
.rp-btn:hover small { opacity: 1; }
.rp-btn.is-current { background: var(--grad-soft); }
@keyframes rp-in { from { transform: translateY(14px) scale(.3); opacity: 0; } }
@media (max-width: 400px) { .rp-btn { width: 42px; height: 42px; } .rp-btn span { font-size: 1.55rem; } }

/* Who reacted */
.reactors-sheet { justify-items: stretch; text-align: left; max-height: 80vh; max-height: 80dvh; grid-template-rows: auto auto auto 1fr; }
.reactors-head { display: flex; align-items: center; justify-content: space-between; }
.reactors-head h2 { margin: 0; font-size: 1.15rem; }
.reactors-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.rt { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--text); }
.rt b { font-weight: 800; margin-left: 2px; }
.rt.is-on { background: var(--grad); color: #fff; border-color: transparent; }
.reactors-list { overflow-y: auto; min-height: 120px; display: grid; align-content: start; gap: 4px; }
.reactor { position: relative; }
.reactor .user-row { padding-right: 34px; }
.reactor-e { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); font-size: 1.3rem; }
.reactor .user-row .btn { margin-right: 8px; }
.gv-viewers .reactors-tabs { margin-bottom: 8px; }
.gv-viewers .rt { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.gv-viewers .rt.is-on { background: var(--grad); }

/* Glint player reactions */
.gv-react.is-on { background: rgba(255,255,255,.16); }
.gv-react-e { font-size: 1.4rem; line-height: 1; }
.gv-react.pulse { animation: heart .45s var(--ease); }
.gv-reacts { margin-left: 8px; }
.gv-re { letter-spacing: -2px; }

/* Topbar menu button (avatar + ☰) */
.topbar-menu {
  position: relative; display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 3px 10px 3px 3px;
  border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.topbar-menu .avatar { width: 32px; height: 32px; }
.topbar-menu-ic .icon { width: 20px; height: 20px; display: block; }
.topbar-menu-dot { position: absolute; top: -3px; right: -3px; }
.topbar-menu:active { transform: scale(.95); }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(5,5,15,.0); transition: background-color .3s; }
.drawer-backdrop.open { background: rgba(5,5,15,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(86vw, 360px); overflow-y: auto; overscroll-behavior: contain;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 28px 0 0 28px; border-right: 0;
  display: flex; flex-direction: column; gap: 14px;
  transform: translateX(105%); transition: transform .32s var(--ease);
  box-shadow: -30px 0 60px -30px rgba(0,0,0,.6);
}
.drawer-backdrop.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-me { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none !important; }
.drawer-me span { display: grid; min-width: 0; }
.drawer-me strong { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-me small { color: var(--muted); }
.drawer-group { display: grid; gap: 2px; padding: 6px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-border); }
.drawer-link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; border: 0; border-radius: 14px;
  background: transparent; color: var(--text); font-weight: 650; font-size: .98rem; text-align: left; text-decoration: none !important; cursor: pointer;
}
.drawer-link:hover, .drawer-link:active { background: var(--glass-hover); }
.drawer-link.danger { color: var(--danger); }
.dl-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--grad-soft); color: var(--accent); }
.drawer-link.danger .dl-ic { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.dl-ic .icon { width: 19px; height: 19px; }
.dl-label { flex: 1; min-width: 0; }
.dl-go { color: var(--muted); display: grid; }
.dl-go .icon { width: 16px; height: 16px; }
.dl-badge { position: static; }
.drawer-theme { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; font-weight: 650; }
.drawer-theme .seg { margin: 0; }
.drawer-theme .seg label { padding: 7px 12px; }
.drawer-logout { margin: 0; }
.drawer-foot { text-align: center; margin: auto 0 0; }

/* Following / everyone: a compact glass switch instead of a full-width bar */
.home-feed .tabs {
  display: flex; width: fit-content; margin: 0 auto; padding: 4px; gap: 2px;
  border-radius: 999px; position: relative;
}
.home-feed .tab { flex: none; padding: 7px 18px; font-size: .86rem; border-radius: 999px; }
.home-feed .tab[aria-selected="true"] {
  color: #fff; background: var(--grad);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 16px -8px rgba(124,58,237,.9);
}

/* Sparkle burst when a Glint is shared */
.sparkle-burst { position: fixed; inset: 0; z-index: 300; pointer-events: none; animation: fade .2s; }
.sparkle-burst canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sparkle-burst.out { opacity: 0; transition: opacity .28s; }
.sb-core {
  position: absolute; left: var(--cx); top: var(--cy); width: 120px; height: 120px; margin: -60px 0 0 -60px;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,.9) 12%, rgba(196,181,253,.6) 30%, rgba(34,211,238,.25) 50%, transparent 70%);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  animation: sb-core 1.1s var(--ease) both; filter: drop-shadow(0 0 18px #fff);
}
.sb-ring {
  position: absolute; left: var(--cx); top: var(--cy); width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.9); box-shadow: 0 0 30px #a78bfa, inset 0 0 20px #22d3ee;
  animation: sb-ring 1s var(--ease) .05s both;
}
.sb-label {
  position: absolute; left: 0; right: 0; top: calc(var(--cy) + 90px); text-align: center; font-weight: 900; font-size: 1.6rem;
  background: linear-gradient(90deg, #a78bfa, #22d3ee, #f472b6, #fbbf24, #a78bfa); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 10px rgba(0,0,0,.4));
  animation: sb-label 1.4s var(--ease) both, sb-shine 1.4s linear both;
}
.sb-label span { -webkit-text-fill-color: initial; color: #fff; }
@keyframes sb-core { 0% { transform: scale(0) rotate(-60deg); opacity: 0; } 35% { transform: scale(1.5) rotate(0); opacity: 1; } 100% { transform: scale(.2) rotate(45deg); opacity: 0; } }
@keyframes sb-ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(9); opacity: 0; border-width: 1px; } }
@keyframes sb-label { 0% { opacity: 0; transform: translateY(16px) scale(.9); } 25%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes sb-shine { to { background-position: -200% 0; } }

/* …and your ring shimmers once on the refreshed page */
.glint-item.just-posted .glint-ring { position: relative; animation: jp-pop .7s var(--ease); }
.glint-item.just-posted .glint-ring::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 0deg, #a78bfa, #22d3ee, #f472b6, #fbbf24, #a78bfa); animation: jp-spin 1.6s linear 2;
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%);
}
.glint-item.just-posted .glint-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.8) 48%, transparent 66%); background-size: 250% 100%;
  animation: jp-sweep 1.2s ease-out .2s 2 both;
}
@keyframes jp-spin { to { transform: rotate(360deg); } }
@keyframes jp-sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes jp-pop { 40% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .sb-core, .sb-ring { display: none; } }
.sparkle-burst::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--cx) var(--cy), rgba(196,181,253,.38), rgba(34,211,238,.12) 30%, rgba(5,5,15,.35) 70%);
  animation: sb-bg 1.6s ease both;
}
@keyframes sb-bg { 0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* ==========================================================================
   2.0 — Composer that grows out of the bubble, in-app panels, smoother & lighter
   ========================================================================== */

/* Home: just the bubble — every option unfolds inside the composer */
.composer-launch { padding: 12px 14px; }
.composer-launch .composer-row { gap: 10px; }
.composer-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 8px 11px 18px; }
.composer-field > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.cf-plus { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 14px -8px rgba(124,58,237,.9); transition: transform .25s var(--ease); }
.cf-plus .icon { width: 16px; height: 16px; }
.composer-field:active .cf-plus { transform: rotate(90deg) scale(.9); }

/* Composer: flex column — header and tools stay put, the middle scrolls */
.ps-backdrop { animation: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(5,5,15,.45); }
.post-sheet { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0; animation: none; }
.post-sheet > * { flex: none; }
.post-sheet .ps-head { position: sticky; top: -10px; z-index: 3; margin: -10px -22px 0; padding: 12px 22px 10px; background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.post-sheet .ps-tools {
  position: sticky; bottom: 0; z-index: 3; margin: auto -22px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  justify-content: space-between; flex-wrap: nowrap; gap: 2px;
  background: color-mix(in srgb, var(--bg) 60%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.ps-backdrop.kb-open .post-sheet .ps-tools { padding-bottom: 8px; }
.ps-tool { flex-direction: column; gap: 4px; padding: 4px 6px; border-radius: 14px; color: var(--text-soft); font-size: .7rem; min-width: 56px; }
.ps-tool .co-ic { width: 38px; height: 38px; border-radius: 13px; transition: transform .2s var(--ease); }
.ps-tool:active .co-ic { transform: scale(.9); }
.ps-tool.is-on { background: transparent; color: var(--text); }
.ps-tool.is-on .co-ic { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
@media (max-width: 480px) {
  .ps-tool span:not(.ps-gif) { display: inline; }
  .ps-tool .co-ic { display: grid; }
  .ps-tool { padding: 4px 2px; min-width: 0; flex: 1; }
}
.post-sheet.is-edit .ps-tool-glint { display: none; }
.ps-canvas textarea { min-height: 96px; }

/* Opening: the tools and text rise in, one after another */
.ps-opening .ps-compose { animation: rise .4s var(--ease) .04s both; }
.ps-opening .ps-tools > * { animation: tool-in .5s var(--ease) both; }
.ps-opening .ps-tools > :nth-child(1) { animation-delay: .08s; }
.ps-opening .ps-tools > :nth-child(2) { animation-delay: .12s; }
.ps-opening .ps-tools > :nth-child(3) { animation-delay: .16s; }
.ps-opening .ps-tools > :nth-child(4) { animation-delay: .20s; }
.ps-opening .ps-tools > :nth-child(5) { animation-delay: .24s; }
@keyframes tool-in { from { opacity: 0; transform: translateY(14px) scale(.7); } }

/* Phones: a full-screen composer that always fits above the keyboard */
@media (max-width: 640px) {
  .ps-backdrop { position: fixed; inset: auto 0 auto 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); align-items: stretch; background: transparent; }
  .ps-backdrop .post-sheet {
    width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0;
    padding: calc(10px + env(safe-area-inset-top)) 16px 0;
  }
  .post-sheet .ps-head { top: calc(-10px - env(safe-area-inset-top)); margin: calc(-10px - env(safe-area-inset-top)) -16px 0; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
  .post-sheet .ps-tools { margin: auto -16px 0; padding-left: 10px; padding-right: 10px; }
  .post-sheet .ps-head h2 { font-size: 1rem; }
}
@media (min-width: 641px) {
  .ps-backdrop { align-items: center; }
  .ps-backdrop .post-sheet { max-height: min(86vh, 860px); border-radius: 28px; }
}
body.composing .tabbar { visibility: hidden; }

/* New / edited posts animate in; everything else just appears (faster pages) */
.reveal { animation: none; }
.post.pop-in { animation: rise .45s var(--ease) both; }
.post.just-edited { animation: edited-glow 1.2s ease both; }
@keyframes edited-glow { 0% { box-shadow: 0 0 0 2px var(--accent), var(--depth); } 100% { box-shadow: inset 0 1px 0 var(--edge-hi), var(--depth); } }
.edited { font-style: italic; }

/* In-app panels (notifications, messages) — glass that slides over the page, like the menu */
.ap-backdrop { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100%); z-index: 85; background: rgba(5,5,15,0); transition: background-color .3s; }
.ap-backdrop.open { background: rgba(5,5,15,.42); }
.app-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(100vw, 460px);
  display: grid; overflow: hidden; border-radius: 28px 0 0 28px; border-right: 0;
  padding-top: env(safe-area-inset-top);
  transform: translateX(104%); transition: transform .34s var(--ease);
  box-shadow: -30px 0 60px -30px rgba(0,0,0,.6);
}
.ap-backdrop.open .app-panel { transform: none; }
@media (max-width: 640px) { .app-panel { width: 100vw; border-radius: 0; border: 0; } }
.ap-view { grid-area: 1 / 1; display: flex; flex-direction: column; min-height: 0; visibility: hidden; }
.ap-view.is-on { visibility: visible; }
.ap-view.is-on.anim.from-right { animation: ap-push .34s var(--ease) both; }
.ap-view.is-on.anim.from-left { animation: ap-pop .34s var(--ease) both; }
@keyframes ap-push { from { transform: translateX(40%); opacity: 0; } }
@keyframes ap-pop { from { transform: translateX(-30%); opacity: 0; } }
.ap-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--line); flex: none; }
.ap-head h2 { flex: 1; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.25rem; font-weight: 800; }
.ap-head h2 .icon { width: 22px; height: 22px; color: var(--accent); }
.ap-thread .ap-head { padding-left: 8px; }
.ap-thread .dm-who { flex: 1; min-width: 0; }
.ap-thread .dm-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.ap-body .notif-list { gap: 8px; }
.ap-body .notif { border-radius: 18px; }
.ap-body .dm-convos { padding: 0; overflow: visible; }
.ap-body .dm-convo { padding: 12px; }
.ap-msgs { display: flex; flex-direction: column; gap: 6px; padding: 16px 14px; }
.ap-compose { flex: none; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.ap-skel i { display: block; height: 62px; margin-bottom: 10px; border-radius: 16px; background: linear-gradient(90deg, var(--glass) 0%, var(--glass-hover) 50%, var(--glass) 100%); background-size: 200% 100%; animation: ap-shimmer 1.1s linear infinite; }
@keyframes ap-shimmer { to { background-position: -200% 0; } }
.nav-link.is-panel { color: var(--text); }
.tabbar .nav-link.is-panel { background: var(--grad-soft); }
.ap-body .empty { margin-top: 10px; }

/* ---------- Performance: smoother scrolling on phones ---------- */
/* Glass blurs whatever is behind it every frame. On phones the background stays still and is drawn
   with plain gradients (no live blur), so cards don't have to re-blur a moving scene while you scroll. */
@media (pointer: coarse) {
  .blob { animation: none !important; filter: none !important; background: radial-gradient(closest-side, var(--c) 0%, color-mix(in srgb, var(--c) 45%, transparent) 55%, transparent 100%) !important; }
  .b1 { --c: var(--blob-1); } .b2 { --c: var(--blob-2); } .b3 { --c: var(--blob-3); } .b4 { --c: var(--blob-4); }
  .bg::after { animation: none; display: none; }
  .grain { display: none; }
}
@media (max-width: 820px) {
  :root { --blur: 16px; }
  .post.glass { -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
}


/* Phones: the tab bar floats above the panel so you can hop between alerts, messages and home */
@media (max-width: 820px) {
  body.ap-open .tabbar, body.ap-closing .tabbar { z-index: 95; }
  body.ap-open .ap-body { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  body.ap-in-thread .tabbar { visibility: hidden; }
}
.app-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.ps-tool span.co-ic { display: grid; place-items: center; }
@media (max-width: 640px) {
  .ps-backdrop .post-sheet { background-color: color-mix(in srgb, var(--bg) 82%, transparent); }
}
.app-panel { background-color: color-mix(in srgb, var(--bg) 70%, transparent); }
.notif-list { grid-template-columns: minmax(0, 1fr); }
.notif-glint { color: #a78bfa; background: color-mix(in srgb, #a78bfa 16%, transparent); }
.menu-open, .post:has(.menu:not([hidden])) { position: relative; z-index: 6; }
@media (min-width: 641px) {
  .ps-backdrop { background: rgba(5,5,15,.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}

/* ==========================================================================
   2.1 — Themes (oled, solid), accent colors, wallpapers, readable text
   ========================================================================== */

/* Accent colors (light theme uses deeper tones, dark theme lighter ones — both stay readable) */
:root[data-accent="ocean"] { --accent: #0369a1; --accent-ink: #0369a1; --accent-2: #06b6d4; --accent-3: #14b8a6; --grad: linear-gradient(135deg, #2563eb 0%, #06b6d4 55%, #14b8a6 110%); --grad-soft: linear-gradient(135deg, rgba(37,99,235,.14), rgba(6,182,212,.12)); --focus: 0 0 0 3px rgba(3,105,161,.35); }
:root[data-accent="ocean"][data-theme="dark"] { --accent: #38bdf8; --accent-ink: #38bdf8; --grad-soft: linear-gradient(135deg, rgba(37,99,235,.2), rgba(6,182,212,.14)); --focus: 0 0 0 3px rgba(56,189,248,.45); }
:root[data-accent="rose"] { --accent: #be123c; --accent-ink: #be123c; --accent-2: #f472b6; --accent-3: #fb923c; --grad: linear-gradient(135deg, #e11d48 0%, #f472b6 55%, #fb923c 110%); --grad-soft: linear-gradient(135deg, rgba(225,29,72,.14), rgba(244,114,182,.12)); --focus: 0 0 0 3px rgba(190,18,60,.35); }
:root[data-accent="rose"][data-theme="dark"] { --accent: #fb7185; --accent-ink: #fb7185; --grad-soft: linear-gradient(135deg, rgba(225,29,72,.2), rgba(244,114,182,.14)); --focus: 0 0 0 3px rgba(251,113,133,.45); }
:root[data-accent="sunset"] { --accent: #c2410c; --accent-ink: #c2410c; --accent-2: #ef4444; --accent-3: #db2777; --grad: linear-gradient(135deg, #f97316 0%, #ef4444 55%, #db2777 110%); --grad-soft: linear-gradient(135deg, rgba(249,115,22,.14), rgba(239,68,68,.12)); --focus: 0 0 0 3px rgba(194,65,12,.35); }
:root[data-accent="sunset"][data-theme="dark"] { --accent: #fb923c; --accent-ink: #fb923c; --grad-soft: linear-gradient(135deg, rgba(249,115,22,.2), rgba(239,68,68,.14)); --focus: 0 0 0 3px rgba(251,146,60,.45); }
:root[data-accent="forest"] { --accent: #15803d; --accent-ink: #15803d; --accent-2: #65a30d; --accent-3: #0d9488; --grad: linear-gradient(135deg, #16a34a 0%, #65a30d 55%, #0d9488 110%); --grad-soft: linear-gradient(135deg, rgba(22,163,74,.14), rgba(101,163,13,.12)); --focus: 0 0 0 3px rgba(21,128,61,.35); }
:root[data-accent="forest"][data-theme="dark"] { --accent: #4ade80; --accent-ink: #4ade80; --grad-soft: linear-gradient(135deg, rgba(22,163,74,.2), rgba(101,163,13,.14)); --focus: 0 0 0 3px rgba(74,222,128,.45); }
:root[data-accent="gold"] { --accent: #a16207; --accent-ink: #a16207; --accent-2: #f59e0b; --accent-3: #f97316; --grad: linear-gradient(135deg, #eab308 0%, #f59e0b 55%, #f97316 110%); --grad-soft: linear-gradient(135deg, rgba(234,179,8,.14), rgba(245,158,11,.12)); --focus: 0 0 0 3px rgba(161,98,7,.35); }
:root[data-accent="gold"][data-theme="dark"] { --accent: #facc15; --accent-ink: #facc15; --grad-soft: linear-gradient(135deg, rgba(234,179,8,.2), rgba(245,158,11,.14)); --focus: 0 0 0 3px rgba(250,204,21,.45); }
:root[data-accent="mint"] { --accent: #0f766e; --accent-ink: #0f766e; --accent-2: #22c55e; --accent-3: #06b6d4; --grad: linear-gradient(135deg, #14b8a6 0%, #22c55e 55%, #06b6d4 110%); --grad-soft: linear-gradient(135deg, rgba(20,184,166,.14), rgba(34,197,94,.12)); --focus: 0 0 0 3px rgba(15,118,110,.35); }
:root[data-accent="mint"][data-theme="dark"] { --accent: #5eead4; --accent-ink: #5eead4; --grad-soft: linear-gradient(135deg, rgba(20,184,166,.2), rgba(34,197,94,.14)); --focus: 0 0 0 3px rgba(94,234,212,.45); }
:root[data-accent="berry"] { --accent: #86198f; --accent-ink: #86198f; --accent-2: #9333ea; --accent-3: #ec4899; --grad: linear-gradient(135deg, #c026d3 0%, #9333ea 55%, #ec4899 110%); --grad-soft: linear-gradient(135deg, rgba(192,38,211,.14), rgba(147,51,234,.12)); --focus: 0 0 0 3px rgba(134,25,143,.35); }
:root[data-accent="berry"][data-theme="dark"] { --accent: #e879f9; --accent-ink: #e879f9; --grad-soft: linear-gradient(135deg, rgba(192,38,211,.2), rgba(147,51,234,.14)); --focus: 0 0 0 3px rgba(232,121,249,.45); }
:root[data-accent="sky"] { --accent: #1d4ed8; --accent-ink: #1d4ed8; --accent-2: #60a5fa; --accent-3: #a78bfa; --grad: linear-gradient(135deg, #3b82f6 0%, #60a5fa 55%, #a78bfa 110%); --grad-soft: linear-gradient(135deg, rgba(59,130,246,.14), rgba(96,165,250,.12)); --focus: 0 0 0 3px rgba(29,78,216,.35); }
:root[data-accent="sky"][data-theme="dark"] { --accent: #93c5fd; --accent-ink: #93c5fd; --grad-soft: linear-gradient(135deg, rgba(59,130,246,.2), rgba(96,165,250,.14)); --focus: 0 0 0 3px rgba(147,197,253,.45); }
:root[data-accent="crimson"] { --accent: #b91c1c; --accent-ink: #b91c1c; --accent-2: #9f1239; --accent-3: #ea580c; --grad: linear-gradient(135deg, #dc2626 0%, #9f1239 55%, #ea580c 110%); --grad-soft: linear-gradient(135deg, rgba(220,38,38,.14), rgba(159,18,57,.12)); --focus: 0 0 0 3px rgba(185,28,28,.35); }
:root[data-accent="crimson"][data-theme="dark"] { --accent: #f87171; --accent-ink: #f87171; --grad-soft: linear-gradient(135deg, rgba(220,38,38,.2), rgba(159,18,57,.14)); --focus: 0 0 0 3px rgba(248,113,113,.45); }
:root[data-accent="lavender"] { --accent: #6d28d9; --accent-ink: #6d28d9; --accent-2: #c084fc; --accent-3: #f0abfc; --grad: linear-gradient(135deg, #a78bfa 0%, #c084fc 55%, #f0abfc 110%); --grad-soft: linear-gradient(135deg, rgba(167,139,250,.14), rgba(192,132,252,.12)); --focus: 0 0 0 3px rgba(109,40,217,.35); }
:root[data-accent="lavender"][data-theme="dark"] { --accent: #c4b5fd; --accent-ink: #c4b5fd; --grad-soft: linear-gradient(135deg, rgba(167,139,250,.2), rgba(192,132,252,.14)); --focus: 0 0 0 3px rgba(196,181,253,.45); }
:root[data-accent="mono"] { --accent: #334155; --accent-ink: #334155; --accent-2: #64748b; --accent-3: #94a3b8; --grad: linear-gradient(135deg, #475569 0%, #64748b 55%, #94a3b8 110%); --grad-soft: linear-gradient(135deg, rgba(71,85,105,.14), rgba(100,116,139,.12)); --focus: 0 0 0 3px rgba(51,65,85,.35); }
:root[data-accent="mono"][data-theme="dark"] { --accent: #e2e8f0; --accent-ink: #e2e8f0; --grad-soft: linear-gradient(135deg, rgba(71,85,105,.2), rgba(100,116,139,.14)); --focus: 0 0 0 3px rgba(226,232,240,.45); }
:root[data-accent="mono"] .btn-primary, :root[data-accent="mono"][data-theme="dark"] .tab[aria-selected="true"] { color: #fff; }

/* Wallpapers */
.bg-wall { position: absolute; inset: 0; background: var(--wall, none); }
:root[data-wall]:not([data-wall="glassay"]) .blob,
:root[data-wall]:not([data-wall="glassay"]) .grain,
:root[data-wall]:not([data-wall="glassay"]) .bg::after { display: none; }
:root[data-wall="plain"] .bg { background: var(--bg); }

/* Glass gets a little thicker over a wallpaper, and much thicker when the wallpaper fights the theme,
   so text on cards always stays easy to read. */
:root[data-wall]:not([data-wall="glassay"]):not([data-wall="plain"])[data-theme="light"] { --glass: rgba(255,255,255,.72); --glass-strong: rgba(255,255,255,.82); --glass-hover: rgba(255,255,255,.88); }
:root[data-wall]:not([data-wall="glassay"]):not([data-wall="plain"])[data-theme="dark"] { --glass: rgba(16,16,30,.52); --glass-strong: rgba(16,16,30,.72); --glass-hover: rgba(30,30,52,.62); }
:root[data-wall-clash][data-theme="light"] { --glass: rgba(255,255,255,.88); --glass-strong: rgba(255,255,255,.93); --glass-hover: rgba(255,255,255,.96); }
:root[data-wall-clash][data-theme="dark"] { --glass: rgba(14,14,26,.84); --glass-strong: rgba(14,14,26,.9); --glass-hover: rgba(30,30,50,.9); }
/* Bits of text that sit straight on the wallpaper get their own small glass pill */
:root[data-wall]:not([data-wall="glassay"]):not([data-wall="plain"]) :is(.page-head h1, .feed-end, .customize-link, .footer-note) {
  width: fit-content; padding: 3px 12px; border-radius: 999px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
:root[data-wall]:not([data-wall="glassay"]):not([data-wall="plain"]) .feed-end { margin-inline: auto; }

/* OLED: true black, no glow, no blur — great on OLED screens and for battery */
:root[data-skin="oled"] {
  --bg: #000; --blob-opacity: 0;
  --glass: rgba(255,255,255,.04); --glass-strong: #0b0b0f; --glass-hover: rgba(255,255,255,.08);
  --glass-border: rgba(255,255,255,.1); --glass-tint: transparent; --sheen: transparent;
  --edge-hi: rgba(255,255,255,.1); --edge-lo: rgba(255,255,255,.03); --depth: none;
  --input: rgba(255,255,255,.06); --input-border: rgba(255,255,255,.14);
  --text: #f5f5f7; --text-soft: #d4d4dc; --muted: #9a9aa8; --line: rgba(255,255,255,.1);
}
:root[data-skin="oled"][data-wall="glassay"] .bg, :root[data-skin="oled"][data-wall="plain"] .bg { background: #000; }
:root[data-skin="oled"][data-wall="glassay"] .blob, :root[data-skin="oled"][data-wall="glassay"] .grain, :root[data-skin="oled"][data-wall="glassay"] .bg::after { display: none; }
:root[data-skin="oled"]:is([data-wall="glassay"], [data-wall="plain"]) :is(.glass, .glass-strong, .topbar, .tabbar, .sidebar-inner, .post.glass) { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-skin="oled"]:is([data-wall="glassay"], [data-wall="plain"]) .topbar { background: rgba(0,0,0,.92); }
:root[data-skin="oled"]:is([data-wall="glassay"], [data-wall="plain"]) .tabbar { background: rgba(14,14,18,.96); }
:root[data-skin="oled"] .msg-in .msg-bubble { background: #16161c; }

/* Solid light: crisp white cards, nothing see-through */
:root[data-skin="solid"] {
  --bg: #eceef5;
  --glass: #ffffff; --glass-strong: #ffffff; --glass-hover: #f3f4f8;
  --glass-border: rgba(15,23,42,.08); --glass-tint: transparent; --sheen: transparent;
  --edge-hi: transparent; --edge-lo: transparent;
  --depth: 0 1px 2px rgba(15,23,42,.06), 0 10px 26px -18px rgba(15,23,42,.35);
  --input: #f3f4f8; --input-border: rgba(15,23,42,.12);
  --text: #0f1222; --text-soft: #32364d; --muted: #5f6378; --line: rgba(15,23,42,.09);
}
:root[data-skin="solid"][data-wall="glassay"] .blob, :root[data-skin="solid"][data-wall="glassay"] .grain, :root[data-skin="solid"][data-wall="glassay"] .bg::after { display: none; }
:root[data-skin="solid"][data-wall="glassay"] .bg { background: #eceef5; }
:root[data-skin="solid"] :is(.glass, .glass-strong, .topbar, .tabbar, .sidebar-inner, .post.glass, .sheet, .menu, .toast) { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-skin="solid"] :is(.glass, .glass-strong) { background-image: none; border-color: rgba(15,23,42,.08); }
:root[data-skin="solid"] .topbar, :root[data-skin="solid"] .tabbar { background: rgba(255,255,255,.97); }
:root[data-skin="solid"] .sheet, :root[data-skin="solid"] .menu, :root[data-skin="solid"] .app-panel, :root[data-skin="solid"] .drawer { background: #fff; }

/* Theme toggle icons for the new themes */
.theme-toggle .ti-oled, .theme-toggle .ti-solid { display: none; }
:root[data-theme-pref="oled"] .theme-toggle .ti-oled, :root[data-theme-pref="solid"] .theme-toggle .ti-solid { display: grid; }
.drawer-theme { flex-wrap: wrap; gap: 8px; }
.drawer-theme .seg label { padding: 7px 9px; }

/* Settings: theme cards, accents, wallpapers, text colors */
.set-sub { margin: 18px 0 10px; font-size: .92rem; font-weight: 800; }
.set-sub:first-of-type { margin-top: 4px; }
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.theme-card { position: relative; display: grid; gap: 2px; padding: 8px 8px 10px; border-radius: 18px; border: 1px solid var(--glass-border); background: var(--glass); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.theme-card input { position: absolute; opacity: 0; }
.theme-card:has(input:checked) { box-shadow: 0 0 0 2px var(--accent); }
.theme-card:active { transform: scale(.97); }
.theme-card strong { font-size: .85rem; margin-top: 6px; }
.theme-card small { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.tc-preview { height: 62px; border-radius: 12px; display: grid; grid-template-columns: 1fr; gap: 5px; padding: 8px; overflow: hidden; }
.tc-preview i { display: block; border-radius: 6px; height: 10px; }
.tc-preview i:nth-child(2) { width: 70%; } .tc-preview i:nth-child(3) { width: 45%; }
.tc-light .tc-preview { background: linear-gradient(135deg, #c4b5fd, #a5f3fc 60%, #fbcfe8); } .tc-light .tc-preview i { background: rgba(255,255,255,.75); }
.tc-dark .tc-preview { background: linear-gradient(135deg, #2e1065, #0e7490 60%, #831843); } .tc-dark .tc-preview i { background: rgba(255,255,255,.18); }
.tc-oled .tc-preview { background: #000; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); } .tc-oled .tc-preview i { background: #1a1a20; }
.tc-solid .tc-preview { background: #eceef5; box-shadow: inset 0 0 0 1px rgba(15,23,42,.1); } .tc-solid .tc-preview i { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tc-system .tc-preview { background: linear-gradient(90deg, #eef0fb 50%, #0b0b16 50%); } .tc-system .tc-preview i { background: linear-gradient(90deg, #fff 50%, #2a2a40 50%); }

.accent-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.acc { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--g); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 12px -6px rgba(0,0,0,.5); transition: transform .2s var(--ease); }
.acc input { position: absolute; opacity: 0; }
.acc:has(input:checked) { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); transform: scale(1.06); }
.acc:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }

.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-bottom: 10px; }
.wall-opt { position: relative; display: grid; gap: 4px; justify-items: center; cursor: pointer; }
.wall-opt input[type=radio] { position: absolute; opacity: 0; }
.wall-thumb { width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; display: grid; place-items: center; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 6px 16px -10px rgba(0,0,0,.6); transition: transform .2s var(--ease); }
.wall-opt small { font-size: .72rem; font-weight: 650; color: var(--text-soft); text-align: center; }
.wall-opt:has(input:checked) .wall-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.wall-opt:active .wall-thumb { transform: scale(.95); }
.wt-glassay { background: radial-gradient(60% 50% at 25% 25%, #8b5cf6, transparent), radial-gradient(60% 50% at 80% 40%, #06b6d4, transparent), radial-gradient(60% 50% at 40% 90%, #ec4899, transparent), #12122a; }
.wt-plain { background: var(--bg); }
.wall-upload .wall-thumb { border: 2px dashed color-mix(in srgb, var(--muted) 60%, transparent); box-shadow: none; color: var(--accent); }
.wall-upload .wall-thumb .icon { width: 26px; height: 26px; }
.wall-opt.is-busy .wall-thumb { animation: ap-shimmer 1s linear infinite; background: linear-gradient(90deg, var(--glass), var(--glass-hover), var(--glass)); background-size: 200% 100%; }

.text-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.txt { position: relative; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; cursor: pointer; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.txt input { position: absolute; opacity: 0; }
.txt span { font-weight: 800; font-size: 1.05rem; color: var(--c, var(--text)); }
.txt-auto span { font-size: .72rem; }
.txt:has(input:checked) { box-shadow: 0 0 0 2px var(--accent); }
.txt.is-unreadable { opacity: .45; }
.txt.is-unreadable::after { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--muted); transform: rotate(-35deg); border-radius: 2px; }
.text-note { margin: 8px 0 0; }
:root:root[data-skin="solid"][data-wall][data-theme] { --glass: #ffffff; --glass-strong: #ffffff; --glass-hover: #f3f4f8; }

/* Replies: tap the bubble — the full composer opens above the keyboard */
.reply-launch { display: flex; align-items: center; gap: 8px; }
.reply-field {
  flex: 1; min-width: 0; text-align: left; padding: 10px 16px; border-radius: 999px; cursor: text;
  border: 1px solid var(--input-border); background: var(--input); color: var(--muted); font-weight: 500; font-size: .95rem;
}
.reply-launch .icon-btn { width: 38px; height: 38px; }
.reply-gif .ps-gif { font-size: .62rem; }
.post-sheet.is-reply :is([data-ps-toggle="bg"], [data-ps-glint], [data-ps-panel="bg"]) { display: none !important; }
.comment-bubble .post-media { margin: 8px 0 2px; border-radius: 14px; }
.comment-bubble .post-media.media-1 .pm-item img { max-height: 320px; }
.comment-actions { margin: 4px 0 0 -8px; }
.comment-actions .action { padding: 4px 8px; font-size: .78rem; }
.comment-actions .react-face { width: 16px; height: 16px; }
.comment-actions .react-face .icon { width: 15px; height: 15px; }
.comment-actions .react-emoji { font-size: .95rem; }
.comment-actions .react-label { display: none; }
.comment-actions .react-sum { padding: 2px 8px 2px 4px; font-size: .78rem; }
.comment-actions .rs-e { width: 19px; height: 19px; font-size: .68rem; }
.comment-bubble { min-width: 0; }
.migrate-alert { position: relative; z-index: 50; margin: calc(70px + env(safe-area-inset-top)) 12px -60px; text-transform: none; }

/* ---------- 2.2: the dock as real liquid glass ---------- */
@media (max-width: 820px) {
  .tabbar {
    border: 1px solid rgba(255,255,255,.32);
    background:
      linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.06) 42%, rgba(255,255,255,.02) 100%),
      var(--glass-strong);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.65),
      inset 0 -1px 0 rgba(255,255,255,.12),
      inset 0 0 18px rgba(255,255,255,.06),
      0 20px 44px -14px rgba(0,0,0,.5),
      0 2px 8px -2px rgba(0,0,0,.18);
    -webkit-backdrop-filter: blur(26px) saturate(230%) brightness(1.08);
    backdrop-filter: blur(26px) saturate(230%) brightness(1.08);
    isolation: isolate;
  }
  .tabbar::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
    background:
      radial-gradient(120% 140% at 50% -40%, rgba(255,255,255,.35), transparent 55%),
      linear-gradient(100deg, transparent 18%, rgba(255,255,255,.14) 32%, transparent 46%);
  }
  :root[data-theme="dark"] .tabbar { border-color: rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(255,255,255,.05), 0 22px 48px -14px rgba(0,0,0,.75); }
  :root[data-theme="dark"] .tabbar::before { opacity: .45; }
  .tabbar .nav-link { transition: color .2s, background-color .25s, transform .15s var(--ease); }
  .tabbar .nav-link:active { transform: scale(.92); }
}
:root[data-skin="solid"] .tabbar::before, :root[data-skin="oled"] .tabbar::before { display: none; }
html { background-color: var(--bg); }

/* ==========================================================================
   2.2 — Huddles, Top 8, promises
   ========================================================================== */
.avatar-xs { width: 22px; height: 22px; font-size: .62rem; }
.huddle-dot { display: inline-block; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 650; cursor: pointer; }

/* Huddles list */
.huddles-head { display: flex; align-items: center; justify-content: space-between; }
.huddles-intro { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-bottom: 14px; }
.huddles-intro p { margin: 4px 0 0; }
.hi-icon { width: 44px; height: 44px; flex: none; border-radius: 15px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.huddle-list { display: grid; gap: 10px; }
.huddle-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px; color: var(--text); text-decoration: none !important; transition: transform .2s var(--ease); }
.huddle-card:active { transform: scale(.98); }
.hc-wall { width: 58px; height: 58px; flex: none; border-radius: 18px; background-size: cover !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 6px 14px -8px rgba(0,0,0,.5); }
.hc-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.hc-body strong { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.hc-faces { display: inline-flex; }
.hc-faces .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.hc-faces .avatar:first-child { margin-left: 0; }
.hc-plan { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--accent); font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hc-plan .icon { width: 13px; height: 13px; flex: none; }
.home-huddles .huddle-card { padding: 8px; background: transparent; box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.home-huddles .hc-wall { width: 42px; height: 42px; border-radius: 13px; }
.home-huddles .hc-body strong { font-size: .92rem; }
.huddle-new { justify-items: stretch; text-align: left; }
.huddle-new label { display: grid; gap: 6px; font-weight: 650; font-size: .88rem; }

/* Huddle page */
.huddle-page { display: grid; gap: 14px; }
.hud-hero { position: relative; overflow: hidden; padding: 14px 18px 18px; display: grid; gap: 8px; }
.hud-wall { position: absolute; inset: 0 0 auto 0; height: 92px; background-size: cover !important; opacity: .95; -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent); }
.hud-top { position: relative; display: flex; align-items: center; gap: 8px; }
.hud-top .icon-btn { background: rgba(0,0,0,.28); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hud-private { margin-right: auto; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.3); color: #fff; font-size: .74rem; font-weight: 700; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hud-private .icon { width: 13px; height: 13px; }
.hud-hero h1 { position: relative; margin: 28px 0 0; font-size: 1.7rem; font-weight: 850; line-height: 1.15; }
.hud-about { margin: 0; color: var(--text-soft); }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.hud-faces { display: inline-flex; align-items: center; gap: 0; border: 0; background: none; padding: 0; color: var(--muted); font-weight: 650; font-size: .85rem; cursor: pointer; }
.hud-faces .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg); }
.hud-faces .avatar:first-child { margin-left: 0; }
.hud-faces span { margin-left: 10px; }
.hud-tabs { display: flex; width: 100%; padding: 4px; gap: 2px; border-radius: 999px; }
.hud-tabs .tab { flex: 1; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; font-size: .86rem; }
.hud-tabs .tab small { opacity: .7; }
.hud-tabs .tab[aria-selected="true"] { color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 16px -8px rgba(124,58,237,.9); }
.hud-tabs .dot-badge { min-width: 18px; height: 18px; font-size: .66rem; }
.hud-pane { display: grid; gap: 14px; }
.hud-pane[hidden] { display: none; }
.hud-glints { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.hud-glint-ring { width: 64px; height: 64px; flex: none; }
.hud-glint-ring .avatar-glint { width: 56px; height: 56px; background-size: cover !important; }
.hud-glints-text { flex: 1; min-width: 0; display: grid; gap: 2px; }

/* Group chat */
.hud-chat { display: flex; flex-direction: column; height: calc(100dvh - 300px); min-height: 380px; overflow: hidden; padding: 0; }
.hud-msgs { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.hmsg { max-width: 80%; }
.hmsg.is-grouped { margin-top: -2px; }
.hmsg-who { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; color: var(--muted); margin: 6px 0 3px 4px; }
.hmsg-system { align-self: center; margin: 8px 0; padding: 4px 12px; border-radius: 99px; background: var(--glass); border: 1px solid var(--glass-border); font-size: .76rem; color: var(--muted); font-weight: 650; text-align: center; }
.hud-compose { flex: none; }
@media (max-width: 820px) {
  body.hud-in-chat .tabbar { display: none; }
  body.hud-in-chat .shell { padding-bottom: 12px; }
  .hud-chat { height: calc(100dvh - 300px - env(safe-area-inset-top)); }
}

/* Plans */
.plan-new { padding: 0; overflow: hidden; }
.plan-new summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 750; display: flex; align-items: center; gap: 8px; color: var(--accent); }
.plan-new summary::-webkit-details-marker { display: none; }
.plan-new .form { padding: 0 16px 16px; }
.plan-list { display: grid; gap: 10px; }
.plan { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.plan-date time { width: 54px; height: 58px; display: grid; place-content: center; text-align: center; border-radius: 16px; color: #fff; background: var(--grad); line-height: 1.05; box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.plan-date b { font-size: 1.35rem; font-weight: 850; }
.plan-date span { font-size: .72rem; font-weight: 750; text-transform: lowercase; }
.plan-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.plan-main strong { font-size: 1rem; }
.plan-going { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.plan-faces { display: inline-flex; }
.plan-faces .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.plan-faces .avatar:first-child { margin-left: 0; }
.plan-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.plan-actions .is-in { color: var(--accent); }
@media (max-width: 480px) { .plan { flex-wrap: wrap; } .plan-actions { flex-direction: row; width: 100%; justify-content: flex-end; } }

/* People + invite */
.invite-card { padding: 16px; display: grid; gap: 8px; }
.invite-card strong { display: flex; align-items: center; gap: 8px; }
.invite-row { display: flex; gap: 8px; }
.invite-row input { flex: 1; min-width: 0; font-size: .82rem !important; }
.hud-member { position: relative; display: flex; align-items: center; }
.hud-member .user-row { flex: 1; min-width: 0; }
.hud-settings { justify-items: stretch; text-align: left; max-height: 88dvh; overflow-y: auto; }
.hud-settings label { display: grid; gap: 6px; font-weight: 650; font-size: .88rem; }
.hud-walls { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }

/* Invite landing */
.join-card { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 120px 24px 28px; max-width: 520px; margin: 0 auto; }
.join-wall { position: absolute; inset: 0 0 auto 0; height: 110px; background-size: cover !important; -webkit-mask: linear-gradient(#000 50%, transparent); mask: linear-gradient(#000 50%, transparent); }
.join-kicker { margin: 0; font-size: .8rem; font-weight: 750; color: var(--accent); letter-spacing: .02em; }
.join-card h1 { margin: 0; font-size: 1.8rem; font-weight: 850; }
.join-faces { display: flex; }
.join-faces .avatar { margin-left: -8px; box-shadow: 0 0 0 3px var(--bg); }
.join-faces .avatar:first-child { margin-left: 0; }

/* Top 8 */
.top8-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; }
.top8-friend { position: relative; display: grid; justify-items: center; gap: 4px; color: var(--text); font-size: .78rem; font-weight: 700; text-decoration: none !important; }
.top8-friend .avatar { transition: transform .2s var(--ease); }
.top8-friend:hover .avatar { transform: scale(1.06) rotate(-2deg); }
.top8-rank { position: absolute; top: -4px; left: 50%; margin-left: -30px; z-index: 1; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 850; color: #fff; background: var(--grad); box-shadow: 0 0 0 2px var(--bg); }
.top8-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top8-empty { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; border: 2px dashed color-mix(in srgb, var(--muted) 50%, transparent); background: transparent; color: var(--text-soft); text-align: left; cursor: pointer; font-weight: 600; }
.top8-empty .icon { flex: none; color: var(--accent); }
.top8-sheet { justify-items: stretch; text-align: left; max-height: 90dvh; overflow-y: auto; }
.top8-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
.top8-slot { position: relative; display: grid; justify-items: center; gap: 4px; min-height: 78px; font-size: .74rem; font-weight: 700; cursor: pointer; }
.top8-slot .avatar { width: 52px; height: 52px; }
.top8-slot .top8-rank { margin-left: -28px; }
.top8-plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed color-mix(in srgb, var(--muted) 55%, transparent); color: var(--muted); font-size: 1.3rem; }
.top8-search { margin-top: 4px; }
.top8-people { display: grid; gap: 2px; max-height: 38dvh; overflow-y: auto; }
.top8-person { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 14px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.top8-person span { display: grid; }
.top8-person.is-picked { background: var(--grad-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* "No algorithm, no ads" — said plainly on the way in */
.promise-chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.promise-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 650; background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.promise-chips .icon { width: 15px; height: 15px; color: var(--accent); }

/* ==========================================================================
   2.3 — glass dialogs, search, zoomable photos, swipe to delete, chat depth,
   chat themes and tools, live audio rooms, compact feed switch
   ========================================================================== */

/* Layers: the composer and chat-theme sheet open on top of the in-app panels */
.ps-backdrop, [data-ct-sheet] { z-index: 120; }

/* Glass dialog (replaces the browser's confirm box) */
.gd-backdrop {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px;
  background: rgba(5,5,15,0); transition: background-color .2s;
}
.gd-backdrop.open { background: rgba(5,5,15,.42); }
.gd {
  width: min(340px, 100%); padding: 22px 20px 16px; border-radius: 26px; text-align: center;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--edge-hi, rgba(255,255,255,.4)), 0 30px 70px -20px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(30px) saturate(200%); backdrop-filter: blur(30px) saturate(200%);
  opacity: 0; transform: scale(.94); transition: opacity .2s, transform .26s var(--ease);
}
.gd-backdrop.open .gd { opacity: 1; transform: none; }
.gd-title { margin: 0 0 6px; font-size: 1.08rem; font-weight: 800; line-height: 1.3; }
.gd-text { margin: 0 0 16px; font-size: .9rem; line-height: 1.45; }
.gd-title:last-child { margin-bottom: 14px; }
.gd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gd-actions.is-stack { grid-template-columns: 1fr; }
.gd-actions .btn { justify-content: center; min-height: 44px; }
.gd-actions .btn-danger { background: var(--danger); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -10px var(--danger); }

/* Search: opens over the page, ready to type */
.search-ov { position: fixed; inset: 0; z-index: 92; background: rgba(5,5,15,0); transition: background-color .22s; }
.search-ov.open { background: rgba(5,5,15,.38); }
.search-ov-panel {
  position: absolute; left: 10px; right: 10px; top: calc(env(safe-area-inset-top) + 8px);
  max-width: 620px; margin: 0 auto; border-radius: 26px; padding: 8px; border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--edge-hi, rgba(255,255,255,.4)), 0 24px 60px -20px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(32px) saturate(210%); backdrop-filter: blur(32px) saturate(210%);
  opacity: 0; transform: translateY(-10px) scale(.98); transition: opacity .2s, transform .26s var(--ease);
  max-height: calc(100dvh - 120px); display: flex; flex-direction: column;
}
.search-ov.open .search-ov-panel { opacity: 1; transform: none; }
.search-ov-form { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; }
.search-ov-form > .icon { color: var(--muted); flex: none; }
.search-ov-form input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 4px !important; font-size: 1rem; }
.search-ov-form input::-webkit-search-cancel-button { display: none; }
.search-ov-results { overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 2px; padding: 4px; }
.search-ov-results:empty { display: none; }
.so-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 16px; color: var(--text); }
.so-row:hover, .so-row:focus-visible, .so-row.is-active { background: var(--glass-hover); text-decoration: none; }
.so-row > span:last-child { display: grid; min-width: 0; }
.so-row strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); flex: none; }
.so-label { font-size: .72rem; font-weight: 750; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 2px; }

/* Photos: pinch, double-tap or scroll-wheel to zoom, drag to look around — no scroll bars */
.lightbox { z-index: 250; padding: 0; display: block; overflow: hidden; cursor: default; touch-action: none; overscroll-behavior: contain; }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.lb-stage img {
  max-width: 100vw; max-height: 100vh; max-height: 100dvh; border-radius: 0; box-shadow: none; animation: zoom-in .25s var(--ease);
  transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: zoom-in;
}
.lightbox.is-zoomed .lb-stage img { cursor: grab; }
.lightbox.is-dragging .lb-stage img { cursor: grabbing; }
.lbx-bar {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px; color: #fff;
  background: rgba(20,20,34,.55) !important; border: 1px solid rgba(255,255,255,.16);
}
.lbx-bar .icon-btn { color: #fff; }
.lb-hint { font-size: .78rem; font-weight: 650; opacity: .8; padding: 0 6px; white-space: nowrap; }
.lightbox.is-zoomed .lb-hint { display: none; }
.lightbox-close { display: none; }

/* Swipe left to delete (notifications and messages) */
.notif-wrap { position: relative; border-radius: var(--radius, 22px); }
.notif-wrap > .notif { position: relative; z-index: 1; touch-action: pan-y; will-change: transform; }
.notif-wrap.is-swiping > .notif { transition: none; }
.notif-wrap:not(.is-swiping) > .notif { transition: transform .28s var(--ease); }
.notif-del, .msg-del {
  position: absolute; top: 50%; right: 6px; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%;
  display: grid; place-items: center; border: 0; color: #fff; cursor: pointer;
  background: linear-gradient(180deg, #fb7185, #e11d48); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 18px -8px rgba(225,29,72,.9);
  opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--ease);
  pointer-events: none;
}
.notif-wrap.is-open .notif-del, .msg.is-open .msg-del { opacity: 1; transform: none; pointer-events: auto; }
.notif-wrap.is-removing, .msg.is-removing { animation: swipe-out .3s ease-in forwards; }
@keyframes swipe-out { to { opacity: 0; transform: translateX(-40%); max-height: 0; margin: 0; } }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-clear { margin-left: auto; padding: 6px 12px; font-size: .8rem; }
.ap-head h2 + .ap-clear + .icon-btn { margin-left: 0; }

/* Messages: deeper glass bubbles */
.msg { position: relative; }
.msg-row { display: flex; flex-direction: column; align-items: inherit; max-width: 100%; touch-action: pan-y; will-change: transform; }
.msg:not(.is-swiping) .msg-row, .msg:not(.is-swiping) .hmsg-who { transition: transform .28s var(--ease); }
.msg-bubble { position: relative; isolation: isolate; }
.msg-in .msg-bubble {
  background:
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.03) 60%),
    linear-gradient(var(--bubble-in-tint, transparent), var(--bubble-in-tint, transparent)),
    var(--glass-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(190%); backdrop-filter: blur(18px) saturate(190%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -1px 0 rgba(0,0,0,.06), 0 10px 24px -14px rgba(0,0,0,.55);
}
:root[data-theme="dark"] .msg-in .msg-bubble { box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.25), 0 12px 26px -14px rgba(0,0,0,.8); }
.msg-out .msg-bubble {
  background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0) 52%), var(--bubble-out, var(--grad));
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 6px rgba(0,0,0,.12), 0 10px 22px -12px color-mix(in srgb, var(--accent) 80%, transparent);
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.msg-bubble::after { /* soft specular glint on the top edge */
  content: ""; position: absolute; left: 12%; right: 12%; top: 1px; height: 40%; border-radius: inherit; z-index: -1;
  background: linear-gradient(180deg, rgba(255,255,255,.22), transparent); pointer-events: none; opacity: .7;
}
.msg-bubble.media-only { padding: 4px; }
.msg-bubble.has-media:not(.media-only) { padding: 4px 4px 9px; }
.msg-bubble.has-media .msg-text { padding: 6px 10px 0; }
.msg-media { display: grid; gap: 3px; border-radius: 14px; overflow: hidden; width: min(260px, 62vw); }
.msg-media.mm-2, .msg-media.mm-4 { grid-template-columns: 1fr 1fr; }
.msg-media.mm-3 { grid-template-columns: 1fr 1fr; }
.msg-media.mm-3 > :first-child { grid-column: span 2; }
.mm-item { position: relative; padding: 0; border: 0; background: rgba(0,0,0,.2); display: block; cursor: zoom-in; }
.mm-item img, .mm-item video { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.msg-media:not(.mm-1) .mm-item img, .msg-media:not(.mm-1) .mm-item video { aspect-ratio: 1; height: 100%; }
.mm-item .gif-badge { position: absolute; left: 6px; bottom: 6px; }
/* Desktop: a small delete button appears beside a message on hover */
@media (hover: hover) and (pointer: fine) {
  .msg:not(.is-open):not(.is-swiping) .msg-del { width: 32px; height: 32px; margin-top: -16px; }
  .msg-out:not(.is-open):not(.is-swiping) .msg-del { right: auto; left: -40px; }
  .msg-in:not(.is-open):not(.is-swiping) .msg-del { right: -40px; }
  .msg:not(.is-swiping):hover .msg-del { opacity: .9; transform: none; pointer-events: auto; }
}

/* Chat themes */
.chat-themed { --bubble-out: var(--grad); }
.chat-themed .dm-messages, .chat-themed .hud-msgs, .ap-msgs.chat-themed { background-image: var(--chat-wash, none); background-attachment: local; }
.ap-thread.chat-themed .ap-msgs { background-image: var(--chat-wash, none); }
.chat-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 14px; }
.ct-opt { display: grid; justify-items: center; gap: 4px; cursor: pointer; font-size: .74rem; font-weight: 650; color: var(--muted); }
.ct-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ct-swatch {
  width: 54px; height: 54px; border-radius: 18px; display: grid; align-content: center; gap: 4px; padding: 8px;
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.ct-swatch i { display: block; height: 10px; border-radius: 6px; background: var(--sw); }
.ct-swatch i:first-child { width: 70%; justify-self: end; }
.ct-swatch i:last-child { width: 55%; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.ct-opt input:checked + .ct-swatch { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); transform: scale(1.06); }
.ct-opt input:checked ~ small { color: var(--text); }
.ct-opt input:focus-visible + .ct-swatch { outline: 2px solid var(--accent); outline-offset: 3px; }
.ct-preview { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 20px; margin-bottom: 14px; border: 1px solid var(--glass-border); background-color: var(--glass); background-image: var(--chat-wash, none); }
.ct-preview .msg { animation: none; }
.ct-sheet h2 { display: flex; align-items: center; gap: 8px; }

/* Chat tools: + opens photo / gif / meme */
.dm-compose { position: relative; align-items: flex-end; }
.chat-plus { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--glass-border); transition: transform .25s var(--ease), background-color .2s; }
.chat-plus[aria-expanded="true"] { transform: rotate(45deg); background: var(--grad-soft); color: var(--accent); }
.chat-tray {
  position: absolute; left: 10px; bottom: calc(100% + 6px); z-index: 5; display: flex; gap: 6px; padding: 6px; border-radius: 22px;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(200%); backdrop-filter: blur(24px) saturate(200%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 16px 34px -16px rgba(0,0,0,.55);
  transform-origin: 20px 100%; animation: tray-in .26s var(--ease);
}
@keyframes tray-in { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.chat-tool { display: grid; justify-items: center; gap: 3px; padding: 6px 8px; border: 0; background: transparent; border-radius: 16px; color: var(--text); font: inherit; font-size: .7rem; font-weight: 650; cursor: pointer; min-width: 62px; }
.chat-tool:hover { background: var(--glass-hover); }
.chat-tool .co-ic { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; }
.post-sheet.is-chat .char-count { display: none; }

/* Huddle chat bar: live audio + theme */
.hud-chat-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.hud-voice-btn { margin-left: auto; }
.hud-voice-btn .icon { color: #f43f5e; }
.hud-live { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .8rem; font-weight: 700; }
.hud-live .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 0 0 rgba(244,63,94,.6); animation: live-pulse 1.6s infinite; flex: none; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgba(244,63,94,0); } 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); } }
.hud-live .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.hud-live .avatar:first-of-type { margin-left: 0; }
.live-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: .72rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #f43f5e, #ec4899); box-shadow: 0 6px 14px -8px #f43f5e; }

/* Live audio room: a glass bar that floats above the dock */
.voice-dock {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px)); padding: 10px 10px 10px 14px; border-radius: 26px;
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--glass-strong) 92%, transparent); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(30px) saturate(210%); backdrop-filter: blur(30px) saturate(210%);
  box-shadow: inset 0 1px 0 var(--edge-hi, rgba(255,255,255,.4)), 0 22px 50px -20px rgba(0,0,0,.6);
  animation: vd-in .35s var(--ease);
}
@media (min-width: 821px) { .voice-dock { bottom: 22px; } }
@keyframes vd-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.96); } }
.vd-label { display: grid; line-height: 1.2; min-width: 0; }
.vd-label strong { font-size: .86rem; display: flex; align-items: center; gap: 6px; }
.vd-label small { color: var(--muted); font-size: .72rem; }
.vd-people { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.vd-people::-webkit-scrollbar { display: none; }
.vd-person { position: relative; flex: none; border-radius: 50%; transition: box-shadow .12s; }
.vd-person .avatar { width: 38px; height: 38px; }
.vd-person.is-speaking { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #22c55e, 0 0 16px 2px rgba(34,197,94,.55); }
.vd-person.is-muted::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border-radius: 50%; background: #f43f5e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E") center / 10px no-repeat; box-shadow: 0 0 0 2px var(--bg); }
.vd-person.is-connecting { opacity: .55; }
.vd-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); cursor: pointer; }
.vd-btn.is-muted { background: color-mix(in srgb, #f43f5e 18%, var(--glass)); color: #f43f5e; }
.vd-leave { background: linear-gradient(180deg, #fb7185, #e11d48); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 18px -8px rgba(225,29,72,.9); }
body.in-voice .toasts { bottom: 170px; }

/* Following / everyone: one slim glass switch with a sliding pill, sitting in a tidy feed header */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.feed-seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px;
  width: 232px; max-width: 64%;
}
.feed-seg .fs-ind {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px;
  background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 14px -8px rgba(124,58,237,.9);
  transition: transform .32s var(--ease);
}
.feed-seg[data-feed="all"] .fs-ind { transform: translateX(100%); }
.feed-seg .tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 8px; font-size: .8rem; font-weight: 700; border-radius: 999px; background: transparent !important; box-shadow: none !important;
}
.feed-seg .tab .icon { width: 15px; height: 15px; }
.feed-seg .tab[aria-selected="true"] { color: #fff; }
.feed-order { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.feed-order .icon { width: 14px; height: 14px; }

/* 2.3 additions: swipe rows, viewer UI, live banner, room bar placement */
.convo-wrap { position: relative; border-radius: 14px; }
.swipe-wrap > .swipe-row { position: relative; z-index: 1; touch-action: pan-y; }
.swipe-wrap.is-swiping > .swipe-row { transition: none !important; }
.swipe-wrap:not(.is-swiping) > .swipe-row { transition: transform .28s var(--ease), background-color .2s; }
.convo-wrap.is-open > .dm-convo, .convo-wrap.is-swiping > .dm-convo { background: var(--glass-strong); }
.convo-wrap.is-open .notif-del, .convo-wrap.is-swiping .notif-del, .notif-wrap.is-swiping .notif-del, .msg.is-swiping .msg-del { opacity: 1; transform: none; pointer-events: auto; }
.swipe-wrap.is-armed .notif-del, .msg.is-armed .msg-del { transform: scale(1.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 0 6px rgba(244,63,94,.22), 0 10px 22px -8px rgba(225,29,72,1); }
.msg.is-swiping .msg-row, .msg.is-swiping .hmsg-who { transition: none !important; }
.notif-wrap.is-removing, .convo-wrap.is-removing, .msg.is-removing { overflow: hidden; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .swipe-wrap:not(.is-open):not(.is-swiping) .notif-del { z-index: 2; width: 30px; height: 30px; margin-top: -15px; right: 10px; }
  .swipe-wrap:not(.is-swiping):hover .notif-del { opacity: .92; transform: none; pointer-events: auto; }
  .swipe-wrap .notif-del .icon { width: 15px; height: 15px; }
}
.lightbox.hide-ui .lbx-bar { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
.lbx-bar { transition: opacity .2s, transform .25s var(--ease); }
.lightbox:focus { outline: none; }
.home-feed .feed { transition: opacity .22s ease, transform .28s var(--ease); }
.home-feed .feed.is-switching { opacity: 0; transform: translateY(6px); transition-duration: .15s; pointer-events: none; }
.home-feed .feed.is-arriving { opacity: 0; transform: translateY(-6px); transition: none; }

/* "maya + 2 more live now — join" inside the huddle header */
.hud-live-banner {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 10px 12px 10px 14px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, #f43f5e 40%, transparent); color: var(--text); font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, #f43f5e 18%, transparent), color-mix(in srgb, #ec4899 10%, transparent));
}
.hud-live-banner .live-dot, .live-chip .live-dot, .vd-label .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #f43f5e; animation: live-pulse 1.6s infinite; flex: none; display: inline-block; }
.live-chip .live-dot { background: #fff; }
.hud-live-banner .hlb-join { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 99px; color: #fff; background: linear-gradient(135deg, #f43f5e, #ec4899); font-size: .8rem; }
.hud-live-banner .hlb-join .icon { width: 15px; height: 15px; }
.huddle-card .live-chip { vertical-align: 2px; margin-left: 4px; }

/* The room bar sits under the top bar on phones, so it never covers the chat box or the keyboard */
@media (max-width: 820px) {
  .voice-dock { top: calc(env(safe-area-inset-top) + 68px); bottom: auto; animation-name: vd-in-top; }
  body.in-voice .toasts { bottom: 110px; }
}
@media (min-width: 821px) { .voice-dock { top: 18px; bottom: auto; animation-name: vd-in-top; } }
@keyframes vd-in-top { from { opacity: 0; transform: translate(-50%, -16px) scale(.96); } }
.voice-dock.out { opacity: 0; transform: translate(-50%, -12px) scale(.96); transition: opacity .2s, transform .25s; }
.vd-audio { display: none; }
body.in-voice .hud-chat { scroll-margin-top: 140px; }
.gd-actions .gd-alt { font-weight: 750; background: var(--glass-strong); }
@media (max-width: 820px) { body.in-voice .main { padding-top: 70px; } }

/* ---------- 2.3.1: text size (everything is sized in rem, so the whole app scales together) ---------- */
html[data-text-size="xs"]  { font-size: 87.5%; }
html[data-text-size="sm"]  { font-size: 93.75%; }
html[data-text-size="lg"]  { font-size: 112.5%; }
html[data-text-size="xl"]  { font-size: 125%; }
html[data-text-size="xxl"] { font-size: 137.5%; }
/* iPhone / iPad: follow Dynamic Type (Settings → Display & Brightness → Text Size). Other browsers ignore this
   and keep 100% of their own default size, which already follows the browser's font-size setting. */
html[data-text-size="device"] { font: -apple-system-body; font-family: inherit; }
/* The dock, top bar and menus keep their shape at any text size */
.tabbar .nav-link { font-size: min(.68rem, 12.5px); }
.topbar .brand { font-size: min(1.12rem, 19px); }
html[data-text-size="xl"] .post-actions, html[data-text-size="xxl"] .post-actions { flex-wrap: wrap; row-gap: 4px; }

.text-size { display: grid; gap: 10px; margin-top: 6px; }
.ts-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); transition: opacity .2s; }
.ts-row.is-off { opacity: .45; }
.ts-a { font-weight: 800; line-height: 1; color: var(--muted); }
.ts-a-sm { font-size: 13px; } .ts-a-lg { font-size: 24px; }
.ts-row input[type=range] { flex: 1; accent-color: var(--accent); height: 28px; }
.ts-label { margin: 0; text-align: center; font-weight: 750; font-size: .9rem; }
.ts-device { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.ts-device > span { display: grid; gap: 2px; }
.reset-look { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; justify-items: start; }
.reset-look p { margin: 0; }
/* Large text: long one-line labels shrink with "…" instead of pushing the page sideways */
.lblock, .composer-row, .composer-field { min-width: 0; }
.composer-field > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-head { flex-wrap: wrap; row-gap: 6px; }
.feed-seg { width: min(100%, 14.5rem); max-width: none; }

/* 2.3.2: the page color lives on <html>; <body> stays see-through so the wallpaper layer behind it shows.
   (An opaque body painted over the wallpaper ever since <html> got its own background color.)
   Body text is in rem so it follows the text-size setting. */
body { background: transparent; font-size: .9375rem; }
/* Sheets follow the visible screen: with the keyboard up they sit right above it and scroll inside */
.sheet-backdrop:not(.ps-backdrop) { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); transition: height .18s ease-out; }
.sheet-backdrop:not(.ps-backdrop) .sheet { max-height: calc(var(--vv-h, 100dvh) - 16px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain; }
/* A bigger, easier ✕ on the alerts and messages panels */
.ap-head [data-ap-close] { width: 44px; height: 44px; margin: -4px -4px -4px 0; flex: none; }
.ap-head [data-ap-close] .icon { width: 22px; height: 22px; }

/* ---------- 2.4: one compact tab style everywhere (feed, profile, huddles, admin) ---------- */
.tabs { padding: 3px; gap: 2px; }
.tabs .tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 10px; font-size: .8rem; font-weight: 700; border: 0; background: transparent;
}
.tabs .tab .icon { width: 15px; height: 15px; flex: none; }
.tabs .tab[aria-selected="true"] {
  color: #fff; background: var(--grad);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 6px 14px -8px color-mix(in srgb, var(--accent) 90%, transparent);
}
.tabs .tab .dot-badge { min-width: 17px; height: 17px; font-size: .64rem; margin-left: 2px; }
.tabs-compact { width: fit-content; max-width: 100%; justify-self: start; }
.tabs-compact .tab { flex: none; padding: 6px 14px; }
.hud-tabs .tab { padding: 6px 6px; font-size: .8rem; }

/* Friend buttons */
.friend-btns { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.friend-btns .btn .icon { width: 15px; height: 15px; }
.friend-btns .fb-friends .icon { color: var(--success, #22c55e); }
.friend-btns .fb-decline { padding-left: 9px; padding-right: 9px; }
.pf-top-actions .friend-btns .btn-ghost { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.28); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.pf-req-link strong { color: var(--accent); }
.profile-handle .pill .icon { width: 12px; height: 12px; vertical-align: -1px; }

/* A friend request right inside the notification */
.notif-wrap.has-actions > .notif { padding-bottom: 56px; }
.notif-actions { position: absolute; left: 70px; bottom: 12px; z-index: 2; display: flex; gap: 6px; transition: opacity .2s; }
.notif-wrap.is-open .notif-actions, .notif-wrap.is-swiping .notif-actions { opacity: 0; pointer-events: none; }
.notif-done { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 6px 2px; }
.notif-icon.notif-freq, .notif-icon.notif-follow, .notif-icon.notif-friend { color: var(--accent); }
.profile-handle .pill .icon { margin-right: 3px; }

/* Alerts and messages on phones: a strip of the page stays visible on the left — tap it (or any empty
   space in the panel) to close. Chats still use the whole screen. */
@media (max-width: 640px) {
  .app-panel { width: calc(100vw - 44px); border-radius: 26px 0 0 26px; border-left: 1px solid var(--glass-border); }
  body.ap-in-thread .app-panel { width: 100vw; border-radius: 0; border-left: 0; }
}

/* ---------- 2.4.3: glints creator goes full screen on phones, like a native camera ---------- */
.glint-bottom { display: grid; gap: 12px; }
@media (max-width: 820px) {
  .glint-create-backdrop { padding: 0 !important; align-items: stretch !important; background: #000 !important; -webkit-backdrop-filter: none; backdrop-filter: none; top: 0 !important; height: 100% !important; }
  .glint-create {
    position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none;
    margin: 0; padding: 0; border: 0; border-radius: 0; background: #000 !important; display: block; overflow: hidden;
    -webkit-backdrop-filter: none; backdrop-filter: none; animation: gc-in .28s var(--ease);
  }
  @keyframes gc-in { from { opacity: 0; transform: scale(1.03); } }
  .glint-create .sheet-grip { display: none; }
  .glint-create .glint-canvas { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  /* top: close + type switch float over the picture */
  .glint-create-head { position: absolute; z-index: 6; top: calc(env(safe-area-inset-top) + 10px); left: 12px; right: auto; }
  .glint-create-head h2 { display: none; }
  .glint-create-head .icon-btn, .glint-create .glint-flip { width: 44px; height: 44px; color: #fff; background: rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.18); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .glint-create .glint-mode {
    position: absolute; z-index: 6; top: calc(env(safe-area-inset-top) + 12px); left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,.38) !important; border: 1px solid rgba(255,255,255,.16); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .glint-create .glint-mode label { color: rgba(255,255,255,.85); padding: 7px 11px; font-size: .8rem; }
  .glint-create .glint-flip { top: calc(env(safe-area-inset-top) + 10px); right: 12px; }
  .glint-create .glint-rec-time { top: calc(env(safe-area-inset-top) + 66px); }
  .glint-create .glint-clear { top: calc(env(safe-area-inset-top) + 10px); right: 12px; width: 44px; height: 44px; }
  .glint-create .glint-shutter { bottom: calc(env(safe-area-inset-bottom) + 46px); width: 84px; height: 84px; margin-left: -42px; }
  .glint-create .glint-cam-hint { bottom: calc(env(safe-area-inset-bottom) + 16px); }
  .glint-create .glint-text-input { padding-top: 45% !important; font-size: 1.7rem !important; }
  /* bottom: caption + share float over the picture once there's something to share */
  .glint-create .glint-bottom {
    position: absolute; z-index: 6; left: 0; right: 0; bottom: var(--kb, 0px); gap: 10px;
    padding: 40px 14px calc(env(safe-area-inset-bottom) + 14px);
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.55) 40%, rgba(0,0,0,.75));
  }
  .glint-create .glint-caption { background: rgba(255,255,255,.14) !important; border-color: rgba(255,255,255,.2) !important; color: #fff !important; }
  .glint-create .glint-caption::placeholder { color: rgba(255,255,255,.7); }
  .glint-create .glint-note { color: rgba(255,255,255,.65); }
  /* while the camera is live, only the shutter shows at the bottom */
  .glint-create:has(.glint-cam-ui:not([hidden])) .glint-bottom { display: none; }
  .glint-create:has(.glint-pick:not([hidden])) .glint-bottom .btn { opacity: .6; }
}
/* GIPHY credit: still there (their terms ask for it) but tiny and quiet */
.giphy-credit { margin: -2px 4px 0; font-size: .56rem; font-weight: 600; letter-spacing: .02em; line-height: 1.2; color: var(--muted); opacity: .45; text-align: right; }
/* Photo editor: cropping photos in posts, and the cover's phone / computer guides */
.pe-backdrop { z-index: 130; }
.pe-cover .pe-stage { aspect-ratio: 4 / 3; }
.pe-post .pe-stage { width: min(100%, calc(52dvh * var(--ar, 1))); }
.pe-aspects { justify-self: center; }
.pe-guides { display: none; position: absolute; inset: 0; pointer-events: none; }
.pe-cover .pe-guides { display: block; }
.pe-guides span { position: absolute; border: 1.5px dashed rgba(255,255,255,.75); border-radius: 10px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.pe-guides i { position: absolute; left: 6px; top: 4px; font-style: normal; font-size: .62rem; font-weight: 750; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
/* phones show a tall slice of the middle (about 4:5), computers a wide band (about 5:2) */
.pg-phone { top: 3%; bottom: 3%; left: 50%; width: 57%; transform: translateX(-50%); }
.pg-wide { left: 3%; right: 3%; top: 50%; height: 55%; transform: translateY(-50%); border-color: rgba(125,211,252,.85) !important; }
.pg-wide i { left: auto; right: 6px; }
.ps-edit {
  position: absolute; left: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center;
  color: #fff; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer;
}
.ps-edit .icon { width: 15px; height: 15px; }
@media (max-width: 820px) {
  .glint-create-backdrop .glint-create { max-height: none !important; height: 100dvh !important; overflow: hidden !important; }
  .glint-create .glint-mode { display: flex; flex-wrap: nowrap; white-space: nowrap; padding: 3px; gap: 2px; max-width: calc(100vw - 128px); }
  .glint-create .glint-mode label { display: inline-flex; align-items: center; gap: 4px; padding: 7px 10px; font-size: .74rem; }
  .glint-create .glint-mode label .icon { width: 14px; height: 14px; }
}
/* While typing in a sheet, the page behind can't scroll away (iPhone would otherwise move the page, not the sheet) */
html.sheet-typing, html.sheet-typing body { overflow: hidden; }

/* ---------- 2.4.5: a slimmer dock that tucks away while you scroll down ---------- */
@media (max-width: 820px) {
  .tabbar {
    padding: 4px; border-radius: 26px; bottom: calc(10px + env(safe-area-inset-bottom));
    /* its own layer: no jumping when the page height changes mid-scroll (some themes on iPhone) */
    transform: translate3d(0, 0, 0); will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden;
    transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), opacity .3s ease;
  }
  .tabbar .nav-link { padding: 5px 8px 4px; gap: 1px; min-width: 52px; font-size: min(.64rem, 11.5px); border-radius: 18px; }
  .tabbar .nav-link .icon { width: 21px; height: 21px; }
  .tab-compose .nav-icon { width: 40px; height: 40px; border-radius: 14px; }
  body.dock-away .tabbar { transform: translate3d(0, calc(100% + 26px + env(safe-area-inset-bottom)), 0); opacity: 0; transition: transform .32s cubic-bezier(.5, 0, .75, 0), opacity .25s ease .05s; pointer-events: none; }
  .shell, .shell.no-right { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Glint rings: room for the colored ring and its glow (it was clipped at the top) */
.glint-scroll { padding-top: 6px; padding-bottom: 4px; margin-top: -6px; }
.glint-tray { overflow: visible; }

/* Notifications: a little more air between lines */
.notif { gap: 12px; padding: 14px 16px; align-items: flex-start; }
.notif > .avatar, .notif > .notif-icon { margin-top: 2px; }
.notif-text { line-height: 1.38; font-size: .92rem; }
.notif-text strong { font-weight: 750; }
.notif-snippet { margin-top: 4px; }
.notif-wrap.has-actions > .notif { padding-bottom: 58px; }
.notif-actions { left: 82px; }
.notif-done { display: inline-block; padding: 6px 12px; border-radius: 99px; background: var(--grad-soft); color: var(--accent); }

/* Invite sheet */
.hud-invite { justify-items: stretch; text-align: left; gap: 12px; }
.hud-invite h2 { text-align: center; font-size: 1.1rem; }
.hi-share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hi-opt { display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border-radius: 18px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font: inherit; font-weight: 750; font-size: .86rem; cursor: pointer; }
.hi-opt small { font-weight: 600; font-size: .7rem; color: var(--muted); }
.hi-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.hi-ic-share { background: linear-gradient(135deg, #22c55e, #0ea5e9); }
.hi-ic-copy { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.hi-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 16px; background: var(--input); border: 1px solid var(--input-border); }
.hi-search .icon { color: var(--muted); }
.hi-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 11px 0 !important; }
.hi-label { font-size: .74rem; font-weight: 750; color: var(--muted); letter-spacing: .03em; padding: 0 4px; }
.hi-list { display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; overscroll-behavior: contain; }
.hi-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.hi-who { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.hi-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.join-kicker { display: inline-flex; align-items: center; gap: 6px; }
.join-actions { display: grid; gap: 8px; width: 100%; max-width: 320px; margin-top: 8px; }

/* ---------- 2.5: videos — a full-screen, swipe-up feed of public video posts ---------- */
.feed-videos {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px 6px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; color: var(--text); white-space: nowrap;
}
.feed-videos .icon { width: 13px; height: 13px; color: var(--accent); fill: currentColor; }
.feed-videos:hover { background: var(--glass-hover); }
.feed-head .feed-order { margin-left: auto; }
.pm-vfeed {
  position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px 5px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff;
  background: rgba(0,0,0,.42); -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255,255,255,.22);
}
.pm-vfeed .icon { width: 12px; height: 12px; fill: currentColor; }

body.page-videos { --vs-bottom: 22px; --vs-top: 16px; }
body.page-videos .main { display: block; }
.vfeed {
  position: relative; height: calc(100vh - 40px); height: calc(100dvh - 40px); max-width: 470px; margin: 0 auto;
  overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none;
  border-radius: 28px; background: #000; color: #fff; isolation: isolate;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.08);
}
body.page-videos .shell { padding-top: 20px; padding-bottom: 20px; }
.vfeed::-webkit-scrollbar { display: none; }
.vf-head {
  position: sticky; top: 0; z-index: 8; height: 0; display: flex; align-items: flex-start; justify-content: space-between;
  pointer-events: none;
}
.vf-head > * { pointer-events: auto; margin-top: var(--vs-top); }
.vf-head .icon-btn { margin-left: 10px; margin-right: 10px; color: #fff; background: rgba(0,0,0,.28); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.18); }
.vf-title { margin-top: calc(var(--vs-top) + 8px); font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0,0,0,.6); pointer-events: none; }
.vf-back { visibility: hidden; }

.vslide.post {
  position: relative; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: #000; overflow: hidden;
  scroll-snap-align: start; scroll-snap-stop: always; color: #fff; contain: layout paint;
}
.vslide.post:hover { border-color: transparent; }
.vs-stage { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-y; }
.vs-stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; pointer-events: none; }
.vslide.is-portrait .vs-stage video { object-fit: cover; }
.vs-stage::before, .vs-stage::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; }
.vs-stage::before { top: 0; height: 120px; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.vs-stage::after { bottom: 0; height: 46%; background: linear-gradient(transparent, rgba(0,0,0,.2) 35%, rgba(0,0,0,.72)); }
.vs-paused {
  position: absolute; z-index: 2; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.3); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.22); opacity: 0; transform: scale(1.3); transition: opacity .2s, transform .25s var(--ease); pointer-events: none;
}
.vs-paused .icon { width: 30px; height: 30px; fill: #fff; margin-left: 4px; }
.vslide.is-paused .vs-paused { opacity: 1; transform: none; }
.vs-burst { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.vs-heart { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; font-size: 84px; line-height: 96px; text-align: center; animation: vs-heart .9s cubic-bezier(.2,.9,.3,1.2) forwards; filter: drop-shadow(0 6px 18px rgba(244,63,94,.6)); }
@keyframes vs-heart { 0% { transform: scale(.2) rotate(-14deg); opacity: 0; } 18% { transform: scale(1.15) rotate(-8deg); opacity: 1; } 32% { transform: scale(.95) rotate(-8deg); } 70% { transform: scale(1) rotate(-8deg) translateY(0); opacity: 1; } 100% { transform: scale(.9) rotate(-8deg) translateY(-90px); opacity: 0; } }
.vs-progress { position: absolute; left: 14px; right: 14px; bottom: calc(var(--vs-bottom) - 10px); height: 3px; border-radius: 3px; background: rgba(255,255,255,.22); z-index: 2; overflow: hidden; }
.vs-progress i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: #fff; border-radius: inherit; }

.vs-info { position: absolute; left: 14px; right: 78px; bottom: var(--vs-bottom); z-index: 4; display: grid; gap: 8px; text-shadow: 0 1px 6px rgba(0,0,0,.55); }
.vs-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vs-avatar .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.vs-name { display: grid; min-width: 0; color: #fff; line-height: 1.25; }
.vs-name strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-name small { font-size: .76rem; opacity: .82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-author .friend-btns { flex: none; }
.vs-author .friend-btns .btn { padding: 5px 11px; font-size: .74rem; text-shadow: none; }
.vs-author .friend-btns .btn .icon { width: 14px; height: 14px; }
.vs-caption {
  font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vs-caption.is-open { display: block; max-height: 38vh; overflow-y: auto; }
.vs-caption a { color: #fff; font-weight: 700; }
.vs-more { justify-self: start; font-size: .74rem; color: #fff; background: rgba(255,255,255,.16); text-shadow: none; }

.vs-rail { position: absolute; right: 8px; bottom: var(--vs-bottom); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.vs-rail .vs-act { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vs-rail .action, .vs-rail button.vs-act {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: 0; background: none !important;
  color: #fff; font-size: .7rem; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.6); box-shadow: none; min-width: 0; cursor: pointer;
}
.vs-rail .action > .icon, .vs-rail .react-face, .vs-rail .vs-snd-off, .vs-rail .vs-snd-on {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; box-sizing: border-box; padding: 12px;
  background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 20px -10px rgba(0,0,0,.7);
  transition: transform .2s var(--ease), background-color .2s;
}
.vs-rail .vs-snd-off .icon, .vs-rail .vs-snd-on .icon { width: 22px; height: 22px; }
.vs-rail .action:active > .icon, .vs-rail .action:active .react-face, .vs-rail .action:active .vs-snd-off, .vs-rail .action:active .vs-snd-on { transform: scale(.9); }
.vs-rail .react-face .icon { width: 24px; height: 24px; }
.vs-rail .react-emoji { font-size: 1.5rem; }
.vs-rail .react-btn.is-on .react-face { background: rgba(255,255,255,.24); }
.vs-rail .react-btn.react-heart { color: #fb7185; }
.vs-rail .react-btn.react-heart .react-face .icon { fill: currentColor; }
.vs-rail .react-label { font-size: .7rem; }
.vs-rail .react-btn.is-on .react-label { display: none; }
.vs-rail .react-sum { padding: 2px 7px 2px 4px; gap: 3px; color: #fff; font-size: .7rem; background: rgba(0,0,0,.25); }
.vs-rail .react-sum .rs-e { font-size: .82rem; }
.vs-rail .count { color: #fff; font-size: .7rem; }
.vfeed:not(.is-muted) .vs-snd-off, .vfeed.is-muted .vs-snd-on { display: none !important; }
.vs-rail .menu { right: 54px; left: auto; bottom: 0; top: auto; color: var(--text); text-shadow: none; }

.vs-comments {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; max-height: 72%; display: flex; flex-direction: column;
  border-radius: 26px 26px 0 0; color: var(--text); padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  animation: vs-sheet .32s var(--ease); text-shadow: none;
}
.vs-comments[hidden] { display: none; }
@keyframes vs-sheet { from { transform: translateY(100%); } }
.vs-comments-head { position: relative; display: flex; align-items: center; justify-content: center; padding: 14px 0 8px; flex: none; }
.vs-comments-head .sheet-grip { position: absolute; top: 6px; left: 50%; margin-left: -18px; }
.vs-comments-head h2 { margin: 0; font-size: .95rem; }
.vs-comments-head .icon-btn { position: absolute; right: -4px; top: 8px; }
.vs-comments .comment-list { flex: 1 1 auto; min-height: 90px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px 10px; }
.vs-comments .comment-form { flex: none; padding-top: 10px; border-top: 1px solid var(--line); }
.vs-end { height: 0; }
.vs-end:not([hidden]) { height: 90px; display: grid; place-items: center; scroll-snap-align: end; }
.vs-end .pill { color: #fff; background: rgba(255,255,255,.12); }
.vs-empty { display: grid; place-items: center; padding: 24px; }
.vs-empty .empty { max-width: 320px; color: var(--text); }
.vs-empty .empty .btn { margin-top: 8px; }

@media (max-width: 820px) {
  body.page-videos { --vs-bottom: calc(80px + env(safe-area-inset-bottom)); --vs-top: calc(8px + env(safe-area-inset-top)); overflow: hidden; }
  body.page-videos .topbar { display: none; }
  body.page-videos .shell { padding: 0; }
  body.page-videos #main { animation: none; }
  .vfeed { position: fixed; inset: 0; height: auto; max-width: none; border-radius: 0; box-shadow: none; z-index: 1; }
  .vf-back { visibility: visible; }
  body.page-videos .tabbar { background: rgba(20,20,24,.38); border-color: rgba(255,255,255,.14); color: #fff; }
  body.page-videos .tabbar .nav-link { color: rgba(255,255,255,.86); }
  .vs-comments { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .vs-rail { right: 6px; }
}
@media (min-width: 821px) and (max-height: 640px) { .vs-rail { gap: 8px; } .vs-rail .action > .icon, .vs-rail .react-face, .vs-rail .vs-snd-off, .vs-rail .vs-snd-on { width: 42px; height: 42px; padding: 10px; } }
@media (prefers-reduced-motion: reduce) { .vs-heart { animation-duration: .01s; } .vs-comments { animation: none; } }
/* replies over a bright video: thicker glass so text stays readable */
.vs-comments.glass-strong { background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); }
.vs-rail .react-sum .rs-e { box-shadow: none; background: transparent; width: 16px; height: 16px; margin-left: -3px; }
.feed-head { flex-wrap: nowrap; }
@media (max-width: 520px) { .feed-head .feed-order { display: none; } }
.vslide:has(.vs-comments:not([hidden])) .vs-info, .vslide:has(.vs-comments:not([hidden])) .vs-progress { opacity: 0; transition: opacity .2s; }

/* ---------- 2.5: link preview cards ---------- */
.link-card {
  position: relative; display: grid; margin: 10px 0 4px; border-radius: 18px; overflow: hidden;
  background: var(--input); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
}
.link-card.lc-in { animation: rise .35s var(--ease); }
.link-card a { color: inherit; text-decoration: none; }
.lc-media { position: relative; display: block; background: #0b0b12; overflow: hidden; max-height: 520px; }
.lc-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.lc-media:hover img { transform: scale(1.02); }
.lc-tall .lc-media { max-height: 480px; }
.lc-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lc-media.is-playing { aspect-ratio: 16 / 9 !important; }
.lc-tall .lc-media.is-playing { aspect-ratio: 9 / 16 !important; max-height: 600px; }
.lc-play {
  position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.38);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,255,255,.3); box-shadow: 0 10px 30px -10px rgba(0,0,0,.7); transition: transform .2s var(--ease);
}
.lc-play .icon { width: 24px; height: 24px; fill: currentColor; margin-left: 3px; }
.lc-media:hover .lc-play { transform: scale(1.08); }
.lc-text { display: grid; gap: 3px; padding: 11px 14px 12px; min-width: 0; }
.lc-site { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650; color: var(--muted); text-transform: lowercase; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lc-site .icon { width: 13px; height: 13px; flex: none; }
.lc-title { font-size: .95rem; line-height: 1.3; font-weight: 750; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lc-desc { font-size: .84rem; line-height: 1.38; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lc-thumb { grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
.lc-thumb .lc-media { aspect-ratio: 1 !important; height: 100%; min-height: 96px; max-height: none; border-right: 1px solid var(--line); }
.lc-thumb .lc-desc { -webkit-line-clamp: 1; }
.lc-plain .lc-text { padding: 12px 14px; }
.link-card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--glass-border)); }
.lc-pending { min-height: 74px; align-content: end; padding: 12px 14px; }
.lc-shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--text) 7%, transparent) 50%, transparent 80%); background-size: 220% 100%; animation: lc-shimmer 1.3s linear infinite; }
@keyframes lc-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.lc-pending .lc-site { position: relative; }
/* in the composer */
.ps-link { position: relative; margin: 2px 14px 6px; }
.ps-link .link-card { margin: 0; }
.ps-link .lc-media { max-height: 220px; }
.ps-link .lc-play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
.ps-link-x {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.5); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ps-link-x .icon { width: 16px; height: 16px; }
@media (max-width: 820px) { .link-card { border-radius: 16px; } .lc-thumb { grid-template-columns: 84px minmax(0, 1fr); } .lc-thumb .lc-media { min-height: 84px; } }

/* ---------- 2.5: reactions on chat messages ---------- */
.msg .msg-bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .2s var(--ease); }
.msg .msg-bubble.rx-held { transform: scale(.96); }
.msg-rx {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 1px; margin: -9px 8px 0; padding: 2px 7px 2px 5px;
  border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass-strong); color: var(--text);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow: 0 4px 12px -6px rgba(0,0,0,.45); font-size: .8rem; line-height: 1.25; cursor: pointer;
}
.msg-rx span { font-size: .85rem; }
.msg-rx b { margin-left: 3px; font-size: .72rem; font-weight: 750; color: var(--muted); }
.msg-rx.is-mine { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-border)); }
.msg-rx.pop { animation: rx-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes rx-pop { from { transform: scale(.3); opacity: 0; } }
.msg-rx + .msg-time { margin-top: 3px; }
.msg-rb {
  position: absolute; top: 50%; margin-top: -16px; width: 32px; height: 32px; border-radius: 50%; display: none; place-items: center;
  border: 1px solid var(--glass-border); background: var(--glass-strong); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s;
}
.msg-rb .icon { width: 16px; height: 16px; }
.msg-out .msg-rb { left: -76px; }
.msg-in .msg-rb { right: -76px; }
@media (hover: hover) and (pointer: fine) {
  .msg-rb { display: grid; }
  .msg:hover .msg-rb, .msg-rb:focus-visible { opacity: 1; }
  .msg .msg-bubble { -webkit-user-select: text; user-select: text; }
}
.msg.is-swiping .msg-rb, .msg.is-open .msg-rb { display: none; }
/* 2.5.2: videos from other sites play inside the card */
.lc-media.is-playing { aspect-ratio: 16 / 9 !important; background: #000; max-height: none; }
.lc-media.is-playing.is-tall { aspect-ratio: 9 / 16 !important; width: min(100%, 340px); margin: 0 auto; border-radius: 0; }
.lc-tall:has(.is-playing) { background: #000; }
.lc-media.is-playing video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.lc-stop {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.5); color: #fff; cursor: pointer; opacity: .75;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lc-stop .icon { width: 15px; height: 15px; }
.lc-stop:hover { opacity: 1; }
.lc-noimg { display: grid; place-items: center; background: radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--accent) 55%, #000), #0b0b14 70%); }
.lc-noimg-site { position: absolute; left: 14px; bottom: 10px; color: rgba(255,255,255,.75); font-size: .74rem; font-weight: 700; }
.lc-playable .lc-media { cursor: pointer; }

/* ---------- 2.5.3: sound groups ---------- */
.snd-types { margin-top: 4px; transition: opacity .2s; }
.snd-types.is-off { opacity: .45; pointer-events: none; }
.snd-grid { display: grid; gap: 6px; margin-top: 6px; }
.snd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--input); border: 1px solid var(--input-border); cursor: pointer; }
.snd-ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); }
.snd-ic .icon { width: 18px; height: 18px; }
.snd-txt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.snd-txt strong { font-size: .9rem; }
.snd-txt small { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snd-try { flex: none; color: var(--muted); }
.snd-item .switch { transform: scale(.85); transform-origin: right center; }

/* ---------- 2.5.3: profile music ---------- */
.pf-music .panel-title .icon { color: var(--accent); }
.pm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pm-track {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 8px; border: 0; border-radius: 12px; background: transparent;
  color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: background-color .15s;
}
.pm-track:hover, .pm-track.is-current { background: var(--glass-hover); }
.pm-n { position: relative; width: 26px; height: 26px; flex: none; display: grid; place-items: center; font-size: .78rem; font-weight: 750; color: var(--muted); }
.pm-n .pm-pi { position: absolute; width: 14px; height: 14px; fill: currentColor; opacity: 0; }
.pm-track:hover .pm-num { opacity: 0; }
.pm-track:hover .pm-pi { opacity: 1; color: var(--accent); }
.pm-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.pm-eq i { width: 3px; border-radius: 2px; background: var(--accent); animation: pm-eq 0.9s ease-in-out infinite; }
.pm-eq i:nth-child(2) { animation-delay: -.3s; } .pm-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes pm-eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }
.pm-track.is-playing .pm-num, .pm-track.is-playing:hover .pm-pi { opacity: 0; }
.pm-track.is-playing .pm-eq { display: inline-flex; }
.pm-meta { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.pm-meta strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-meta small { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-track.is-current .pm-meta strong { color: var(--accent-ink); }
.pm-star { color: #f59e0b; font-size: .9rem; }

.pmusic {
  position: fixed; z-index: 29; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(420px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px 8px; border-radius: 22px; overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); animation: rise .4s var(--ease);
}
.pmusic[hidden] { display: none; }
.pmusic-art { position: relative; width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.pmusic-art .icon { width: 20px; height: 20px; }
.pmusic-art .pm-eq { position: absolute; }
.pmusic-art .pm-eq i { background: #fff; }
.pmusic.is-playing .pmusic-art .icon { display: none; }
.pmusic.is-playing .pmusic-art .pm-eq { display: inline-flex; height: 18px; }
.pmusic-meta { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.pmusic-meta small { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmusic-meta strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmusic-meta small:empty { display: none; }
.pmusic-btn { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: var(--grad); cursor: pointer; box-shadow: 0 8px 18px -8px rgba(124,58,237,.9); }
.pmusic-btn .icon { width: 18px; height: 18px; fill: currentColor; }
.pmusic-btn .pm-play { margin-left: 2px; }
.pmusic .pm-pause, .pmusic.is-playing .pm-play { display: none; }
.pmusic.is-playing .pm-pause { display: block; }
.pmusic.needs-tap .pmusic-btn { animation: pm-pulse 1.6s ease-in-out infinite; }
@keyframes pm-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 50% { box-shadow: 0 0 0 9px transparent; } }
.pmusic-x { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.pmusic-x .icon { width: 16px; height: 16px; }
.pmusic-progress { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.pmusic-progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .25s linear; }
@media (max-width: 820px) {
  .pmusic { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* settings → music */
.ms-list { display: grid; gap: 6px; margin: 8px 0 10px; }
.ms-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 16px; background: var(--input); border: 1px solid var(--input-border); }
.ms-row.is-song { border-color: color-mix(in srgb, #f59e0b 55%, var(--input-border)); }
.ms-play { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent); cursor: pointer; }
.ms-play .icon { width: 15px; height: 15px; fill: currentColor; }
.ms-play.is-playing { background: var(--grad); color: #fff; }
.ms-fields { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ms-fields input { padding: 4px 8px !important; border-radius: 9px !important; background: transparent !important; border-color: transparent !important; font-size: .88rem; min-width: 0; }
.ms-fields input:focus { background: var(--input) !important; border-color: var(--input-border) !important; }
.ms-fields input[data-ms-title] { font-weight: 700; }
.ms-fields input[data-ms-artist] { font-size: .78rem; color: var(--muted); }
.ms-star { width: 34px; height: 34px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; opacity: .55; }
.ms-row.is-song .ms-star { color: #f59e0b; opacity: 1; }
.ms-move .icon { transform: rotate(90deg); }
.ms-row:first-child .ms-move { visibility: hidden; }
.ms-add { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ms-progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 8px 0; }
.ms-progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.ms-visit { margin-top: 14px; }
.seg-choice { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.seg-choice label { cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg-choice span { display: inline-block; padding: 7px 13px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--input); border: 1px solid var(--input-border); }
.seg-choice input:checked + span { background: var(--grad); color: #fff; border-color: transparent; }
.seg-choice input:focus-visible + span { box-shadow: var(--focus); }

/* 2.5.3: video links show just the video */
.link-card.lc-bare { background: #000; }
.lc-bare .lc-media { max-height: 640px; }
.lc-bare.lc-tall .lc-media:not(.is-playing) { aspect-ratio: 9 / 16 !important; width: min(100%, 360px); margin: 0 auto; max-height: none; }
.lc-bare.lc-tall { background: #000; }
.lc-src {
  position: absolute; top: 10px; left: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 750; color: #fff !important; background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
}
.lc-src .icon { width: 11px; height: 11px; fill: currentColor; }
.lc-media.is-loading .lc-play { animation: lc-load 1s ease-in-out infinite; }
@keyframes lc-load { 50% { transform: scale(.88); opacity: .7; } }
.lc-media.is-playing.is-tall { max-height: none; }
/* videos feed: clips from other sites */
.vs-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; filter: saturate(1.05); }
.vslide.is-portrait .vs-poster { object-fit: cover; }
.vs-stage > video ~ .vs-poster { display: none; }
.vs-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; background: #000; }
.vs-embed [data-vs-mute] { display: none !important; }
.vs-src {
  position: absolute; z-index: 4; left: 14px; top: calc(var(--vs-top) + 52px); display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 8px;
  border-radius: 999px; font-size: .72rem; font-weight: 750; color: #fff; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.vs-src .icon { width: 11px; height: 11px; fill: currentColor; }
.vs-embed .vs-src { display: none; }
.vs-unplayable .vs-paused { opacity: 1; transform: none; }

/* ---------- 2.5.4: top 10 from Apple Music & Spotify ---------- */
.ms-src { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: .64rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap; line-height: 1.4; }
.ms-src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ms-src-apple { color: #fa2d48; background: color-mix(in srgb, #fa2d48 14%, transparent); }
.ms-src-spotify { color: #1db954; background: color-mix(in srgb, #1db954 15%, transparent); }
.ms-src-upload { color: var(--muted); background: var(--input); }
.ms-search { display: grid; gap: 8px; margin: 10px 0 6px; }
.ms-search-row { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 999px; background: var(--input); border: 1px solid var(--input-border); }
.ms-search-row .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ms-search-row input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; padding: 11px 0 !important; box-shadow: none !important; }
.ms-results { display: grid; gap: 4px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border-radius: 18px; background: color-mix(in srgb, var(--input) 60%, transparent); margin-bottom: 8px; }
.msr-row, .ms-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 14px; }
.msr-row:hover { background: var(--glass-hover); }
.ms-play { position: relative; width: 48px; height: 48px; flex: none; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--grad-soft); cursor: pointer; }
.ms-play:disabled { cursor: default; }
.ms-art, .pm-art { display: grid; place-items: center; width: 100%; height: 100%; color: var(--accent); }
.ms-art img, .pm-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-art .icon, .pm-art .icon { width: 20px; height: 20px; }
.ms-pi { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; color: #fff; fill: #fff; opacity: 0; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); transition: opacity .15s; }
.ms-play:not(:disabled):hover .ms-pi, .ms-play.is-current .ms-pi { opacity: 1; }
.ms-play.is-playing::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.ms-play.is-playing .ms-pi { opacity: 0; }
.ms-play.is-playing { box-shadow: 0 0 0 2px var(--accent); }
.ms-meta { flex: 1; min-width: 0; display: grid; gap: 1px; justify-items: start; line-height: 1.3; }
.ms-meta strong { font-size: .9rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-meta small { font-size: .76rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-meta .ms-src { margin-top: 2px; }
.ms-h { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; font-size: .95rem; }
.ms-list { counter-reset: rank; gap: 4px; }
.ms-row { background: var(--input); border: 1px solid var(--input-border); padding: 6px 8px 6px 4px; }
.ms-rank { width: 22px; flex: none; text-align: center; font-weight: 800; font-size: .85rem; color: var(--muted); }
.ms-rank::before { counter-increment: rank; content: counter(rank); }
.ms-row.is-song .ms-rank { color: #f59e0b; }
.ms-wait { padding: 8px; }
.msr-row .btn { flex: none; }

/* on the profile */
.pm-li { display: flex; align-items: center; gap: 4px; }
.pm-li .pm-track { flex: 1; min-width: 0; }
.pm-track .pm-n { width: 20px; font-size: .82rem; }
.pm-cover { position: relative; width: 44px; height: 44px; flex: none; border-radius: 9px; overflow: hidden; background: var(--grad-soft); display: grid; place-items: center; }
.pm-cover .pm-pi { position: absolute; width: 16px; height: 16px; fill: #fff; color: #fff; opacity: 0; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.pm-track:hover .pm-cover .pm-pi { opacity: 1; }
.pm-cover .pm-eq { position: absolute; inset: 0; margin: auto; width: max-content; height: 16px; }
.pm-cover .pm-eq i { background: #fff; }
.pm-track.is-playing .pm-cover::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.pm-track.is-playing .pm-cover .pm-eq { display: inline-flex; z-index: 1; }
.pm-track.is-playing .pm-cover .pm-pi { opacity: 0 !important; }
.pm-track:hover .pm-num { opacity: 1; }
.pm-out { flex: none; padding: 4px; border-radius: 999px; }
.pm-note { margin: 8px 4px 0; font-size: .72rem; }
.pm-meta .pm-star { font-size: .8rem; }

/* the mini player */
.pmusic { flex-wrap: wrap; row-gap: 8px; }
.pmusic-art { overflow: hidden; }
.pmusic-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pmusic.has-art .pmusic-art > .icon { display: none; }
.pmusic.has-art.is-playing .pmusic-art::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.pmusic.has-art .pmusic-art .pm-eq { z-index: 1; }
.pmusic-out { flex: none; text-decoration: none; }
.pmusic-embed { flex-basis: 100%; height: 80px; border-radius: 14px; overflow: hidden; }
.pmusic-embed iframe { width: 100%; height: 80px; border: 0; display: block; }
.pmusic.is-embed .pmusic-btn, .pmusic.is-embed .pmusic-progress { display: none; }
@media (max-width: 420px) { .pmusic-out .ms-src { font-size: 0; padding: 4px; } .pmusic-out .ms-src::before { width: 9px; height: 9px; } }

/* 2.5.5: people allowed to keep their capitals */
.keep-case, .keep-case * { text-transform: none; }
html[data-keep-case] input:not([type=password]), html[data-keep-case] textarea { text-transform: none; }
.case-row { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

/* 2.5.5: the music player tucks away with the dock while you scroll down, and comes back with it */
@media (max-width: 820px) {
  .pmusic {
    transform: translate3d(-50%, 0, 0); will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden;
    transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), opacity .3s ease;
  }
  body.dock-away .pmusic {
    transform: translate3d(-50%, calc(100% + 110px + env(safe-area-inset-bottom)), 0); opacity: 0; pointer-events: none;
    transition: transform .32s cubic-bezier(.5, 0, .75, 0), opacity .25s ease .05s;
  }
}
.ms-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 2px 0 6px; }
.ms-upload-row .muted { flex: 1 1 200px; font-size: .74rem; }
.ms-edit input { padding: 3px 8px !important; border-radius: 8px !important; background: transparent !important; border-color: transparent !important; font-size: .88rem; min-width: 0; width: 100%; }
.ms-edit input:focus { background: var(--input) !important; border-color: var(--input-border) !important; }
.ms-edit input[data-ms-title] { font-weight: 700; }
.ms-edit input[data-ms-artist] { font-size: .76rem; color: var(--muted); }
.pmusic { animation: pm-in .4s var(--ease); }
@keyframes pm-in { from { transform: translate3d(-50%, 14px, 0); opacity: 0; } }
.ms-meta.ms-edit { justify-items: stretch; }
.ms-edit input { width: 100% !important; max-width: none; }
.ms-edit .ms-src { justify-self: start; }
/* 2.5.6: clips from other sites in the videos feed — sized to the clip, centred on black, shown once drawn */
.vs-embed .vs-frame { position: absolute; inset: auto; top: 50%; left: 50%; bottom: auto; transform: translate(-50%, -50%); max-width: 100%; max-height: 100%;
  border: 0; z-index: 3; background: #000; opacity: 0; transition: opacity .35s ease; }
.vs-embed .vs-frame.is-ready { opacity: 1; }
.vs-ext .vs-stage { background: #000; }
.vs-ext.vs-loading .vs-paused { opacity: 1; transform: none; animation: lc-load 1s ease-in-out infinite; }

/* ---------- 2.5.7: one switch for friends / everyone / videos ---------- */
.feed-seg { grid-template-columns: repeat(3, 1fr); width: min(100%, 21.5rem); }
.feed-seg .fs-ind { width: calc(33.333% - 2px); }
.feed-seg[data-feed="all"] .fs-ind { transform: translateX(100%); }
.feed-seg[data-feed="videos"] .fs-ind { transform: translateX(200%); }
.feed-seg .tab-videos .icon { fill: currentColor; width: 12px; height: 12px; }
.feed-seg[data-feed="videos"] .tab-videos { color: #fff; }
.feed-videos { display: none !important; }

/* ---------- 2.5.7: the official updates account ---------- */
.official-badge { display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; margin-left: 3px; border-radius: 50%; vertical-align: -0.12em;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee); color: #fff; box-shadow: 0 2px 8px -2px rgba(124,58,237,.8); }
.official-badge .icon { width: 68%; height: 68%; stroke-width: 3.2; }
.post.is-update { border-color: color-mix(in srgb, #a78bfa 45%, var(--glass-border)); box-shadow: var(--glass-shadow), 0 0 0 1px color-mix(in srgb, #22d3ee 18%, transparent), 0 18px 40px -24px rgba(124,58,237,.75); }
.update-tag { display: inline-flex; align-items: center; gap: 3px; font-weight: 750; background: linear-gradient(90deg, #a78bfa, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.update-tag .icon { width: 12px; height: 12px; color: #a78bfa; }
.update-hide { margin-left: auto; opacity: .7; }
.update-hide + .menu-wrap { margin-left: 0; }
.pf-official { display: inline-flex; align-items: center; gap: 4px; color: #fff; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.25); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.pf-official .icon { width: 14px; height: 14px; }
/* a profile color only the updates account has */
.pf-theme-prism { --pf-grad: linear-gradient(120deg, #6d28d9, #2563eb 30%, #06b6d4 55%, #d946ef 80%, #f59e0b); --pf-accent: #c4b5fd; }
@media (max-width: 820px) { .feed-head .feed-seg { width: 100%; } }

/* ---------- 2.5.8: tagging friends ---------- */
.mention-box { position: fixed; z-index: 400; max-height: 264px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 18px;
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.6); animation: rise .18s var(--ease); }
.mention-box[hidden] { display: none; }
.mb-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.mb-row:hover, .mb-row.is-active { background: var(--glass-hover); }
.mb-meta { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.mb-meta strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-meta small { font-size: .74rem; color: var(--muted); }
.mb-friend { flex: none; font-size: .66rem; font-weight: 750; padding: 2px 8px; border-radius: 999px; background: var(--grad-soft); color: var(--accent-ink); }
.mb-empty { margin: 6px 10px; font-size: .82rem; color: var(--muted); }
.co-tag { background: linear-gradient(135deg, #22d3ee, #6366f1); }
.co-tag .icon { color: #fff; }

/* ---------- 2.6: polls ---------- */
.co-poll { background: linear-gradient(135deg, #a855f7, #ec4899); }
.co-poll .icon { color: #fff; }
.post-sheet:is(.is-reply, .is-chat) :is([data-ps-toggle="poll"], [data-ps-panel="poll"]) { display: none !important; }
.poll-inputs { display: grid; gap: 6px; margin: 6px 0 8px; }
.poll-inputs input[hidden] { display: none; }
.poll-length { margin-top: 8px; }
.poll { display: grid; gap: 7px; margin: 10px 0 4px; }
.poll-opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 10px 14px;
  border-radius: 14px; border: 1px solid var(--input-border); background: var(--input); color: var(--text); font: inherit; font-weight: 650;
  text-align: left; cursor: pointer; overflow: hidden; isolation: isolate; transition: border-color .2s, transform .15s;
}
.poll-opt:not(:disabled):active { transform: scale(.985); }
.poll:not(.is-results) .poll-opt:not(:disabled):hover { border-color: var(--accent); }
.poll-bar { position: absolute; inset: 0; z-index: -1; width: var(--pct); background: var(--grad-soft); border-radius: inherit; transition: width .6s var(--ease); }
.poll-opt.is-lead .poll-bar { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 34%, transparent), color-mix(in srgb, #22d3ee 22%, transparent)); }
.poll-opt.is-mine { border-color: color-mix(in srgb, var(--accent) 60%, var(--input-border)); }
.poll-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.poll-label .icon { width: 16px; height: 16px; color: var(--accent); flex: none; }
.poll-pct { flex: none; font-variant-numeric: tabular-nums; font-weight: 750; color: var(--text-soft); }
.poll-opt:disabled { cursor: default; opacity: 1; }
.poll-meta { margin: 2px 2px 0; font-size: .76rem; color: var(--muted); }
.poll.just-voted .poll-bar { animation: poll-grow .6s var(--ease); }
@keyframes poll-grow { from { width: 0; } }

/* ---------- 2.6: shared albums ---------- */
.albums-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.albums-head p { margin: 2px 0 0; max-width: 34rem; }
.alb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.alb-card { display: grid; padding: 8px; border-radius: 20px; color: var(--text); text-decoration: none; transition: transform .2s var(--ease); }
.alb-card:hover { transform: translateY(-2px); }
.alb-cover { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--grad-soft); display: grid; place-items: center; }
.alb-cover img { width: 100%; height: 100%; object-fit: cover; }
.alb-empty-art .icon { width: 34px; height: 34px; color: var(--accent); }
.alb-meta { display: grid; padding: 8px 4px 2px; line-height: 1.3; min-width: 0; }
.alb-meta strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alb-meta small { font-size: .74rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.alb-meta small .icon { width: 12px; height: 12px; }
.alb-head { position: relative; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 14px 16px; border-radius: 22px; }
.alb-back { flex: none; }
.alb-head-text { flex: 1 1 200px; min-width: 0; }
.alb-head h1 { margin: 2px 0 2px; font-size: 1.4rem; letter-spacing: -.02em; }
.alb-head p { margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.alb-head p .icon { width: 13px; height: 13px; }
.alb-faces { display: flex; margin-top: 8px; align-items: center; }
.alb-faces .avatar { margin-right: -8px; box-shadow: 0 0 0 2px var(--bg); }
.alb-faces .muted { margin-left: 14px; }
.alb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alb-actions .btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.alb-progress { flex-basis: 100%; }
.alb-tip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alb-tip p { margin: 0; flex: 1 1 240px; font-size: .88rem; }
.alb-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 18px; overflow: hidden; }
@media (min-width: 821px) { .alb-photos { grid-template-columns: repeat(4, 1fr); } }
.alb-cell { position: relative; aspect-ratio: 1; background: var(--input); overflow: hidden; }
.alb-item { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.alb-item img, .alb-item video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.alb-item:hover img { transform: scale(1.04); }
.alb-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.alb-play .icon { width: 30px; height: 30px; fill: #fff; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.alb-by { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; font-size: .64rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alb-del { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.45); cursor: pointer; opacity: 0; transition: opacity .15s; }
.alb-del .icon { width: 14px; height: 14px; }
.alb-cell:hover .alb-del { opacity: 1; }
@media (hover: none) { .alb-del { opacity: .85; } }
.alb-video-view { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: rgba(0,0,0,.92); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.alb-video-view video { max-width: 100%; max-height: 100%; }
.alb-video-x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; color: #fff; background: rgba(255,255,255,.14); }
.alb-peek { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 16px; overflow: hidden; margin-bottom: 14px; }
.alb-peek img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.album-new label { display: grid; gap: 4px; margin-bottom: 10px; }

/* ---------- 2.6: invites ---------- */
.invite-landing { text-align: center; }
.invite-hero-face { display: flex; justify-content: center; margin-bottom: 10px; }
.invite-hero-face .avatar { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent), 0 14px 34px -14px rgba(124,58,237,.8); }
.invite-card .invite-row { display: flex; gap: 8px; }
.invite-card .invite-row input { flex: 1; min-width: 0; font-size: .82rem; }

/* ---------- 2.6: memories ---------- */
.mem-card { position: relative; display: grid; gap: 8px; padding: 12px 14px; margin-bottom: 12px; border-radius: 20px; color: var(--text); text-decoration: none;
  border-color: color-mix(in srgb, #f59e0b 30%, var(--glass-border)); }
.mem-kicker { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 750; color: #f59e0b; }
.mem-kicker .icon { width: 13px; height: 13px; }
.mem-thumbs { display: flex; gap: 6px; }
.mem-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.mem-text { font-size: .9rem; color: var(--text-soft); }
.mem-x { position: absolute; top: 8px; right: 8px; }
.mem-year { display: grid; gap: 12px; margin-bottom: 18px; }

/* the composer's tool row scrolls sideways when there are more tools than room */
.ps-tools { overflow-x: auto; scrollbar-width: none; }
.ps-tools::-webkit-scrollbar { display: none; }
.ps-tools .ps-tool { flex: none; }

/* ==========================================================================
   2.7 — songs from youtube, soundcloud, deezer and other links
   ========================================================================== */
.ms-src-youtube { color: #ff3b30; background: color-mix(in srgb, #ff3b30 14%, transparent); }
.ms-src-soundcloud { color: #ff7a1a; background: color-mix(in srgb, #ff7a1a 15%, transparent); }
.ms-src-deezer { color: #a238ff; background: color-mix(in srgb, #a238ff 15%, transparent); }
.ms-src-web { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ms-services { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 10px; }
.ms-search-row { position: relative; }
.ms-paste { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 5px 10px; font: inherit; font-size: .74rem; font-weight: 700;
  color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, transparent); cursor: pointer; white-space: nowrap; }
.ms-paste .icon { width: 13px; height: 13px; }
.ms-paste[hidden] { display: none; }
/* the floating player with a youtube / soundcloud player tucked inside */
.pmusic-vid { display: none; width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.pmusic-vid .icon { width: 16px; height: 16px; }
.pmusic.emb-youtube .pmusic-vid { display: grid; }
.pmusic.show-embed .pmusic-vid { color: var(--accent-ink); }
.pmusic.is-ctl-embed .pmusic-embed { height: 0; margin: -8px 0 0; transition: height .35s var(--ease), margin .35s var(--ease); position: relative; }
.pmusic.is-ctl-embed.show-embed .pmusic-embed { margin: 0; }
.pmusic.emb-youtube.show-embed .pmusic-embed { height: auto; aspect-ratio: 16 / 9; }
.pmusic.emb-soundcloud.show-embed .pmusic-embed { height: 120px; }
.pmusic.emb-youtube .pmusic-embed iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.pmusic.emb-soundcloud .pmusic-embed iframe { height: 120px; }
.pmusic.emb-deezer .pmusic-embed, .pmusic.emb-deezer .pmusic-embed iframe { height: 92px; }
.pmusic-embed-tip { display: none; margin: 0 0 6px; font-size: .72rem; font-weight: 700; color: var(--accent-ink); text-align: center; }
.pmusic.is-ctl-embed.needs-tap.show-embed .pmusic-embed-tip { display: block; }
.pmusic.needs-tap.show-embed .pmusic-embed { height: auto; }
.pmusic.emb-youtube.needs-tap.show-embed .pmusic-embed { aspect-ratio: auto; }

/* 2.7 — wallpaper packs */
.packs { margin: 18px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.packs-head { display: flex; align-items: center; gap: 8px; }
.packs-gem { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 6px 16px -6px rgba(124,58,237,.8); }
.packs-gem .icon { width: 15px; height: 15px; }
.packs-excl { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; color: #fff;
  background: linear-gradient(120deg, #f59e0b, #ec4899 50%, #8b5cf6); background-size: 200% 100%; animation: excl-shine 4s ease-in-out infinite; }
@keyframes excl-shine { 50% { background-position: 100% 0; } }
.packs-admin { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.packs-admin .icon { width: 15px; height: 15px; flex: none; }
.pack-list { display: grid; gap: 12px; margin-top: 10px; }
.pack { padding: 12px; border-radius: 22px; position: relative; overflow: hidden; }
.pack::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.55), transparent 40%, transparent 60%, rgba(255,255,255,.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.pack-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 10px; }
.pack-title { flex: 1 1 210px; min-width: 0; display: grid; line-height: 1.3; }
.pack-title strong { font-size: 1rem; }
.pack-title small { color: var(--muted); font-size: .76rem; }
.pack-buy { white-space: nowrap; }
.pack-buy.is-busy { opacity: .7; pointer-events: none; }
.pack-owned { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 800; padding: 5px 10px; border-radius: 999px; color: #16a34a; background: color-mix(in srgb, #22c55e 16%, transparent); }
.pack-owned .icon { width: 13px; height: 13px; }
.pack-soon { font-size: .72rem; font-weight: 700; color: var(--muted); padding: 5px 10px; border-radius: 999px; background: var(--input); }
.pack-walls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pack-wall { display: grid; gap: 5px; justify-items: center; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; position: relative; }
.pack-wall input { position: absolute; opacity: 0; pointer-events: none; }
.pw-img { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 20px -12px rgba(0,0,0,.6);
  transition: transform .2s var(--ease), box-shadow .2s; outline: 2px solid transparent; outline-offset: 2px; }
.pw-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pack-wall small { font-size: .7rem; color: var(--muted); text-align: center; line-height: 1.2; }
.pack-wall:hover .pw-img { transform: translateY(-2px); }
.pack-wall input:checked + .pw-img, .pack-wall.is-trying .pw-img { outline-color: var(--accent); }
.pack-wall input:checked + .pw-img::after { content: "✓"; position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; font-weight: 900; color: #fff; background: var(--accent); }
.pack-wall input:focus-visible + .pw-img { outline-color: var(--accent); }
.pw-lock { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: .64rem; font-weight: 800; color: #fff; background: rgba(0,0,0,.42); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); white-space: nowrap; }
.pw-lock .icon { width: 11px; height: 11px; }
.pack-wall.is-trying .pw-lock { background: var(--accent); }
.pack.just-got { animation: pack-got 1.6s var(--ease) 2; }
@keyframes pack-got { 30% { box-shadow: 0 0 0 3px var(--accent), 0 20px 50px -20px var(--accent); transform: scale(1.015); } }
.packs-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .72rem; }
.packs-foot .icon { width: 13px; height: 13px; }
.pack-try-bar { position: fixed; z-index: 60; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(440px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 20px; box-shadow: 0 18px 44px -16px rgba(0,0,0,.6); animation: rise .35s var(--ease); }
.pack-try-bar.out { opacity: 0; transform: translate(-50%, 20px); transition: .25s ease; }
.ptb-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.ptb-text small { font-size: .7rem; color: var(--muted); }
.ptb-text strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .pack-try-bar { bottom: calc(84px + env(safe-area-inset-bottom)); } }
body.pack-trying .settings-section:not(#appearance) { opacity: .5; }
@media (max-width: 480px) { .pack-walls { gap: 6px; } .pack-buy { flex: 1 1 100%; } }
/* admin */
.setup-steps { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.setup-steps code, .copy-code { font-size: .74rem; padding: 1px 6px; border-radius: 6px; background: var(--input); word-break: break-all; }
.pill.ok { color: #16a34a; background: color-mix(in srgb, #22c55e 15%, transparent); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.sales-list { display: grid; gap: 4px; margin-bottom: 10px; }
.sale-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .84rem; padding: 6px 10px; border-radius: 12px; background: var(--input); }
.gift-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gift-row input { flex: 1 1 160px; }
.check-row { display: flex !important; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }
.check-row input { width: auto !important; }

/* ==========================================================================
   2.7 — status in messages
   ========================================================================== */
/* presence dots */
.pres-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #94a3b8; flex: none; }
.pres-online { background: #22c55e; }
.pres-available { background: #10b981; box-shadow: 0 0 0 2px color-mix(in srgb, #10b981 35%, transparent); }
.pres-busy { background: #ef4444; }
.pres-busy::after { content: ""; display: block; width: 55%; height: 2px; margin: 4.5px auto 0; border-radius: 2px; background: #fff; }
.pres-away { background: #f59e0b; }
.pres-offline { background: transparent; box-shadow: inset 0 0 0 2px #94a3b8; }
.dm-convo-av, .st-ring, .st-person-av, .st-card-who { position: relative; flex: none; }
.dm-convo-av > .pres-dot, .st-ring > .pres-dot, .st-person-av > .pres-dot, .st-card-who > .pres-dot {
  position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border: 2.5px solid var(--surface, #fff); box-sizing: content-box; }
html[data-theme="dark"] .dm-convo-av > .pres-dot, html[data-theme="dark"] .st-ring > .pres-dot, html[data-theme="dark"] .st-person-av > .pres-dot, html[data-theme="dark"] .st-card-who > .pres-dot { border-color: #14122a; }
.st-card-who > .pres-dot { left: 24px; right: auto; bottom: -1px; width: 10px; height: 10px; border-width: 2px; }
.pres-busy.pres-dot::after { margin-top: 5px; }
.pres-t-online, .pres-t-available { color: #16a34a; }
.pres-t-busy { color: #ef4444; }
.pres-t-away { color: #d97706; }
html[data-theme="dark"] .pres-t-online, html[data-theme="dark"] .pres-t-available { color: #4ade80; }
html[data-theme="dark"] .pres-t-away { color: #fbbf24; }
.dm-pres { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-pres > span { display: inline-flex; align-items: center; gap: 4px; }
.dm-pres .pres-dot { width: 8px; height: 8px; }
.dm-pres .pres-busy::after { width: 5px; height: 1.5px; margin-top: 3.2px; }
.dm-pres-st { overflow: hidden; text-overflow: ellipsis; color: var(--text-soft); display: inline !important; }

/* chats / status switch */
.dm-st-head { padding: 0 12px 4px; }
.dm-tabs { display: flex; width: 100%; padding: 4px; gap: 4px; }
.dm-tabs .seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 0; border-radius: 999px; background: none;
  font: inherit; font-size: .86rem; font-weight: 700; color: var(--text-soft); cursor: pointer; transition: background-color .2s, color .2s; }
.dm-tabs .seg-btn .icon { width: 15px; height: 15px; }
.dm-tabs .seg-btn.is-on { background: var(--glass-strong); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0,0,0,.25); }
.dm-tabs .dot-badge { position: static; margin-left: 2px; }
.ap-body > .dm-st-head { padding: 4px 4px 2px; }

/* the rail */
.st-rail { display: flex; gap: 12px; overflow-x: auto; padding: 10px 4px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.st-rail::-webkit-scrollbar { display: none; }
.st-bub { flex: none; width: 66px; display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; scroll-snap-align: start; position: relative; }
.st-bub small { font-size: .7rem; font-weight: 600; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.st-ring { width: 60px; height: 60px; border-radius: 50%; padding: 3px; display: grid; place-items: center;
  background: conic-gradient(from 210deg, #f59e0b, #ec4899, #8b5cf6, #06b6d4, #f59e0b); transition: transform .2s var(--ease); }
.st-ring .avatar { width: 54px; height: 54px; border: 3px solid var(--surface, #fff); box-sizing: border-box; }
html[data-theme="dark"] .st-ring .avatar { border-color: #14122a; }
.st-ring.is-seen { background: var(--line); }
.st-me .st-ring:not(.is-seen) { background: transparent; }
.st-bub:active .st-ring { transform: scale(.94); }
.st-emo, .st-add { position: absolute; right: -3px; bottom: -3px; min-width: 24px; height: 24px; padding: 0 3px; border-radius: 999px; display: grid; place-items: center; font-size: .82rem; line-height: 1;
  background: var(--glass-strong); box-shadow: 0 2px 8px rgba(0,0,0,.25); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.st-emo .icon { width: 13px; height: 13px; }
.st-add { color: #fff; background: var(--grad); border: 2px solid var(--surface, #fff); }
.st-add .icon { width: 13px; height: 13px; stroke-width: 3; }
.st-pres-chip { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); font-size: .56rem; font-weight: 800; letter-spacing: .02em; padding: 1px 6px; border-radius: 999px; color: #fff; background: #22c55e; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.st-pres-chip.pres-busy { background: #ef4444; } .st-pres-chip.pres-away { background: #f59e0b; } .st-pres-chip.pres-offline { background: #64748b; } .st-pres-chip.pres-available { background: #10b981; }
.st-pres-chip.pres-busy::after { display: none; }
.st-rail-empty { align-self: center; max-width: 200px; margin: 0 0 14px; font-size: .74rem; line-height: 1.35; }

/* the status tab */
.dm-pane-status { padding: 0 12px 16px; }
.ap-body > .dm-pane-status { padding: 0 4px 12px; }
.st-feed { display: grid; gap: 10px; }
.st-h { font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 8px 4px 0; display: flex; gap: 6px; align-items: baseline; }
.st-mine { padding: 12px; border-radius: 20px; display: grid; gap: 10px; }
.st-mine-top { display: flex; align-items: center; gap: 10px; }
.st-mine-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.st-mine-text small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-mine-text small .icon { width: 12px; height: 12px; vertical-align: -2px; }
.pres-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pres-opt { position: relative; cursor: pointer; }
.pres-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pres-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--text-soft);
  background: var(--input); border: 1px solid var(--input-border); transition: all .2s; }
.pres-opt .pres-dot { width: 9px; height: 9px; }
.pres-opt .pres-busy::after { width: 5px; margin-top: 3.5px; }
.pres-opt input:checked + span { color: var(--text); background: var(--glass-strong); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pres-opt input:focus-visible + span { box-shadow: var(--focus); }
.pres-desc { margin: -2px 2px 0; font-size: .74rem; }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.st-card { border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform .2s var(--ease); --sh: 260; }
.st-card:hover { transform: translateY(-2px); }
.st-card:focus-visible { box-shadow: var(--focus); outline: 0; }
.st-card-img { display: block; aspect-ratio: 16 / 10; max-height: 210px; overflow: hidden; }
.st-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-card-emo { display: grid; place-items: center; height: 96px; font-size: 2.6rem;
  background: radial-gradient(120% 120% at 20% 10%, hsl(var(--sh) 85% 72% / .9), hsl(calc(var(--sh) + 50) 80% 58% / .85) 60%, hsl(calc(var(--sh) + 100) 75% 50% / .8)); }
.st-card-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.st-card-who { display: flex; align-items: center; gap: 8px; }
.st-card-who > span { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.st-card-who strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-card-who small { font-size: .7rem; color: var(--muted); }
.st-new-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.st-card-text { font-size: .95rem; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.st-card.is-seen { opacity: .86; }
.st-card-rx { display: flex; align-items: center; gap: 4px; }
.st-qrx { width: 34px; height: 34px; border: 0; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: var(--input); cursor: pointer; transition: transform .15s; }
.st-qrx:active, .st-qrx.pop { transform: scale(1.25); }
.st-qreply { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .78rem; font-weight: 700;
  color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 13%, transparent); cursor: pointer; }
.st-qreply .icon { width: 14px; height: 14px; }
.st-empty { padding: 18px; border-radius: 20px; display: flex; align-items: center; gap: 14px; }
.st-empty-art { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--grad); flex: none; }
.st-empty p { font-size: .9rem; line-height: 1.4; }
.st-none { margin: 0 4px; }
.st-around { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.st-person { display: grid; justify-items: center; gap: 3px; padding: 8px 4px; border-radius: 16px; color: var(--text); text-align: center; }
.st-person:hover { background: var(--glass-hover); text-decoration: none; }
.st-person small { font-size: .74rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-person-p { font-size: .64rem; font-weight: 700; }

/* the share sheet */
.st-sheet-bd { z-index: 126; }
.st-sheet { text-align: left; justify-items: stretch; gap: 12px; }
.st-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.st-sheet .sheet-grab { justify-self: center; width: 40px; height: 5px; border-radius: 99px; background: var(--line); }
.st-compose { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 20px; background: var(--input); border: 1px solid var(--input-border); }
.st-compose:focus-within { border-color: var(--accent); }
.st-emoji-btn { width: 46px; height: 46px; border-radius: 15px; border: 0; font-size: 1.5rem; display: grid; place-items: center; cursor: pointer; background: var(--glass-strong); box-shadow: 0 2px 8px rgba(0,0,0,.12); flex: none; }
.st-compose input[type=text] { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 10px 0 !important; font-size: 1rem; font-weight: 600; }
.st-count { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 8px; border-radius: 16px; background: var(--input); }
.st-emoji-grid[hidden] { display: none; }
.st-emoji-grid button { aspect-ratio: 1; border: 0; border-radius: 10px; background: none; font-size: 1.3rem; cursor: pointer; }
.st-emoji-grid button:hover { background: var(--glass-hover); }
.st-suggest { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -22px; padding: 0 22px; }
.st-suggest::-webkit-scrollbar { display: none; }
.st-chip { flex: none; border: 1px solid var(--input-border); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: .78rem; font-weight: 600; background: var(--input); color: var(--text-soft); cursor: pointer; white-space: nowrap; }
.st-chip:active { transform: scale(.96); }
.st-selfie-row { display: flex; align-items: center; gap: 8px; }
.st-selfie-btn { flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 18px; cursor: pointer; border: 1px dashed var(--input-border); }
.st-selfie-btn:hover { background: var(--glass-hover); }
.st-selfie-btn > span:last-child { display: grid; line-height: 1.3; }
.st-selfie-btn small { font-size: .72rem; }
.st-selfie-thumb { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; color: #fff; background: var(--grad); flex: none; }
.st-selfie-thumb img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(1); }
.st-selfie-thumb .icon { width: 22px; height: 22px; }
.st-clear-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.st-hours label span { padding: 6px 12px; }
.st-actions { display: flex; gap: 8px; justify-content: flex-end; }
.st-actions .btn-primary { flex: 1; max-width: 260px; }
.st-actions [hidden] { display: none; }

/* the viewer */
.st-viewer { position: fixed; inset: 0; z-index: 125; display: grid; grid-template-rows: auto auto 1fr auto; background: #07060f; color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 0 calc(env(safe-area-inset-bottom) + 10px); opacity: 0; transform: scale(.98); transition: opacity .22s ease, transform .22s var(--ease); --sh: 260; }
.st-viewer.open { opacity: 1; transform: none; }
.st-viewer[hidden] { display: none; }
.st-viewer::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 60% at 50% 30%, hsl(var(--sh) 80% 45% / .55), transparent 70%), #07060f; }
.st-viewer > * { width: 100%; max-width: 520px; margin: 0 auto; }
.stv-bars { display: flex; gap: 4px; padding: 0 12px; }
.stv-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.28); overflow: hidden; }
.stv-bars span i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
.stv-bars span.done i { transform: scaleX(1); }
.stv-bars span.on i { animation: stv-fill linear forwards; }
.st-viewer.is-paused .stv-bars span.on i { animation-play-state: paused; }
@keyframes stv-fill { to { transform: scaleX(1); } }
.stv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.stv-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: #fff; }
.stv-who:hover { text-decoration: none; }
.stv-who > span { display: grid; line-height: 1.25; min-width: 0; }
.stv-who strong { font-size: .95rem; }
.stv-who small { font-size: .74rem; color: rgba(255,255,255,.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stv-x { width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; }
.stv-x .icon { width: 20px; height: 20px; }
.stv-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 6px 12px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stv-img { width: 100%; height: 100%; max-height: 100%; object-fit: cover; border-radius: 22px; box-shadow: 0 30px 70px -30px rgba(0,0,0,.8); }
.stv-cap { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); max-width: calc(100% - 60px); padding: 10px 16px; border-radius: 18px; font-size: 1.05rem; font-weight: 700; text-align: center;
  background: rgba(10,8,25,.45); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid rgba(255,255,255,.18); overflow-wrap: anywhere; }
.stv-card { width: 100%; height: 100%; max-height: 640px; border-radius: 28px; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 30px; text-align: center;
  background: radial-gradient(120% 90% at 15% 10%, hsl(var(--sh) 85% 66%), hsl(calc(var(--sh) + 45) 80% 52%) 55%, hsl(calc(var(--sh) + 95) 75% 40%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 30px 70px -30px rgba(0,0,0,.8); }
.stv-emo { font-size: 5.2rem; line-height: 1; filter: drop-shadow(0 10px 24px rgba(0,0,0,.25)); animation: stv-emo .5s var(--ease); }
@keyframes stv-emo { from { transform: scale(.5) rotate(-12deg); opacity: 0; } }
.stv-text { font-size: 1.6rem; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 14px rgba(0,0,0,.2); overflow-wrap: anywhere; }
.stv-nav { position: absolute; top: 90px; bottom: 120px; width: 30%; border: 0; background: none; cursor: pointer; z-index: 1; -webkit-tap-highlight-color: transparent; }
.stv-prev { left: 0; } .stv-next { right: 0; width: 45%; }
@media (min-width: 700px) { .stv-prev { left: calc(50% - 360px); width: 100px; } .stv-next { right: calc(50% - 360px); width: 100px; } .stv-nav::after { content: "‹"; font-size: 2.4rem; color: rgba(255,255,255,.6); } .stv-next::after { content: "›"; } }
.stv-foot, .stv-mine { position: relative; z-index: 2; display: grid; gap: 10px; padding: 8px 12px 0; }
.stv-foot[hidden], .stv-mine[hidden] { display: none; }
.stv-rx { display: flex; justify-content: center; gap: 8px; }
.stv-rx button { width: 44px; height: 44px; border: 0; border-radius: 50%; font-size: 1.35rem; background: rgba(255,255,255,.1); cursor: pointer; transition: transform .15s var(--ease); }
.stv-rx button:hover { background: rgba(255,255,255,.18); }
.stv-rx button:active, .stv-rx button.pop { transform: scale(1.3); }
.stv-reply { display: flex; gap: 8px; align-items: center; }
.stv-reply input { flex: 1; min-width: 0; padding: 12px 16px !important; border-radius: 999px !important; color: #fff !important; background: rgba(255,255,255,.1) !important; border: 1px solid rgba(255,255,255,.22) !important; }
.stv-reply input::placeholder { color: rgba(255,255,255,.6); }
.stv-mine { grid-template-columns: 1fr auto; align-items: center; }
.stv-seen { display: inline-flex; align-items: center; gap: 6px; border: 0; background: rgba(255,255,255,.1); color: #fff; padding: 9px 14px; border-radius: 999px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; justify-self: start; }
.stv-seen .icon { width: 16px; height: 16px; }
.stv-mine-btns { display: flex; gap: 6px; }
.stv-mine .btn-ghost { color: #fff; background: rgba(255,255,255,.1); }
.stv-viewers { grid-column: 1 / -1; max-height: 40vh; overflow-y: auto; display: grid; gap: 6px; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.08); }
.stv-viewers[hidden] { display: none; }
.stv-viewer { display: flex; align-items: center; gap: 10px; }
.stv-viewer > span:nth-child(2) { flex: 1; display: grid; line-height: 1.25; }
.stv-viewer small { color: rgba(255,255,255,.6); font-size: .72rem; }
.stv-vrx { font-size: 1.2rem; }
.stv-burst { position: absolute; left: 50%; top: 50%; font-size: 4rem; transform: translate(-50%, -50%); animation: stv-burst .9s var(--ease) forwards; pointer-events: none; }
@keyframes stv-burst { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 30% { transform: translate(-50%, -60%) scale(1.3); opacity: 1; } 100% { transform: translate(-50%, -150%) scale(1); opacity: 0; } }

/* a reply to a status, in the chat */
.msg-stq { display: flex; align-items: center; gap: 8px; max-width: 78%; margin: 0 0 3px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--input); border-left: 3px solid var(--accent); font-size: .76rem; }
.msg-out .msg-stq { margin-left: auto; }
.msg-stq-art { width: 34px; height: 44px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; font-size: 1.1rem; background: var(--grad-soft); flex: none; }
.msg-stq-art img { width: 100%; height: 100%; object-fit: cover; }
.msg-stq-text { display: grid; line-height: 1.3; min-width: 0; }
.msg-stq-text small { color: var(--muted); font-size: .68rem; }
.msg-stq-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ==========================================================================
   2.8 — no news or politics
   ========================================================================== */
.topic-rule { display: flex; align-items: center; gap: 7px; margin: 2px 2px 0; font-size: .74rem; font-weight: 600; color: var(--muted); }
.topic-rule .icon { width: 14px; height: 14px; flex: none; color: var(--accent-ink); }
.post-sheet:is(.is-reply, .is-chat) .topic-rule { display: none; }
.review-intro { display: flex; gap: 8px; align-items: flex-start; margin: 0 4px 12px; line-height: 1.45; }
.review-intro .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.held-item .report-head { flex-wrap: wrap; gap: 8px; }
.held-why { flex: 1 1 200px; }
.held-item .pill .icon { width: 12px; height: 12px; margin-right: 4px; }
.gd-actions:has(> :only-child) { justify-content: stretch; }
.gd-actions > .btn:only-child { flex: 1; }

/* ==========================================================================
   2.8 — clear glass: as see-through as glass gets. Light or dark text is
   picked from the wallpaper's brightness (yours, or the profile you visit),
   and text carries a soft shadow so it reads over any picture.
   ========================================================================== */
.theme-toggle .ti-clear { display: none; }
:root[data-theme-pref="clear"] .theme-toggle .ti-clear { display: grid; }
.tc-clear .tc-preview { background: linear-gradient(135deg, #7c3aed, #06b6d4 60%, #ec4899); }
.tc-clear .tc-preview i { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
:root:root[data-skin="clear"][data-theme="dark"] {
  --glass: rgba(255,255,255,.035); --glass-strong: rgba(255,255,255,.07); --glass-hover: rgba(255,255,255,.1);
  --glass-border: rgba(255,255,255,.3); --glass-edge: rgba(255,255,255,.08);
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 1px rgba(255,255,255,.04), 0 18px 40px -24px rgba(0,0,0,.55);
  --input: rgba(255,255,255,.08); --input-border: rgba(255,255,255,.28);
  --text: #ffffff; --text-soft: rgba(255,255,255,.9); --muted: rgba(255,255,255,.74); --line: rgba(255,255,255,.18);
  --blur: 6px; --clear-shadow: 0 1px 2px rgba(0,0,0,.55), 0 0 14px rgba(0,0,0,.35);
}
:root:root[data-skin="clear"][data-theme="light"] {
  --glass: rgba(255,255,255,.1); --glass-strong: rgba(255,255,255,.22); --glass-hover: rgba(255,255,255,.3);
  --glass-border: rgba(255,255,255,.7); --glass-edge: rgba(255,255,255,.3);
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 18px 40px -24px rgba(30,20,80,.3);
  --input: rgba(255,255,255,.28); --input-border: rgba(255,255,255,.75);
  --text: #0c0c1c; --text-soft: rgba(12,12,28,.86); --muted: rgba(12,12,28,.66); --line: rgba(12,12,28,.12);
  --blur: 6px; --clear-shadow: 0 1px 2px rgba(255,255,255,.7), 0 0 14px rgba(255,255,255,.55);
}
:root[data-skin="clear"] :is(.glass, .glass-strong, .post.glass, .topbar, .tabbar, .sidebar-inner, .panel) {
  -webkit-backdrop-filter: blur(6px) saturate(140%); backdrop-filter: blur(6px) saturate(140%);
}
:root[data-skin="clear"] :is(.glass, .glass-strong) { background-image: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,0) 45%); }
:root[data-skin="clear"] .topbar { background: rgba(255,255,255,.04); }
:root[data-skin="clear"][data-theme="light"] .topbar { background: rgba(255,255,255,.18); }
:root[data-skin="clear"] .tabbar { background: rgba(255,255,255,.06); }
:root[data-skin="clear"][data-theme="light"] .tabbar { background: rgba(255,255,255,.24); }
/* text that sits on see-through glass gets a soft halo in the opposite tone */
:root[data-skin="clear"] body { text-shadow: var(--clear-shadow); }
:root[data-skin="clear"] :is(.btn-primary, .pill, .badge, .dot-badge, .st-pres-chip, .packs-excl, input, textarea, select, .msg-out .msg-bubble, img, video, iframe, .stv-stage, .st-viewer) { text-shadow: none; }
/* sheets, menus and panels you read for a while stay a little frostier */
:root[data-skin="clear"][data-theme="dark"] :is(.sheet, .menu, .app-panel, .drawer, .gd) { background: rgba(14,14,28,.55); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); }
:root[data-skin="clear"][data-theme="light"] :is(.sheet, .menu, .app-panel, .drawer, .gd) { background: rgba(255,255,255,.6); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); }
:root[data-skin="clear"] .msg-in .msg-bubble { background: rgba(255,255,255,.12); }
:root[data-skin="clear"][data-theme="light"] .msg-in .msg-bubble { background: rgba(255,255,255,.45); }

/* ==========================================================================
   2.8.1 — posts with several photos / videos: swipe through them
   ========================================================================== */
.pm-carousel { position: relative; display: block; background: #000; touch-action: pan-y pinch-zoom; }
.pmc-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; aspect-ratio: 4 / 5; max-height: 620px; }
.pmc-track::-webkit-scrollbar { display: none; }
.pmc-track > .pm-item { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; background: #000; }
.pmc-track > .pm-item img { width: 100%; height: 100%; object-fit: cover; }
.pmc-track > .pm-item.pm-video video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.pm-carousel .pm-item:hover img { transform: none; }
.pmc-count { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #fff;
  background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: none; }
.pmc-dots { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2; display: flex; gap: 5px; padding: 5px 8px; border-radius: 999px;
  background: rgba(0,0,0,.3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; max-width: 80%; overflow: hidden; }
.pmc-dots i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: rgba(255,255,255,.5); transition: transform .2s, background-color .2s; }
.pmc-dots i.on { background: #fff; transform: scale(1.25); }
.pm-carousel:has(.pm-video) .pmc-dots { bottom: auto; top: 12px; }
.pmc-nav { position: absolute; top: 50%; z-index: 2; width: 36px; height: 36px; margin-top: -18px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: #111; background: rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(0,0,0,.3); opacity: 0; transition: opacity .2s; }
.pmc-nav .icon { width: 18px; height: 18px; }
.pmc-prev { left: 10px; } .pmc-next { right: 10px; } .pmc-next .icon { transform: scaleX(-1); }
.pmc-nav[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .pm-carousel:hover .pmc-nav { opacity: 1; } }
.comment-bubble .pm-carousel .pmc-track { max-height: 360px; }
/* the photo viewer, with several photos */
.lb-nav { position: absolute; top: 50%; z-index: 3; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lb-nav .icon { width: 22px; height: 22px; }
.lb-prev { left: 12px; } .lb-next { right: 12px; } .lb-next .icon { transform: scaleX(-1); }
.lb-nav[hidden] { display: none; }
.lightbox.hide-ui .lb-nav { opacity: 0; pointer-events: none; }
@media (hover: none) { .lb-nav { display: none; } }

/* 2.8.2 — a youtube song plays in a small video where the album art goes (no big box) */
.pmusic.emb-youtube .pmusic-embed, .pmusic.emb-youtube.show-embed .pmusic-embed, .pmusic.emb-youtube.needs-tap.show-embed .pmusic-embed {
  order: -1; flex: 0 0 112px; width: 112px; height: 63px !important; aspect-ratio: auto !important; margin: 0 !important; border-radius: 12px; overflow: hidden; background: #000; }
.pmusic.emb-youtube .pmusic-embed iframe { width: 112px !important; height: 63px !important; aspect-ratio: auto !important; }
.pmusic.emb-youtube .pmusic-art, .pmusic.emb-youtube .pmusic-vid, .pmusic.emb-youtube .pmusic-embed-tip { display: none !important; }
.pmusic.emb-youtube { flex-wrap: nowrap; }
.pmusic.emb-youtube.needs-tap .pmusic-embed { box-shadow: 0 0 0 2px var(--accent); animation: pm-pulse 1.6s ease-in-out infinite; }

/* 2.8.3 — page titles that use gradient letters stay readable on wallpapers (the glass pill used to replace the gradient that colors the letters) */
:root[data-wall]:not([data-wall="glassay"]):not([data-wall="plain"]) .page-head h1.grad-text,
:root[data-wall]:not([data-wall="glassay"]):not([data-wall="plain"]) .page-head .grad-text {
  color: var(--text); -webkit-text-fill-color: currentColor; background: var(--glass-strong); -webkit-background-clip: border-box; background-clip: border-box;
}
.page-head h1 { white-space: nowrap; }
.page-head:has(> p) { flex-wrap: wrap; }
.page-head > p { flex-basis: 100%; margin: 0 0 0 4px; }

/* 2.8.4 — editing a poll */
.poll-edit-note { margin: 4px 2px 8px; font-size: .74rem; }
.poll-length .pl-keep span { border-style: dashed; }
.review-intro > span { flex: 1; min-width: 0; }
/* admin and other tab rows: never wider than the screen — they scroll sideways instead */
.tabs { max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { flex: 1 0 auto; white-space: nowrap; }
main > * { min-width: 0; max-width: 100%; }
