/* =====================================================================
   VIBE design system — noir profond & rose néon.
   One file, tokens first, then components. No inline styles in markup.
   ===================================================================== */
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 300 800; font-display: swap; src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 400 900; font-display: swap; src: url('../fonts/outfit-latin.woff2') format('woff2'); }

:root {
  --bg: #060509;
  --bg-2: #0d0b12;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.09);
  --surface-3: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.78);
  --muted: rgba(255, 255, 255, 0.52);
  --faint: rgba(255, 255, 255, 0.32);

  --pink: #ff2e7e;
  --pink-soft: #ff6aa6;
  --violet: #a63dff;
  --grad: linear-gradient(135deg, #ff2e7e 0%, #d0379f 50%, #a63dff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 46, 126, 0.18), rgba(166, 61, 255, 0.14));
  --glow: 0 10px 34px -8px rgba(255, 46, 126, 0.6);
  --glow-sm: 0 4px 18px -6px rgba(255, 46, 126, 0.55);
  --gold: #ffcf5a;
  --ok: #2ee59d;
  --warn: #ffcf5a;
  --bad: #ff4d6d;

  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-full: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --top: calc(env(safe-area-inset-top) + 56px);
  --dock: calc(env(safe-area-inset-bottom) + 92px);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font);
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; user-select: none; -webkit-user-select: none; }
input, textarea, select { user-select: text; -webkit-user-select: text; font: inherit; color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--pink-soft); text-decoration: none; }
img, video { display: block; }
svg { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
::-webkit-scrollbar { width: 0; height: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.app-container { position: relative; width: 100%; max-width: 480px; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--bg); }
@media (min-width: 520px) { .app-container { border-left: 1px solid var(--border); border-right: 1px solid var(--border); } }

/* ---------------------------------------------------------- top bar */
.top-nav {
  position: absolute; inset: 0 0 auto 0; z-index: 50; height: var(--top);
  padding: env(safe-area-inset-top) 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: linear-gradient(180deg, rgba(6, 5, 9, 0.92) 0%, rgba(6, 5, 9, 0.75) 100%);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease), border-color 0.3s;
}
.top-nav.over-feed { background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%); border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav-brand { display: flex; align-items: center; gap: 7px; min-width: 84px; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 21px; letter-spacing: 0.06em; }
.logo-badge { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--grad); box-shadow: var(--glow-sm); }
.nav-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-full); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); }
.tab-btn { padding: 6px 13px; border-radius: var(--r-full); font-size: 13px; font-weight: 700; color: var(--muted); transition: all 0.25s var(--ease); }
.tab-btn.active { color: var(--text); background: var(--surface-3); }
.screen-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.coin-badge { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 10px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 800; font-size: 13px; min-width: 84px; justify-content: flex-end; }
.coin-badge .coin-svg-icon { width: 16px; height: 16px; color: var(--gold); }
.coin-plus { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); font-size: 13px; line-height: 1; }

