/* iChat web — design system + app shell.
   Same brand as the Android app (ui/theme/Color.kt): ink navy #14132B,
   electric purple #6C5CE7, lime #D4FF3A. Dark is the default; Light and
   "Same as device" come from Settings → Appearance (js/app/core/theme.js
   sets <html data-theme>). RTL (Arabic) flips via <html dir="rtl">, so
   layout uses logical properties (margin-inline-start, inset-inline-end…). */

/* ------------------------------------------------------------------ tokens */
/* Roboto — same font as the Android app (res/font/roboto.ttf): variable
   weights 100–900, Latin only (public/fonts/LICENSE-roboto.txt). Arabic
   falls through to the next fonts in --font. */
@font-face {
  font-family: "Roboto";
  src: url("/fonts/roboto-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-017F, U+2000-206F, U+20A0-20C0, U+2122, U+2190, U+2192, U+2713, U+2715;
}

:root {
  --brand-ink: #14132b;
  --brand-purple: #6c5ce7;
  --brand-purple-dark: #5444d6;
  --brand-purple-soft: #8b7ff0;
  --brand-lime: #d4ff3a;
  --online: #22c55e;
  --gold: #f5b100;
  --fire: #ff7a1a;

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --pill: 999px;

  --sidebar-w: 264px;
  --rail-w: 340px;
  --feed-w: 640px;
  --topbar-h: 60px;
  --dock-h: 74px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Arabic", "Helvetica Neue", Tahoma, Arial, sans-serif;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14132b;
  --bg-elev: #17162f;
  --surface: #1d1b38;
  --surface-2: #26244a;
  --surface-3: #302d58;
  --border: #2f2d55;
  --border-strong: #3d3a66;
  --text: #f3f1ff;
  --text-2: #b4b1d6;
  --text-3: #8a87ad;
  --primary: #d4ff3a;
  --primary-hover: #e1ff6e;
  --on-primary: #14132b;
  --primary-soft: rgba(212, 255, 58, .14);
  --accent: #8b7ff0;
  --accent-strong: #a99ff5;
  --accent-soft: rgba(139, 127, 240, .18);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .14);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, .14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .15);
  --link: #a99ff5;
  --overlay: rgba(8, 7, 22, .66);
  --glass: rgba(29, 27, 56, .72);
  --glass-border: rgba(255, 255, 255, .08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .75);
  --skeleton: linear-gradient(90deg, #232146 0%, #2d2a55 50%, #232146 100%);
  --streak-bg: linear-gradient(90deg, #3a2412, #2a1a36);
  --streak-border: rgba(255, 170, 90, .35);
  --streak-text: #ffb066;
  --star: #fbbf24;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f5fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1efff;
  --surface-3: #e7e4fb;
  --border: #e6e4f2;
  --border-strong: #cfcbe6;
  --text: #14132b;
  --text-2: #4a4868;
  --text-3: #8b89a8;
  --primary: #6c5ce7;
  --primary-hover: #5444d6;
  --on-primary: #ffffff;
  --primary-soft: rgba(108, 92, 231, .12);
  --accent: #6c5ce7;
  --accent-strong: #5444d6;
  --accent-soft: rgba(108, 92, 231, .12);
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --warn: #d97706;
  --warn-soft: #fff7e6;
  --link: #5444d6;
  --overlay: rgba(20, 19, 43, .45);
  --glass: rgba(255, 255, 255, .78);
  --glass-border: rgba(20, 19, 43, .08);
  --shadow-sm: 0 1px 2px rgba(20, 19, 43, .06);
  --shadow: 0 10px 30px -14px rgba(20, 19, 43, .22);
  --shadow-lg: 0 24px 60px -20px rgba(20, 19, 43, .35);
  --skeleton: linear-gradient(90deg, #eeecf8 0%, #f7f6fd 50%, #eeecf8 100%);
  --streak-bg: linear-gradient(90deg, #fff4e5, #fffbe8);
  --streak-border: #ffd9a8;
  --streak-text: #e8590c;
  --star: #d48c00;
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
}
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: grid; place-items: center; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

/* thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* icons */
.ic { width: 22px; height: 22px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.ic-sm { width: 18px; height: 18px; }
.ic-xs { width: 15px; height: 15px; }
.ic-lg { width: 26px; height: 26px; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--pill);
  font-weight: 700; font-size: 14.5px; letter-spacing: .1px; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .15s, color .15s, box-shadow .2s, opacity .15s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px -8px var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-accent { background: var(--brand-purple); color: #fff; box-shadow: 0 6px 18px -8px var(--brand-purple); }
.btn-accent:hover:not(:disabled) { background: var(--brand-purple-dark); }
.btn-tonal { background: var(--surface-2); color: var(--text); }
.btn-tonal:hover:not(:disabled) { background: var(--surface-3); }
.btn-outline { border: 1.5px solid var(--border-strong); color: var(--text); background: transparent; }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-xs { height: 28px; padding: 0 11px; font-size: 12.5px; gap: 5px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%; color: var(--text);
  transition: background-color .15s, transform .15s var(--ease), color .15s;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.filled { background: var(--surface-2); }
.icon-btn.filled:hover { background: var(--surface-3); }
.icon-btn.on-media { background: rgba(0, 0, 0, .35); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.icon-btn.on-media:hover { background: rgba(0, 0, 0, .5); }

.badge {
  position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); line-height: 1;
}
.dot-badge { position: absolute; top: 7px; inset-inline-end: 7px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--bg); }

.link { color: var(--link); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ form controls */
.input, .textarea, .select {
  width: 100%; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; outline: none;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--text-3); }
.search-box { position: relative; }
.search-box .ic { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .input { padding-inline-start: 44px; border-radius: var(--pill); height: 46px; background: var(--surface-2); border-color: transparent; }
.search-box .input:focus { border-color: var(--accent); background: var(--surface); }

.switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-3); transition: background-color .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--brand-purple); }
.switch input:checked + span::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-18px); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }

/* ------------------------------------------------------------------ chips / tabs */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-weight: 700; font-size: 14px; white-space: nowrap; flex: 0 0 auto;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip:active { transform: scale(.96); }
.chip.active { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: 0 6px 16px -8px var(--primary); }
.chip.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.chip .ic { width: 18px; height: 18px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 14px 16px; color: var(--text-2); font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; inset-inline: 16px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-purple); }
:root[data-theme="dark"] .tab.active::after, :root:not([data-theme]) .tab.active::after { background: var(--brand-purple-soft); }

