/* ============================================================
   Rafiq — glass / liquid design system
   ============================================================ */

:root {
  --bg: #06070f;
  --bg-2: #0a0d1a;
  --text: #eef1ff;
  --muted: #98a2bd;
  --muted-2: #6f7896;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-soft: rgba(255, 255, 255, 0.035);
  --stroke: rgba(255, 255, 255, 0.13);
  --stroke-soft: rgba(255, 255, 255, 0.07);
  --aqua: #5eead4;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --amber: #fbbf24;
  --danger: #fb7185;
  --ok: #34d399;
  --grad: linear-gradient(135deg, #5eead4 0%, #8b5cf6 52%, #f472b6 100%);
  --grad-soft: linear-gradient(135deg, rgba(94, 234, 212, 0.22), rgba(139, 92, 246, 0.24) 55%, rgba(244, 114, 182, 0.2));
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 18px 50px -22px rgba(139, 92, 246, 0.75);
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --sidebar: 264px;
  --nav-h: 74px;
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Kufi Arabic", "Tajawal", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
::selection { background: rgba(139, 92, 246, 0.45); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: content-box; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------------------------------------------------- background -- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(1200px 700px at 80% -10%, #141a3a 0%, transparent 60%), var(--bg); }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5; will-change: transform; }
.b1 { width: 46vw; height: 46vw; background: radial-gradient(circle at 30% 30%, #3b82f6, transparent 65%); top: -12vw; inset-inline-start: -8vw; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 40vw; height: 40vw; background: radial-gradient(circle at 40% 40%, #a855f7, transparent 65%); bottom: -14vw; inset-inline-end: -6vw; animation: drift2 32s ease-in-out infinite alternate; }
.b3 { width: 30vw; height: 30vw; background: radial-gradient(circle at 50% 50%, #14b8a6, transparent 62%); top: 34vh; inset-inline-start: 46vw; opacity: 0.32; animation: drift3 24s ease-in-out infinite alternate; }
.grain { position: absolute; inset: 0; opacity: 0.16; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E"); mix-blend-mode: overlay; }

@keyframes drift1 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }
@keyframes drift2 { from { transform: translate3d(0, 0, 0) scale(1.05); } to { transform: translate3d(-7vw, -5vh, 0) scale(0.94); } }
@keyframes drift3 { from { transform: translate3d(-3vw, 2vh, 0) scale(0.95); } to { transform: translate3d(4vw, -6vh, 0) scale(1.15); } }

/* -------------------------------------------------------------- shell -- */
.app-shell { position: relative; z-index: 1; min-height: 100dvh; }
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), var(--shadow-lg);
}
.glass-soft {
  background: var(--glass-soft);
  border: 1px solid var(--stroke-soft);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}

/* ------------------------------------------------------------ sidebar -- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-inline-end: 1px solid var(--stroke-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 20px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 16px;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #06070f;
  box-shadow: 0 12px 30px -10px rgba(139, 92, 246, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative; overflow: hidden;
}
.brand-mark::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%); animation: sheen 6s linear infinite; }
@keyframes sheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(120%); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand-tag { font-size: 11px; color: var(--muted-2); letter-spacing: 0.08em; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.side-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid transparent;
  transition: color 0.25s, background 0.25s, transform 0.25s var(--ease-spring);
}
.side-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.side-link:active { transform: scale(0.98); }
.side-link.active { color: #fff; background: var(--grad-soft); border-color: var(--stroke); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.side-link.active::before {
  content: ""; position: absolute; inset-inline-start: -16px; top: 50%; width: 4px; height: 22px;
  transform: translateY(-50%); border-radius: 99px; background: var(--grad);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.9);
}
.side-link svg { width: 21px; height: 21px; flex: none; }
.side-link .badge-dot { margin-inline-start: auto; }

.badge-dot {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--grad); color: #06070f; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 18px; border: 1px solid var(--stroke-soft); background: var(--glass-soft);
  cursor: pointer; transition: background 0.25s, transform 0.2s;
}
.user-chip:hover { background: var(--glass); }
.user-chip:active { transform: scale(0.985); }
.user-chip .meta { min-width: 0; }
.user-chip .meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta span { font-size: 11.5px; color: var(--muted-2); }

/* --------------------------------------------------------------- main -- */
.main { padding: 26px clamp(16px, 3vw, 40px) 40px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.topbar .page-title { font-size: clamp(22px, 3vw, 30px); }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 15px;
  display: grid; place-items: center; flex: none;
  background: var(--glass); border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: transform 0.2s var(--ease-spring), background 0.25s, border-color 0.25s;
}
.icon-btn:hover { background: var(--glass-strong); border-color: rgba(255, 255, 255, 0.22); }
.icon-btn:active { transform: scale(0.93); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 9px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px rgba(6, 7, 15, 0.6); }

.mobile-brand { display: none; }

/* ------------------------------------------------------------- buttons -- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--stroke); background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-weight: 700; font-size: 14px; color: var(--text);
  transition: transform 0.18s var(--ease-spring), background 0.25s, box-shadow 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn:hover { background: var(--glass-strong); border-color: rgba(255, 255, 255, 0.24); }
.btn:active { transform: scale(0.96); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #080a12; border-color: transparent; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.1); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.btn-danger { color: #ffd9df; border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.14); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple 0.65s ease-out; background: rgba(255, 255, 255, 0.35); pointer-events: none; z-index: -1; }
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--stroke-soft); color: var(--muted);
}
.chip svg { width: 14px; height: 14px; }
.chip.ok { color: #b8ffe9; background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.3); }
.chip.warn { color: #ffe9b8; background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.3); }
.chip.bad { color: #ffd6dd; background: rgba(251, 113, 133, 0.14); border-color: rgba(251, 113, 133, 0.3); }

/* -------------------------------------------------------------- inputs -- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); padding-inline-start: 4px; }
.input, .textarea, .select {
  width: 100%; padding: 13px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  color: var(--text); outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
  background: rgba(255, 255, 255, 0.07);
}
.textarea { resize: vertical; min-height: 96px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
[dir="rtl"] .select { background-position: 20px 50%, 15px 50%; }
.select option { background: #10131f; }

/* ------------------------------------------------------------- avatars -- */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--grad); color: #06070f; font-weight: 800; font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.xl { width: 104px; height: 104px; font-size: 36px; }
.avatar.online::after {
  content: ""; position: absolute; bottom: 1px; inset-inline-end: 1px;
  width: 11px; height: 11px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 2.5px #0a0d18, 0 0 12px rgba(52, 211, 153, 0.8);
}

/* ---------------------------------------------------------- page anims -- */
.page { animation: page-in 0.5s var(--ease-out) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px) scale(0.995); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.stagger > * { animation: rise 0.55s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------- hero ---- */
.hero {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  min-height: 300px; aspect-ratio: 21 / 9;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  cursor: pointer; isolation: isolate;
  animation: hero-in 0.7s var(--ease-out) both;
}
@keyframes hero-in { from { opacity: 0; transform: scale(0.98) translateY(12px); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
.hero img.bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 7, 15, 0.96) 0%, rgba(6, 7, 15, 0.55) 45%, rgba(6, 7, 15, 0.1) 100%),
    linear-gradient(to right, rgba(6, 7, 15, 0.6), transparent 60%);
}
[dir="rtl"] .hero::after {
  background: linear-gradient(to top, rgba(6, 7, 15, 0.96) 0%, rgba(6, 7, 15, 0.55) 45%, rgba(6, 7, 15, 0.1) 100%),
    linear-gradient(to left, rgba(6, 7, 15, 0.6), transparent 60%);
}
.hero:hover img.bg-img { transform: scale(1.045); }
.hero-body { position: absolute; inset-inline: 0; bottom: 0; padding: clamp(20px, 3.4vw, 40px); z-index: 2; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--aqua); }
.hero-title { font-size: clamp(26px, 4.4vw, 44px); max-width: 22ch; text-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hero-watch {
  padding: 13px 26px; border-radius: 999px; border: none;
  background: var(--grad); color: #080a12; font-weight: 800; font-size: 15px;
  box-shadow: 0 18px 40px -16px rgba(139, 92, 246, 0.95);
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.2s var(--ease-spring), filter 0.2s;
}
.hero-watch:hover { transform: translateY(-2px); filter: brightness(1.08); }
.hero-watch:active { transform: scale(0.97); }

/* -------------------------------------------------------------- rails -- */
.rail-head { display: flex; align-items: center; gap: 12px; margin: 34px 0 14px; }
.rail-head h2 { font-size: clamp(18px, 2.2vw, 22px); }
.rail-head .more { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--stroke-soft); background: var(--glass-soft); transition: 0.25s; }
.rail-head .more:hover { color: var(--text); border-color: var(--stroke); background: var(--glass); }
.rail { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }

/* --------------------------------------------------------- video card -- */
.vcard { width: 290px; border-radius: var(--r-lg); overflow: hidden; position: relative; cursor: pointer; transition: transform 0.35s var(--ease-spring); }
.vcard:hover { transform: translateY(-5px); }
.vcard .poster { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #10131f; border: 1px solid var(--stroke-soft); }
.vcard .poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.vcard:hover .poster img { transform: scale(1.06); }
.vcard .poster .fallback { position: absolute; inset: 0; background: var(--grad-soft); display: grid; place-items: center; font-size: 30px; color: rgba(255, 255, 255, 0.4); }
.vcard .overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 7, 15, 0.85), transparent 55%); opacity: 0; transition: opacity 0.3s; }
.vcard:hover .overlay { opacity: 1; }
.vcard .play-fab {
  position: absolute; inset-inline-end: 12px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transform: scale(0.85); opacity: 0; transition: 0.3s var(--ease-spring);
}
.vcard:hover .play-fab { transform: scale(1); opacity: 1; }
.vcard .duration { position: absolute; inset-inline-start: 10px; bottom: 10px; padding: 3px 8px; border-radius: 8px; background: rgba(6, 7, 15, 0.72); font-size: 11.5px; font-weight: 700; border: 1px solid var(--stroke-soft); }
.vcard .lock { position: absolute; inset-inline-end: 10px; top: 10px; padding: 4px 8px; border-radius: 999px; background: rgba(6, 7, 15, 0.7); font-size: 11px; display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--stroke-soft); }
.vcard .info { padding: 12px 4px 0; display: flex; gap: 10px; }
.vcard .info .txt { min-width: 0; }
.vcard .info h3 { font-size: 15px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .info p { font-size: 12.5px; color: var(--muted-2); margin-top: 4px; display: flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------ stories -- */
.story-rail { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 14px; scrollbar-width: none; }
.story-rail::-webkit-scrollbar { display: none; }
.story { width: 74px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.story .ring {
  width: 70px; height: 70px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 180deg, #5eead4, #8b5cf6, #f472b6, #5eead4);
  position: relative; transition: transform 0.3s var(--ease-spring);
}
.story:hover .ring { transform: translateY(-3px) scale(1.04); }
.story.seen .ring { background: rgba(255, 255, 255, 0.14); }
.story .ring .avatar { width: 100%; height: 100%; border: 3px solid #0a0c16; font-size: 24px; }
.story .ring .plus {
  position: absolute; bottom: -2px; inset-inline-end: -2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad); color: #06070f; display: grid; place-items: center;
  border: 3px solid #0a0c16; z-index: 2;
}
.story span { font-size: 11.5px; color: var(--muted); max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------- player -- */
.player-wrap { position: relative; border-radius: var(--r-xl); overflow: hidden; background: #000; border: 1px solid var(--stroke); box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9); }
.player-wrap video { width: 100%; aspect-ratio: 16 / 9; background: #000; display: block; }
.player-glow { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 80px rgba(139, 92, 246, 0.14); }
.video-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; margin-top: 26px; align-items: start; }
.panel { border-radius: var(--r-lg); padding: 20px; }
.panel h3 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel h3 svg { width: 18px; height: 18px; color: var(--aqua); }

.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--stroke-soft); }
.comment:first-child { border-top: none; }
.comment .body { min-width: 0; flex: 1; }
.comment .head { display: flex; align-items: baseline; gap: 8px; }
.comment .head b { font-size: 13.5px; }
.comment .head span { font-size: 11.5px; color: var(--muted-2); }
.comment p { font-size: 14px; color: #d7dcec; margin-top: 2px; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 10px; margin-top: 14px; }

/* --------------------------------------------------------------- chat -- */
.chat-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; height: calc(100dvh - 140px); min-height: 480px; }
.chat-list { border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.chat-list .head { padding: 16px; border-bottom: 1px solid var(--stroke-soft); }
.chat-list .items { overflow-y: auto; padding: 8px; flex: 1; }
.conv { display: flex; gap: 12px; padding: 12px; border-radius: 16px; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.conv:hover { background: rgba(255, 255, 255, 0.05); }
.conv:active { transform: scale(0.99); }
.conv.active { background: var(--grad-soft); border: 1px solid var(--stroke); }
.conv .meta { flex: 1; min-width: 0; }
.conv .meta b { display: block; font-size: 14px; }
.conv .meta p { font-size: 12.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.conv .side time { font-size: 11px; color: var(--muted-2); }

.chat-main { border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--stroke-soft); }
.chat-head .meta b { display: block; font-size: 15px; }
.chat-head .meta span { font-size: 12px; color: var(--muted-2); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(600px 300px at 50% 0%, rgba(139, 92, 246, 0.06), transparent 70%); }
.msg { max-width: min(76%, 560px); padding: 10px 14px; border-radius: 18px; font-size: 14px; position: relative; animation: msg-in 0.35s var(--ease-out) both; overflow-wrap: anywhere; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.msg .stamp { display: block; font-size: 10.5px; color: rgba(255, 255, 255, 0.45); margin-top: 4px; }
.msg.them { align-self: flex-start; background: rgba(255, 255, 255, 0.075); border: 1px solid var(--stroke-soft); border-start-start-radius: 6px; }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, rgba(94, 234, 212, 0.22), rgba(139, 92, 246, 0.3)); border: 1px solid rgba(139, 92, 246, 0.35); border-start-end-radius: 6px; }
.msg.audio { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-width: 190px; }
.msg.audio audio { height: 34px; max-width: 100%; }
.msg .playbtn { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); display: grid; place-items: center; flex: none; border: 1px solid var(--stroke); }
.msg .callrow { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.msg img.attach { border-radius: 12px; max-height: 260px; object-fit: cover; margin-bottom: 6px; }

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--stroke-soft); }
.composer .input { border-radius: 18px; padding: 11px 16px; }
.composer .icon-btn { width: 42px; height: 42px; }
.recording-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--danger); font-weight: 700; font-size: 13px; }
.recording-bar .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.8); } }