/* ------------------------------------------------------------ views */
.view-screen { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px); transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s; }
.view-screen.active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; z-index: 5; }
.screen-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: calc(var(--top) + 14px) 16px calc(var(--dock) + 16px); -webkit-overflow-scrolling: touch; }
.screen-content.flush { padding-left: 0; padding-right: 0; padding-top: var(--top); }
.page-title { font-family: var(--font-display); font-size: 26px; font-weight: 900; margin-bottom: 14px; }
.section-title-wrap { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 12px; }
.section-title-wrap h3, .section-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); font-size: 14px; padding: 42px 18px; }
.empty-state::before { content: ''; width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255, 46, 126, 0.3); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5aa0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9z'/%3E%3Cpath d='M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z'/%3E%3C/svg%3E"); background: var(--icon) center / 24px no-repeat, var(--grad-soft); animation: empty-in 0.4s var(--ease) both; }
.empty-state.is-chat::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5aa0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z'/%3E%3C/svg%3E"); }
.empty-state.is-video::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5aa0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='14' height='14' rx='3'/%3E%3Cpath d='M17 10l4-2.5v9L17 14'/%3E%3C/svg%3E"); }
.empty-state.is-search::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5aa0' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
@keyframes empty-in { from { opacity: 0; transform: scale(0.85); } }
@media (prefers-reduced-motion: reduce) { .empty-state::before { animation: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.12); border-top-color: var(--pink); animation: spin 0.8s linear infinite; margin: 30px auto; grid-column: 1 / -1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------- buttons */
.btn-primary-gradient { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-full); background: var(--grad); color: #fff; font-weight: 800; font-size: 15px; box-shadow: var(--glow); transition: transform 0.15s var(--ease), filter 0.2s, opacity 0.2s; }
.btn-primary-gradient:active { transform: scale(0.97); }
.btn-secondary { background: var(--surface-2) !important; border: 1px solid var(--border-strong) !important; box-shadow: none !important; color: var(--text) !important; }
.btn-danger { background: rgba(255, 77, 109, 0.1) !important; border: 1px solid rgba(255, 77, 109, 0.45) !important; box-shadow: none !important; color: var(--bad) !important; }
.btn-ghost { min-height: 40px; padding: 0 14px; border-radius: var(--r-full); color: var(--text-2); font-weight: 700; font-size: 13px; }
button[disabled], .btn-primary-gradient[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--border-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; }
.icon-btn svg { width: 19px; height: 19px; }
.pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border-strong); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(46, 229, 157, 0.4); background: rgba(46, 229, 157, 0.1); }
.pill.warn { color: var(--warn); border-color: rgba(255, 207, 90, 0.4); background: rgba(255, 207, 90, 0.1); }
.pill.bad { color: var(--bad); border-color: rgba(255, 77, 109, 0.4); background: rgba(255, 77, 109, 0.1); }
.pill.pink { color: #fff; background: var(--grad); border: none; }

/* ----------------------------------------------------------- forms */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.form-input, .form-select, .form-textarea { width: 100%; min-height: 48px; padding: 12px 15px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font-size: 15px; outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.form-textarea { resize: vertical; min-height: 84px; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--faint); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 46, 126, 0.15); background: var(--surface-2); }
.form-select option { background: var(--bg-2); }
.form-check { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.45; cursor: pointer; }
.form-check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); margin-top: 1px; display: grid; place-items: center; transition: all 0.2s; }
.form-check input:checked { background: var(--grad); border-color: transparent; }
.form-check input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.form-hint { font-size: 12px; color: var(--muted); }
.file-pick { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); border: 1.5px dashed var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color 0.2s; }
.file-pick:active { border-color: var(--pink); }
.file-pick input { display: none; }
.file-pick.big { flex-direction: column; justify-content: center; text-align: center; padding: 26px 14px; }
.file-pick.big svg { width: 34px; height: 34px; color: var(--pink-soft); }
.search-box { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border-strong); }
.search-box svg { width: 19px; height: 19px; color: var(--muted); }
.search-box input { flex: 1; background: none; border: none; outline: none; font-size: 15px; }
.search-box:focus-within { border-color: var(--pink); }
.filter-pills { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; }
.pill-btn { padding: 8px 16px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.pill-btn.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow-sm); }