.segmented { display: inline-flex; padding: 4px; border-radius: var(--pill); background: var(--surface-2); gap: 2px; }
.segmented button { height: 34px; padding: 0 16px; border-radius: var(--pill); font-weight: 700; font-size: 13.5px; color: var(--text-2); transition: background-color .15s, color .15s; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ avatars */
.avatar {
  --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; flex: 0 0 auto;
  background: var(--surface-2) center/cover no-repeat; position: relative; overflow: visible;
  display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: calc(var(--s) * .4);
  text-transform: uppercase; user-select: none;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.xs { --s: 28px; }
.avatar.sm { --s: 34px; }
.avatar.md { --s: 44px; }
.avatar.lg { --s: 56px; }
.avatar.xl { --s: 88px; }
.avatar.xxl { --s: 140px; }
.avatar .online-dot { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 2.5px var(--surface); }
.avatar-ring { padding: 3px; border-radius: 50%; background: conic-gradient(from 210deg, var(--brand-lime), var(--brand-purple), #ff5f9e, var(--brand-lime)); display: inline-grid; }
.avatar-ring > .avatar { box-shadow: 0 0 0 3px var(--bg); }
.avatar-ring.seen { background: var(--border-strong); }
.verified { display: inline-grid; place-items: center; width: 17px; height: 17px; flex: 0 0 auto; color: #1d9bf0; vertical-align: -3px; }
.verified svg { width: 100%; height: 100%; }
.name-line { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-weight: 800; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-pad { padding: 18px; }
.card-title { font-size: 17px; font-weight: 800; margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.card-head .card-title { font-size: 16px; }
.section-title { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ------------------------------------------------------------------ list rows */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r);
  transition: background-color .12s; min-width: 0; width: 100%; text-align: start;
}
.list-row:hover { background: var(--surface-2); }
.list-row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row .title { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .title.name-line { display: inline-flex; max-width: 100%; }
.list-row .sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .trail { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.list-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-2); color: var(--text); }

/* ------------------------------------------------------------------ app shell */
.app {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh; max-width: 1440px; margin: 0 auto;
}
.app.with-rail { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w); }
.app.full { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); max-width: none; }
.main { min-width: 0; position: relative; }
.page { max-width: var(--feed-w); margin: 0 auto; padding: 18px 16px 48px; }
.page.wide { max-width: 980px; }
.page.full { max-width: none; padding: 0; }
.rail { padding: 18px 18px 48px 4px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * + * { margin-top: 16px; }

/* sidebar (desktop) */
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  border-inline-end: 1px solid var(--border); overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; font-weight: 900; font-size: 22px; letter-spacing: -.5px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(140deg, var(--brand-purple), #8b7ff0 60%, var(--brand-lime) 140%); color: #fff;
  box-shadow: 0 8px 20px -10px var(--brand-purple); font-size: 20px; font-weight: 900;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-word b { color: var(--primary); }
.nav-item {
  display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 14px; border-radius: var(--r);
  color: var(--text-2); font-weight: 700; font-size: 16px; position: relative; transition: background-color .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { color: var(--text); background: var(--surface-2); }
.nav-item.active .ic { color: var(--primary); }
:root[data-theme="light"] .nav-item.active .ic { color: var(--brand-purple); }
.nav-item .badge { position: static; margin-inline-start: auto; box-shadow: none; }
.nav-item .ic { width: 25px; height: 25px; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }
.sidebar .btn-create { margin: 12px 4px 6px; height: 50px; font-size: 15.5px; }
.sidebar-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); }
.sidebar-me:hover { background: var(--surface-2); }

/* top bar (mobile + sub pages) */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 6px;
  padding: 0 8px; background: var(--glass); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 19px; font-weight: 800; letter-spacing: -.2px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.topbar-center { position: absolute; inset-inline: 0; margin: 0 auto; width: max-content; }
.topbar .actions { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.topbar.home { justify-content: space-between; }
.topbar.transparent { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.desktop-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; min-height: 42px; }
.desktop-head h1 { font-size: 26px; font-weight: 900; letter-spacing: -.6px; margin: 0; flex: 1; min-width: 0; }

/* bottom dock (mobile) */
.dock {
  position: fixed; z-index: 50; inset-inline: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--dock-h); padding: 0 8px; border-radius: 26px; display: none; align-items: center; justify-content: space-around;
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg);
  backdrop-filter: saturate(170%) blur(20px); -webkit-backdrop-filter: saturate(170%) blur(20px);
}
.dock-item { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 56px; color: var(--text-3); font-size: 11.5px; font-weight: 700; position: relative; }
.dock-item .pill { width: 54px; height: 34px; border-radius: 18px; display: grid; place-items: center; transition: background-color .2s var(--ease), color .2s; }
.dock-item.active { color: var(--primary); }
:root[data-theme="light"] .dock-item.active { color: var(--brand-purple); }
.dock-item.active .pill { background: var(--primary); color: var(--on-primary); }
.dock-item .avatar { --s: 28px; }
.dock-item.active .avatar { box-shadow: 0 0 0 2px var(--primary); }
.dock-item.active .pill:has(.avatar) { background: transparent; }
.dock-create { width: 58px; height: 46px; border-radius: 16px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; box-shadow: 0 10px 22px -10px var(--primary); transition: transform .2s var(--ease-spring); }
.dock-create:active { transform: scale(.92) rotate(90deg); }
.dock-create .ic { width: 28px; height: 28px; }
.dock .badge { top: -2px; inset-inline-end: 6px; }

/* ------------------------------------------------------------------ streak pill */
.streak-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--pill);
  background: var(--streak-bg); border: 1px solid var(--streak-border); font-weight: 800; font-size: 15px;
  transition: transform .2s var(--ease-spring); white-space: nowrap;
}
.streak-pill:hover { transform: scale(1.04); }
.streak-pill .fire { font-size: 17px; line-height: 1; }
.streak-pill .num { color: var(--streak-text); }
.streak-pill .star-num { color: var(--star); }
.streak-pill .sep { width: 1px; height: 16px; background: var(--streak-border); margin: 0 2px; }
.streak-pill.dim .fire { filter: grayscale(1); opacity: .6; }
.streak-pill.golden { background: linear-gradient(90deg, #4a3500, #3a2a05); border-color: #f5b100; }
:root[data-theme="light"] .streak-pill.golden { background: linear-gradient(90deg, #fff7d1, #ffefb0); }
.streak-pill.bump { animation: bump .5s var(--ease-spring); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ------------------------------------------------------------------ open-in-app banner */
.app-banner {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.app-banner .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.app-banner .txt { flex: 1; min-width: 0; line-height: 1.25; }
.app-banner .txt b { display: block; font-size: 14.5px; }
.app-banner .txt span { font-size: 12.5px; color: var(--text-2); }
.app-banner .stars { color: var(--star); font-size: 11px; letter-spacing: 1px; }
.open-app-fab {
  position: fixed; z-index: 55; inset-inline-end: 16px; bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom));
  display: none; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border-radius: var(--pill);
  background: var(--brand-purple); color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 14px 30px -12px var(--brand-purple);
  animation: fab-in .5s var(--ease-spring) both;
}
.open-app-fab .ic { width: 20px; height: 20px; }
@keyframes fab-in { from { transform: translateY(20px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ overlays: modal / sheet */
.overlay {
  position: fixed; inset: 0; z-index: 200; background: var(--overlay); display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; transition: opacity .2s var(--ease);
}
.overlay.show { opacity: 1; }
.modal {
  width: min(560px, 100%); max-height: min(88dvh, 860px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  transform: translateY(14px) scale(.98); transition: transform .25s var(--ease); overflow: hidden;
}
.overlay.show .modal { transform: none; }
.modal.sm { width: min(420px, 100%); }
.modal.lg { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 20px; min-height: 60px; }
[dir="rtl"] .modal-head { padding: 14px 20px 10px 14px; }
.modal-head h2 { font-size: 18px; font-weight: 800; margin: 0; flex: 1; min-width: 0; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--border); }
.sheet-handle { display: none; width: 42px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 8px auto 0; flex: 0 0 auto; }

.dialog-text { color: var(--text-2); margin: 0 0 6px; }

/* popover menu */
.menu {
  position: fixed; z-index: 300; min-width: 220px; max-width: 300px; padding: 6px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; transform: scale(.96); transform-origin: top; transition: opacity .14s, transform .14s var(--ease);
}
.menu.show { opacity: 1; transform: none; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 11px; font-weight: 600; font-size: 14.5px; text-align: start; color: var(--text); }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-item .ic { width: 20px; height: 20px; color: var(--text-2); }
.menu-item.danger .ic { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 6px; }

/* toast */
.toast-stack { position: fixed; z-index: 400; inset-inline: 0; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 12px 18px; border-radius: var(--r);
  background: #0f0e22; color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .08);
  animation: toast-in .3s var(--ease-spring) both;
}
:root[data-theme="light"] .toast { background: #14132b; }
.toast.out { animation: toast-out .25s var(--ease) both; }
.toast .ic { width: 19px; height: 19px; }
.toast button { color: var(--brand-lime); font-weight: 800; margin-inline-start: 6px; }
@keyframes toast-in { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateY(10px); opacity: 0; } }

/* spinner / skeleton / empty */
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.lg { width: 36px; height: 36px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: grid; place-items: center; padding: 28px 0; }
.skel { background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-line { height: 12px; margin: 8px 0; }
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 46px 20px; color: var(--text-2);
}
.empty .empty-ico { width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 34px; }
.empty .empty-ico .ic { width: 34px; height: 34px; }
.empty h3 { margin: 4px 0 0; color: var(--text); font-size: 17px; font-weight: 800; }
.empty p { margin: 0; max-width: 340px; font-size: 14px; }

/* progress */
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-purple), var(--brand-lime)); transition: width .3s var(--ease); }

/* ------------------------------------------------------------------ stories */
.stories { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story-card {
  position: relative; flex: 0 0 112px; height: 186px; border-radius: 18px; overflow: hidden; background: var(--surface-2) center/cover no-repeat;
  scroll-snap-align: start; isolation: isolate; transition: transform .2s var(--ease);
}
.story-card:hover { transform: translateY(-2px); }
.story-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .25) 0%, transparent 30%, transparent 55%, rgba(0, 0, 0, .7) 100%); z-index: 0; }
.story-card .story-av { position: absolute; top: 9px; inset-inline-start: 9px; z-index: 1; }
.story-card .story-av .avatar { --s: 36px; }
.story-card .story-name { position: absolute; bottom: 9px; inset-inline: 9px; z-index: 1; color: #fff; font-weight: 700; font-size: 13px; line-height: 1.2; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-card.add { background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; }
.story-card.add::after { display: none; }
.story-card.add .add-photo { flex: 1; background: var(--surface-2) center/cover no-repeat; }
.story-card.add .add-btn { position: absolute; top: calc(100% - 64px); inset-inline-start: 50%; transform: translateX(-50%); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-purple); color: #fff; border: 3px solid var(--surface); z-index: 2; }
[dir="rtl"] .story-card.add .add-btn { transform: translateX(50%); }
.story-card.add .add-label { height: 52px; display: grid; place-items: end center; padding-bottom: 9px; font-weight: 700; font-size: 12.5px; color: var(--text); }
.story-card .play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: #fff; }

/* story viewer */
.story-viewer { position: fixed; inset: 0; z-index: 260; background: #000; display: grid; place-items: center; }
.story-stage { position: relative; width: min(440px, 100%); height: min(100dvh, 860px); background: #111; border-radius: 0; overflow: hidden; }
@media (min-width: 700px) { .story-stage { border-radius: 18px; height: min(94dvh, 860px); } }
.story-stage img, .story-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.story-bars { position: absolute; top: 10px; inset-inline: 10px; display: flex; gap: 4px; z-index: 3; }
.story-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.story-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.story-bars i.done b { width: 100%; }
.story-top { position: absolute; top: 20px; inset-inline: 10px; display: flex; align-items: center; gap: 10px; z-index: 3; color: #fff; }
.story-top .who { flex: 1; min-width: 0; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.story-top .who small { display: block; font-weight: 500; opacity: .8; font-size: 12px; }
.story-tap { position: absolute; top: 70px; bottom: 90px; width: 35%; z-index: 2; }
.story-tap.prev { inset-inline-start: 0; }
.story-tap.next { inset-inline-end: 0; width: 65%; }
.story-caption { position: absolute; bottom: 96px; inset-inline: 16px; z-index: 3; color: #fff; text-align: center; font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.story-bottom { position: absolute; bottom: 0; inset-inline: 0; padding: 14px 12px calc(16px + env(safe-area-inset-bottom)); z-index: 3; display: flex; justify-content: center; gap: 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.story-react { width: 46px; height: 46px; border-radius: 50%; font-size: 24px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); transition: transform .15s var(--ease-spring), background-color .15s; }
.story-react:hover { background: rgba(255, 255, 255, .22); transform: scale(1.1); }
.story-react.active { background: rgba(212, 255, 58, .25); box-shadow: 0 0 0 2px var(--brand-lime); }
.story-viewers-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--pill); background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }
.story-burst { position: absolute; inset: 0; display: grid; place-items: center; font-size: 110px; z-index: 4; pointer-events: none; opacity: 0; }
.story-burst.go { animation: burst .9s var(--ease) both; }
@keyframes burst { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1.15); } 100% { opacity: 0; transform: scale(1.6) translateY(-60px); } }
.story-nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; }
.story-nav-arrow.l { inset-inline-start: -64px; }
.story-nav-arrow.r { inset-inline-end: -64px; }
@media (max-width: 699px) { .story-nav-arrow { display: none; } }

/* ------------------------------------------------------------------ composer trigger */
.composer-card { padding: 14px 16px; }
.composer-row { display: flex; align-items: center; gap: 12px; }
.composer-fake { flex: 1; height: 46px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-3); display: flex; align-items: center; padding: 0 18px; font-size: 15px; text-align: start; transition: background-color .15s; }
.composer-fake:hover { background: var(--surface-3); }
.composer-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.composer-actions button { flex: 1; height: 42px; border-radius: var(--pill); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 14px; transition: filter .15s, transform .15s; }
.composer-actions button:hover { filter: brightness(1.12); }
.composer-actions .photo { background: rgba(16, 185, 129, .14); color: #10b981; }
.composer-actions .feel { background: rgba(245, 158, 11, .16); color: #f59e0b; }
.composer-actions .reel { background: rgba(236, 72, 153, .14); color: #ec4899; }

/* ------------------------------------------------------------------ post card */
.post { margin-bottom: 14px; overflow: hidden; }
.post-chip { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; color: var(--text-2); font-size: 13px; font-weight: 600; }
.post-chip .ic { width: 16px; height: 16px; }
.post-head { display: flex; align-items: center; gap: 11px; padding: 14px 10px 8px 16px; }
[dir="rtl"] .post-head { padding: 14px 16px 8px 10px; }
.post-who { flex: 1; min-width: 0; }
.post-who .name-line { font-size: 15px; max-width: 100%; }
.post-who .name-line a:hover { text-decoration: underline; }
.post-who .extra { font-weight: 500; color: var(--text-2); }
.post-who .extra a { font-weight: 700; color: var(--text); }
.post-meta { display: flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 12.5px; font-weight: 500; flex-wrap: wrap; }
.post-meta .ic { width: 13px; height: 13px; }
.post-body { padding: 0 16px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.5; }
.post-body.big { font-size: 22px; font-weight: 700; line-height: 1.35; padding-top: 4px; padding-bottom: 14px; }
.post-body .more { color: var(--text-2); font-weight: 700; }
.hashtag, .mention { color: var(--link); font-weight: 600; cursor: pointer; }
.hashtag:hover, .mention:hover { text-decoration: underline; }
.edited { color: var(--text-3); font-size: 12.5px; }
.mod-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 10px; padding: 6px 12px; border-radius: var(--pill); font-size: 12.5px; font-weight: 700; }
.mod-badge.pending { background: var(--warn-soft); color: var(--warn); }
.mod-badge.rejected { background: var(--danger-soft); color: var(--danger); }
.anon-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700; }

.media { position: relative; background: #000; overflow: hidden; cursor: pointer; }
.media-grid { display: grid; gap: 2px; background: var(--border); }
.media-grid > div { background: var(--surface-2) center/cover no-repeat; position: relative; cursor: zoom-in; min-height: 0; }
.media-grid.n1 > div { aspect-ratio: auto; }
.media-grid.n1 img { width: 100%; max-height: 640px; object-fit: cover; background: var(--surface-2); }
.media-grid.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.1; }
.media-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1.4; }
.media-grid.n3 > div:first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1; }
.media-grid .more-n { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 800; }

.video-wrap { position: relative; background: #000; display: grid; place-items: center; }
.video-wrap video { width: 100%; max-height: 640px; object-fit: contain; background: #000; }
.video-wrap .play-btn { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .2s var(--ease), opacity .2s; }
.video-wrap .play-btn .ic { width: 32px; height: 32px; margin-inline-start: 4px; }
.video-wrap.playing .play-btn { opacity: 0; transform: scale(.8); pointer-events: none; }
.video-wrap .vbtn { position: absolute; bottom: 12px; inset-inline-end: 12px; }
.video-wrap .reel-tag { position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--pill); background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; font-weight: 800; backdrop-filter: blur(6px); }
.video-wrap .vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .2); }
.video-wrap .vbar i { display: block; height: 100%; width: 0; background: var(--brand-lime); }

.shared-box { margin: 0 16px 12px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: background-color .15s; }
.shared-box:hover { background: var(--surface-2); }
.shared-box .shared-head { display: flex; align-items: center; gap: 9px; padding: 12px 12px 6px; }
.shared-box .shared-text { padding: 0 12px 10px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.shared-box .shared-media { aspect-ratio: 16 / 9; background: #000 center/cover no-repeat; }
.shared-box .shared-media video { width: 100%; height: 100%; object-fit: cover; }

.poll { margin: 0 16px 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); }
.poll-q { font-weight: 800; margin-bottom: 10px; }
.poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; margin-bottom: 8px; border-radius: 12px; border: 1.5px solid var(--border-strong); overflow: hidden; font-weight: 700; text-align: start; transition: border-color .15s; }
.poll-opt:hover { border-color: var(--accent); }
.poll-opt .fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--accent-soft); transition: width .5s var(--ease); z-index: 0; }
.poll-opt > span { position: relative; z-index: 1; }
.poll-opt.voted { border-color: var(--accent); }
.poll-opt.voted .fill { background: rgba(139, 127, 240, .32); }
.poll-meta { font-size: 12.5px; color: var(--text-2); }