.typing { font-size: 12px; color: var(--muted-2); padding: 4px 20px; height: 22px; }

/* -------------------------------------------------------- watch party -- */
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.room-panel { border-radius: var(--r-lg); display: flex; flex-direction: column; height: min(72vh, 640px); overflow: hidden; }
.room-head { padding: 14px 16px; border-bottom: 1px solid var(--stroke-soft); display: flex; align-items: center; gap: 10px; }
.room-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.room-foot { padding: 10px; border-top: 1px solid var(--stroke-soft); }
.people { display: flex; gap: -8px; }
.people .avatar { margin-inline-start: -8px; border: 2px solid #0a0c16; }
.people .avatar:first-child { margin-inline-start: 0; }
.system-msg { align-self: center; font-size: 11.5px; color: var(--muted-2); background: rgba(255, 255, 255, 0.04); padding: 4px 12px; border-radius: 99px; }
.reaction-float { position: absolute; font-size: 26px; animation: floatUp 3s ease-out forwards; pointer-events: none; }
@keyframes floatUp { from { opacity: 1; transform: translateY(0) scale(0.8); } to { opacity: 0; transform: translateY(-160px) scale(1.4); } }

/* --------------------------------------------------------------- auth -- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.auth-card { width: min(440px, 100%); border-radius: var(--r-xl); padding: 34px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: -40% -10% auto; height: 220px; background: radial-gradient(closest-side, rgba(139, 92, 246, 0.4), transparent); filter: blur(20px); pointer-events: none; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-switch button { color: var(--aqua); font-weight: 700; background: none; border: none; }
.demo-hint { margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: rgba(94, 234, 212, 0.07); border: 1px dashed rgba(94, 234, 212, 0.3); font-size: 12px; color: var(--muted); line-height: 1.7; }
.demo-hint code { color: var(--aqua); font-size: 12px; }

/* ------------------------------------------------------------ profile -- */
.profile-cover { height: clamp(140px, 24vw, 240px); border-radius: var(--r-xl); background: var(--grad-soft); position: relative; overflow: hidden; border: 1px solid var(--stroke); }
.profile-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 200px at 20% 0%, rgba(94, 234, 212, 0.3), transparent), radial-gradient(500px 240px at 90% 100%, rgba(244, 114, 182, 0.28), transparent); }
.profile-head { display: flex; align-items: flex-end; gap: 18px; padding: 0 24px; margin-top: -46px; position: relative; z-index: 2; flex-wrap: wrap; }
.profile-head .avatar { border: 4px solid #0a0c16; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9); }
.profile-head h1 { font-size: clamp(22px, 3vw, 30px); }
.profile-head .handle { color: var(--muted-2); font-size: 13px; }
.profile-stats { display: flex; gap: 22px; margin: 18px 0 6px; }
.profile-stats div { text-align: center; }
.profile-stats b { display: block; font-size: 19px; }
.profile-stats span { font-size: 11.5px; color: var(--muted-2); }
.grid-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* -------------------------------------------------------------- admin -- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { border-radius: var(--r-md); padding: 16px 18px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset-inline-end: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: var(--grad-soft); filter: blur(10px); }
.stat b { font-size: 26px; display: block; letter-spacing: -0.03em; }
.stat span { font-size: 12px; color: var(--muted); }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--stroke-soft); background: rgba(255, 255, 255, 0.03); }
.row-item + .row-item { margin-top: 8px; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item b { font-size: 14px; display: block; }
.row-item small { color: var(--muted-2); font-size: 12px; }

/* ------------------------------------------------------------- upload -- */
.dropzone { border: 2px dashed rgba(255, 255, 255, 0.2); border-radius: var(--r-lg); padding: 40px 20px; text-align: center; transition: 0.25s; cursor: pointer; background: rgba(255, 255, 255, 0.02); }
.dropzone:hover, .dropzone.drag { border-color: rgba(139, 92, 246, 0.7); background: rgba(139, 92, 246, 0.08); }
.dropzone .icon { width: 60px; height: 60px; border-radius: 20px; background: var(--grad-soft); display: grid; place-items: center; margin: 0 auto 14px; }
.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 0.3s; box-shadow: 0 0 16px rgba(139, 92, 246, 0.8); }