/* ------------------------------------------------------------ feed */
#viewFeed { background: #000; }
.feed-slider { position: absolute; inset: 0; }
.video-card { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease); background: #000; }
.video-card.active { opacity: 1; pointer-events: auto; }
.video-media-wrapper { position: absolute; inset: 0; }
.video-thumb-bg, .card-video-element { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-video-element { background: transparent; }
.video-card::after { content: ''; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%); pointer-events: none; z-index: 2; }
.video-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 22%; background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent); pointer-events: none; z-index: 2; }
.video-sim-bg { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; pointer-events: none; }
.play-state-indicator { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transform: scale(0.8); transition: all 0.25s var(--ease); }
.video-card.paused .play-state-indicator { opacity: 1; transform: scale(1); }
.video-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; pointer-events: none; }
.teaser-bar { position: absolute; z-index: 6; top: calc(var(--top) + 8px); left: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-full); font-size: 12px; font-weight: 800; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--border-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.teaser-bar.locked { background: var(--grad); border: none; box-shadow: var(--glow-sm); }
.sound-toggle { position: absolute; z-index: 6; top: calc(var(--top) + 6px); right: 14px; }
.action-sidebar { position: absolute; z-index: 8; right: 10px; bottom: calc(var(--dock) + 12px); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.creator-avatar-wrap { position: relative; margin-bottom: 6px; cursor: pointer; }
.avatar-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; background: var(--bg-2); }
.follow-btn { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); font-weight: 900; font-size: 15px; line-height: 1; box-shadow: var(--glow-sm); }
.action-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.icon-circle { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 0.2s var(--ease), color 0.2s; }
.icon-circle svg { width: 25px; height: 25px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.action-btn:active .icon-circle { transform: scale(0.88); }
.action-btn .count { font-size: 12px; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.like-btn.liked .icon-circle { color: var(--pink); animation: pop 0.35s var(--ease); }
.like-btn.liked .icon-circle svg { filter: drop-shadow(0 0 10px rgba(255, 46, 126, 0.8)); }
@keyframes pop { 40% { transform: scale(1.25); } }
.gold-glow { color: var(--gold); }
.creator-meta { position: absolute; z-index: 7; left: 14px; right: 82px; bottom: calc(var(--dock) + 14px); }
.creator-identity { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; cursor: pointer; }
.username { font-family: var(--font-display); font-weight: 800; font-size: 17px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.verified-badge { width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--grad); font-size: 10px; font-weight: 900; }
.caption { font-size: 14px; color: var(--text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.caption strong { color: #fff; }
.audio-track-info { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.audio-track-info svg { width: 14px; height: 14px; }
.paywall-overlay { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; padding: var(--top) 80px var(--dock) 18px; background: radial-gradient(120% 80% at 50% 40%, rgba(255, 46, 126, 0.14), rgba(0, 0, 0, 0.55) 60%); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.glass-paywall-card { width: 100%; max-width: 300px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 20px; text-align: center; border-radius: var(--r-xl); background: rgba(14, 10, 20, 0.72); border: 1px solid rgba(255, 46, 126, 0.32); box-shadow: 0 20px 60px -20px rgba(255, 46, 126, 0.5); }
.glass-paywall-card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 900; }
.glass-paywall-card p { font-size: 13px; color: var(--text-2); }
.lock-icon-wrap { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: var(--glow); }
.lock-icon-wrap svg { width: 26px; height: 26px; }
.unlock-price-tag { display: flex; align-items: baseline; gap: 6px; margin: 4px 0; }
.price-amount { font-family: var(--font-display); font-size: 34px; font-weight: 900; }
.price-unit { font-size: 13px; color: var(--muted); font-weight: 700; }
.unlock-trigger { width: 100%; }
.subtext-secure { font-size: 11px; color: var(--muted); }
.feed-state { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 30px; text-align: center; color: var(--text-2); background: radial-gradient(90% 60% at 50% 40%, rgba(255, 46, 126, 0.12), transparent 70%), var(--bg); }
.feed-state h3 { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: #fff; }

/* -------------------------------------------------------- discover */
.creators-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.creator-card-small { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-lg); overflow: hidden; background: var(--grad-soft); border: 1px solid var(--border); cursor: pointer; transition: transform 0.2s var(--ease); }
.creator-card-small:active { transform: scale(0.97); }
.creator-card-small > img { width: 100%; height: 100%; object-fit: cover; }
.creator-card-small .card-avatar { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--pink); }
.card-overlay { position: absolute; inset: auto 0 0 0; padding: 30px 12px 12px; background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), transparent); display: flex; flex-direction: column; gap: 2px; }
.c-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.c-subs { font-size: 12px; color: var(--text-2); }
.announce-banner { margin-bottom: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--grad-soft); border: 1px solid rgba(255, 46, 126, 0.35); font-size: 13px; font-weight: 600; }

/* -------------------------------------------------------- messages */
.inbox-header { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 6px; }
.inbox-header:not(:has(.unread-pill:not(.hidden))) { display: none; }
.inbox-header h2 { font-family: var(--font-display); font-size: 26px; font-weight: 900; }
.unread-pill { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-full); display: inline-grid; place-items: center; background: var(--grad); font-size: 11px; font-weight: 800; }
.conversations-list { display: flex; flex-direction: column; gap: 4px; }
.chat-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); cursor: pointer; transition: background 0.2s; }
.chat-row:active { background: var(--surface); }
.chat-row.unread { background: var(--surface); }
.chat-avatar-wrap img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--bg-2); }
.chat-row.unread .chat-avatar-wrap img { outline: 2px solid var(--pink); outline-offset: 2px; }
.chat-info { flex: 1; min-width: 0; }
.chat-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-name { font-weight: 800; font-size: 15px; }
.chat-time { font-size: 12px; color: var(--muted); }
.chat-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .chat-preview { color: var(--text-2); font-weight: 600; }
#inboxThreadView { position: absolute; inset: 0; z-index: 4; flex-direction: column; background: var(--bg); padding: calc(var(--top) + 6px) 0 calc(env(safe-area-inset-bottom) + 10px); }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 10px; border-bottom: 1px solid var(--border); }
.thread-head .who { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.thread-head .who img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.thread-head .who span { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#inboxThreadMessages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 20px; font-size: 14px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--grad); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble .meta { display: block; margin-top: 4px; font-size: 10px; opacity: 0.65; text-align: right; }
.bubble.gift { background: rgba(255, 207, 90, 0.1); border: 1px solid rgba(255, 207, 90, 0.5); color: var(--gold); }
.composer { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; border-top: 1px solid var(--border); }
.composer input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border-strong); outline: none; }
.composer input:focus { border-color: var(--pink); }
.send-btn { height: 46px; padding: 0 16px; border-radius: var(--r-full); background: var(--grad); font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; box-shadow: var(--glow-sm); white-space: nowrap; }
.send-btn small { font-size: 11px; opacity: 0.85; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 19px; flex-shrink: 0; }
.load-older { align-self: center; }