.post-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; color: var(--text-2); font-size: 13.5px; }
.post-stats button:hover { text-decoration: underline; }
.post-stats .likes { display: inline-flex; align-items: center; gap: 6px; }
.post-stats .heart-chip { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #ff5f7e, #e0245e); color: #fff; }
.post-stats .heart-chip .ic { width: 11px; height: 11px; }
.post-actions { display: flex; gap: 4px; padding: 4px 8px 8px; border-top: 1px solid var(--border); margin: 0 8px; }
.post-action { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 12px; color: var(--text-2); font-weight: 700; font-size: 14px; transition: background-color .15s, color .15s; }
.post-action:hover { background: var(--surface-2); color: var(--text); }
.post-action.liked { color: #f43f5e; }
.post-action.saved { color: var(--accent-strong); }
:root[data-theme="light"] .post-action.saved { color: var(--brand-purple); }
.post-action .ic { width: 21px; height: 21px; }
.post-action.liked .ic { animation: pop .35s var(--ease-spring); }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
.heart-burst { position: absolute; inset: 0; margin: auto; width: 110px; height: 110px; color: #fff; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .4)); pointer-events: none; animation: heart-burst .8s var(--ease) both; z-index: 5; }
@keyframes heart-burst { 0% { transform: scale(0); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 60% { transform: scale(.95); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }

.suggest-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 8px; padding: 5px 11px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; font-weight: 700; }
:root[data-theme="light"] .suggest-chip { color: var(--brand-purple); }

/* comments */
.comments { padding: 4px 0; }
.comment { display: flex; gap: 10px; padding: 6px 0; }
.comment .bubble { background: var(--surface-2); border-radius: 18px; padding: 8px 14px; display: inline-block; max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment .bubble b { display: block; font-size: 13.5px; }
.comment .c-meta { display: flex; align-items: center; gap: 14px; padding: 4px 12px 0; font-size: 12.5px; color: var(--text-3); font-weight: 700; }
.comment .c-meta button:hover { color: var(--text); text-decoration: underline; }
.comment .c-meta .liked { color: #f43f5e; }
.comment .replies { margin-top: 2px; }
.comment-input {
  display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface);
}
.comment-input .pill { flex: 1; display: flex; align-items: flex-end; gap: 4px; background: var(--surface-2); border-radius: 22px; padding: 4px 6px 4px 16px; min-height: 44px; }
[dir="rtl"] .comment-input .pill { padding: 4px 16px 4px 6px; }
.comment-input textarea { flex: 1; border: 0; background: transparent; outline: none; resize: none; padding: 9px 0; max-height: 130px; font-size: 15px; line-height: 1.4; }
.comment-input .send { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); transition: background-color .15s, color .15s, transform .15s; flex: 0 0 auto; }
.comment-input .send.ready { background: var(--primary); color: var(--on-primary); }
.comment-input .send.ready:active { transform: scale(.9); }
.replying-to { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-top: 1px solid var(--border); }
.quick-emojis { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--border); }
.quick-emojis button { flex: 0 0 auto; width: 44px; height: 38px; border-radius: 19px; background: var(--surface-2); font-size: 20px; transition: transform .15s var(--ease-spring); }
.quick-emojis button:hover { transform: scale(1.12); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 280; background: rgba(5, 5, 14, .96); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100dvh; object-fit: contain; user-select: none; }
.lightbox .lb-close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lightbox .lb-nav.prev { inset-inline-start: 14px; }
.lightbox .lb-nav.next { inset-inline-end: 14px; }
.lightbox .lb-count { position: absolute; top: 22px; inset-inline-start: 0; inset-inline-end: 0; margin: auto; width: max-content; color: #fff; font-weight: 700; background: rgba(255, 255, 255, .12); padding: 4px 12px; border-radius: var(--pill); }

/* ------------------------------------------------------------------ composer modal */
.composer-modal .who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.audience-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; font-weight: 800; margin-top: 3px; }
:root[data-theme="light"] .audience-pill { color: var(--brand-purple); }
.audience-pill.anon { background: var(--surface-3); color: var(--text); }
.composer-text { width: 100%; border: 0; outline: none; resize: none; background: transparent; font-size: 19px; line-height: 1.45; min-height: 120px; padding: 4px 0; }
.composer-text.small { font-size: 16px; min-height: 90px; }
.composer-text::placeholder { color: var(--text-3); }
.composer-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.composer-preview .tile { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.composer-preview .tile img, .composer-preview .tile video { width: 100%; height: 100%; object-fit: cover; }
.composer-preview .tile.video { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.composer-preview .tile.video video { object-fit: contain; background: #000; }
.composer-preview .rm { position: absolute; top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.composer-tools { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); margin-top: 10px; flex-wrap: wrap; }
.composer-tools .lbl { font-weight: 700; font-size: 14px; flex: 1; min-width: 120px; }
.tool-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; transition: background-color .15s, transform .15s; }
.tool-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.tool-btn.active { background: var(--accent-soft); }
.tool-btn .ic { width: 23px; height: 23px; }
.feelings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.feelings-grid button { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); font-weight: 700; text-transform: capitalize; }
.feelings-grid button:hover, .feelings-grid button.active { background: var(--accent-soft); }
.feeling-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.poll-builder { margin-top: 10px; padding: 14px; border-radius: var(--r); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.poll-builder .input { background: var(--surface); }
.upload-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.upload-bar .progress { flex: 1; }

/* create menu sheet */
.create-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.create-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); text-align: start; transition: transform .15s var(--ease), background-color .15s; }
.create-tile:hover { background: var(--surface-3); transform: translateY(-2px); }
.create-tile .ci { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.create-tile b { font-size: 15px; }
.create-tile span { font-size: 12.5px; color: var(--text-2); }

/* text story composer */
.text-story { position: relative; aspect-ratio: 9 / 16; max-height: 62dvh; margin: 0 auto; border-radius: 20px; overflow: hidden; display: grid; place-items: center; padding: 26px; }
.text-story textarea { width: 100%; background: transparent; border: 0; outline: none; resize: none; color: #fff; text-align: center; font-size: 26px; font-weight: 800; line-height: 1.3; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.text-story textarea::placeholder { color: rgba(255, 255, 255, .7); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; transition: transform .15s; }
.swatches button.active { border-color: var(--text); transform: scale(1.1); }

/* ------------------------------------------------------------------ people / groups cards */
.h-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.person-card {
  flex: 0 0 168px; scroll-snap-align: start; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); text-align: center;
}
.person-card .avatar-ring { margin-bottom: 6px; }
.person-card .p-name { font-weight: 800; max-width: 100%; }
.person-card .p-sub { font-size: 12.5px; color: var(--text-2); min-height: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card .btn { margin-top: 8px; width: 100%; }
.person-card .x { position: absolute; top: 6px; inset-inline-end: 6px; }
.group-card { flex: 0 0 260px; scroll-snap-align: start; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; }
.group-card .g-cover { height: 110px; background: linear-gradient(135deg, var(--brand-purple), var(--brand-lime)) center/cover no-repeat; position: relative; }
.group-card .g-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.group-card .g-av { width: 54px; height: 54px; border-radius: 16px; margin-top: -27px; border: 3px solid var(--surface); background: var(--surface-2) center/cover no-repeat; position: relative; display: grid; place-items: center; font-weight: 900; font-size: 22px; color: #fff; }
.group-card .g-name { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-card .g-sub { font-size: 13px; color: var(--text-2); }
.group-card .btn { margin-top: 8px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.grid-cards .group-card { flex: none; }

/* explore grid */
.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: var(--r); overflow: hidden; }
.explore-grid .tile { position: relative; aspect-ratio: 1; background: var(--surface-2) center/cover no-repeat; cursor: pointer; overflow: hidden; }
.explore-grid .tile.tall { grid-row: span 2; aspect-ratio: auto; }
.explore-grid .tile:hover::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .25); }
.explore-grid .tile .t-ico { position: absolute; top: 8px; inset-inline-end: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.explore-grid .tile .t-stat { position: absolute; bottom: 8px; inset-inline-start: 8px; color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 4px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }

.trend-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r); width: 100%; text-align: start; }
.trend-row:hover { background: var(--surface-2); }
.trend-row .rank { width: 28px; font-weight: 900; color: var(--text-3); font-size: 18px; text-align: center; }
.trend-row .tag { font-weight: 800; font-size: 16px; }
.trend-row .cnt { font-size: 13px; color: var(--text-2); }

/* ------------------------------------------------------------------ profile */
.profile-cover { height: 230px; background: linear-gradient(135deg, #2a1f7a, var(--brand-purple) 55%, #b9e83a) center/cover no-repeat; position: relative; border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (min-width: 900px) { .profile-cover { height: 300px; border-radius: var(--r-lg); margin: 18px 16px 0; } }
.profile-cover .cover-btn { position: absolute; bottom: 14px; inset-inline-end: 14px; }
.profile-head { padding: 0 20px; position: relative; }
.profile-av-wrap { margin-top: -70px; display: inline-block; position: relative; }
.profile-av-wrap .avatar { box-shadow: 0 0 0 5px var(--bg); }
.profile-av-wrap .cam { position: absolute; bottom: 8px; inset-inline-end: 4px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-purple); color: #fff; border: 3px solid var(--bg); }
.profile-name { font-size: 28px; font-weight: 900; letter-spacing: -.5px; margin: 10px 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-name .verified { width: 24px; height: 24px; }
.profile-status { color: var(--text-2); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.profile-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); }
.profile-status .dot.on { background: var(--online); }
.profile-bio { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.stat-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.stat-boxes button { padding: 14px 8px; text-align: center; transition: background-color .15s; }
.stat-boxes button + button { border-inline-start: 1px solid var(--border); }
.stat-boxes button:hover { background: var(--surface-2); }
.stat-boxes b { display: block; font-size: 22px; font-weight: 900; }
.stat-boxes span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-actions .btn { flex: 1; min-width: 120px; }
.about-item { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: var(--r); background: var(--surface-2); margin-bottom: 8px; }
.about-item .ic { color: var(--accent); }
.about-item .k { color: var(--text-2); flex: 1; }
.about-item .v { font-weight: 800; text-align: end; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 14px; }
:root[data-theme="light"] .cat-chip { color: var(--brand-purple); }
.media-tab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.media-tab-grid .tile { aspect-ratio: 1; background: var(--surface-2) center/cover no-repeat; position: relative; cursor: pointer; }
.media-tab-grid .tile .t-ico { position: absolute; top: 8px; inset-inline-end: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }

/* ------------------------------------------------------------------ reels */
.reels { position: relative; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; background: #000; scrollbar-width: none; overscroll-behavior: contain; }
.reels::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; }
.reel-stage { position: relative; height: 100%; width: 100%; max-width: calc(100dvh * 9 / 16); background: #000; }
@media (min-width: 768px) { .reel-stage { height: calc(100% - 32px); border-radius: 20px; overflow: hidden; } }
.reel-stage video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.reel-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 18%, transparent 55%, rgba(0, 0, 0, .75) 100%); pointer-events: none; }
.reel-info { position: absolute; bottom: 18px; inset-inline-start: 14px; inset-inline-end: 76px; color: #fff; z-index: 2; }
.reel-info .r-author { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15.5px; }
.reel-info .r-author .avatar { --s: 40px; box-shadow: 0 0 0 2px #fff; }
.reel-follow { height: 30px; padding: 0 13px; border-radius: var(--pill); border: 1.5px solid #fff; font-weight: 800; font-size: 13px; color: #fff; }
.reel-follow.following { background: rgba(255, 255, 255, .2); border-color: transparent; }
.reel-caption { margin-top: 10px; font-size: 14.5px; line-height: 1.4; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); max-height: 4.2em; overflow: hidden; }
.reel-caption.open { max-height: 40vh; overflow-y: auto; }
.reel-sound { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; height: 32px; padding: 0 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .16); color: #fff; font-size: 13px; font-weight: 700; max-width: 100%; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.reel-sound span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reel-side { position: absolute; bottom: 18px; inset-inline-end: 8px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; }
.reel-act { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.reel-act .ra { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .15s var(--ease-spring), background-color .15s; }
.reel-act .ra:hover { background: rgba(0, 0, 0, .45); }
.reel-act .ra:active { transform: scale(.88); }
.reel-act .ra .ic { width: 27px; height: 27px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.reel-act.liked .ra { color: #ff3b5c; }
.reel-act.saved .ra { color: var(--brand-lime); }
.reel-disc { width: 44px; height: 44px; border-radius: 50%; background: #222 center/cover no-repeat; border: 6px solid #111; animation: disc 5s linear infinite; }
.reel-disc.paused { animation-play-state: paused; }
@keyframes disc { to { transform: rotate(360deg); } }
.reel-top { position: absolute; top: 0; inset-inline: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 12px 12px; color: #fff; }
.reel-top h1 { font-size: 22px; font-weight: 900; margin: 0; flex: 1; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.reel-center-icon { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; background: rgba(0, 0, 0, .4); color: #fff; display: grid; place-items: center; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .2s; }
.reel-center-icon.show { opacity: 1; }
.reel-center-icon.hold { opacity: 1; background: rgba(0, 0, 0, .55); }
.reel-center-icon .ic { width: 38px; height: 38px; }
.reel-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, .2); z-index: 3; }
.reel-progress i { display: block; height: 100%; width: 0; background: #fff; }
.reels-desktop-nav { position: fixed; top: 50%; transform: translateY(-50%); inset-inline-end: 28px; z-index: 30; display: flex; flex-direction: column; gap: 12px; }
.reels-desktop-nav .icon-btn { background: var(--surface-2); width: 48px; height: 48px; }
.reel-comments { position: absolute; inset-inline: 0; bottom: 0; height: 70%; z-index: 6; background: var(--surface); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .3s var(--ease); }
.reel-comments.show { transform: none; }

/* ------------------------------------------------------------------ chat */
.chat-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); height: 100dvh; border-inline-start: 0; }
.chat-list-pane { border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-list-head { padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.chat-list-head .row h1 { font-size: 26px; font-weight: 900; margin: 0; flex: 1; letter-spacing: -.5px; }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 8px 100px; }
.conv { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: var(--r); text-align: start; transition: background-color .12s; position: relative; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--accent-soft); }
.conv .c-main { flex: 1; min-width: 0; }
.conv .c-top { display: flex; align-items: center; gap: 6px; }
.conv .c-name { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .c-time { font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.conv .c-prev { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.conv.unread .c-name, .conv.unread .c-prev { color: var(--text); font-weight: 800; }
.conv .unread-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.streak-chip { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: var(--pill); background: var(--streak-bg); border: 1px solid var(--streak-border); font-size: 12.5px; font-weight: 900; color: var(--streak-text); flex: 0 0 auto; }
.streak-chip.broken { filter: grayscale(.4); }
.chat-pane { display: flex; flex-direction: column; min-height: 0; height: 100dvh; position: relative; background: var(--chat-bg, var(--bg)); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 0 10px; height: 66px; border-bottom: 1px solid var(--border); background: var(--chat-bar, var(--surface)); flex: 0 0 auto; color: var(--chat-bar-text, var(--text)); }
.chat-head .who { flex: 1; min-width: 0; cursor: pointer; }
.chat-head .who b { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.chat-head .who small { display: block; font-size: 12.5px; color: var(--chat-bar-sub, var(--text-2)); }
.chat-hint { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; background: var(--streak-bg); color: var(--streak-text); border-bottom: 1px solid var(--streak-border); flex: 0 0 auto; }
.chat-hint .dots { display: flex; gap: 4px; margin-inline-start: auto; }
.chat-hint .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 140, 50, .3); }
.chat-hint .dots i.on { background: #ff7a1a; }
.broken-card { margin: 10px 12px; padding: 14px; border-radius: 18px; background: var(--streak-bg); border: 1px solid var(--streak-border); flex: 0 0 auto; }
.broken-card .bc-top { display: flex; align-items: center; gap: 10px; }
.broken-card .bc-top b { display: block; }
.broken-card .bc-top small { color: var(--text-2); }
.broken-card .bc-actions { display: flex; gap: 8px; margin-top: 12px; }
.broken-card .bc-actions .btn { flex: 1; }
.messages { flex: 1; overflow-y: auto; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 2px; background-image: radial-gradient(var(--chat-dot, rgba(139, 127, 240, .07)) 1px, transparent 1px); background-size: 22px 22px; }
.day-chip { align-self: center; margin: 12px 0 8px; padding: 5px 12px; border-radius: var(--pill); background: var(--chat-chip, var(--surface)); color: var(--chat-chip-text, var(--text-2)); font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm); }
.msg { display: flex; align-items: flex-end; gap: 6px; max-width: 78%; position: relative; }
.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.msg + .msg { margin-top: 2px; }
.msg.gap { margin-top: 10px; }
.bubble { position: relative; padding: 8px 12px 6px; border-radius: 20px; background: var(--chat-other, var(--surface)); color: var(--chat-other-text, var(--text)); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; min-width: 60px; }
.msg.own .bubble { background: var(--chat-own, var(--brand-purple)); color: var(--chat-own-text, #fff); }
.msg:not(.own) .bubble { border-end-start-radius: 6px; }
.msg.own .bubble { border-end-end-radius: 6px; }
.bubble .txt { white-space: pre-wrap; font-size: 15px; line-height: 1.4; }
.bubble .m-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; opacity: .72; margin-top: 2px; }
.bubble .tick { display: inline-flex; }
.bubble .tick.seen { color: var(--chat-tick, var(--brand-lime)); opacity: 1; }
.bubble.deleted { font-style: italic; opacity: .7; }
.bubble .att-img { display: block; border-radius: 14px; overflow: hidden; margin: -2px -6px 6px; max-width: 320px; cursor: zoom-in; }
.bubble .att-img img { width: 100%; max-height: 360px; object-fit: cover; }
.bubble video.att-video { border-radius: 14px; margin: -2px -6px 6px; max-width: 320px; max-height: 360px; background: #000; }
.bubble audio { max-width: 260px; height: 38px; margin: 2px 0; }
.bubble .att-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .14); margin-bottom: 6px; }
.bubble .att-file b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.bubble .att-file small { opacity: .8; }
.bubble .quote { display: flex; gap: 8px; padding: 6px 8px; margin: -1px -4px 6px; border-radius: 12px; background: rgba(0, 0, 0, .15); cursor: pointer; }
.bubble .quote .bar { width: 3px; border-radius: 2px; background: var(--brand-lime); flex: 0 0 auto; }
.bubble .quote b { font-size: 12.5px; display: block; }
.bubble .quote span { font-size: 13px; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bubble .quote .qthumb { width: 40px; height: 40px; border-radius: 8px; background: center/cover no-repeat; flex: 0 0 auto; margin-inline-start: auto; }
.bubble .story-r { display: flex; flex-direction: column; gap: 6px; }
.bubble .story-r small { opacity: .85; }
.bubble .story-r .sr-media { position: relative; width: 140px; height: 220px; border-radius: 14px; overflow: hidden; background: #000; }
.bubble .story-r .sr-media img, .bubble .story-r .sr-media video { width: 100%; height: 100%; object-fit: cover; }
.bubble .story-r .sr-emoji { position: absolute; bottom: -6px; inset-inline-end: -6px; font-size: 34px; }
.bubble .story-r .sr-gone { width: 140px; height: 80px; border-radius: 14px; display: grid; place-items: center; background: rgba(0, 0, 0, .2); font-size: 12.5px; }
.bubble .shared-p { display: block; width: 260px; max-width: 100%; border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, .14); margin: -2px -4px 6px; }
.bubble .shared-p .sp-cover { aspect-ratio: 16 / 10; background: #000 center/cover no-repeat; position: relative; }
.bubble .shared-p .sp-body { padding: 8px 10px; }
.bubble .shared-p b { font-size: 13px; display: block; }
.bubble .shared-p span { font-size: 13px; opacity: .9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reactions-chip { position: absolute; bottom: -12px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border); font-size: 13px; box-shadow: var(--shadow-sm); color: var(--text); }
.msg.has-reactions { margin-bottom: 12px; }
.msg .m-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; align-self: center; }
.msg:hover .m-actions { opacity: 1; }
.msg .m-actions .icon-btn { width: 32px; height: 32px; color: var(--text-2); }
.msg.flash .bubble { animation: flash 1.2s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow-sm); } 30% { box-shadow: 0 0 0 4px var(--brand-lime); } }
.typing { align-self: flex-start; padding: 12px 16px; border-radius: 20px; background: var(--chat-other, var(--surface)); display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--chat-bar, var(--surface)); border-top: 1px solid var(--border); flex: 0 0 auto; }
.chat-composer .pill { flex: 1; display: flex; align-items: flex-end; gap: 2px; min-height: 46px; padding: 3px 4px 3px 14px; border-radius: 24px; background: var(--chat-input, var(--surface-2)); }
[dir="rtl"] .chat-composer .pill { padding: 3px 14px 3px 4px; }
.chat-composer textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; padding: 11px 0; max-height: 140px; font-size: 15px; line-height: 1.35; color: var(--chat-bar-text, var(--text)); }
.chat-composer .pill .icon-btn { width: 40px; height: 40px; color: var(--text-2); }
.chat-send { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--chat-send, var(--brand-purple)); color: #fff; flex: 0 0 auto; transition: transform .15s var(--ease-spring); }
.chat-send:active { transform: scale(.9); }
.chat-send.rec { background: #ef4444; animation: pulse-rec 1.2s infinite; }
@keyframes pulse-rec { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); } 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } }
.reply-banner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--chat-bar, var(--surface)); flex: 0 0 auto; }
.reply-banner .rb { flex: 1; min-width: 0; border-inline-start: 3px solid var(--brand-purple); padding-inline-start: 10px; }
.reply-banner .rb b { font-size: 13px; color: var(--accent-strong); }
.reply-banner .rb span { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chips { display: flex; gap: 8px; padding: 8px 14px 0; overflow-x: auto; background: var(--chat-bar, var(--surface)); flex: 0 0 auto; }
.attach-chip { position: relative; width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2) center/cover no-repeat; flex: 0 0 auto; display: grid; place-items: center; font-size: 11px; text-align: center; padding: 4px; overflow: hidden; }
.attach-chip .rm { position: absolute; top: 3px; inset-inline-end: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 24px; background: var(--danger-soft); color: var(--danger); font-weight: 800; }
.rec-bar .rdot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.reaction-pick { position: fixed; z-index: 320; display: flex; gap: 2px; padding: 6px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toast-in .2s var(--ease-spring) both; }
.reaction-pick button { width: 42px; height: 42px; border-radius: 50%; font-size: 25px; transition: transform .15s var(--ease-spring); }
.reaction-pick button:hover { transform: scale(1.25); }
.reaction-pick button.mine { background: var(--accent-soft); }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--text-2); }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-tile { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; }
.theme-tile .tt { width: 100%; height: 110px; border-radius: 16px; border: 1.5px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.theme-tile .tt i { height: 15px; border-radius: 8px; display: block; }
.theme-tile .tt i.o { align-self: flex-end; width: 70%; }
.theme-tile .tt i.t { width: 65%; }
.theme-tile.active .tt { border: 3px solid var(--accent); }

/* ------------------------------------------------------------------ notifications */
.notif { display: flex; gap: 12px; padding: 12px; border-radius: var(--r); width: 100%; text-align: start; position: relative; transition: background-color .12s; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--accent-soft); }
.notif.unread::before { content: ""; position: absolute; top: 50%; inset-inline-end: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-purple); transform: translateY(-50%); }
.notif .n-av { position: relative; flex: 0 0 auto; }
.notif .n-type { position: absolute; bottom: -2px; inset-inline-end: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid var(--surface); }
.notif .n-type .ic { width: 13px; height: 13px; }
.notif .n-text { flex: 1; min-width: 0; padding-inline-end: 22px; }
.notif .n-text b { font-weight: 800; }
.notif .n-time { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.notif .n-thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--surface-2) center/cover no-repeat; flex: 0 0 auto; }
.announce { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); margin-bottom: 12px; text-align: start; width: 100%; display: block; position: relative; }
.announce .a-img { aspect-ratio: 2.4; background: var(--surface-2) center/cover no-repeat; }
.announce .a-body { padding: 14px 16px; }
.announce .a-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--accent-strong); text-transform: uppercase; letter-spacing: .5px; }
:root[data-theme="light"] .announce .a-tag { color: var(--brand-purple); }
.announce h3 { margin: 6px 0 4px; font-size: 17px; }
.announce p { margin: 0; color: var(--text-2); font-size: 14px; }
.announce .a-cta { margin-top: 10px; }