/* -------------------------------------------------------------- modal -- */
.modal-root { position: fixed; inset: 0; z-index: 100; display: none; }
.modal-root.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 10, 0.66); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade 0.3s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: absolute; inset-inline: 0; margin-inline: auto; top: 50%; transform: translateY(-50%);
  width: min(520px, calc(100% - 32px)); max-height: min(86dvh, 780px); overflow: auto;
  border-radius: var(--r-xl); padding: 24px; animation: modal-in 0.45s var(--ease-spring) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-46%) scale(0.94); filter: blur(8px); } to { opacity: 1; transform: translateY(-50%) scale(1); filter: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 20px; }
.modal-head .icon-btn { margin-inline-start: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.sheet { top: auto; bottom: 0; transform: none; border-end-start-radius: 0; border-end-end-radius: 0; animation: sheet-in 0.4s var(--ease-out) both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@media (min-width: 720px) { .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: var(--r-xl); animation: modal-in 0.4s var(--ease-spring) both; } }

/* ------------------------------------------------------------- toasts -- */
.toasts { position: fixed; z-index: 200; bottom: calc(var(--nav-h) + 18px); inset-inline: 0; margin-inline: auto; width: min(420px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px;
  background: rgba(16, 19, 33, 0.9); border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600;
  animation: toast-in 0.4s var(--ease-spring) both;
}
.toast.out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.97); } }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--aqua); }
.toast.err svg { color: var(--danger); }