/* --------------------------------------------------------- profile */
.profile-cover { position: relative; height: 190px; background: radial-gradient(120% 120% at 20% 0%, rgba(255, 46, 126, 0.55), transparent 55%), radial-gradient(120% 120% at 100% 30%, rgba(166, 61, 255, 0.5), transparent 55%), var(--bg-2); }
.profile-cover > img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--bg) 100%); }
.profile-cover .cover-actions { position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; }
.profile-head { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: -56px; padding: 0 16px; }
.profile-avatar { position: relative; }
.profile-avatar img { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; background: var(--bg-2); border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--pink), var(--glow); }
.profile-avatar .age-chip { position: absolute; right: -2px; bottom: 4px; font-size: 10px; font-weight: 900; padding: 3px 7px; border-radius: var(--r-full); background: var(--grad); border: 2px solid var(--bg); }
.profile-name { margin-top: 12px; display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 24px; font-weight: 900; }
.profile-handle { color: var(--muted); font-size: 14px; font-weight: 600; }
.profile-bio { margin-top: 8px; max-width: 340px; font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.wallet-card { width: 100%; margin-top: 18px; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); text-align: left; background: var(--grad-soft); border: 1px solid rgba(255, 46, 126, 0.3); }
.wallet-card .wc-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: var(--glow-sm); }
.wallet-card .wc-icon svg { width: 21px; height: 21px; }
.wallet-card .wc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wallet-card .wc-title { font-size: 12px; color: var(--text-2); font-weight: 700; }
.wallet-card .wc-value { font-family: var(--font-display); font-size: 19px; font-weight: 900; }
.wallet-card .btn-primary-gradient { min-height: 40px; padding: 0 16px; font-size: 13px; }
.stats-row { width: 100%; margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.stats-row > div { display: flex; flex-direction: column; align-items: center; padding: 12px 4px; }
.stats-row > div + div { border-left: 1px solid var(--border); }
.stats-row strong { font-family: var(--font-display); font-size: 20px; font-weight: 900; }
.stats-row span { font-size: 12px; color: var(--muted); }
.profile-actions { width: 100%; display: flex; gap: 10px; margin-top: 14px; }
.profile-actions > * { flex: 1; }
.profile-tabs { width: 100%; display: flex; margin: 20px 0 12px; border-bottom: 1px solid var(--border); }
.profile-tabs .tab-btn { flex: 1; border-radius: 0; padding: 12px; background: none; position: relative; }
.profile-tabs .tab-btn.active { background: none; color: #fff; }
.profile-tabs .tab-btn.active::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--grad); }
.media-grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.media-tile { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 6px; background: var(--bg-2); cursor: pointer; }
.media-tile img { width: 100%; height: 100%; object-fit: cover; }
.media-tile .tile-badge { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: var(--r-full); background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); }
.media-tile .tile-lock { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); font-size: 11px; }
.plans-list { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.plan-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border-strong); }
.plan-card.featured { background: var(--grad-soft); border-color: rgba(255, 46, 126, 0.55); box-shadow: var(--glow-sm); }
.plan-card.diamond { border-color: rgba(166, 61, 255, 0.55); }
.plan-title { font-weight: 800; font-size: 15px; }
.plan-feat { font-size: 12px; color: var(--muted); margin-top: 2px; }
.plan-card button { flex-shrink: 0; min-height: 36px; padding: 0 16px; border-radius: var(--r-full); background: var(--surface-3); font-weight: 800; font-size: 13px; }
.plan-card.featured button { background: var(--grad); box-shadow: var(--glow-sm); }