/* ------------------------------------------------------------------ points */
.balance-card { position: relative; overflow: hidden; padding: 22px; border-radius: var(--r-xl); background: radial-gradient(120% 140% at 0% 0%, #3b2d8f 0%, #1d1b38 55%, #14132b 100%); color: #fff; border: 1px solid #3d3a66; }
:root[data-theme="light"] .balance-card { background: radial-gradient(120% 140% at 0% 0%, #7d6ff0 0%, #6c5ce7 45%, #4a3bc4 100%); border-color: transparent; }
.balance-card::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; inset-inline-end: -80px; top: -110px; background: radial-gradient(circle, rgba(212, 255, 58, .25), transparent 70%); }
.balance-card .coin { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: linear-gradient(145deg, #ffd34d, #f59e0b); box-shadow: 0 10px 24px -8px rgba(245, 158, 11, .8), inset 0 -4px 0 rgba(0, 0, 0, .15); flex: 0 0 auto; }
.balance-card .big { font-size: 46px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; }
.balance-card .progress { background: rgba(255, 255, 255, .15); margin-top: 18px; }
.balance-card .progress > i { background: linear-gradient(90deg, #8b7ff0, #ffd34d); }
.mission { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.mission + .mission { border-top: 1px solid var(--border); }
.mission .m-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: 0 0 auto; }
.mission .m-main { flex: 1; min-width: 0; }
.mission .m-main b { display: block; }
.mission .progress { height: 6px; margin-top: 7px; max-width: 220px; }
.mission .m-pts { height: 34px; padding: 0 14px; border-radius: var(--pill); background: var(--surface-2); display: grid; place-items: center; font-weight: 900; color: var(--star); flex: 0 0 auto; }
.mission .m-done { height: 34px; padding: 0 14px; border-radius: var(--pill); background: var(--success-soft); color: var(--success); display: grid; place-items: center; font-weight: 900; }
.week { display: flex; justify-content: space-between; gap: 6px; margin-top: 14px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.week .d i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-style: normal; font-size: 17px; }
.week .d.done i { background: linear-gradient(145deg, #ff9a3c, #ff5e1a); box-shadow: 0 6px 16px -6px #ff5e1a; }
.week .d.frozen i { background: linear-gradient(145deg, #7dd3fc, #38bdf8); }
.week .d.today i { box-shadow: inset 0 0 0 2.5px #ff7a1a; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.store-item { padding: 16px; border-radius: var(--r-lg); border: 1.5px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.store-item.gold { border-color: rgba(245, 177, 0, .55); background: linear-gradient(180deg, rgba(245, 177, 0, .08), transparent); }
.store-item .s-ico { font-size: 26px; }
.store-item b { font-size: 15.5px; }
.store-item .cost { font-weight: 900; color: var(--star); }
.perk-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.perk-list li { display: flex; gap: 10px; align-items: flex-start; }
.perk-list li::before { content: "✦"; color: var(--gold); flex: 0 0 auto; }
.info-section { margin-bottom: 14px; }
.info-section h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 17px; }
.info-section h3 .hi { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); font-size: 20px; }
.info-section ul { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.info-section ul li::marker { color: var(--fire); }

/* celebration */
.celebrate { position: fixed; inset: 0; z-index: 500; pointer-events: none; display: grid; place-items: center; }
.celebrate .c-card { pointer-events: auto; text-align: center; padding: 26px 30px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toast-in .45s var(--ease-spring) both; max-width: 340px; }
.celebrate .c-emoji { font-size: 64px; line-height: 1; animation: bump 1s var(--ease-spring) infinite alternate; }
.celebrate .c-pts { font-size: 34px; font-weight: 900; color: var(--star); margin-top: 8px; }
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; border-radius: 3px; z-index: 499; pointer-events: none; animation: confetti 2.4s var(--ease) forwards; }
@keyframes confetti { to { transform: translateY(105vh) rotate(720deg); opacity: .7; } }

/* ------------------------------------------------------------------ side drawer (mobile menu) */
.drawer-overlay { position: fixed; inset: 0; z-index: 250; background: var(--overlay); opacity: 0; transition: opacity .25s; }
.drawer-overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 251; width: min(360px, 88vw); background: var(--bg);
  transform: translateX(-102%); transition: transform .3s var(--ease); display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
[dir="rtl"] .drawer { transform: translateX(102%); }
.drawer.show { transform: none !important; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px; }
.drawer-head h2 { font-size: 26px; font-weight: 900; margin: 0; letter-spacing: -.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 14px calc(30px + env(safe-area-inset-bottom)); }
.menu-profile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.menu-profile .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-profile small { color: var(--text-2); }
.menu-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.menu-tile { padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); text-align: start; display: flex; flex-direction: column; gap: 4px; min-height: 104px; }
.menu-tile.streak { background: var(--streak-bg); border-color: var(--streak-border); }
.menu-tile.premium { background: linear-gradient(135deg, #2b8af7, #7c3aed); color: #fff; border-color: transparent; }
.menu-tile b { font-size: 16px; }
.menu-tile small { opacity: .85; font-size: 12.5px; }
.menu-section { font-size: 15px; font-weight: 800; margin: 20px 4px 10px; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shortcut { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 14.5px; text-align: start; min-width: 0; }
.shortcut:hover { background: var(--surface-2); }
.shortcut .si { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.shortcut .si .ic { width: 19px; height: 19px; }
.settings-list { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: start; font-weight: 600; transition: background-color .12s; }
.settings-row + .settings-row { border-top: 1px solid var(--border); }
.settings-row:hover { background: var(--surface-2); }
.settings-row .ri { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); flex: 0 0 auto; }
.settings-row .ri .ic { width: 20px; height: 20px; }
.settings-row .rv { margin-inline-start: auto; color: var(--text-2); font-size: 13.5px; display: flex; align-items: center; gap: 4px; }
.settings-row.danger { color: var(--danger); }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); border: 1.5px solid var(--border); font-weight: 700; text-align: start; width: 100%; }
.choice.active { border-color: var(--accent); background: var(--accent-soft); }
.choice .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); margin-inline-start: auto; display: grid; place-items: center; }
.choice.active .radio { border-color: var(--accent); }
.choice.active .radio::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }

/* ------------------------------------------------------------------ groups */
.group-cover { height: 220px; background: linear-gradient(135deg, var(--brand-purple), #2a1f7a 60%, var(--brand-lime)) center/cover no-repeat; border-radius: 0 0 var(--r-lg) var(--r-lg); position: relative; }
@media (min-width: 900px) { .group-cover { border-radius: var(--r-lg); margin: 18px 16px 0; height: 280px; } }
.group-head { padding: 0 20px; }
.group-head .g-av { width: 96px; height: 96px; border-radius: 26px; margin-top: -48px; border: 5px solid var(--bg); background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: #fff; font-size: 38px; font-weight: 900; position: relative; }
.group-head h1 { font-size: 26px; font-weight: 900; margin: 10px 0 4px; letter-spacing: -.4px; }
.privacy-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); font-weight: 700; }
.member-strip { display: flex; margin-top: 12px; }
.member-strip .avatar { --s: 32px; box-shadow: 0 0 0 2.5px var(--bg); }
.member-strip .avatar + .avatar { margin-inline-start: -9px; }
.role-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 800; text-transform: capitalize; }
.role-tag.owner { background: var(--warn-soft); color: var(--warn); }
.role-tag.admin { background: var(--accent-soft); color: var(--accent-strong); }
.role-tag.moderator { background: var(--success-soft); color: var(--success); }
.event-card { display: flex; gap: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); margin-bottom: 10px; }
.event-date { width: 64px; height: 70px; border-radius: 14px; background: var(--accent-soft) center/cover no-repeat; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--accent-strong); }
.event-date b { font-size: 24px; line-height: 1; }
.event-date small { font-size: 12px; font-weight: 800; text-transform: uppercase; }

/* ------------------------------------------------------------------ auth pages */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--brand-ink); color: #f3f1ff; }
.auth-art { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.auth-art .b1 { width: 420px; height: 420px; background: var(--brand-purple); top: -120px; inset-inline-start: -100px; }
.auth-art .b2 { width: 360px; height: 360px; background: #b8e600; bottom: -140px; inset-inline-end: -60px; opacity: .35; }
.auth-art .b3 { width: 260px; height: 260px; background: #ff5f9e; top: 40%; inset-inline-start: 40%; opacity: .25; }
.auth-art > * { position: relative; z-index: 1; }
.auth-headline { font-size: clamp(34px, 4.4vw, 58px); font-weight: 900; line-height: 1.05; letter-spacing: -1.5px; margin: 0; }
.auth-headline em { font-style: normal; color: var(--brand-lime); }
.auth-sub { font-size: 17px; color: #b4b1d6; max-width: 460px; margin: 16px 0 0; }
.auth-phone { width: 300px; border-radius: 36px; background: #1d1b38; border: 1px solid #3d3a66; padding: 16px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); transform: rotate(-4deg); }
.auth-phone .ph-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; margin-bottom: 8px; width: fit-content; max-width: 85%; }
.auth-phone .ph-bubble.in { background: #26244a; }
.auth-phone .ph-bubble.out { background: var(--brand-purple); margin-inline-start: auto; color: #fff; }
.auth-phone .ph-streak { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: var(--pill); background: linear-gradient(90deg, #3a2412, #2a1a36); border: 1px solid rgba(255, 170, 90, .35); color: #ffb066; font-weight: 800; font-size: 13px; margin-bottom: 12px; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; background: #17162f; }
.auth-box { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth-box h2 { font-size: 30px; font-weight: 900; margin: 0; letter-spacing: -.8px; }
.auth-box p { margin: 0; color: #b4b1d6; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 56px; border-radius: 16px; background: #fff; color: #1f1f1f; font-weight: 800; font-size: 16px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); transition: transform .15s var(--ease); }
.google-btn:hover { transform: translateY(-1px); }
.google-btn svg { width: 22px; height: 22px; }
.auth .input { background: #26244a; border-color: #2f2d55; color: #f3f1ff; }
.auth .input:focus { border-color: #8b7ff0; }
.auth .lang-pill { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--pill); background: rgba(255, 255, 255, .08); color: #fff; font-weight: 700; }
.auth-feats { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-feats span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--pill); background: rgba(255, 255, 255, .07); font-weight: 700; font-size: 14px; }
.get-app { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.get-app .gi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-lime); color: var(--brand-ink); flex: 0 0 auto; }
.get-app div { flex: 1; min-width: 0; font-size: 13.5px; }
.get-app b { display: block; font-size: 14.5px; }
.error-box { padding: 12px 14px; border-radius: 12px; background: rgba(248, 113, 113, .14); color: #fca5a5; font-weight: 600; font-size: 14px; }
.onboard { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 120px; }
.onboard h1 { font-size: 32px; font-weight: 900; text-align: center; margin: 10px 0 6px; letter-spacing: -.8px; }
.onboard .cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; width: min(760px, 100%); margin-top: 26px; }
.cat-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: var(--r-lg); border: 2px solid var(--border); background: var(--surface); text-align: start; font-weight: 800; transition: border-color .15s, transform .15s var(--ease), background-color .15s; position: relative; }
.cat-pick:hover { transform: translateY(-2px); }
.cat-pick .ce { font-size: 30px; }
.cat-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.cat-pick.on::after { content: "✓"; position: absolute; top: 10px; inset-inline-end: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.onboard-foot { position: fixed; bottom: 0; inset-inline: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 10px; }

/* boot screen */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 1000; transition: opacity .3s; }
.boot .brand-mark { width: 64px; height: 64px; border-radius: 20px; animation: bump 1.2s var(--ease-spring) infinite; }
.boot.out { opacity: 0; pointer-events: none; }

/* misc */
.pill-tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--pill); background: var(--surface-2); font-size: 12px; font-weight: 800; color: var(--text-2); }
.kbd { font-size: 12px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-3); }
.email-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px; }
.premium-hero { padding: 28px 22px; border-radius: var(--r-xl); background: linear-gradient(135deg, #1d9bf0 0%, #6c5ce7 60%, #9b5cf6 100%); color: #fff; text-align: center; position: relative; overflow: hidden; }
.premium-hero .ph-badge { width: 92px; height: 92px; margin: 0 auto 14px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.premium-hero .ph-badge svg { width: 54px; height: 54px; color: #fff; }
.premium-hero h1 { margin: 0; font-size: 28px; font-weight: 900; }
.premium-hero p { margin: 8px auto 0; max-width: 420px; opacity: .92; }
.feature-row { display: flex; gap: 14px; padding: 14px 0; }
.feature-row + .feature-row { border-top: 1px solid var(--border); }
.feature-row .fi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); flex: 0 0 auto; font-size: 20px; }
.sound-head { display: flex; gap: 18px; align-items: center; padding: 18px; border-radius: var(--r-xl); background: linear-gradient(180deg, var(--surface-2), transparent); }
.sound-cover { width: 120px; height: 120px; border-radius: 50%; background: #222 center/cover no-repeat; border: 4px solid #0ea5e9; flex: 0 0 auto; position: relative; }
.sound-cover.spin { animation: disc 6s linear infinite; }
.sound-play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; }
.right-card { padding: 16px; }
.rail-links { font-size: 12.5px; color: var(--text-3); padding: 0 6px; line-height: 1.8; }
.rail-links a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1279px) {
  .app.with-rail { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .rail { display: none; }
}
@media (max-width: 1099px) {
  :root { --sidebar-w: 84px; }
  .sidebar { align-items: center; padding: 18px 10px; }
  .sidebar .brand-word, .nav-item .lbl, .sidebar .btn-create .lbl, .sidebar-me .meta, .nav-sep { display: none; }
  .brand { padding: 6px 0 16px; }
  .nav-item { width: 56px; height: 52px; justify-content: center; padding: 0; }
  .nav-item .badge { position: absolute; top: 4px; inset-inline-end: 4px; box-shadow: 0 0 0 2px var(--bg); }
  .sidebar .btn-create { width: 52px; height: 52px; padding: 0; border-radius: 16px; }
  .chat-layout { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .app, .app.with-rail, .app.full { display: block; }
  .sidebar { display: none; }
  .dock { display: flex; }
  .open-app-fab.on { display: inline-flex; }
  .main { padding-bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom)); }
  .main.no-dock { padding-bottom: 0; }
  .page { padding: 12px 12px 30px; }
  .card { border-radius: 20px; }
  .post { border-radius: 0; border-inline: 0; margin-inline: -12px; margin-bottom: 10px; }
  .desktop-head { display: none; }
  .overlay { padding: 0; align-items: flex-end; }
  .overlay.center-sm { align-items: center; padding: 16px; }
  .overlay:not(.center-sm) .modal { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; border-inline: 0; border-bottom: 0; transform: translateY(100%); }
  .overlay.show:not(.center-sm) .modal { transform: none; }
  .overlay.full .modal { max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .sheet-handle { display: block; }
  .chat-layout { display: block; height: auto; }
  .chat-layout .chat-pane { display: none; position: fixed; inset: 0; z-index: 70; }
  .chat-layout.open .chat-pane { display: flex; }
  .chat-list-pane { min-height: calc(100dvh - var(--dock-h) - 24px); border: 0; }
  .msg { max-width: 86%; }
  .msg .m-actions { display: none; }
  .profile-name { font-size: 24px; }
  .stories .story-card { flex-basis: 104px; height: 170px; }
  .explore-grid { border-radius: 0; margin: 0 -12px; }
  .reels-desktop-nav { display: none; }
  .reel-stage { max-width: none; }
  .toast-stack { bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom)); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 64px 22px 10px; min-height: auto; }
  .auth-art .auth-phone { display: none; }
  .auth-panel { padding: 22px 18px 40px; background: transparent; place-items: start center; }
  .grid-cards { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* full-bleed pages (reels) — no bottom padding; overlay text sits above the dock */
.main.flush { padding-bottom: 0 !important; }
@media (max-width: 767px) {
  .main.flush .reel-info, .main.flush .reel-side { bottom: calc(var(--dock-h) + 28px + env(safe-area-inset-bottom)); }
  .main.flush .reel-progress { bottom: calc(var(--dock-h) + 20px + env(safe-area-inset-bottom)); }
  .reel-top h1 { font-size: 20px; }
}

/* chat themes carry their own light/dark look regardless of the site theme */
.chat-pane.light-theme { color-scheme: light; --text: #14132b; --text-2: #4a4868; --text-3: #8b89a8; --surface: #ffffff; --surface-2: #f1efff; --surface-3: #e7e4fb; --border: #e6e4f2; --border-strong: #cfcbe6; --accent-soft: rgba(108, 92, 231, .12); --streak-bg: linear-gradient(90deg, #fff4e5, #fffbe8); --streak-border: #ffd9a8; --streak-text: #e8590c; color: var(--text); }
.chat-pane.dark-theme { color-scheme: dark; --text: #e9edef; --text-2: #aebac1; --text-3: #8696a0; --surface: #202c33; --surface-2: #2a3942; --surface-3: #33444f; --border: #2a3942; --border-strong: #3b4a54; color: var(--text); }
.chat-head .icon-btn { color: var(--chat-bar-text, var(--text)); }
.chat-hit { background: #fde047; color: #14132b; border-radius: 3px; padding: 0 1px; }
.announce.unread { box-shadow: 0 0 0 2px var(--brand-purple); }
.menu-tile.premium .ic, .premium-hero .ph-badge svg { --vcheck: #5b6cf0; }
.notif { margin-bottom: 4px; }
.notif.unread:has(.n-thumb)::before { inset-inline-end: auto; inset-inline-start: 6px; top: 14px; transform: none; width: 8px; height: 8px; }
.notif:has(.n-thumb) .n-text { padding-inline-end: 0; }
@media (max-width: 420px) {
  .composer-tools { gap: 2px; padding: 8px 10px; flex-wrap: nowrap; }
  .composer-tools .lbl { min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tool-btn { width: 36px; height: 36px; flex: 0 0 auto; }
  .tool-btn .ic { width: 21px; height: 21px; }
}
.reel-top .segmented button { white-space: nowrap; }
@media (max-width: 480px) {
  .reel-top { gap: 6px; padding: 10px 8px; }
  .reel-top h1 { display: none; }
  .reel-top .segmented { margin-inline-end: auto; }
  .reel-top .segmented button { height: 30px; padding: 0 12px; font-size: 13px; }
  .reel-top [data-open-app] { padding: 0 9px; }
}

/* website ads (ui/ads.js) */
.web-ad { position: relative; margin-bottom: 14px; padding: 26px 12px 12px; overflow: hidden; min-height: 60px; }
.web-ad .web-ad-label { position: absolute; top: 7px; inset-inline-start: 12px; font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--text-3); }
.web-ad ins { min-height: 50px; }
.web-ad-test ins { display: none !important; }
.web-ad-ph { display: grid; place-items: center; gap: 4px; min-height: 110px; border: 2px dashed var(--border-strong); border-radius: 12px; color: var(--text-3); font-weight: 700; font-size: 13px; text-align: center; padding: 10px; }
.web-ad-ph small { font-weight: 500; font-size: 12px; }
.reel.reel-ad { background: #000; }
.reel-ad-card { width: min(420px, 92%); background: var(--surface); border-radius: 20px; }
@media (max-width: 767px) { .web-ad.card { border-radius: 0; border-inline: 0; margin-inline: -12px; } }

/* ------------------------------------------------------------------ guest (signed-out) pages — pages/guest.js */
.guest .topbar { padding-inline: 16px; }
.guest-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 14px; padding: 12px max(16px, calc((100vw - 760px) / 2)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: var(--brand-navy, #14132b); color: #fff; box-shadow: 0 -6px 24px rgba(0, 0, 0, .25); }
.guest-bar b { display: block; font-size: 15px; }
.guest-bar span { display: block; font-size: 13px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .guest-brand { display: none; } .guest .topbar .actions .btn { padding-inline: 12px; } }

/* reCAPTCHA v3: Google allows hiding its badge when the notice is shown in
   the sign-in box instead (pages/login.js) — keeps it off the guest bar. */
.grecaptcha-badge { visibility: hidden !important; }

/* "Not interested" / "Hide posts from X": a post folded into "Hidden · Undo" (ui/post.js). */
.post-hidden-note { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.post-hidden-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text-2); flex: none; }
.post-hidden-text { flex: 1; min-width: 0; }
.post-hidden-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
