@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #09090c;
  --panel: #111116;
  --panel-2: #17171e;
  --line: #27272f;
  --muted: #92929d;
  --text: #f7f7fa;
  --purple: #9a6bff;
  --purple-2: #7043dc;
  --pink: #d69aff;
  --radius: 18px;
  font-family: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; background: var(--bg); }
body { margin: 0; overflow-x: hidden; overscroll-behavior-x: none; color: var(--text); }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.app-shell { min-height: 100vh; min-height: 100dvh; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% -15%, #332059 0, transparent 42%), var(--bg); }
.auth-card { width: min(100%, 440px); padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: rgba(17,17,22,.9); box-shadow: 0 30px 90px rgba(0,0,0,.4); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: .07em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; font-size: 15px; background: linear-gradient(135deg, var(--purple), #d3a0ff); }
.auth-card h1 { margin: 38px 0 8px; font: 700 clamp(28px, 7vw, 40px)/1.05 'Space Grotesk', sans-serif; letter-spacing: -.04em; }
.auth-copy { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; color: #d8d8e0; font-size: 13px; font-weight: 600; }
.field input, .field textarea, .chat-input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--text); background: #0d0d11; }
.primary-btn, .secondary-btn { min-height: 44px; border-radius: 12px; padding: 0 18px; font-weight: 700; transition: .2s ease; }
.primary-btn { color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-2)); box-shadow: 0 10px 25px rgba(112,67,220,.2); }
.primary-btn:disabled { cursor: wait; opacity: .65; transform: none; }
.primary-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.secondary-btn { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.secondary-btn:hover, .icon-btn:hover { border-color: #565660; background: #202027; }
.auth-switch { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 14px; }
.auth-app-actions { display: grid; gap: 10px; margin-top: 18px; }
.auth-app-actions .secondary-btn { width: 100%; }
.text-btn { padding: 0; color: #c8adff; background: transparent; font-weight: 700; }
.demo-note { margin: 20px 0 0; color: #6f6f79; text-align: center; font-size: 12px; }
.app-shell { background: var(--bg); }
.main-layout { display: grid; grid-template-columns: 230px minmax(0, 680px) 280px; gap: 32px; max-width: 1280px; min-height: 100vh; margin: auto; padding: 24px 28px; }
.sidebar { position: sticky; top: 24px; height: calc(100vh - 48px); display: flex; flex-direction: column; }
.sidebar .brand { margin: 6px 0 42px 4px; }
.nav { display: grid; gap: 7px; }
.nav-btn { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 0 14px; border-radius: 13px; color: #a8a8b2; background: transparent; text-align: left; font-weight: 600; }
.nav-btn:hover, .nav-btn.active { color: #fff; background: var(--panel-2); }
.nav-btn.active { box-shadow: inset 3px 0 0 var(--purple); }
.nav-icon { width: 21px; text-align: center; font-size: 18px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.mini-user { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.avatar { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; background: linear-gradient(135deg, #905eff, #e7b0ff); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 74px; height: 74px; font-size: 25px; }
.mini-user div { min-width: 0; }
.mini-user strong, .user-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified-badge { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 5px; border: 2px solid var(--panel); border-radius: 50%; color: #fff; background: #2589ff; box-shadow: 0 0 0 1px rgba(37,137,255,.45); font-size: 10px; font-weight: 800; line-height: 1; vertical-align: 1px; }
.spark-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 7px; padding: 3px 7px; border: 1px solid #7d4cb4; border-radius: 999px; color: #f1d9ff; background: #321c4b; font-size: 10px; font-weight: 800; vertical-align: 2px; }
.spark-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.spark-badge-icon { display: inline-flex; align-items: center; gap: 4px; min-width: 42px; height: 30px; padding: 0 7px; border: 1px solid #5d4677; border-radius: 10px; color: #d8c5e8; background: #21182d; font-size: 15px; }
.spark-badge-icon b { font-weight: 800; line-height: 1; }
.spark-badge-icon small { color: #bca6d2; font-size: 10px; font-weight: 800; }
.spark-badge-icon.earned { border-color: #a361e8; color: #ffe1ff; background: linear-gradient(135deg, #43236c, #2b1943); box-shadow: 0 5px 14px rgba(150, 82, 220, .2); }
.spark-badge-icon.earned small { color: #efc9ff; }
.spark-badge-icon.locked { opacity: .42; filter: grayscale(.55); }
.page-title .verified-badge { width: 19px; height: 19px; font-size: 13px; vertical-align: 2px; }
.story .verified-badge { width: 12px; height: 12px; margin-left: 3px; font-size: 8px; vertical-align: 1px; }
.mini-user span, .handle, .muted { color: var(--muted); font-size: 12px; }
.logout { color: var(--muted); background: transparent; text-align: left; }
.content { min-width: 0; background: var(--bg); }
.database-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #6f48a7; border-radius: 14px; color: var(--text); background: #1b1428; }
.database-banner strong { color: #e2c9ff; }
.database-banner span { flex: 1; color: var(--muted); font-size: 13px; line-height: 1.4; }
.database-banner .secondary-btn { flex: 0 0 auto; min-height: 36px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 54px; margin-bottom: 18px; }
.page-title { margin: 0; font: 700 24px 'Space Grotesk', sans-serif; letter-spacing: -.03em; }
.mobile-brand { display: none; }
.mobile-user-summary { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: #dcdce3; background: var(--panel); font-size: 17px; }
.view { animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.stories { display: flex; gap: 12px; overflow-x: auto; padding: 3px 0 20px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { min-width: 74px; display: grid; justify-items: center; gap: 7px; padding: 0; color: #c8c8d1; background: transparent; font-size: 11px; }
.story-ring { padding: 3px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), #f4c6ff); }
.story .avatar { border: 3px solid var(--bg); }
.story-ring.has-image { display: block; width: 62px; height: 62px; padding: 3px; }
.story-ring.has-image img { display: block; width: 100%; height: 100%; object-fit: cover; border: 3px solid var(--bg); border-radius: 50%; }
.story-ring.has-video { position: relative; display: grid; place-items: center; width: 62px; height: 62px; padding: 3px; }
.story-ring.has-video .avatar { width: 100%; height: 100%; }
.story-video-mark { position: absolute; z-index: 1; right: 0; bottom: 0; display: grid; place-items: center; width: 21px; height: 21px; border: 2px solid var(--bg); border-radius: 50%; color: #fff; background: var(--purple); font-size: 9px; }
.story.add .story-ring { background: var(--line); }
.story.add .avatar { color: var(--purple); background: var(--panel-2); }
.composer, .post-card, .profile-card, .conversation, .empty-state { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.composer { padding: 16px; margin-bottom: 16px; }
.composer-row { display: flex; gap: 12px; align-items: center; }
.composer input { flex: 1; min-width: 0; border: 0; color: var(--text); background: transparent; font-size: 15px; }
.composer input:focus { outline: none; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.attachments { display: flex; gap: 8px; color: var(--muted); font-size: 13px; }
.attach-control { display: inline-flex; align-items: center; gap: 5px; color: #c8adff; cursor: pointer; }
.attach-control input, .upload-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.attach-control:hover { color: #fff; }
.media-preview { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; background: #0d0d11; }
.media-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.post-card { padding: 18px; margin-bottom: 14px; }
.post-head { display: flex; align-items: center; gap: 11px; }
.post-head > div { min-width: 0; }
.post-head .more { margin-left: auto; color: var(--muted); background: transparent; font-size: 19px; }
.post-content { margin: 16px 0; color: #e7e7ec; line-height: 1.55; white-space: pre-wrap; }
.post-image { width: 100%; max-height: 420px; object-fit: cover; border-radius: 14px; background: #202026; }
.post-actions { display: flex; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.action-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 9px; color: var(--muted); background: transparent; font-size: 13px; }
.action-btn:hover, .action-btn.liked { color: #d0b5ff; background: #251d36; }
.rightbar { padding-top: 54px; }
.side-card { padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.side-card h3 { margin: 0 0 14px; font: 600 15px 'Space Grotesk', sans-serif; }
.suggestion { display: flex; align-items: center; gap: 9px; padding: 9px 0; }
.suggestion-info { flex: 1; min-width: 0; }
.follow-btn { padding: 6px 9px; color: #c3a5ff; background: transparent; font-size: 12px; font-weight: 700; }
.message-btn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px; color: #c8adff; background: transparent; font-size: 13px; }
.message-btn:hover { background: #251d36; border-color: #5b477e; }
.trend { display: flex; justify-content: space-between; padding: 10px 0; color: var(--muted); font-size: 12px; }
.trend strong { display: block; color: #eeeef2; font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 16px; }
.section-head h2 { margin: 0; font: 600 17px 'Space Grotesk', sans-serif; }
.profile-card { padding: 24px; }
.profile-top { display: flex; gap: 18px; align-items: center; }
.profile-identity { min-width: 0; flex: 1; }
.profile-identity .page-title { overflow-wrap: anywhere; line-height: 1.12; }
.profile-handle { display: block; margin-top: 5px; }
.profile-bio { margin: 18px 0; color: #c2c2cb; line-height: 1.5; }
.profile-stats { display: flex; gap: 28px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-stat { display: grid; gap: 2px; min-width: 64px; padding: 0; color: var(--text); background: transparent; text-align: left; }
.profile-stat[data-connections] { border-radius: 8px; text-align: left; }
.profile-stat[data-connections]:hover { color: #d3b5ff; }
.profile-stats strong { display: block; font-size: 18px; }
.profile-stats span { color: var(--muted); font-size: 12px; }
.profile-actions { display: flex; gap: 9px; margin-top: 16px; }
.profile-actions button { flex: 1; }
.profile-edit-note { align-self: center; color: var(--muted); font-size: 11px; line-height: 1.3; }
.modal-backdrop { position: fixed; z-index: 8; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); }
.profile-editor { width: min(100%, 480px); max-height: calc(100vh - 36px); overflow-y: auto; padding: 22px; border: 1px solid #40355c; border-radius: 22px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.channel-create-modal { width: min(100%, 540px); }
.channel-create-modal .editor-head { margin-bottom: 18px; }
.channel-create-modal .editor-head .muted { max-width: 360px; margin: 8px 0 0; line-height: 1.45; }
.channel-type-fieldset { margin: 0; padding: 0; border: 0; }
.channel-type-fieldset legend { margin-bottom: 9px; color: var(--text); font-size: 13px; font-weight: 700; }
.channel-type-options { display: grid; gap: 10px; }
.channel-type-option { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: var(--panel-2); text-align: left; transition: .2s ease; }
.channel-type-option:hover, .channel-type-option:focus-visible { border-color: var(--purple); background: #211735; transform: translateY(-1px); }
.channel-type-option.selected { border-color: var(--purple); background: linear-gradient(135deg, #2c1b4b, #1b1429); box-shadow: 0 0 0 2px rgba(112,67,220,.22), 0 12px 26px rgba(50,22,82,.22); }
.channel-type-option.selected strong { color: #fff; }
.channel-type-option.selected b { color: #d4b2ff; }
.channel-type-option > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; flex: 1; }
.channel-type-option strong { font-size: 15px; }
.channel-type-option small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.channel-type-option b { color: var(--muted); font-size: 24px; font-weight: 400; }
.channel-type-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-2)); font-size: 18px; }
.post-option .channel-type-icon { background: linear-gradient(135deg, #454552, #272731); }
.channel-create-actions { display: flex; gap: 10px; margin-top: 4px; }
.channel-create-actions button { flex: 1; }
.channel-create-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.channel-create-choice { display: flex; align-items: flex-start; gap: 11px; min-height: 88px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: var(--panel); text-align: left; transition: .2s ease; }
.channel-create-choice:hover, .channel-create-choice:focus-visible { border-color: var(--purple); background: linear-gradient(135deg, #24163a, #17131f); transform: translateY(-2px); }
.channel-create-choice .choice-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--purple), var(--purple-2)); font-size: 17px; }
.channel-create-choice.post-choice .choice-icon { background: linear-gradient(135deg, #4b4b5c, #292933); }
.channel-create-choice > span:last-child { display: grid; gap: 5px; min-width: 0; }
.channel-create-choice strong { font-size: 14px; }
.channel-create-choice small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.danger-btn { min-height: 44px; border: 1px solid rgba(255, 96, 130, .38); border-radius: 12px; padding: 0 14px; color: #ffb2c0; background: rgba(139, 31, 61, .22); font-weight: 700; }
.danger-btn:hover, .danger-btn:focus-visible { border-color: #ff6484; color: #fff; background: #8b1f3d; }
.compact-danger { white-space: nowrap; }
@media (max-width: 560px) { .channel-create-choices { grid-template-columns: 1fr; } .channel-create-choice { min-height: 76px; } }
.connections-modal { width: min(100%, 480px); max-height: min(680px, calc(100vh - 36px)); overflow-y: auto; padding: 22px; border: 1px solid #40355c; border-radius: 22px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.connections-list { display: grid; gap: 2px; }
.connection-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); }
.connection-person { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 4px; border-radius: 10px; color: var(--text); background: transparent; text-align: left; }
.connection-person:hover { background: var(--panel-2); }
.connection-person > span { display: grid; gap: 3px; min-width: 0; }
.connection-person strong, .connection-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-person small { color: var(--muted); font-size: 12px; }
.settings-notice { padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.4; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.editor-head h2 { margin: 2px 0 0; font: 700 24px 'Space Grotesk', sans-serif; }
.eyebrow { margin: 0; color: var(--purple); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.profile-editor textarea { resize: vertical; min-height: 92px; }
.story-editor textarea { min-height: 78px; }
.upload-zone { position: relative; display: grid; justify-items: center; gap: 5px; padding: 22px 16px; border: 1px dashed #51416e; border-radius: 14px; color: var(--muted); background: #0d0d11; text-align: center; cursor: pointer; }
.upload-zone:hover, .upload-zone:focus-within { border-color: var(--purple); background: #15111f; }
.upload-zone strong { color: #eeeef4; font-size: 14px; }
.upload-zone span:last-of-type { font-size: 11px; }
.upload-icon { color: var(--purple); font-size: 24px; }
.editor-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.editor-actions button { min-width: 120px; }
.channel-delete-modal-btn { margin-right: auto; }
.channel-editor .editor-actions { flex-wrap: wrap; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 22px 0 16px; }
.tab { padding: 10px 2px; color: var(--muted); background: transparent; border-bottom: 2px solid transparent; font-weight: 600; }
.tab.active { color: #fff; border-color: var(--purple); }
.messages-layout { display: grid; grid-template-columns: 230px 1fr; min-height: 650px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.conversations { border-right: 1px solid var(--line); }
.conversation-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); font: 600 16px 'Space Grotesk', sans-serif; }
.conversation { display: flex; gap: 10px; align-items: center; padding: 13px 14px; margin: 8px; border-color: transparent; background: transparent; border-radius: 12px; }
.conversation:hover, .conversation.active { background: var(--panel-2); }
.conversation-copy { flex: 1; min-width: 0; }
.conversation-copy strong, .conversation-copy p { display: block; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.chat-new-message { margin-left: auto; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px; overflow-y: auto; }
.bubble { max-width: 76%; align-self: flex-start; padding: 11px 14px; border-radius: 15px 15px 15px 4px; color: #e7e7ed; background: #222229; line-height: 1.4; font-size: 14px; }
.bubble.mine { align-self: flex-end; border-radius: 15px 15px 4px 15px; color: #fff; background: var(--purple-2); }
.chat-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input { flex: 1 1 160px; min-width: 0; }
.chat-form-actions { display: flex; align-items: center; gap: 8px; width: 100%; }
.chat-form-actions .primary-btn { margin-left: auto; }
.media-quality-hint { color: #a995c9; font-size: 10px; white-space: nowrap; }
.empty-state { padding: 46px 24px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 7px; color: #fff; font: 600 17px 'Space Grotesk', sans-serif; }
.conversation-empty { padding: 22px 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.toast { position: fixed; z-index: 1000; left: 50%; top: max(78px, calc(env(safe-area-inset-top) + 68px)); bottom: auto; max-width: min(92vw, 440px); transform: translate(-50%, -14px); padding: 12px 16px; border: 1px solid #4c3971; border-radius: 12px; color: #fff; background: #241b37; box-shadow: 0 12px 30px rgba(0,0,0,.32); opacity: 0; pointer-events: none; transition: .25s; font-size: 13px; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.notification-btn { position: relative; }
.notification-btn.has-unread { color: #fff; border-color: #5b477e; }
.notification-count { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 4px; border: 2px solid var(--bg); border-radius: 99px; color: #fff; background: #e35c9a; font-size: 10px; font-weight: 800; }
.notifications-view { display: grid; gap: 16px; }
.notifications-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.notifications-head h2 { margin: 4px 0 0; font: 700 26px 'Space Grotesk', sans-serif; letter-spacing: -.03em; }
.notification-list, .notification-settings { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.notification-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; text-align: left; }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover, .notification-item.unread { background: #171222; }
.notification-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; color: #d8bdff; background: #261b3b; font-size: 18px; }
.notification-copy { display: grid; gap: 5px; min-width: 0; }
.notification-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.notification-copy small { color: var(--muted); font-size: 11px; }
.notification-item i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #e35c9a; }
.notification-settings { padding: 18px; }
.notification-settings .section-head { margin: 0 0 8px; }
.notification-settings .section-head h2 { margin-bottom: 4px; }
.notification-settings .section-head p { margin: 0; line-height: 1.4; }
.notification-setting, .push-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 0; border-top: 1px solid var(--line); }
.notification-setting span { display: grid; gap: 4px; }
.notification-setting small { color: var(--muted); font-size: 12px; }
.notification-setting input { width: 21px; height: 21px; accent-color: var(--purple); }
.push-setting strong { display: block; margin-bottom: 4px; }
.push-setting p { margin: 0; line-height: 1.4; }
.push-status { display: inline-block; margin-top: 8px; color: #ffb8d2; font-size: 12px; font-weight: 700; }
.push-status.is-on { color: #b9f2d1; }
.push-setting .secondary-btn { min-height: 38px; padding: 0 12px; white-space: nowrap; }
.push-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.push-actions .text-btn { min-height: 38px; white-space: nowrap; }
.mobile-bottom-nav { display: none; }
.avatar-image { overflow: hidden; }
.avatar-image img { width: 100%; height: 100%; object-fit: cover; }
.post-head { position: relative; }
.post-menu { position: absolute; z-index: 3; top: 42px; right: 0; display: grid; min-width: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #202026; box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.post-menu button { padding: 10px 12px; color: var(--text); background: transparent; text-align: left; border-radius: 8px; }
.post-menu button:hover { background: #30273d; }
.danger-btn { min-height: 38px; padding: 0 12px; border-radius: 10px; color: #ff9ebd; background: #3a1d2c; font-weight: 700; }
.reaction-toggle.active { color: #f0d5ff; background: #2c1c3d; }
.reaction-summary { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 2px; }
.reaction-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #15151b; font-size: 12px; }
.reaction-chip:hover, .reaction-chip.selected { border-color: #8e61cb; color: #fff; background: #2b1c3d; }
.reaction-chip span { font-size: 16px; }
.reaction-chip b { color: var(--text); font-size: 11px; }
.reaction-chip small { color: var(--muted); font-size: 10px; }
.reaction-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; margin-top: 8px; padding: 10px; border: 1px solid #39294d; border-radius: 14px; background: #15111d; }
.reaction-option { display: grid; justify-items: center; gap: 4px; min-height: 58px; padding: 6px 4px; border-radius: 10px; color: var(--muted); background: transparent; text-align: center; }
.reaction-option:hover, .reaction-option.selected { color: #fff; background: #302044; }
.reaction-option span { font-size: 22px; line-height: 1; }
.reaction-option small { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
body.light-theme .reaction-chip { color: #705b83; background: #faf7ff; border-color: #ded2e9; }
body.light-theme .reaction-chip:hover, body.light-theme .reaction-chip.selected { color: #4d2c75; background: #f1e5ff; border-color: #b894dd; }
body.light-theme .reaction-picker { background: #fbf8ff; border-color: #dfd0ee; }
body.light-theme .reaction-option:hover, body.light-theme .reaction-option.selected { color: #4d2c75; background: #f0e3ff; }
.comments-block { display: none; padding-top: 12px; }
.comments-block.open { display: grid; gap: 10px; }
.comment-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.comment-row > div { min-width: 0; flex: 1; }
.comment-row strong { font-size: 12px; }
.comment-row p { margin: 3px 0 0; color: #d0d0d8; font-size: 13px; white-space: pre-wrap; }
.comment-delete { color: var(--muted); background: transparent; font-size: 18px; }
.comment-form, .search-form { display: flex; gap: 8px; }
.comment-form input, .search-form input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); background: #0d0d11; }
.story-viewer { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 0; background: radial-gradient(circle at 50% 20%, #33204f 0, #0a080f 48%, #040306 100%); }
.story-viewer-card { position: relative; width: min(100vw, 470px); height: min(100svh, 840px); overflow: hidden; background: #09070d; box-shadow: 0 28px 90px rgba(0,0,0,.65); }
.story-viewer-card::after { position: absolute; z-index: 1; inset: 0; pointer-events: none; content: ''; background: linear-gradient(180deg, rgba(0,0,0,.56), transparent 23%, transparent 66%, rgba(0,0,0,.7)); }
.story-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-image { background: #16111e; }
.story-video { background: #09070d; }
.story-text-media { display: grid; place-items: center; padding: 40px; color: #fff; background: linear-gradient(145deg, #7043dc, #c13d8b); text-align: center; }
.story-text-media span { font: 700 clamp(24px, 6vw, 38px) 'Space Grotesk', sans-serif; white-space: pre-wrap; }
.story-progress { position: absolute; z-index: 4; top: max(12px, env(safe-area-inset-top)); right: 12px; left: 12px; display: flex; gap: 4px; }
.story-progress-segment { position: relative; height: 3px; min-width: 0; flex: 1; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.32); }
.story-progress-segment.done { background: #fff; }
.story-progress-segment.current i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: #fff; animation: story-progress var(--story-duration, 5s) linear forwards; }
.story-viewer-top, .story-viewer-bottom { position: absolute; z-index: 3; right: 16px; left: 16px; }
.story-viewer-top { top: max(26px, calc(env(safe-area-inset-top) + 16px)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.story-viewer-user { display: flex; align-items: center; gap: 9px; min-width: 0; color: #fff; }
.story-viewer-user > span { display: grid; gap: 2px; min-width: 0; }
.story-viewer-user strong, .story-viewer-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-viewer-user small { color: rgba(255,255,255,.7); font-size: 11px; }
.story-close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #fff; background: rgba(22,17,29,.65); font-size: 26px; }
.story-viewer-bottom { bottom: max(20px, env(safe-area-inset-bottom)); }
.story-viewer-bottom p { margin: 0 0 12px; color: #fff; white-space: pre-wrap; }
.story-viewer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.story-viewer-actions .secondary-btn, .story-viewer-actions .danger-btn { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(20,16,28,.68); }
.story-tap-zone { position: absolute; z-index: 2; top: 0; bottom: 0; width: 38%; background: transparent; }
.story-tap-zone:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
.story-tap-prev { left: 0; }
.story-tap-next { right: 0; width: 62%; }
@keyframes story-progress { to { width: 100%; } }
.search-view, .channels-view, .settings-view { display: grid; gap: 16px; }
.search-results, .channel-list, .settings-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.search-result { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; color: var(--text); background: transparent; border-bottom: 1px solid var(--line); text-align: left; }
.search-result:last-child, .settings-row:last-child { border-bottom: 0; }
.search-result:hover { background: var(--panel-2); }
.search-result > span { display: grid; gap: 3px; min-width: 0; flex: 1; }
.search-result small, .search-result em { overflow: hidden; color: var(--muted); font-size: 12px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.search-result b { color: var(--muted); font-size: 22px; }
.status-text { display: block; margin-top: 5px; color: #c8adff; font-size: 12px; }
.back-link { margin-top: 12px; }
.channel-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); }
.channel-card:last-child { border-bottom: 0; }
.channel-card h3 { margin: 0 0 5px; font: 600 16px 'Space Grotesk', sans-serif; }
.channel-card p { margin: 0; color: var(--muted); font-size: 13px; }
.channel-card-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; padding: 0; color: var(--text); background: transparent; text-align: left; }
.channel-card-main > span { display: grid; gap: 4px; min-width: 0; }
.channel-card-main strong, .channel-card-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-card-main small, .channel-card-main em { color: var(--muted); font-size: 12px; font-style: normal; }
.channel-card-main b { margin-left: auto; color: var(--muted); font-size: 24px; }
.channel-card-main:hover strong { color: #d8b8ff; }
.channel-card-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.compact-danger { min-height: 32px; padding: 0 9px; font-size: 11px; }
.admin-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 999px; color: #e2ceff; background: #342454; font-size: 11px; font-weight: 700; white-space: nowrap; }
.channel-view { display: grid; gap: 14px; }
.channel-hero { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, var(--panel), #211833); }
.channel-identity { min-width: 0; flex: 1; }
.channel-identity h2 { margin: 0; font: 700 clamp(20px, 5vw, 30px) 'Space Grotesk', sans-serif; }
.channel-identity p { margin: 6px 0; color: var(--muted); white-space: pre-wrap; }
.channel-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.channel-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid rgba(255, 96, 130, .34); border-radius: var(--radius); background: linear-gradient(135deg, rgba(139, 31, 61, .2), rgba(55, 18, 40, .18)); }
.channel-danger-zone > div { display: grid; gap: 4px; min-width: 0; }
.channel-danger-zone strong { color: #ffb2c0; font-size: 14px; }
.channel-danger-zone span { color: var(--muted); font-size: 12px; }
.channel-composer { margin: 0; }
.channel-post-list { display: grid; gap: 12px; }
.channel-post { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.channel-post .post-head { display: flex; align-items: center; gap: 10px; }
.channel-post .post-head > div:nth-child(2) { min-width: 0; flex: 1; display: grid; gap: 3px; }
.channel-post-actions { display: flex; align-items: center; gap: 8px; }
.channel-post-actions .danger-btn { min-height: 32px; padding: 0 9px; font-size: 11px; }
.channel-join-callout { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border: 1px dashed #6f48a7; border-radius: var(--radius); color: var(--text); background: #1b1428; }
.channel-join-callout strong { font-size: 14px; }
.channel-editor { max-height: min(720px, 90svh); overflow: auto; }
.settings-card { padding: 18px; }
.settings-card .section-head { margin: 0 0 6px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 68px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); background: transparent; text-align: left; }
.settings-row span { display: grid; gap: 4px; }
.settings-row small { color: var(--muted); font-size: 12px; }
.settings-row input { width: 21px; height: 21px; accent-color: var(--purple); }
.settings-row select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--text); background: var(--panel-2); }
.danger-row strong { color: #ff9ebd; }
.chat-attach { display: grid; place-items: center; width: 42px; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; color: #c8adff; cursor: pointer; }
.chat-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.message-image, .message-video { display: block; width: min(100%, 520px); max-height: 520px; border-radius: 12px; margin-bottom: 5px; background: #08080b; }
.message-image { height: auto; object-fit: contain; }
.message-video { height: auto; object-fit: contain; }
.message-draft-preview { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }
.message-draft-preview img, .message-draft-preview video { width: 54px; height: 54px; border-radius: 7px; object-fit: cover; background: #08080b; }
.read-mark { display: block; margin-top: 4px; color: #d8b8ff; font-size: 10px; text-align: right; }
.conversation-tools { display: flex; gap: 6px; }
.empty-action { display: block; width: fit-content; margin: 18px auto 0; }
.messages-layout { position: relative; }
.message-picker { position: absolute; z-index: 5; top: 58px; left: 12px; width: min(360px, calc(100% - 24px)); padding: 10px; border: 1px solid #4a3a66; border-radius: 16px; background: #18151f; box-shadow: 0 22px 50px rgba(0,0,0,.42); }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; }
.picker-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; border-radius: 10px; color: var(--text); background: transparent; text-align: left; }
.picker-person:hover { background: var(--panel-2); }
.picker-person > span { display: grid; gap: 3px; min-width: 0; flex: 1; }
.picker-person small { color: var(--muted); }
.picker-person b { color: var(--purple); }
.short-video-composer { display: grid; gap: 12px; padding: 16px; border: 1px solid #55357b; border-radius: 18px; background: linear-gradient(135deg, rgba(74,39,116,.42), rgba(24,17,37,.92)); }
.short-video-composer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.short-video-composer-head > div { display: grid; gap: 4px; }
.short-video-composer-head strong { font-size: 16px; }
.short-video-composer-head small { color: #cdbde0; font-size: 12px; }
.shorts-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #a35dff, #e36bc8); font-size: 18px; }
.short-caption-input { width: 100%; min-height: 44px; border: 1px solid #63478b; border-radius: 11px; padding: 10px 12px; color: var(--text); background: rgba(9,8,13,.55); outline: 0; }
.short-caption-input:focus { border-color: #b27bff; box-shadow: 0 0 0 3px rgba(178,123,255,.14); }
.short-video-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.short-video-composer-footer .attach-control { min-height: 40px; padding: 0 11px; }
.short-video-upload-preview { display: flex; align-items: center; gap: 10px; color: #d9c8e8; font-size: 12px; }
.short-video-upload-preview video { width: 58px; height: 78px; border-radius: 9px; object-fit: cover; background: #09090c; }
.shorts-section { display: grid; gap: 10px; }
.compact-section-head { margin: 0; }
.compact-section-head h3 { margin: 0; font: 700 18px 'Space Grotesk', sans-serif; }
.short-video-feed { display: grid; gap: 16px; justify-items: center; }
.short-video-card { width: min(100%, 390px); overflow: hidden; border: 1px solid #49325f; border-radius: 20px; background: #09080d; box-shadow: 0 18px 45px rgba(0,0,0,.24); }
.short-video-stage { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: #08070b; }
.short-video-player { display: block; width: 100%; height: 100%; object-fit: cover; background: #08070b; }
.short-video-overlay { position: absolute; right: 12px; bottom: 54px; left: 12px; display: grid; gap: 4px; pointer-events: none; color: #fff; text-shadow: 0 2px 9px rgba(0,0,0,.85); }
.short-video-overlay strong { overflow: hidden; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.short-video-overlay span { color: #e8deef; font-size: 11px; }
.short-video-tools { position: absolute; right: 10px; bottom: 10px; left: 10px; display: flex; align-items: center; gap: 8px; pointer-events: none; color: #fff; font-size: 12px; text-shadow: 0 2px 6px #000; }
.short-video-tools button { pointer-events: auto; min-height: 34px; border: 0; border-radius: 999px; padding: 0 10px; color: #fff; background: rgba(20,14,28,.72); font-weight: 700; }
.short-video-tools .short-video-like.liked { color: #ff9ec8; }
.short-video-tools .short-video-delete { margin-left: auto; color: #ffc2d0; font-size: 11px; }
.video-frame, .video-player { width: 100%; overflow: hidden; border-radius: 14px; background: #09090c; }
.video-frame { aspect-ratio: 16 / 9; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-player { max-height: 440px; }
.videos-view { display: grid; gap: 16px; }
.video-search { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.video-search-icon { color: var(--muted); font-size: 22px; line-height: 1; }
.video-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
.video-search .primary-btn { min-height: 36px; padding: 0 12px; }
.video-search .text-btn { white-space: nowrap; }
.video-channels { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.video-channels::-webkit-scrollbar { display: none; }
.video-channel { display: flex; align-items: center; gap: 8px; min-width: 150px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: var(--panel); text-align: left; }
.video-channel > span { display: grid; gap: 3px; min-width: 0; }
.video-channel strong, .video-channel small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-channel small { color: var(--muted); font-size: 11px; }
.video-grid { display: grid; gap: 14px; }
.video-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.video-card-copy { display: flex; gap: 10px; padding: 12px; }
.video-card-copy > div { display: grid; gap: 3px; min-width: 0; }
.video-card-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-card-copy small { color: var(--muted); font-size: 11px; }
.spark-balance { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid #5b3c8f; border-radius: 999px; color: #f0d9ff; background: #241637; font-size: 13px; font-weight: 800; white-space: nowrap; }
.spark-action { color: #d4a6ff; }
.spark-action:hover, .spark-action.sparked { color: #fff; background: linear-gradient(135deg, #3a2165, #6e3fb0); }
.spark-action:disabled { cursor: not-allowed; opacity: .48; }
.spark-card { margin-top: 16px; padding: 14px; border: 1px solid #513278; border-radius: 15px; background: linear-gradient(135deg, #1c1328, #25163b); }
.spark-card-head { display: flex; align-items: center; gap: 10px; }
.spark-symbol { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #a461ff, #ed9eff); font-size: 19px; box-shadow: 0 6px 18px rgba(166,91,255,.28); }
.spark-card-head > div { display: grid; gap: 3px; min-width: 0; flex: 1; }
.spark-card-head strong { font-size: 14px; }
.spark-card-head small, .spark-card p { color: #c9b9d8; font-size: 11px; }
.spark-card-head b { color: #f2d8ff; font: 700 20px 'Space Grotesk', sans-serif; }
.spark-progress { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: #38224f; }
.spark-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9b5dff, #f0a2ff); transition: width .3s ease; }
.spark-card p { margin: 9px 0 0; }
body.light-theme {
  --bg: #f7f5fa;
  --panel: #ffffff;
  --panel-2: #eeeaf5;
  --line: #d8d2e2;
  --muted: #5d536b;
  --text: #1a1620;
}
body.light-theme .content, body.light-theme .app-shell { background: var(--bg); }
body.light-theme .auth-screen { background: radial-gradient(circle at 50% -15%, #e7d9ff 0, transparent 42%), var(--bg); }
body.light-theme .auth-card { border-color: var(--line); background: rgba(255,255,255,.94); box-shadow: 0 24px 70px rgba(55,35,82,.14); }
body.light-theme .field { color: #2b2434; }
body.light-theme .field input, body.light-theme .field textarea, body.light-theme .chat-input,
body.light-theme .video-url-input, body.light-theme .comment-form input, body.light-theme .search-form input { background: #fbfaff; }
body.light-theme .text-btn { color: #6840ba; }
body.light-theme .spark-badge { color: #6840ba; background: #f1e7ff; border-color: #c8a8eb; }
body.light-theme .spark-badge-icon { color: #6840ba; background: #faf7ff; border-color: #d4c3e5; }
body.light-theme .spark-badge-icon.earned { color: #5b2f96; background: linear-gradient(135deg, #f0ddff, #fff); border-color: #b98bdf; }
body.light-theme .spark-badge-icon small { color: #806c91; }
body.light-theme .spark-badge-icon.earned small { color: #6840ba; }
body.light-theme .push-status { color: #a33e65; }
body.light-theme .push-status.is-on { color: #26724a; }
body.light-theme .demo-note { color: var(--muted); }
body.light-theme .nav-btn { color: var(--muted); }
body.light-theme .nav-btn:hover, body.light-theme .nav-btn.active { color: var(--text); }
body.light-theme .icon-btn { color: var(--text); }
body.light-theme .story { color: var(--muted); }
body.light-theme .attach-control, body.light-theme .message-btn, body.light-theme .follow-btn { color: #6840ba; }

.story-camera-backdrop { z-index: 12; }
.story-camera { width: min(100%, 480px); max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px; border: 1px solid #40355c; border-radius: 22px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.story-camera-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.story-camera-head h2 { margin: 3px 0 0; font: 700 22px 'Space Grotesk', sans-serif; }
.story-camera-stage { position: relative; width: min(100%, 350px); aspect-ratio: 9 / 16; margin: 0 auto 14px; overflow: hidden; border: 1px solid #55416f; border-radius: 22px; background: radial-gradient(circle at 50% 25%, #34204e, #09070d 70%); box-shadow: 0 18px 42px rgba(0,0,0,.32); }
.story-camera-stage video { width: 100%; height: 100%; display: block; object-fit: contain; transform: scaleX(-1); background: linear-gradient(145deg, #2c1d44, #09070d); }
.story-record-canvas { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.story-mask-overlay { position: absolute; inset: 0; pointer-events: none; transition: background .2s ease; }
.story-mask-overlay span::before, .story-mask-overlay span::after { position: absolute; font-size: 52px; line-height: 1; }
.story-mask-overlay[data-mask="neon"] { box-shadow: inset 0 0 0 6px #c98cff, inset 0 0 28px #c98cff; }
.story-mask-overlay[data-mask="neon"] span::before { content: '✦'; top: 22px; left: 50%; color: #fff; text-shadow: 0 0 18px #c98cff; transform: translateX(-50%); }
.story-mask-overlay[data-mask="hearts"] span::before { content: '♥  ♥'; top: 20px; left: 16px; color: #ff6fae; letter-spacing: 100px; text-shadow: 0 0 12px #ff6fae; }
.story-mask-overlay[data-mask="hearts"] span::after { content: '♥  ♥'; bottom: 28px; right: 14px; color: #ff6fae; letter-spacing: 60px; text-shadow: 0 0 12px #ff6fae; }
.story-mask-overlay[data-mask="glasses"] span::before { content: '◉━━◉'; top: 35%; left: 50%; color: #73e4ff; font-size: 64px; text-shadow: 0 0 14px #73e4ff; transform: translateX(-50%); }
.story-mask-overlay[data-mask="crown"] span::before { content: '♛'; top: 10px; left: 50%; color: #ffd166; font-size: 92px; text-shadow: 0 0 14px #ffd166; transform: translateX(-50%); }
.story-mask-overlay[data-mask="sparkle"] span::before { content: '✧'; top: 70px; left: 22px; color: #f3c8ff; text-shadow: 0 0 14px #fff; }
.story-mask-overlay[data-mask="sparkle"] span::after { content: '✦'; right: 22px; bottom: 110px; color: #f3c8ff; font-size: 72px; text-shadow: 0 0 14px #fff; }
.story-mask-overlay[data-mask="aurora"] { background: linear-gradient(145deg, rgba(62,231,194,.22), transparent 44%, rgba(189,93,255,.25)); box-shadow: inset 0 0 0 2px rgba(98,230,197,.7); }
.story-mask-overlay[data-mask="aurora"] span::before { content: '〰'; top: 12%; left: 50%; color: #8affd9; font-size: 70px; text-shadow: 0 0 18px #62e6c5; transform: translateX(-50%); }
.story-mask-overlay[data-mask="bunny"] span::before { content: '♢  ♢'; top: 12%; left: 50%; color: #ffb8df; font-size: 70px; text-shadow: 0 0 14px #fff; transform: translateX(-50%); }
.story-mask-overlay[data-mask="butterfly"] span::before { content: '🦋'; top: 20%; left: 24px; font-size: 58px; }
.story-mask-overlay[data-mask="butterfly"] span::after { content: '🦋'; right: 24px; bottom: 28%; font-size: 58px; }
.story-mask-overlay[data-mask="retro"] { border: 7px solid rgba(242,179,95,.76); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); }
.story-mask-overlay[data-mask="retro"] span::before { content: ''; position: absolute; inset: 0; opacity: .22; background: repeating-linear-gradient(0deg, transparent 0 10px, #f2b35f 11px 13px); }
.story-mask-overlay[data-mask="comic"] { background: radial-gradient(circle, transparent 42%, rgba(255,230,109,.2) 43%, transparent 44%); }
.story-mask-overlay[data-mask="comic"] span::before { content: '★'; top: 12%; left: 50%; color: #fff; font-size: 72px; text-shadow: 0 0 14px #ffe66d; transform: translateX(-50%); }
.story-mask-overlay[data-mask="comic"] span::after { content: '★  ★'; right: 20px; bottom: 12%; color: #ffe66d; font-size: 34px; }

.story-camera-tools { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.story-camera-tools .field { flex: 1; }
.story-camera-tools select { min-height: 42px; }
.story-record-time { min-width: 116px; padding: 11px 0; color: #f3c8ff; font: 700 14px ui-monospace, monospace; text-align: right; }
.story-mask-list { display: grid; grid-template-columns: repeat(5, minmax(54px, 1fr)); gap: 7px; margin: 10px 0 14px; }
.story-mask { display: grid; justify-items: center; gap: 4px; min-height: 58px; padding: 7px 3px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--panel-2); }
.story-mask span { font-size: 22px; line-height: 1; }
.story-mask small { font-size: 9px; }
.story-mask.active { color: #fff; border-color: var(--purple); background: #281b43; box-shadow: 0 0 0 2px rgba(112,67,220,.2); }
.story-record-btn { width: 100%; min-height: 46px; }
.story-record-btn.recording { color: #fff; background: #c43e6e; }
.story-camera-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: center; }
.story-camera-launch { display: grid; grid-template-columns: 38px 1fr; align-items: center; column-gap: 10px; width: 100%; padding: 13px; border: 1px solid #51416e; border-radius: 14px; color: var(--text); background: linear-gradient(135deg, #26183e, #15121e); text-align: left; }
.story-camera-launch:hover { border-color: var(--purple); }
.story-camera-launch > span { grid-row: span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--purple); font-size: 22px; }
.story-camera-launch strong { font-size: 14px; }
.story-camera-launch small { color: var(--muted); font-size: 11px; }
.story-video-ready { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.story-video-ready video { width: 100%; max-height: 280px; border-radius: 14px; background: #09070d; }
body.light-theme .story-mask.active { color: #fff; }
body.light-theme .attach-control:hover { color: #45218f; }
body.light-theme .media-preview, body.light-theme .upload-zone { background: #fbfaff; }
body.light-theme .post-content, body.light-theme .profile-bio, body.light-theme .comment-row p { color: var(--text); }
body.light-theme .action-btn:hover, body.light-theme .action-btn.liked { color: #6840ba; background: #f0e9ff; }
body.light-theme .trend strong, body.light-theme .upload-zone strong, body.light-theme .empty-state strong { color: var(--text); }
body.light-theme .tab.active { color: var(--text); }
body.light-theme .bubble { color: var(--text); background: #eeebf3; }
body.light-theme .notification-item:hover, body.light-theme .notification-item.unread { background: #f5f0fb; }
body.light-theme .channel-card-main:hover strong { color: #6840ba; }
body.light-theme .channel-hero { background: linear-gradient(135deg, var(--panel), #eee5fb); }
body.light-theme .channel-join-callout { background: #f5efff; }
body.light-theme .spark-balance { color: #6840ba; background: #f1e7ff; border-color: #cbb1ee; }
body.light-theme .spark-card { background: linear-gradient(135deg, #f4eaff, #fff); border-color: #d4baf1; }
body.light-theme .spark-card-head small, body.light-theme .spark-card p { color: #6f5d7e; }
body.light-theme .spark-progress { background: #e4d7f1; }
body.light-theme .mobile-bottom-nav { background: rgba(255,255,255,.98); box-shadow: 0 -10px 30px rgba(55,35,82,.12); }
body.light-theme .mobile-bottom-nav .nav-btn { color: var(--muted); }
body.light-theme .mobile-bottom-nav .nav-btn.active, body.light-theme .mobile-bottom-nav .nav-btn.active .nav-icon { color: var(--text); }
.channel-type-label { display: inline-flex; width: fit-content; margin-bottom: 4px; color: #c89aff; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.video-channel-card { border-color: #6d42a8; background: linear-gradient(135deg, var(--panel), rgba(112,67,220,.12)); }
.video-channel-hero { position: relative; overflow: hidden; isolation: isolate; }
.video-channel-hero::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(110deg, rgba(19,12,31,.98) 0%, rgba(38,20,61,.88) 60%, rgba(112,67,220,.5)), var(--channel-banner) center/cover; opacity: .9; }
.video-channel-hero > * { position: relative; }
.playlist-bar { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.playlist-bar > div:first-child { display: flex; align-items: center; gap: 8px; }
.playlist-bar > div:first-child span { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--purple); font-size: 11px; font-weight: 800; }
.playlist-bar > .secondary-btn { width: fit-content; }
.playlist-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.playlist-list::-webkit-scrollbar { display: none; }
.playlist-chip { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel-2); font-size: 12px; }
.playlist-chip.active { color: #fff; border-color: var(--purple); background: var(--purple); }
.playlist-tag { display: inline-flex; width: fit-content; margin: 8px 0 10px; padding: 5px 8px; border-radius: 999px; color: #d5b7ff; background: #2a1a42; font-size: 11px; font-weight: 700; }
.channel-playlist-field { margin-top: 10px; }
.channel-post .video-player { margin-top: 10px; }
.video-upload-control { color: #d8b8ff; }
.video-upload-control input { display: none; }
.channel-composer .media-preview video { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; background: #08080b; }
.channel-composer .cover-preview { display: inline-flex; width: min(100%, 280px); }
.channel-composer .cover-preview img { width: 88px; height: 52px; object-fit: cover; border-radius: 8px; }
.cover-upload-control { color: #e2c4ff; }
.channel-analytics { padding: 16px; border: 1px solid #513278; border-radius: var(--radius); background: linear-gradient(135deg, #1b1228, #21163a); }
.channel-analytics .section-head { margin: 0 0 12px; }
.channel-analytics .section-head h2 { font-size: 16px; }
.analytics-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.analytics-stats > div { min-width: 0; padding: 11px 10px; border: 1px solid rgba(198,154,255,.18); border-radius: 12px; background: rgba(10,7,17,.22); }
.analytics-stats strong, .analytics-stats span { display: block; }
.analytics-stats strong { overflow: hidden; text-overflow: ellipsis; font: 700 20px 'Space Grotesk', sans-serif; }
.analytics-stats span { margin-top: 4px; color: #c8b5d8; font-size: 11px; }
.analytics-hint { margin: 11px 0 0; color: #bda9cf; font-size: 11px; line-height: 1.4; }
.permission-backdrop { z-index: 15; }
.permission-modal { width: min(100%, 440px); padding: 24px; border: 1px solid #544076; border-radius: 22px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.permission-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 12px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--purple), #d59bff); font-size: 27px; box-shadow: 0 12px 28px rgba(112,67,220,.25); }
.permission-modal .editor-head { margin-bottom: 12px; }
.permission-modal .editor-head h2 { font-size: 22px; }
.permission-copy, .permission-warning { margin: 0; color: #d3c9dc; line-height: 1.5; font-size: 13px; }
.permission-state { margin: 14px 0 0; padding: 10px 12px; border-radius: 11px; color: #e7d8f6; background: #241a35; font-size: 12px; }
.permission-warning { margin-top: 12px; padding: 11px 12px; border-left: 3px solid #e3a5bd; color: #f0cad8; background: rgba(139,31,61,.2); }
.permission-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
body.light-theme .channel-analytics { background: linear-gradient(135deg, #f5ebff, #fff); border-color: #d4baf1; }
body.light-theme .analytics-stats > div { background: rgba(255,255,255,.65); border-color: #ddc9ef; }
body.light-theme .analytics-stats span, body.light-theme .analytics-hint, body.light-theme .permission-copy { color: #6f5d7e; }
body.light-theme .permission-state { color: #5d476f; background: #f3ebfb; }
body.light-theme .permission-warning { color: #8c3e5b; background: #fff0f5; }
body.light-theme .channel-type-label { color: #6840ba; }
body.light-theme .playlist-chip.active { color: #fff; }
body.light-theme .playlist-tag { color: #6840ba; background: #f1e7ff; }
@media (max-width: 1050px) { .main-layout { grid-template-columns: 200px minmax(0, 680px); max-width: 930px; } .rightbar { display: none; } }
@media (max-width: 800px) {
  .auth-screen { min-height: 100svh; padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
  .auth-card { padding: 26px 20px; border-radius: 22px; }
  .main-layout { display: block; min-height: 100svh; padding: 0 12px calc(76px + env(safe-area-inset-bottom)); }
  .topbar { position: relative; z-index: 1; min-height: calc(58px + env(safe-area-inset-top)); margin: 0 -12px 14px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
  .desktop-sidebar { display: none; }
  .mobile-bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; align-items: stretch; gap: 4px; height: calc(76px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(12,12,16,.98); box-shadow: 0 -10px 30px rgba(0,0,0,.24); backdrop-filter: blur(14px); }
  .mobile-bottom-nav .nav-btn { flex: 1; min-width: 64px; min-height: 64px; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 2px; color: #a8a8b2; background: transparent; font-size: 11px; }
  .mobile-bottom-nav .nav-icon { display: grid; place-items: center; width: auto; font-size: 20px; }
  .mobile-bottom-nav .nav-btn.active { color: #fff; box-shadow: inset 0 3px 0 var(--purple); }
  .mobile-bottom-nav .nav-btn.active .nav-icon { color: #fff; }
  .mobile-brand { display: block; flex: 0 0 auto; max-width: 38px; overflow: hidden; }
  .mobile-brand .brand > span:last-child { display: none; }
  .mobile-brand .brand-mark { width: 32px; height: 32px; }
  .mobile-user-summary { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; margin: 0 8px; }
  .mobile-user-summary-copy { min-width: 0; line-height: 1.1; }
  .mobile-user-summary-copy strong, .mobile-user-summary-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-user-summary-copy strong { color: var(--text); font-size: 13px; }
  .mobile-user-summary-copy > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
  .mobile-user-summary .verified-badge { width: 15px; height: 15px; margin-left: 3px; font-size: 9px; }
  .page-title { display: none; }
  .messages-layout { grid-template-columns: 1fr; min-height: 640px; }
  .conversations { display: none; }
  .chat { min-height: 640px; }
  .profile-card { padding: 18px 16px; }
  .profile-top { align-items: flex-start; gap: 14px; }
  .profile-top .avatar.lg { width: 64px; height: 64px; font-size: 21px; }
  .profile-identity .page-title { display: block; font-size: clamp(19px, 6vw, 24px); }
  .profile-stats { justify-content: space-between; gap: 8px; }
  .profile-actions { gap: 8px; }
  .profile-actions .secondary-btn { padding: 0 12px; }
  .post-actions { flex-wrap: wrap; }
  .post-card, .composer { padding: 14px; }
  .channel-card { align-items: flex-start; flex-wrap: wrap; }
  .channel-card-main { flex-basis: 100%; }
  .channel-card-actions { margin-left: 52px; }
  .channel-hero { align-items: flex-start; flex-wrap: wrap; padding: 14px; }
  .channel-hero .avatar.lg { width: 58px; height: 58px; font-size: 18px; }
  .channel-identity { flex-basis: calc(100% - 76px); }
  .channel-hero-actions { width: 100%; justify-content: flex-start; margin-left: 72px; }
  .channel-danger-zone { align-items: flex-start; flex-direction: column; }
  .channel-danger-zone .danger-btn { width: 100%; }
  .video-search { flex-wrap: wrap; }
  .video-search input { flex-basis: calc(100% - 36px); }
  .video-search .primary-btn { flex: 1; }
  .channel-post-actions { flex-direction: column; align-items: flex-end; }
  .mobile-bottom-nav .nav-btn { min-width: 0; font-size: 10px; }
  .video-grid { grid-template-columns: 1fr; }
  .video-url-input { font-size: 13px; }
  .database-banner { align-items: flex-start; flex-wrap: wrap; }
  .database-banner span { flex-basis: 100%; order: 3; }
}