/* -------------------------------------------------------- settings */
.settings-top-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.settings-top-bar h2 { font-family: var(--font-display); font-size: 22px; font-weight: 900; }
.back-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); }
.back-btn svg { width: 19px; height: 19px; }
.glass-section { margin-bottom: 14px; padding: 18px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.glass-section h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.list-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.list-line:last-child { border-bottom: none; }
.list-line a { color: var(--text); }
.amount-pos { color: var(--ok); font-weight: 800; }
.amount-neg { color: var(--pink-soft); font-weight: 800; }
.plan-edit-row { display: flex; align-items: center; gap: 10px; }
.plan-edit-row > span { flex: 1; font-weight: 700; font-size: 14px; }
.plan-edit-row .form-input { width: 104px; min-height: 42px; }
.avatar-edit { display: flex; align-items: center; gap: 14px; }
.avatar-edit img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--bg-2); border: 2px solid var(--pink); }

/* ------------------------------------------------------------ dock */
.dock-nav { position: absolute; z-index: 60; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); height: 66px; display: flex; align-items: center; justify-content: space-around; padding: 0 6px; border-radius: 24px; background: rgba(16, 13, 22, 0.78); border: 1px solid var(--border-strong); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8); }
.nav-item { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); transition: color 0.2s; }
.nav-item svg { width: 23px; height: 23px; }
.nav-label { font-size: 10.5px; font-weight: 700; }
.nav-item.active { color: #fff; }
.nav-item.active svg { color: var(--pink); filter: drop-shadow(0 0 8px rgba(255, 46, 126, 0.7)); }
.upload-btn { flex: 0 0 auto; width: 54px; height: 44px; margin: 0 4px; border-radius: 16px; background: var(--grad); color: #fff; box-shadow: var(--glow); }
.upload-btn svg { width: 24px; height: 24px; }
.dot-badge { position: absolute; top: 12px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px rgba(16, 13, 22, 1), 0 0 10px var(--pink); }

/* ---------------------------------------------------------- modals */
.modal-backdrop { position: absolute; inset: 0; z-index: 300; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s var(--ease), visibility 0.25s; }
.modal-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-card { width: 100%; max-height: 88dvh; overflow-y: auto; padding: 10px 18px calc(env(safe-area-inset-bottom) + 22px); border-radius: var(--r-xl) var(--r-xl) 0 0; background: #110e17; border: 1px solid var(--border-strong); border-bottom: none; box-shadow: 0 -20px 60px -20px rgba(255, 46, 126, 0.35); transform: translateY(30px); transition: transform 0.3s var(--ease); }
.modal-backdrop.open .modal-card { transform: none; }
.modal-card::before { content: ''; display: block; width: 40px; height: 4px; margin: 0 auto 12px; border-radius: 4px; background: var(--border-strong); }
.modal-backdrop.center { align-items: center; padding: 18px; }
.modal-backdrop.center .modal-card { border-radius: var(--r-xl); border-bottom: 1px solid var(--border-strong); padding-bottom: 22px; }
.modal-backdrop.center .modal-card::before { display: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.modal-header h2 { font-family: var(--font-display); font-size: 20px; font-weight: 900; }
.close-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 14px; flex-shrink: 0; }
.modal-desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.coin-packs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.coin-pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 10px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1.5px solid var(--border); cursor: pointer; transition: all 0.2s var(--ease); }
.coin-pack.active { border-color: var(--pink); background: var(--grad-soft); box-shadow: var(--glow-sm); }
.pack-coins { font-family: var(--font-display); font-size: 24px; font-weight: 900; }
.pack-coins small { display: block; text-align: center; font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--muted); }
.pack-price { font-weight: 800; color: var(--text-2); }
.pack-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 2px 9px; border-radius: var(--r-full); background: var(--grad); font-size: 10px; font-weight: 800; white-space: nowrap; }
.invoice-box { margin-top: 14px; padding: 16px; border-radius: var(--r-lg); text-align: center; background: var(--surface); border: 1px solid var(--border-strong); }
.invoice-box .ib-title { font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #ff9f40; margin-bottom: 6px; }
.invoice-status { display: block; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--ok); }
.btn-btc { background: linear-gradient(135deg, #ff9f40, #ff6a00) !important; box-shadow: 0 10px 30px -10px rgba(255, 140, 0, 0.6) !important; }
.gift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gift-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border-radius: var(--r-lg); background: var(--surface); border: 1.5px solid var(--border); cursor: pointer; transition: all 0.2s var(--ease); }
.gift-card.active { border-color: var(--gold); background: rgba(255, 207, 90, 0.08); box-shadow: 0 6px 24px -10px rgba(255, 207, 90, 0.6); }
.gift-svg { font-size: 34px; line-height: 1.1; }
.gift-name { font-weight: 800; font-size: 13px; }
.gift-cost { font-size: 12px; color: var(--gold); font-weight: 800; }
.comments-list { display: flex; flex-direction: column; gap: 14px; min-height: 120px; max-height: 52dvh; overflow-y: auto; padding: 6px 0 12px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-item .c-user { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.c-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-body .c-name { font-family: var(--font); font-size: 13px; font-weight: 800; }
.c-text { font-size: 14px; color: var(--text-2); word-wrap: break-word; }
.c-time { font-size: 11px; color: var(--faint); margin-top: 2px; }
.c-more { color: var(--muted); font-size: 18px; padding: 0 4px; }
.add-comment-box { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.add-comment-box input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border-strong); outline: none; }
.add-comment-box input:focus { border-color: var(--pink); }
.sheet-item { width: 100%; text-align: left; padding: 15px 4px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 700; }
.sheet-item:last-child { border-bottom: none; }
.sheet-item.danger { color: var(--bad); }
.receipt-frame { width: 100%; height: 60dvh; border: 0; border-radius: var(--r-md); background: #fff; }
#viewerModal { background: #000; backdrop-filter: none; align-items: stretch; }
#viewerHost { position: relative; width: 100%; height: 100%; }
#viewerHost .viewer-close { position: absolute; z-index: 20; top: calc(env(safe-area-inset-top) + 12px); left: 12px; }
.update-changelog { font-size: 14px; line-height: 1.55; white-space: pre-wrap; max-height: 40dvh; overflow: auto; margin-bottom: 12px; color: var(--text-2); }

/* ---------------------------------------------------- progress etc */
.progress { width: 100%; height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.progress > div { width: 0; height: 100%; background: var(--grad); transition: width 0.2s; }
.toast-msg { position: fixed; z-index: 10000; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); max-width: 88%; padding: 11px 18px; border-radius: var(--r-full); text-align: center; font-size: 14px; font-weight: 700; background: rgba(22, 18, 30, 0.95); border: 1px solid rgba(255, 46, 126, 0.4); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8); opacity: 0; transform: translate(-50%, 16px); transition: all 0.25s var(--ease); pointer-events: none; }
.toast-msg.show { opacity: 1; transform: translate(-50%, 0); }
.net-banner { position: fixed; z-index: 9999; left: 50%; top: calc(env(safe-area-inset-top) + 8px); transform: translateX(-50%); display: none; padding: 6px 14px; border-radius: var(--r-full); background: var(--bad); font-size: 12px; font-weight: 800; }
.net-banner.show { display: block; }

/* ------------------------------------------------------ auth pages */
.auth-screen { height: 100dvh; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 28px) 20px 30px; background: radial-gradient(90% 50% at 15% 0%, rgba(255, 46, 126, 0.32), transparent 60%), radial-gradient(80% 50% at 100% 20%, rgba(166, 61, 255, 0.28), transparent 60%), var(--bg); }
.auth-inner { max-width: 420px; margin: 0 auto; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 26px; }
.auth-logo .brand-name { font-size: 30px; }
.auth-hero { text-align: center; margin-bottom: 22px; }
.auth-hero h1 { font-family: var(--font-display); font-size: 32px; font-weight: 900; line-height: 1.1; }
.auth-hero p { margin-top: 8px; color: var(--text-2); font-size: 15px; }
.auth-card { padding: 20px 18px; border-radius: var(--r-xl); background: rgba(17, 14, 23, 0.82); border: 1px solid var(--border-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 80px -30px rgba(255, 46, 126, 0.35); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); }
.auth-tab-btn { height: 40px; border-radius: var(--r-full); font-weight: 800; font-size: 14px; color: var(--muted); transition: all 0.25s var(--ease); }
.auth-tab-btn.active { background: var(--grad); color: #fff; box-shadow: var(--glow-sm); }
.role-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--border); cursor: pointer; transition: all 0.2s var(--ease); }
.role-card.active { border-color: var(--pink); background: var(--grad-soft); }
.role-title { font-weight: 800; font-size: 14px; }
.role-sub { font-size: 12px; color: var(--muted); }
.notice-box { margin-bottom: 16px; padding: 14px; border-radius: var(--r-md); background: rgba(255, 207, 90, 0.08); border: 1px solid rgba(255, 207, 90, 0.4); }
.notice-box strong { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--warn); }
.notice-box p { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.link-btn { display: block; width: 100%; margin-top: 14px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-2); }
.legal-foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--faint); }
.age-gate-mark { font-family: var(--font-display); font-size: 56px; font-weight: 900; line-height: 1; text-align: center; }
.captcha-slot:empty { display: none; }

/* ------------------------------------------------------ late extras */
.pack-bonus { font-size: 11px; font-weight: 800; color: var(--pink-soft); }
#dialogText { white-space: pre-wrap; }
.feed-state .btn-primary-gradient { margin-top: 6px; }
.age-gate { position: fixed; z-index: 2000; background: rgba(6, 5, 9, 0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.age-gate .modal-card { text-align: center; max-width: 420px; margin: 0 auto; padding-top: 28px; box-shadow: 0 30px 90px -30px rgba(255, 46, 126, 0.6); }
.age-gate-title { font-family: var(--font-display); font-size: 22px; font-weight: 900; margin: 6px 0 10px; }
.tab-btn { white-space: nowrap; }
.nav-tabs .tab-btn { padding: 6px 11px; font-size: 12.5px; }
.nav-brand { min-width: 0; }
.coin-badge { min-width: 0; }
@media (max-width: 360px) { .nav-brand .logo-badge { display: none; } }