/* --------------------------------------------------------- bottom nav -- */
.bottom-nav {
  display: none; position: fixed; z-index: 60; bottom: max(12px, env(safe-area-inset-bottom));
  inset-inline: 12px; height: var(--nav-h);
  border-radius: 26px; padding: 0 6px;
  background: rgba(18, 21, 34, 0.72);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.nav-track { position: relative; display: flex; height: 100%; align-items: center; filter: url(#goo); }
.nav-blob { position: absolute; top: 9px; bottom: 9px; border-radius: 20px; background: linear-gradient(135deg, rgba(94, 234, 212, 0.9), rgba(139, 92, 246, 0.95)); transition: left 0.5s var(--ease-spring), width 0.5s var(--ease-spring); box-shadow: 0 8px 26px rgba(139, 92, 246, 0.55); z-index: 0; }
.nav-blob::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; opacity: 0.55; transform: translateX(8px) scale(0.9); filter: blur(6px); }
.nav-blob.moving { animation: blob-morph 0.55s var(--ease-out); }
@keyframes blob-morph { 0% { border-radius: 20px; } 35% { border-radius: 46% 54% 46% 54% / 60% 40% 60% 40%; } 70% { border-radius: 54% 46% 58% 42% / 42% 58% 42% 58%; } 100% { border-radius: 20px; } }
.nav-item { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%; color: var(--muted); border: none; background: none; font-size: 10.5px; font-weight: 700; transition: color 0.3s; }
.nav-item svg { width: 22px; height: 22px; transition: transform 0.35s var(--ease-spring); }
.nav-item.active { color: #08110f; }
.nav-item.active svg { transform: translateY(-1px) scale(1.06); }
.nav-item:active svg { transform: scale(0.9); }
.nav-item .badge-dot { position: absolute; top: 12px; inset-inline-end: 22%; min-width: 16px; height: 16px; font-size: 10px; }

/* --------------------------------------------------------- notif panel -- */
.popover { position: absolute; z-index: 80; width: min(360px, calc(100vw - 32px)); border-radius: var(--r-md); padding: 10px; max-height: 60vh; overflow: auto; }
.popover .item { display: flex; gap: 10px; padding: 10px; border-radius: 12px; font-size: 13px; cursor: pointer; }
.popover .item:hover { background: rgba(255, 255, 255, 0.06); }
.popover .item.unread { background: rgba(139, 92, 246, 0.1); }
.popover .empty { padding: 24px; text-align: center; color: var(--muted-2); font-size: 13px; }

/* --------------------------------------------------------------- call -- */
.call-overlay { position: fixed; inset: 0; z-index: 150; background: radial-gradient(1000px 600px at 50% 0%, #161a35, #05060d 70%); display: flex; flex-direction: column; animation: fade 0.35s; }
.call-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; }
.call-remote { width: 100%; height: 100%; object-fit: contain; background: #000; }
.call-local { position: absolute; inset-inline-end: 18px; bottom: 18px; width: 132px; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; border: 1px solid var(--stroke); box-shadow: var(--shadow-lg); object-fit: cover; background: #0a0c16; z-index: 2; }
.call-avatar { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.call-avatar .pulse-ring { position: absolute; width: 160px; height: 160px; border-radius: 50%; border: 2px solid rgba(139, 92, 246, 0.5); animation: ring 2s infinite; }
@keyframes ring { from { transform: scale(0.8); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.call-bar { padding: 22px; display: flex; justify-content: center; gap: 14px; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
.call-btn { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--stroke); background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: 0.25s; }
.call-btn:hover { background: rgba(255, 255, 255, 0.16); }
.call-btn.end { background: #ef4444; border-color: #ef4444; box-shadow: 0 12px 30px -10px rgba(239, 68, 68, 0.9); }
.call-btn.active { background: rgba(255, 255, 255, 0.28); }

/* --------------------------------------------------------- misc utils -- */
.muted { color: var(--muted); }
.dim { color: var(--muted-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 34px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state svg { width: 46px; height: 46px; opacity: 0.45; }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.search-wrap { position: relative; flex: 1; max-width: 420px; }
.search-wrap svg { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); }
.search-wrap .input { padding-inline-start: 44px; border-radius: 999px; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--stroke-soft); gap: 2px; }
.seg button { padding: 8px 16px; border-radius: 999px; border: none; background: none; color: var(--muted); font-size: 13px; font-weight: 700; transition: 0.25s; }
.seg button.active { background: var(--grad); color: #08110f; }

/* -------------------------------------------------------- responsive --- */
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .room-grid { grid-template-columns: minmax(0, 1fr); }
  .room-panel { height: 52vh; }
  .chat-layout { grid-template-columns: 300px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottom-nav { display: block; }
  .main { padding: 14px 14px calc(var(--nav-h) + 30px); }
  .mobile-brand { display: flex; align-items: center; gap: 10px; }
  .mobile-brand .brand-mark { width: 38px; height: 38px; border-radius: 13px; font-size: 17px; }
  .topbar { margin-bottom: 14px; position: sticky; top: 0; z-index: 30; padding: 8px 0; }
  .topbar::before { content: ""; position: absolute; inset: -14px -14px 0; background: linear-gradient(180deg, rgba(6, 7, 15, 0.92), rgba(6, 7, 15, 0.55) 70%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); z-index: -1; }
  .hero { aspect-ratio: 4 / 5; min-height: 400px; border-radius: 28px; }
  .hero-title { font-size: 27px; }
  .hero-body { padding: 22px; gap: 10px; }
  .vcard { width: 240px; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 42vh; }
  .chat-main { height: calc(100dvh - var(--nav-h) - 120px); }
  .chat-layout.chat-open .chat-list { display: none; }
  .chat-layout:not(.chat-open) .chat-main { display: none; }
  .profile-head { padding: 0 8px; }
  .profile-head .avatar { width: 84px; height: 84px; }
  .modal { width: 100%; max-height: 92dvh; }
  .toasts { bottom: calc(var(--nav-h) + 16px); }
}

@media (max-width: 420px) {
  .vcard { width: 220px; }
  .grid-videos { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .blob { animation: none; }
}

/* ------------------------------------------------------ story viewer --- */
.story-viewer { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; background: rgba(3, 4, 10, 0.86); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: fade 0.3s; padding: 12px; }
.story-stage { position: relative; width: min(440px, 100%); height: min(88dvh, 820px); border-radius: 30px; overflow: hidden; background: #0a0c16; display: flex; flex-direction: column; }
.story-bars { position: absolute; top: 12px; inset-inline: 12px; display: flex; gap: 4px; z-index: 6; }
.story-bars i { flex: 1; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.story-bars i b { display: block; height: 100%; width: 0; background: #fff; border-radius: inherit; }
.story-head { position: absolute; top: 26px; inset-inline: 14px; display: flex; align-items: center; gap: 10px; z-index: 6; }
.story-head b { font-size: 13.5px; display: block; }
.story-content { flex: 1; position: relative; overflow: hidden; }
.story-content img, .story-content video { width: 100%; height: 100%; object-fit: cover; }
.story-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 48px 34px; text-align: center; font-size: clamp(22px, 5vw, 30px); font-weight: 700; line-height: 1.45; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5); }
.story-nav { position: absolute; inset: 0; display: flex; z-index: 5; }
.story-nav button { flex: 1; background: none; border: none; }
.story-gradient-1, .gradient-1 { background: linear-gradient(150deg, #1e1b4b, #7c3aed 45%, #f472b6); }
.story-gradient-2, .gradient-2 { background: linear-gradient(150deg, #042f2e, #0d9488 50%, #5eead4); }
.story-gradient-3, .gradient-3 { background: linear-gradient(150deg, #3b0764, #db2777 55%, #fbbf24); }
.story-gradient-4, .gradient-4 { background: linear-gradient(150deg, #0c4a6e, #2563eb 50%, #a78bfa); }
.story-gradient-5, .gradient-5 { background: linear-gradient(150deg, #1c1917, #ea580c 55%, #fde68a); }
.story-swatch.sel { border-color: #fff !important; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
.reaction-layer { z-index: 4; }

.msg.audio audio { width: 100%; max-width: 240px; height: 36px; }
.people { display: flex; align-items: center; }
.people .avatar { width: 28px; height: 28px; font-size: 11px; }

@media (max-width: 860px) {
  .story-stage { width: 100%; height: 86dvh; border-radius: 24px; }
  .chat-layout .chat-main { height: calc(100dvh - 96px); }
}

/* ============================================================
   Refinement pass — glass depth, icon sizing, bidi & mobile
   ============================================================ */

html { background: var(--bg); scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
body { background: var(--bg); }

/* Inline SVGs default to 300x150 when no size is set — keep them sane. */
svg { width: 1.15em; height: 1.15em; flex: none; }
.brand-mark svg, .empty-state svg, .call-btn svg, .nav-item svg { width: auto; height: auto; }

.glass {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(9, 11, 20, 0.52);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
}
.panel.glass { background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(10, 12, 22, 0.62); }

.side-link.active::before { inset-inline-start: -10px; width: 3px; height: 20px; }

.stat { background:
    radial-gradient(120px 90px at 100% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(10, 12, 22, 0.6); }
.stat .row svg { width: 18px; height: 18px; color: var(--aqua); }
.stat b { direction: ltr; unicode-bidi: isolate; }
.stat .row { direction: inherit; }

.msg .callrow svg { width: 17px; height: 17px; color: var(--muted); }
.msg .playbtn svg { width: 16px; height: 16px; }

.chat-main { display: flex; flex-direction: column; }
.chat-list .head h2 { font-size: 17px; }

/* Mixed-direction content should lay itself out, not inherit the page. */
.msg [dir="auto"], .msg { unicode-bidi: plaintext; }
.hero-title, .vcard h3, .comment p, .row-item b, .panel h3, .popover .item { unicode-bidi: plaintext; }

.people .avatar:first-child { margin-inline-start: 0; }
.reaction-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

@media (max-width: 860px) {
  .mobile-brand .brand-name { display: none; }
  .topbar .page-title { font-size: 17px; }
  .hero { height: min(60vh, 520px); aspect-ratio: auto; min-height: 380px; }
  .hero-title { font-size: 24px; }
  .hero-body { padding: 20px; }
  .hero-actions .btn { padding: 10px 16px; }
  .chat-list { max-height: none; }
  .chat-layout { display: block; }
  .chat-layout .chat-list { height: auto; max-height: none; }
  .chat-layout:not(.chat-open) .chat-main { display: none; }
  .chat-layout.chat-open .chat-list { display: none; }
  .stat b { font-size: 22px; }
}

/* Nav: the goo filter destroyed text rendering inside the track, so the
   blob animates on its own layer and the labels stay crisp. */
.nav-track { filter: none; }
.nav-blob::after { display: none; }
.nav-blob { opacity: 1; }

.side-link.active::before { inset-inline-start: auto; inset-inline-end: -10px; }

.stat b { direction: inherit; unicode-bidi: plaintext; text-align: start; }

@media (max-width: 860px) {
  .chat-list .head { display: none; }
  .chat-layout .chat-list { height: calc(100dvh - 210px); }
  .chat-layout.chat-open .chat-main { height: calc(100dvh - 120px); }
}

/* Active nav marker: keep it inside the rail. */
.side-link.active::before { display: none; }
.side-link.active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 10px 30px -18px rgba(139, 92, 246, 0.8); }

.hero-title { max-width: 34ch; }

/* Cursor-following light inside posters — the small "liquid" touch. */
.vcard .poster::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.24), transparent 62%);
  mix-blend-mode: soft-light;
}
.vcard:hover .poster::after { opacity: 1; }
.hero { --mx: 50%; --my: 50%; }
.hero .glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.0;
  transition: opacity 0.4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, 0.28), transparent 65%);
}
.hero:hover .glow { opacity: 1; }

@media (max-width: 860px) {
  .hero-title { font-size: 22px; max-width: 100%; }
}

/* Nav icon sizing + active state contrast. */
.brand-mark svg { width: 22px; height: 22px; }
.empty-state svg { width: 46px; height: 46px; opacity: 0.45; }
.call-btn svg { width: 24px; height: 24px; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--aqua); }
.nav-item.active svg { color: #08110f; }
.nav-blob { top: 6px; bottom: auto; height: 38px; border-radius: 14px; }

/* Native scrollbars: keep them dark and thin (Safari/Chrome). */
html { scrollbar-color: auto; }
html::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
html::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

/* Nav pill covers icon + label. */
.nav-blob { top: 7px; height: 60px; border-radius: 22px; }
.nav-item.active, .nav-item.active svg { color: #08110f; }

/* Keep short conversations anchored to the composer. */
.chat-body > :first-child, .room-body > :first-child { margin-top: auto; }

@media (max-width: 860px) {
  .hero { height: min(48vh, 430px); min-height: 320px; }
}

/* ============================================================
   V2 — themes, accents, categories, rails, settings, 3D
   ============================================================ */

/* ---------------------------------------------------- accents ---------- */
[data-accent="ocean"] {
  --aqua: #7dd3fc; --violet: #3b82f6; --pink: #22d3ee;
  --grad: linear-gradient(135deg, #7dd3fc 0%, #3b82f6 55%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(125, 211, 252, 0.22), rgba(59, 130, 246, 0.26) 55%, rgba(34, 211, 238, 0.2));
}
[data-accent="sunset"] {
  --aqua: #fbbf24; --violet: #f97316; --pink: #f43f5e;
  --grad: linear-gradient(135deg, #fbbf24 0%, #f97316 55%, #f43f5e 100%);
  --grad-soft: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.24) 55%, rgba(244, 63, 94, 0.2));
}
[data-accent="mint"] {
  --aqua: #6ee7b7; --violet: #10b981; --pink: #84cc16;
  --grad: linear-gradient(135deg, #6ee7b7 0%, #10b981 55%, #84cc16 100%);
  --grad-soft: linear-gradient(135deg, rgba(110, 231, 183, 0.2), rgba(16, 185, 129, 0.24) 55%, rgba(132, 204, 22, 0.18));
}

/* ---------------------------------------------------- soft (dim) ------- */
[data-theme="soft"] {
  --bg: #14161d;
  --bg-2: #191c25;
  --text: #e6e2d8;
  --muted: #a9a598;
  --muted-2: #7d7a70;
  --glass: rgba(255, 250, 240, 0.05);
  --glass-strong: rgba(255, 250, 240, 0.085);
  --glass-soft: rgba(255, 250, 240, 0.032);
  --stroke: rgba(255, 240, 220, 0.12);
  --stroke-soft: rgba(255, 240, 220, 0.065);
}
[data-theme="soft"] .bg { background: radial-gradient(1200px 700px at 80% -10%, #262a35 0%, transparent 60%), var(--bg); }
[data-theme="soft"] .glow, [data-theme="soft"] .b3 { opacity: 0.22; }

/* ---------------------------------------------------- light ------------ */
[data-theme="light"] {
  --bg: #eef0f7;
  --bg-2: #e6e9f2;
  --text: #151a26;
  --muted: #5b6377;
  --muted-2: #818a9e;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-soft: rgba(255, 255, 255, 0.42);
  --stroke: rgba(18, 24, 40, 0.12);
  --stroke-soft: rgba(18, 24, 40, 0.07);
  --shadow-lg: 0 30px 70px -40px rgba(30, 40, 70, 0.35);
  --shadow-glow: 0 18px 40px -22px rgba(139, 92, 246, 0.5);
}
[data-theme="light"] .bg {
  background:
    radial-gradient(1000px 600px at 85% -10%, #dfe6ff 0%, transparent 60%),
    radial-gradient(900px 600px at 0% 100%, #ffe6f4 0%, transparent 55%),
    var(--bg);
}
[data-theme="light"] .blob { opacity: 0.28; }
[data-theme="light"] .grain { opacity: 0.08; }
[data-theme="light"] .glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.55)), rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 20px 40px -30px rgba(40, 50, 80, 0.35);
}
[data-theme="light"] .panel.glass { background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6)), #fff; }
[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.35)); border-inline-end-color: rgba(18, 24, 40, 0.08); }
[data-theme="light"] .side-link:hover { background: rgba(18, 24, 40, 0.05); }
[data-theme="light"] .side-link.active { background: rgba(255, 255, 255, 0.9); border-color: rgba(18, 24, 40, 0.1); box-shadow: 0 10px 24px -18px rgba(50, 60, 100, 0.5); }
[data-theme="light"] .user-chip { background: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .bottom-nav { background: rgba(255, 255, 255, 0.72); box-shadow: 0 18px 40px -22px rgba(40, 50, 80, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
[data-theme="light"] .topbar::before { background: linear-gradient(180deg, rgba(238, 240, 247, 0.96), rgba(238, 240, 247, 0.6) 70%, transparent); }
[data-theme="light"] .input, [data-theme="light"] .textarea, [data-theme="light"] .select { background: rgba(255, 255, 255, 0.72); }
[data-theme="light"] .icon-btn { background: rgba(255, 255, 255, 0.72); }
[data-theme="light"] .btn { background: rgba(255, 255, 255, 0.66); }
[data-theme="light"] .btn:hover { background: rgba(255, 255, 255, 0.92); }
[data-theme="light"] .btn-primary, [data-theme="light"] .btn-primary:hover { background: var(--grad); color: #08110f; }
[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.92); color: var(--text); }
[data-theme="light"] .msg.them { background: rgba(255, 255, 255, 0.85); }
[data-theme="light"] .msg.me { background: linear-gradient(135deg, rgba(94, 234, 212, 0.35), rgba(139, 92, 246, 0.28)); }
[data-theme="light"] .msg .stamp { color: rgba(20, 26, 40, 0.45); }
[data-theme="light"] .msg .playbtn, [data-theme="light"] .chat-head .icon-btn { background: rgba(255, 255, 255, 0.9); }
[data-theme="light"] .chat-body { background: radial-gradient(600px 300px at 50% 0%, rgba(139, 92, 246, 0.07), transparent 70%); }
[data-theme="light"] .row-item { background: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .stat { background: radial-gradient(120px 90px at 100% 0%, rgba(139, 92, 246, 0.12), transparent 70%), rgba(255, 255, 255, 0.7); }
[data-theme="light"] .seg { background: rgba(255, 255, 255, 0.55); }
[data-theme="light"] .seg button.active { color: #08110f; }
[data-theme="light"] .popover { background: rgba(255, 255, 255, 0.94); }
[data-theme="light"] .chip { background: rgba(255, 255, 255, 0.65); color: var(--muted); }
[data-theme="light"] .vcard .poster { background: #dfe3ee; }
[data-theme="light"] .data-empty { color: var(--muted-2); }
[data-theme="light"] .profile-cover { border-color: rgba(18, 24, 40, 0.1); }
[data-theme="light"] .profile-head .avatar { border-color: #eef0f7; }
[data-theme="light"] .modal { background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9)); }

/* ---------------------------------------------------- chat backgrounds -- */
[data-chatbg="aurora"] .chat-body {
  background: radial-gradient(600px 320px at 50% 0%, rgba(139, 92, 246, 0.12), transparent 72%),
    radial-gradient(400px 260px at 90% 100%, rgba(94, 234, 212, 0.1), transparent 70%);
}
[data-chatbg="sunset"] .chat-body {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.1), rgba(244, 63, 94, 0.06) 60%, transparent),
    radial-gradient(500px 300px at 10% 100%, rgba(251, 191, 36, 0.12), transparent 70%);
}
[data-chatbg="night"] .chat-body {
  background: radial-gradient(700px 400px at 50% 110%, rgba(59, 130, 246, 0.16), transparent 65%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.5), transparent);
}
[data-chatbg="plain"] .chat-body { background: transparent; }

/* ---------------------------------------------------- categories ------- */
.cat-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--stroke-soft); background: var(--glass-soft); color: var(--muted);
  transition: 0.28s var(--ease-spring); cursor: pointer;
}
.cat-chip svg { width: 16px; height: 16px; }
.cat-chip:hover { color: var(--text); border-color: var(--stroke); transform: translateY(-2px); }
.cat-chip.active { background: var(--grad); color: #08110f; border-color: transparent; box-shadow: var(--shadow-glow); }
.cat-chip small { opacity: 0.65; font-size: 11px; }

/* ---------------------------------------------------- rails + arrows --- */
.rail-wrap { position: relative; }
.rail-wrap .rail { scroll-behavior: smooth; cursor: grab; }
.rail-wrap .rail.dragging { cursor: grabbing; scroll-behavior: auto; }
.rail-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12, 14, 24, 0.6); border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; transition: 0.25s; pointer-events: none;
}
.rail-wrap:hover .rail-arrow { opacity: 1; pointer-events: auto; }
.rail-arrow:hover { background: var(--glass-strong); transform: translateY(-50%) scale(1.08); }
.rail-arrow.prev { inset-inline-start: -6px; }
.rail-arrow.next { inset-inline-end: -6px; }
[data-theme="light"] .rail-arrow { background: rgba(255, 255, 255, 0.85); }
@media (hover: none) { .rail-arrow { display: none; } }

/* ---------------------------------------------------- rating ----------- */
.rating-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rating-score { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rating-score small { font-size: 13px; color: var(--muted-2); font-weight: 600; }
.stars { display: inline-flex; gap: 4px; }
.stars button {
  width: 30px; height: 30px; display: grid; place-items: center; border: none; background: none;
  color: var(--muted-2); transition: transform 0.2s var(--ease-spring), color 0.2s;
}
.stars button svg { width: 22px; height: 22px; }
.stars button.on { color: var(--amber); }
.stars button:hover { transform: scale(1.18) rotate(-6deg); }

/* ---------------------------------------------------- settings --------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }
.theme-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-card {
  flex: 1; min-width: 110px; border-radius: 18px; padding: 10px; cursor: pointer;
  border: 1px solid var(--stroke-soft); background: var(--glass-soft); transition: 0.25s var(--ease-spring);
}
.theme-card:hover { transform: translateY(-3px); border-color: var(--stroke); }
.theme-card.sel { border-color: transparent; box-shadow: 0 0 0 2px var(--aqua), var(--shadow-glow); }
.theme-preview { height: 58px; border-radius: 12px; overflow: hidden; position: relative; margin-bottom: 8px; }
.theme-preview i { position: absolute; border-radius: 6px; }
.theme-card span { font-size: 12.5px; font-weight: 700; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; transition: 0.2s var(--ease-spring); }
.swatch:hover { transform: scale(1.08); }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
[data-theme="light"] .swatch.sel { border-color: #151a26; box-shadow: 0 0 0 3px rgba(20, 26, 40, 0.15); }
.swatch.aurora { background: linear-gradient(135deg, #5eead4, #8b5cf6 55%, #f472b6); }
.swatch.ocean { background: linear-gradient(135deg, #7dd3fc, #3b82f6 55%, #22d3ee); }
.swatch.sunset { background: linear-gradient(135deg, #fbbf24, #f97316 55%, #f43f5e); }
.swatch.mint { background: linear-gradient(135deg, #6ee7b7, #10b981 55%, #84cc16); }
.swatch.chat-aurora { background: radial-gradient(circle at 50% 0%, #8b5cf6, #0b0d18 70%); }
.swatch.chat-sunset { background: radial-gradient(circle at 50% 0%, #f97316, #0b0d18 70%); }
.swatch.chat-night { background: radial-gradient(circle at 50% 100%, #3b82f6, #0b0d18 70%); }
.swatch.chat-plain { background: #0b0d18; border: 1px solid var(--stroke); }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--stroke-soft); }
.toggle-row:first-child { border-top: none; }
.toggle-row .txt { flex: 1; }
.toggle-row b { display: block; font-size: 14px; }
.toggle-row small { color: var(--muted-2); font-size: 12px; }
.switch { width: 48px; height: 28px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); border: 1px solid var(--stroke); position: relative; cursor: pointer; transition: 0.3s; flex: none; }
.switch i { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: 0.32s var(--ease-spring); }
.switch.on { background: var(--grad); border-color: transparent; }
.switch.on i { inset-inline-start: 23px; background: #08110f; }

/* ---------------------------------------------------- 3D surfaces ------ */
.modal { transform-style: preserve-3d; }
@keyframes modal-in-3d {
  from { opacity: 0; transform: translateY(-46%) perspective(1400px) rotateX(9deg) scale(0.93); filter: blur(10px); }
  to { opacity: 1; transform: translateY(-50%) perspective(1400px) rotateX(0deg) scale(1); filter: none; }
}
.modal:not(.sheet) { animation: modal-in-3d 0.5s var(--ease-spring) both; }
.popover { transform-origin: top; animation: pop-3d 0.4s var(--ease-spring) both; }
@keyframes pop-3d { from { opacity: 0; transform: perspective(900px) rotateX(-10deg) translateY(-8px) scale(0.96); } to { opacity: 1; transform: none; } }
.modal, .popover { box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.16); }

/* ---------------------------------------------------- nav + search ----- */
.nav-fab {
  display: none; position: fixed; z-index: 61; bottom: max(12px, env(safe-area-inset-bottom));
  inset-inline-end: 12px; width: 62px; height: var(--nav-h); border-radius: 24px;
  align-items: center; justify-content: center;
  background: rgba(18, 21, 34, 0.72); border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--text);
}
.nav-fab:active { transform: scale(0.94); }
[data-theme="light"] .nav-fab { background: rgba(255, 255, 255, 0.75); }
@media (max-width: 860px) {
  .nav-fab { display: flex; }
  .bottom-nav { inset-inline-end: 84px; }
}

/* ---------------------------------------------------- search ----------- */
.search-field {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--stroke);
}
.search-field input { flex: 1; background: none; border: none; outline: none; font-size: 16px; }
.search-hero { padding: 30px 0 10px; }
.search-section { margin-top: 22px; }

/* ---------------------------------------------------- category page ---- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: clamp(20px, 2.4vw, 26px); }

/* Card badges */
.cat-badge {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700;
  background: rgba(6, 7, 15, 0.62); border: 1px solid var(--stroke-soft); color: #dfe3f2;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cat-badge svg { width: 12px; height: 12px; }
.fav-btn {
  position: absolute; top: 9px; inset-inline-end: 9px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(6, 7, 15, 0.55); border: 1px solid var(--stroke-soft); color: #fff;
  opacity: 0; transform: scale(0.9); transition: 0.25s var(--ease-spring);
}
.vcard:hover .fav-btn, .fav-btn.on { opacity: 1; transform: none; }
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn.on { color: #fb7185; background: rgba(251, 113, 133, 0.18); border-color: rgba(251, 113, 133, 0.5); }
.fav-btn.on svg { fill: currentColor; }
@media (hover: none) { .fav-btn { opacity: 1; transform: none; } }

.rating-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.muted-2 { color: var(--muted-2); }

/* V2 extras */
.btn.on { color: #fb7185; border-color: rgba(251, 113, 133, 0.45); background: rgba(251, 113, 133, 0.12); }
.btn.on svg { fill: currentColor; }
@media (max-width: 860px) { .desktop-only { display: none !important; } }
.chat-preview .msg { font-size: 12.5px; padding: 8px 12px; }
.cat-chip.active svg, .cat-chip.active { color: #08110f; }
[data-theme="light"] .cat-badge { background: rgba(255, 255, 255, 0.85); color: #151a26; }
[data-theme="light"] .fav-btn { background: rgba(255, 255, 255, 0.85); color: #151a26; }

/* Light theme contrast fixes */
[data-theme="light"] .side-link { color: #5b6377; }
[data-theme="light"] .side-link.active { color: #151a26; }
[data-theme="light"] .side-link.active svg { color: #151a26; }
[data-theme="light"] .hero-body, [data-theme="light"] .hero-title { color: #fff; }
[data-theme="light"] .hero-meta { color: rgba(255, 255, 255, 0.85); }
[data-theme="light"] .hero-meta .chip { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
[data-theme="light"] .brand-tag { color: #818a9e; }
[data-theme="light"] .nav-item { color: #5b6377; }
[data-theme="light"] .nav-item.active { color: #08110f; }
[data-theme="light"] .chat-preview { background: #eef1f8 !important; }
[data-theme="light"] .msg .stamp { color: rgba(20, 26, 40, 0.5); }
[data-theme="light"] .search-field { background: rgba(255, 255, 255, 0.75); }
[data-theme="light"] .stat b, [data-theme="light"] .rating-score { color: #151a26; }
[data-theme="light"] .switch { background: rgba(20, 26, 40, 0.14); }

/* V2 polish */
.swatch.chat-plain {
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0 6px, transparent 6px 12px), #0b0d18;
}
[data-theme="light"] .swatch.chat-plain {
  background: repeating-linear-gradient(45deg, rgba(20, 26, 40, 0.12) 0 6px, transparent 6px 12px), #eef1f7;
}
@media (max-width: 860px) {
  .theme-card { flex: 1 1 30%; min-width: 0; }
  .theme-preview { height: 46px; }
}

/* ============================================================
   V3 — layout hardening, themes gallery, nav controls, covers
   ============================================================ */

.main { overflow-x: clip; }
img, video { max-width: 100%; }
.grow, .min0 { min-width: 0; }

/* Rows that hold actions must wrap on phones instead of squeezing. */
.row-item { flex-wrap: wrap; }
.row-item > .grow { min-width: 0; flex: 1 1 60%; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-inline-start: auto; }
.row-actions .btn { flex: none; }

.profile-head { flex-wrap: wrap; row-gap: 12px; }
.profile-head .grow { min-width: 0; flex: 1 1 200px; }
.profile-head .row { flex-wrap: wrap; }

.grid-videos .vcard { width: 100%; }
.vcard .info .txt { min-width: 0; flex: 1; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
@media (max-width: 1000px) { .split-grid { grid-template-columns: minmax(0, 1fr); } }

/* Stats / tabs on small screens */
@media (max-width: 520px) {
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 8px 10px; font-size: 12px; }
  .page-head .btn { padding: 8px 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-box { gap: 10px; }
}

/* ============================================================
   V3 — theme gallery, nav controls, covers, 3D
   ============================================================ */

[data-theme="black"] { --bg: #000000; --bg-2: #050506; --text: #f4f6fb; --muted: #9aa0b4; --muted-2: #6b7188; --glass: rgba(255,255,255,.05); --glass-soft: rgba(255,255,255,.03); --stroke: rgba(255,255,255,.12); --stroke-soft: rgba(255,255,255,.06); }
[data-theme="black"] .bg { background: #000; }
[data-theme="black"] .blob { opacity: 0.28; }

[data-theme="grey"] { --bg: #23262d; --bg-2: #282b33; --text: #eef0f6; --muted: #b0b5c4; --muted-2: #878da0; --glass: rgba(255,255,255,.07); --stroke: rgba(255,255,255,.14); --glass-soft: rgba(255,255,255,.04); }
[data-theme="grey"] .bg { background: radial-gradient(900px 600px at 80% -10%, #343945 0%, transparent 60%), var(--bg); }
[data-theme="grey"] .blob { opacity: 0.22; }

[data-theme="green"] { --bg: #08130f; --bg-2: #0b1a14; --text: #e4f6ec; --muted: #9db3a7; --muted-2: #6f8a7c; --glass: rgba(150, 255, 210, 0.05); --stroke: rgba(160, 255, 215, 0.14); --glass-soft: rgba(150, 255, 210, 0.03); }
[data-theme="green"] .bg { background: radial-gradient(1000px 700px at 85% -10%, #123227 0%, transparent 60%), var(--bg); }
[data-theme="green"] .blob { opacity: 0.3; }

[data-theme="white"] { --bg: #fbfcff; --bg-2: #f2f4fa; --text: #10141f; --muted: #5a6274; --muted-2: #828a9c; --glass: rgba(255,255,255,.8); --glass-strong: rgba(255,255,255,.95); --glass-soft: rgba(255,255,255,.6); --stroke: rgba(16,20,31,.12); --stroke-soft: rgba(16,20,31,.07); }
[data-theme="white"] .bg { background: radial-gradient(900px 600px at 90% -10%, #eef2ff 0%, transparent 60%), var(--bg); }
[data-theme="white"] .blob { opacity: 0.22; }

[data-theme="beige"] { --bg: #f2e9dc; --bg-2: #ece1d0; --text: #2b2419; --muted: #6d6151; --muted-2: #8d8170; --glass: rgba(255, 252, 246, 0.75); --glass-strong: rgba(255, 253, 248, 0.95); --glass-soft: rgba(255, 252, 246, 0.5); --stroke: rgba(60, 45, 25, 0.14); --stroke-soft: rgba(60, 45, 25, 0.08); }
[data-theme="beige"] .bg { background: radial-gradient(900px 600px at 90% -10%, #f7efe0 0%, transparent 60%), var(--bg); }
[data-theme="beige"] .blob { opacity: 0.2; }

/* Shared light-surface treatment for every light theme. */
[data-lum="light"] { color-scheme: light; }
[data-lum="light"] .glass { background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(255,255,255,.6)), #fff; box-shadow: inset 0 1px 0 #fff, 0 20px 40px -30px rgba(40,50,80,.3); }
[data-lum="light"] .panel.glass { background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(255,255,255,.72)), #fff; }
[data-lum="light"] .sidebar { background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.45)); border-inline-end-color: rgba(18,24,40,.08); }
[data-lum="light"] .side-link { color: var(--muted); }
[data-lum="light"] .side-link:hover { background: rgba(18,24,40,.05); color: var(--text); }
[data-lum="light"] .side-link.active { color: var(--text); background: #fff; border-color: rgba(18,24,40,.1); box-shadow: 0 10px 24px -18px rgba(50,60,100,.5); }
[data-lum="light"] .user-chip { background: rgba(255,255,255,.6); }
[data-lum="light"] .bottom-nav { background: rgba(255,255,255,var(--nav-alpha, .8)); box-shadow: 0 18px 40px -22px rgba(40,50,80,.45), inset 0 1px 0 #fff; }
[data-lum="light"] .nav-fab { background: rgba(255,255,255,.85); }
[data-lum="light"] .topbar::before { background: linear-gradient(180deg, rgba(245,246,250,.96), rgba(245,246,250,.6) 70%, transparent); }
[data-lum="light"] .input, [data-lum="light"] .textarea, [data-lum="light"] .select { background: rgba(255,255,255,.8); }
[data-lum="light"] .icon-btn, [data-lum="light"] .btn { background: rgba(255,255,255,.75); }
[data-lum="light"] .btn:hover { background: #fff; }
[data-lum="light"] .btn-primary { background: var(--grad); color: #08110f; }
[data-lum="light"] .toast { background: rgba(255,255,255,.95); color: var(--text); }
[data-lum="light"] .msg.them { background: rgba(255,255,255,.9); }
[data-lum="light"] .msg .stamp { color: rgba(20,26,40,.5); }
[data-lum="light"] .msg .playbtn, [data-lum="light"] .chat-head .icon-btn { background: #fff; }
[data-lum="light"] .chat-body { background: radial-gradient(600px 300px at 50% 0%, rgba(139,92,246,.07), transparent 70%); }
[data-lum="light"] .row-item { background: rgba(255,255,255,.62); }
[data-lum="light"] .stat { background: radial-gradient(120px 90px at 100% 0%, rgba(139,92,246,.12), transparent 70%), rgba(255,255,255,.78); }
[data-lum="light"] .seg { background: rgba(255,255,255,.6); }
[data-lum="light"] .popover { background: rgba(255,255,255,.96); }
[data-lum="light"] .chip { background: rgba(255,255,255,.7); }
[data-lum="light"] .modal { background: linear-gradient(160deg, #fff, rgba(255,255,255,.94)); }
[data-lum="light"] .hero-body, [data-lum="light"] .hero-title { color: #fff; }
[data-lum="light"] .hero-meta .chip { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.32); color: #fff; }
[data-lum="light"] .nav-item { color: var(--muted); }
[data-lum="light"] .nav-item.active { color: #08110f; }
[data-lum="light"] .search-field { background: rgba(255,255,255,.8); }
[data-lum="light"] .switch { background: rgba(20,26,40,.16); }
[data-lum="light"] .cat-chip { background: rgba(255,255,255,.7); }
[data-lum="light"] .theme-card, [data-lum="light"] .swatch { border-color: rgba(20,26,40,.15); }
[data-lum="light"] .profile-head .avatar { border-color: #f4f5fa; }
[data-lum="light"] .rail-arrow { background: rgba(255,255,255,.9); }

/* Accent additions */
[data-accent="rose"] { --aqua: #fda4af; --violet: #e11d48; --pink: #fb7185; --grad: linear-gradient(135deg, #fda4af 0%, #e11d48 55%, #fb7185 100%); --grad-soft: linear-gradient(135deg, rgba(253,164,175,.22), rgba(225,29,72,.24) 55%, rgba(251,113,133,.2)); }
[data-accent="gold"] { --aqua: #fde68a; --violet: #d97706; --pink: #f59e0b; --grad: linear-gradient(135deg, #fde68a 0%, #d97706 55%, #f59e0b 100%); --grad-soft: linear-gradient(135deg, rgba(253,230,138,.2), rgba(217,119,6,.22) 55%, rgba(245,158,11,.18)); }

/* ---------------------------------------------------- nav look --------- */
.bottom-nav { background: rgba(18, 21, 34, var(--nav-alpha, 0.76)); }
[data-navshape="round"] .bottom-nav { border-radius: 34px; }
[data-navshape="square"] .bottom-nav { border-radius: 16px; }
[data-navshape="floating"] .bottom-nav { inset-inline: 26px; bottom: max(18px, env(safe-area-inset-bottom)); border-radius: 999px; height: 66px; }
[data-navshape="floating"] .nav-fab { bottom: max(18px, env(safe-area-inset-bottom)); }

[data-navind="none"] .nav-blob { display: none; }
[data-navind="none"] .nav-item.active { color: var(--aqua); }
[data-navind="dot"] .nav-blob,
[data-navind="bar"] .nav-blob {
  width: 18px !important; height: 4px !important; top: auto !important; bottom: 7px;
  border-radius: 99px; box-shadow: 0 0 12px var(--violet);
}
[data-navind="bar"] .nav-blob { width: 26px !important; height: 3px !important; bottom: 5px; }
[data-navind="dot"] .nav-item.active,
[data-navind="bar"] .nav-item.active { color: var(--aqua); }
[data-navind="dot"] .nav-item.active svg,
[data-navind="bar"] .nav-item.active svg { color: var(--aqua); }
[data-navind="glass"] .nav-blob { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 8px 24px rgba(0,0,0,.35); }
[data-navind="glass"] .nav-item.active { color: var(--text); }

/* ---------------------------------------------------- cover ------------ */
.profile-cover { background-size: cover; background-position: center; cursor: zoom-in; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-viewer { position: fixed; inset: 0; z-index: 170; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 20px; animation: fade .25s; cursor: zoom-out; }
.cover-viewer img { max-width: 100%; max-height: 90dvh; border-radius: 18px; box-shadow: 0 40px 90px rgba(0,0,0,.7); }

/* ---------------------------------------------------- 3D tilt ---------- */
.rail-wrap { perspective: 1200px; }
.vcard { transform-style: preserve-3d; }
.vcard:hover { transform: translateY(-6px) rotateX(2.5deg) rotateY(-1.5deg); }
[dir="rtl"] .vcard:hover { transform: translateY(-6px) rotateX(2.5deg) rotateY(1.5deg); }
.grid-videos .vcard:hover { transform: translateY(-4px) scale(1.01); }

/* ---------------------------------------------------- chat menu -------- */
.popmenu { position: absolute; z-index: 90; min-width: 190px; border-radius: 18px; padding: 8px; }
.popmenu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: none; background: none; color: var(--text); font-size: 13.5px; font-weight: 600; text-align: start; }
.popmenu button:hover { background: rgba(255,255,255,.08); }
.popmenu button.danger { color: var(--danger); }
[data-lum="light"] .popmenu button:hover { background: rgba(20,26,40,.06); }

/* ---------------------------------------------------- misc ------------- */
.slider { -webkit-appearance: none; width: 100%; height: 6px; border-radius: 99px; background: rgba(255,255,255,.16); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--grad); box-shadow: 0 4px 12px rgba(0,0,0,.4); cursor: pointer; }
[data-lum="light"] .slider { background: rgba(20,26,40,.16); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.theme-dot { border-radius: 16px; padding: 8px; cursor: pointer; border: 2px solid transparent; background: var(--glass-soft); transition: .25s var(--ease-spring); text-align: center; }
.theme-dot:hover { transform: translateY(-2px); }
.theme-dot.sel { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(94,234,212,.15); }
.theme-dot i { display: block; height: 34px; border-radius: 10px; margin-bottom: 6px; border: 1px solid rgba(255,255,255,.12); }
.theme-dot span { font-size: 11px; font-weight: 700; }

.mobile-only { display: none !important; }
@media (max-width: 860px) {
  .mobile-only { display: grid !important; }
  .topbar [data-profile-btn] { display: none !important; }
}

/* Nav blob follows the chosen accent. */
.nav-blob { background: var(--grad); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); }

/* Chat header: never squeeze the name. */
.chat-head { gap: 8px; }
.chat-head .meta { min-width: 0; flex: 1; }
.chat-head .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
@media (max-width: 860px) {
  .chat-head { padding: 10px 12px; gap: 6px; }
  .chat-head .icon-btn { width: 38px; height: 38px; }
  .chat-head .avatar { width: 38px; height: 38px; }
}

/* Nav labels breathe; indicator sits below them. */
.nav-item { padding-block: 6px 10px; }
[data-navind="dot"] .nav-blob, [data-navind="bar"] .nav-blob { bottom: 4px; }

/* Floating bar must leave room for the search button. */
[data-navshape="floating"] .bottom-nav { inset-inline: 18px 92px; }
[data-navshape="round"] .bottom-nav, [data-navshape="square"] .bottom-nav { inset-inline-end: 84px; }

/* Extra accent swatches */
.swatch.rose { background: linear-gradient(135deg, #fda4af, #e11d48 55%, #fb7185); }
.swatch.gold { background: linear-gradient(135deg, #fde68a, #d97706 55%, #f59e0b); }

/* Phone profile: stack identity above the actions. */
@media (max-width: 860px) {
  .profile-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-top: -44px; padding: 0 6px; }
  .profile-head .avatar { align-self: flex-start; }
  .profile-head h1 { font-size: 24px; }
  .profile-head .row { width: 100%; }
  .profile-head .row .btn { flex: 1 1 auto; justify-content: center; }
  .profile-stats { gap: 14px; justify-content: space-between; }
}

@media (max-width: 860px) {
  .profile-head .grow { flex: 0 0 auto; }
}


/* ============================================================
   V4 — stories, nav variants, favourites, ratings
   ============================================================ */

html.story-open, html.story-open body { overflow: hidden !important; }
.story-viewer {
  z-index: 200; padding: 10px; gap: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(3, 4, 10, 0.95);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
  transition: opacity .2s;
}
.story-viewer.closing { opacity: 0; }
.story-topbar {
  position: fixed; top: max(10px, env(safe-area-inset-top)); inset-inline: 12px;
  display: flex; align-items: center; gap: 8px; z-index: 30;
}
.story-topbar .icon-btn { width: 44px; height: 44px; border-radius: 16px; background: rgba(255,255,255,.12); }
.story-topbar .icon-btn.danger { color: var(--danger); }
.story-stage {
  position: relative; width: min(440px, 100%); height: min(86dvh, 780px);
  border-radius: 28px; overflow: hidden; background: #0a0c16; border: 1px solid var(--stroke);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9);
}
.story-content { position: absolute; inset: 0; }
.story-content img, .story-content video { width: 100%; height: 100%; object-fit: cover; }
.story-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 54px 32px; text-align: center; font-size: clamp(22px, 5vw, 30px); font-weight: 700; line-height: 1.5; color: #fff; text-shadow: 0 4px 26px rgba(0,0,0,.55); }
.story-head { position: absolute; top: 14px; inset-inline: 14px; display: flex; align-items: center; gap: 10px; z-index: 6; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.story-bars { top: 4px; inset-inline: 14px; }
.story-nav { z-index: 4; }
.story-nav button { pointer-events: auto; }
.story-swatch { width: 38px; height: 38px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.story-swatch.sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }

[data-navshape="wide"] .bottom-nav { inset-inline: 8px 84px; border-radius: 26px; height: 70px; }
[data-navshape="compact"] .bottom-nav { inset-inline: 56px 92px; border-radius: 26px; height: 62px; }
[data-navshape="dock"] .bottom-nav { inset-inline: 26px 92px; border-radius: 18px 18px 30px 30px; }
[data-navshape="inset"] .bottom-nav { inset-inline: 38px 92px; border-radius: 22px; height: 60px; }

[data-navind="ring"] .nav-blob { background: transparent; border: 2px solid var(--aqua); box-shadow: 0 0 18px var(--aqua); }
[data-navind="glow"] .nav-blob { background: transparent; box-shadow: 0 0 30px 8px var(--violet); }
[data-navind="pill"] .nav-blob { border-radius: 999px; }
[data-navind="underline"] .nav-blob { height: 3px !important; width: 58% !important; top: auto !important; bottom: 3px; border-radius: 3px; }
[data-navind="pulse"] .nav-blob { animation: navpulse 2s ease-in-out infinite; }
@keyframes navpulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }
[data-navind="ring"] .nav-item.active, [data-navind="glow"] .nav-item.active,
[data-navind="underline"] .nav-item.active, [data-navind="pulse"] .nav-item.active { color: var(--aqua); }
[data-navind="ring"] .nav-item.active svg, [data-navind="glow"] .nav-item.active svg,
[data-navind="underline"] .nav-item.active svg, [data-navind="pulse"] .nav-item.active svg { color: var(--aqua); }

.rating-pill {
  position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 800;
  background: rgba(6,7,15,.72); border: 1px solid var(--stroke-soft); color: #ffd98a;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.rating-pill svg { width: 11px; height: 11px; fill: currentColor; }

.fav-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

/* V4 controls */
.scroll-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row.tight { gap: 8px; padding-bottom: 2px; flex-wrap: nowrap; }
.scroll-row .theme-dot { flex: 0 0 auto; width: 78px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.chip.active { background: var(--grad); color: #08110f; border-color: transparent; font-weight: 800; }
.theme-dot i { border: 1px solid rgba(255,255,255,.14); }

/* Grid children must never be sized by their content (20-item scrollers). */
.settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.settings-grid > * { min-width: 0; }
.panel { min-width: 0; }
.scroll-row { max-width: 100%; }
@media (max-width: 860px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Nav geometry guards: never narrower than the items, never under the FAB. */
.bottom-nav { max-width: calc(100vw - 24px); }
[data-navshape="compact"] .bottom-nav { inset-inline: 44px 92px; height: 64px; }
[data-navshape="dock"] .bottom-nav { height: 66px; }
[data-navind="ring"] .nav-blob, [data-navind="glow"] .nav-blob { border-radius: 16px; }

/* Keep every shape wide enough for five items. */
[data-navshape="dock"] .bottom-nav { inset-inline: 20px 88px; }
[data-navshape="inset"] .bottom-nav { inset-inline: 28px 88px; }
[data-navshape="compact"] .bottom-nav { inset-inline: 34px 88px; }
.nav-blob { transition: left .45s var(--ease-spring), width .45s var(--ease-spring), opacity .2s; }

/* Indicator geometry that always fits inside the bar. */
.nav-blob { top: 7px; height: 52px; }
[data-navind="ring"] .nav-blob, [data-navind="glow"] .nav-blob { width: 46px !important; height: 46px !important; top: 6px !important; }
.bottom-nav { padding-bottom: 2px; }

/* ============================================================
   V5 — opacity fixes for dialogs + light backgrounds
   ============================================================ */

/* Dialogs must be solid: the page behind must never show through. */
.modal {
  background: linear-gradient(160deg, rgba(20, 23, 36, 0.99), rgba(12, 14, 24, 0.985)) !important;
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  backdrop-filter: blur(30px) saturate(140%);
}
[data-lum="light"] .modal {
  background: linear-gradient(160deg, #ffffff, rgba(250, 251, 255, 0.99)) !important;
}
.modal-backdrop { background: rgba(3, 4, 10, 0.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
[data-lum="light"] .modal-backdrop { background: rgba(20, 26, 40, 0.42); }

/* Light themes (including mint/peach) need a light ambient background. */
[data-lum="light"] .bg {
  background:
    radial-gradient(900px 600px at 88% -10%, rgba(150, 170, 220, 0.35) 0%, transparent 62%),
    radial-gradient(700px 520px at 0% 100%, rgba(210, 170, 200, 0.25) 0%, transparent 55%),
    var(--bg);
}
[data-lum="light"] .icon-btn { color: #1b2233; }
[data-lum="light"] .page-title { color: var(--text); }

/* V5.1 — visible danger buttons, scrollable theme rows on desktop */
.btn-danger {
  color: #fff !important;
  background: linear-gradient(135deg, #f43f5e, #be123c) !important;
  border-color: transparent !important;
  box-shadow: 0 10px 24px -14px rgba(225, 29, 72, 0.9);
}
.btn-danger:hover { filter: brightness(1.08); }
[data-lum="light"] .btn-danger { color: #fff !important; }

@media (min-width: 861px) {
  .scroll-row[data-themes] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    overflow: visible;
    max-height: none;
  }
  .scroll-row[data-themes] .theme-dot { width: auto; }
  .scroll-row.tight { flex-wrap: wrap; overflow: visible; }
}

/* Call controls */
.call-btn.accept {
  background: linear-gradient(135deg, #34d399, #22d3ee);
  color: #04120c; border: none;
  box-shadow: 0 12px 30px -12px rgba(52, 211, 153, 0.9);
}
.call-btn.end { width: 68px; height: 68px; }
.call-btn.end svg { width: 28px; height: 28px; }
.call-btn.active { background: rgba(255, 255, 255, 0.32); }
.recording-bar { flex-wrap: wrap; }
.recording-bar .btn { padding: 6px 12px; font-size: 12px; }

.call-btn.end svg { transform: rotate(135deg); }
