:root {
  --bg: #0c0b10;
  --panel: #15141b;
  --panel-2: #1c1b24;
  --card: #23222d;
  --hover: #2a2935;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f3f1f7;
  --muted: #a19eae;
  --faint: #6f6c7c;
  --coral: #ff4d6d;
  --amber: #ffa63d;
  --violet: #8a6bff;
  --mint: #3ddc97;
  --live: #ff2e55;
  --grad: linear-gradient(120deg, #ff4d6d 0%, #ff7a4d 55%, #ffa63d 100%);
  --grad-soft: linear-gradient(120deg, rgba(255, 77, 109, .18), rgba(255, 166, 61, .14));
  --shadow: 0 20px 50px rgba(0, 0, 0, .5);
  --r: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--text); font: 15px/1.5 "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden;
  background: radial-gradient(1100px 600px at 100% -10%, rgba(255, 77, 109, .09), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(138, 107, 255, .08), transparent 60%), var(--bg);
}
h1, h2, h3, h4, .logo, .display { font-family: Sora, "DM Sans", sans-serif; letter-spacing: -.02em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: #ffb07a; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2f2d3a; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.xs { width: 13px; height: 13px; }

/* Buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 14px; background: var(--card); font-weight: 700; transition: .15s; white-space: nowrap; border: 1px solid var(--line); }
.btn:hover { background: var(--hover); border-color: var(--line-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.grad { background: var(--grad); color: #1a0d10; border: 0; box-shadow: 0 8px 24px rgba(255, 90, 90, .25); }
.btn.grad:hover { filter: brightness(1.08); }
.btn.live { background: var(--live); color: #fff; border: 0; }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255, 46, 85, .12); color: #ff7d93; border-color: rgba(255, 46, 85, .2); }
.btn.danger:hover { background: var(--live); color: #fff; }
.btn.mint { background: var(--mint); color: #062316; border: 0; }
.btn.big { padding: 14px 18px; font-size: 16px; width: 100%; border-radius: 16px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 11px; }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: var(--text); transition: .15s; position: relative; flex-shrink: 0; }
.icon-btn:hover { background: var(--hover); }
.icon-btn.accent { color: var(--amber); }
.icon-btn.on { background: var(--text); color: var(--bg); }
.icon-btn.off { background: rgba(255, 46, 85, .16); color: #ff7d93; }
.icon-btn .badge { position: absolute; top: 2px; right: 2px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.input, .field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg); outline: none; transition: border .15s, box-shadow .15s; }
.input:focus, .field input:focus, .field textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 77, 109, .15); }
.form-error { color: #ff7d93; min-height: 20px; font-size: 14px; margin-bottom: 8px; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px; border-radius: 10px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.badge { background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; line-height: 1; }
.tag { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; letter-spacing: .04em; vertical-align: 2px; margin-left: 5px; }
.tag-bot { background: rgba(138, 107, 255, .2); color: #b9a8ff; }
.tag-live { background: var(--live); color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.tag-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Auth */
.auth { height: 100%; display: grid; grid-template-columns: 1.2fr 1fr; }
.auth-art { position: relative; overflow: hidden; display: flex; align-items: center; padding: 60px; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.o1 { width: 420px; height: 420px; background: #ff4d6d; top: -80px; left: -60px; animation: float 12s ease-in-out infinite; }
.o2 { width: 360px; height: 360px; background: #ffa63d; bottom: -60px; right: 10%; animation: float 14s ease-in-out infinite reverse; }
.o3 { width: 300px; height: 300px; background: #8a6bff; top: 40%; left: 40%; animation: float 16s ease-in-out infinite; }
@keyframes float { 50% { transform: translate(40px, -30px) scale(1.08); } }
.auth-copy { position: relative; max-width: 520px; }
.auth-copy h1 { font-size: 56px; line-height: 1.05; margin: 28px 0 16px; }
.auth-copy p { font-size: 18px; color: #d9d5e4; }
.auth-side { display: grid; place-items: center; padding: 24px; background: rgba(12, 11, 16, .6); backdrop-filter: blur(20px); border-left: 1px solid var(--line); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { margin: 0; font-size: 30px; }
.auth-card .muted { margin: 4px 0 22px; }
.auth .register-only { display: none; }
.auth.register .register-only { display: block; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.logo.big { font-size: 26px; }
.logo-mark { width: 34px; height: 34px; border-radius: 12px; background: var(--grad); position: relative; flex-shrink: 0; box-shadow: 0 6px 18px rgba(255, 90, 90, .35); }
.logo.big .logo-mark { width: 44px; height: 44px; border-radius: 15px; }
.logo-mark::before, .logo-mark::after { content: ""; position: absolute; top: 28%; width: 30%; height: 30%; border-radius: 50%; background: #fff; }
.logo-mark::before { left: 20%; }
.logo-mark::after { right: 20%; opacity: .75; }

/* App layout */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar { height: 68px; flex-shrink: 0; display: flex; align-items: center; gap: 16px; padding: 0 18px; }
.nav { flex: 1; display: flex; justify-content: center; }
.nav-inner { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 5px; }
.nav button { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 13px; font-weight: 700; color: var(--muted); transition: .15s; position: relative; }
.nav button:hover { color: var(--text); background: var(--panel-2); }
.nav button.active { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav button.active svg { color: var(--amber); }
.nav .badge { margin-left: 2px; }
.nav .live-count { background: var(--live); }
.top-right { display: flex; align-items: center; gap: 8px; }
.go-live { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 14px; background: var(--grad); color: #1a0d10; font-weight: 800; box-shadow: 0 8px 22px rgba(255, 90, 90, .28); }
.go-live .rec { width: 10px; height: 10px; border-radius: 50%; background: #1a0d10; }
.go-live.on { background: var(--live); color: #fff; animation: glow 2s infinite; }
.go-live.on .rec { background: #fff; animation: pulse 1.2s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(255, 46, 85, .2); } }
.me-btn { border-radius: 14px; padding: 3px; border: 1px solid var(--line); }
.me-btn:hover { border-color: var(--line-2); }

.body { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 12px 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-height: 0; }
.sidebar { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.members { width: 260px; flex-shrink: 0; overflow-y: auto; padding: 10px; }

.side-head { padding: 18px 18px 10px; display: flex; align-items: center; gap: 8px; }
.side-head h2 { margin: 0; font-size: 22px; flex: 1; }
.search { margin: 0 14px 12px; position: relative; }
.search input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 10px 40px; outline: none; }
.search input:focus { border-color: var(--line-2); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 18px; height: 18px; }
.side-tabs { padding: 0 14px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 0 8px 10px; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; display: flex; align-items: center; justify-content: space-between; }
.section-label button { color: var(--faint); width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; }
.section-label button:hover { color: var(--text); background: var(--hover); }

.strip { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 12px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .person { width: 60px; text-align: center; font-size: 12px; color: var(--muted); flex-shrink: 0; cursor: pointer; position: relative; }
.strip .person .avatar { margin: 0 auto 5px; }
.strip .person .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .person .tag-live { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); margin: 0; font-size: 9px; padding: 1px 5px; border: 2px solid var(--panel); }

.row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 16px; cursor: pointer; transition: background .12s; min-width: 0; position: relative; }
.row:hover { background: var(--panel-2); }
.row.active { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(255, 120, 90, .18); }
.row .meta { flex: 1; min-width: 0; }
.row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.unread .name, .row.unread .sub { color: var(--text); font-weight: 800; }
.row .unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); flex-shrink: 0; box-shadow: 0 0 10px rgba(255, 90, 90, .6); }
.row .actions { display: flex; gap: 4px; }
.row .actions .icon-btn { width: 34px; height: 34px; background: var(--card); border-radius: 11px; }

/* Spaces */
.space-tiles { display: flex; gap: 10px; overflow-x: auto; padding: 2px 14px 14px; scrollbar-width: thin; }
.space-tile { flex-shrink: 0; width: 56px; text-align: center; font-size: 11px; color: var(--muted); cursor: pointer; }
.space-tile .t { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-family: Sora, "DM Sans", system-ui, sans-serif; font-weight: 800; font-size: 18px; color: #fff; background: var(--c); position: relative; transition: transform .15s, box-shadow .15s; margin-bottom: 5px; }
.space-tile:hover .t { transform: translateY(-2px); }
.space-tile.active .t { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--amber); }
.space-tile .t .dot { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--coral); border: 3px solid var(--panel); }
.space-tile .t .vc { position: absolute; bottom: -4px; right: -4px; width: 20px; height: 20px; border-radius: 8px; background: var(--mint); color: #062316; display: grid; place-items: center; border: 2px solid var(--panel); }
.space-tile .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-tile.add .t { background: var(--card); color: var(--amber); border: 1px dashed var(--line-2); }
.space-card { margin: 0 12px 10px; padding: 14px; border-radius: 18px; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 35%, transparent), transparent 75%), var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.space-card .meta { flex: 1; min-width: 0; }
.space-card h3 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-card .sub { font-size: 12px; color: var(--muted); }
.chan { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: 13px; color: var(--muted); cursor: pointer; font-weight: 600; position: relative; }
.chan:hover { background: var(--panel-2); color: var(--text); }
.chan.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 120, 90, .18); }
.chan.unread { color: var(--text); font-weight: 800; }
.chan .ci { width: 28px; height: 28px; border-radius: 9px; background: var(--card); display: grid; place-items: center; color: var(--faint); font-weight: 700; flex-shrink: 0; }
.chan.active .ci { color: var(--amber); }
.chan .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan .del { opacity: 0; color: var(--faint); }
.chan:hover .del { opacity: 1; }
.chan .del:hover { color: var(--live); }
.voice-users { padding: 2px 0 6px 46px; }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; font-size: 14px; color: var(--muted); }
.voice-user .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-user svg { width: 14px; height: 14px; color: var(--faint); }

/* Avatars: squircles */
.avatar { --c: #ff4d6d; position: relative; border-radius: 34%; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 100%, white 12%), color-mix(in srgb, var(--c) 80%, black 25%)); color: #fff; display: grid; place-items: center; font-family: Sora, "DM Sans", system-ui, sans-serif; font-weight: 700; flex-shrink: 0; text-transform: uppercase; user-select: none; }
.avatar.bot { border-radius: 24%; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 30%; height: 30%; min-width: 11px; min-height: 11px; border-radius: 50%; background: var(--mint); border: 3px solid var(--panel); }
.avatar .dot.off { background: #55525f; }
.avatar.ring-live { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--live); }
.avatar.speaking { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--mint); }

/* Main head */
.main-head { height: 70px; padding: 0 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.main-head .title { flex: 1; min-width: 0; }
.main-head .t { font-family: Sora, "DM Sans", system-ui, sans-serif; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-head .s { font-size: 13px; color: var(--muted); }
.main-head .s.on { color: var(--mint); }
.main-head .ci { width: 38px; height: 38px; border-radius: 12px; background: var(--card); display: grid; place-items: center; color: var(--amber); font-size: 20px; font-weight: 700; }
.back-btn { display: none; }
.empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.empty h3 { color: var(--text); font-size: 24px; margin: 18px 0 6px; }
.hero-ico { width: 92px; height: 92px; border-radius: 30px; background: var(--grad); display: grid; place-items: center; margin: 0 auto; color: #1a0d10; box-shadow: 0 18px 40px rgba(255, 90, 90, .3); transform: rotate(-6deg); }
.hero-ico svg { width: 44px; height: 44px; }

/* Messages */
.messages { flex: 1; overflow-y: auto; padding: 18px 20px 8px; display: flex; flex-direction: column; }
.chat-intro { text-align: center; padding: 30px 10px 24px; color: var(--muted); }
.chat-intro .avatar { margin: 0 auto 12px; }
.chat-intro h3 { margin: 0; color: var(--text); font-size: 22px; }
.chan-intro { padding: 20px 4px; }
.chan-intro .big { width: 64px; height: 64px; border-radius: 20px; background: var(--grad-soft); display: grid; place-items: center; font-size: 34px; color: var(--amber); margin-bottom: 12px; font-family: Sora, "DM Sans", system-ui, sans-serif; }
.chan-intro h3 { margin: 0 0 4px; font-size: 26px; color: var(--text); }
.time-sep { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--faint); font-weight: 600; margin: 18px 0 8px; }
.time-sep::before, .time-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg-group { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.msg-group.mine { flex-direction: row-reverse; }
.msg-group .avatar { margin-bottom: 2px; cursor: pointer; }
.msg-group .stack { display: flex; flex-direction: column; align-items: flex-start; max-width: min(72%, 640px); min-width: 0; gap: 3px; }
.msg-group.mine .stack { align-items: flex-end; }
.msg-group .author { font-size: 12px; color: var(--muted); padding: 0 12px 2px; font-weight: 700; cursor: pointer; }
.msg { position: relative; display: flex; align-items: center; gap: 6px; max-width: 100%; }
.mine .msg { flex-direction: row-reverse; }
.bubble { padding: 9px 14px; border-radius: 20px; background: var(--card); word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; max-width: 100%; border: 1px solid var(--line); }
.mine .bubble { background: var(--grad); color: #1d0b0f; border: 0; font-weight: 500; }
.mine .bubble a { color: #1d0b0f; }
.msg-group:not(.mine) .msg:not(:first-of-type) .bubble { border-top-left-radius: 6px; }
.msg-group:not(.mine) .msg:not(:last-child) .bubble { border-bottom-left-radius: 6px; }
.mine .msg:not(:first-of-type) .bubble { border-top-right-radius: 6px; }
.mine .msg:not(:last-child) .bubble { border-bottom-right-radius: 6px; }
.bubble.emoji { background: none !important; border: 0; font-size: 40px; padding: 0 4px; line-height: 1.2; }
.bubble code { background: rgba(0, 0, 0, .3); padding: 1px 5px; border-radius: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.bubble .mention { background: rgba(255, 166, 61, .18); color: #ffc58a; padding: 0 3px; border-radius: 5px; font-weight: 700; }
.mine .bubble .mention { background: rgba(0, 0, 0, .15); color: inherit; }
.reply-quote { font-size: 12px; color: var(--muted); padding: 3px 12px; border-left: 3px solid var(--amber); margin: 2px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed { border-left: 4px solid var(--c, var(--amber)); background: var(--panel-2); border-radius: 12px; padding: 10px 14px; margin-top: 3px; max-width: 460px; white-space: pre-wrap; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.embed .et { font-weight: 800; margin-bottom: 4px; font-family: Sora, "DM Sans", system-ui, sans-serif; }
.embed .ed { font-size: 14px; color: #d4d0de; }
.msg .tools { opacity: 0; display: flex; gap: 2px; transition: .1s; }
.msg:hover .tools { opacity: 1; }
.msg .tools button { width: 28px; height: 28px; border-radius: 9px; color: var(--faint); display: grid; place-items: center; }
.msg .tools button:hover { background: var(--hover); color: var(--text); }
.typing { height: 22px; padding: 0 24px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.composer-wrap { padding: 0 16px 16px; }
.reply-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 12px; background: var(--panel-2); border-radius: 14px 14px 0 0; margin: 0 8px; }
.reply-bar b { color: var(--text); }
.reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { display: flex; align-items: flex-end; gap: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 20px; padding: 5px 5px 5px 16px; transition: border .15s; }
.composer:focus-within { border-color: rgba(255, 120, 90, .5); }
.composer textarea { flex: 1; background: none; border: 0; outline: none; resize: none; padding: 9px 0; max-height: 160px; line-height: 1.4; }
.composer .icon-btn { color: var(--muted); width: 38px; height: 38px; }
.composer .send { background: var(--grad); color: #1a0d10; border-radius: 14px; }
.composer .send:hover { filter: brightness(1.08); background: var(--grad); }
.emoji-pop { position: absolute; bottom: 80px; right: 24px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 10px; display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; box-shadow: var(--shadow); z-index: 20; }
.emoji-pop button { font-size: 22px; height: 36px; border-radius: 10px; }
.emoji-pop button:hover { background: var(--hover); }

/* Voice stage */
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; background: radial-gradient(600px 300px at 50% 0%, rgba(255, 77, 109, .08), transparent), #0a090d; }
.stage.compact { flex: 0 0 46%; border-bottom: 1px solid var(--line); }
.stage-grid { flex: 1; display: grid; gap: 12px; padding: 16px; align-content: center; min-height: 0; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); margin: 0 auto; width: 100%; }
.tile { position: relative; background: var(--panel-2); border-radius: 22px; overflow: hidden; display: grid; place-items: center; aspect-ratio: 16 / 10; width: 100%; border: 1px solid var(--line); transition: box-shadow .15s; }
.tile.speaking { box-shadow: 0 0 0 3px var(--mint); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile video.contain { object-fit: contain; }
.tile video.mirror { transform: scaleX(-1); }
.tile .label { position: absolute; left: 10px; bottom: 10px; background: rgba(10, 9, 13, .7); padding: 4px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; backdrop-filter: blur(6px); }
.tile .label svg { width: 15px; height: 15px; color: #ff7d93; }
.tile .calling { position: absolute; top: 14px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; }
.stage-top { position: absolute; top: 14px; left: 18px; font-weight: 700; color: #ddd; z-index: 2; pointer-events: none; font-family: Sora, "DM Sans", system-ui, sans-serif; }
.stage-controls { display: flex; justify-content: center; gap: 10px; padding: 12px 12px 18px; }
.stage-controls .icon-btn { width: 50px; height: 50px; background: var(--card); border-radius: 17px; border: 1px solid var(--line); }
.stage-controls .icon-btn.on { background: var(--text); color: var(--bg); }
.stage-controls .icon-btn.off { background: rgba(255, 46, 85, .18); color: #ff7d93; }
.stage-controls .icon-btn.hang { background: var(--live); width: 66px; color: #fff; border: 0; }
.join-panel { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); }
.join-panel .people { display: flex; justify-content: center; margin: 14px 0; }
.join-panel .people .avatar { margin: 0 -5px; border: 3px solid var(--panel); }

/* Voice island */
.island { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; background: rgba(21, 20, 27, .92); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow); backdrop-filter: blur(14px); animation: rise .25s; }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
.island .where { display: flex; flex-direction: column; cursor: pointer; padding-right: 8px; max-width: 220px; }
.island .where b { font-size: 13px; color: var(--mint); display: flex; align-items: center; gap: 6px; }
.island .where b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.island .where span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.island .icon-btn { width: 40px; height: 40px; background: var(--card); }
.island .icon-btn.on { background: var(--text); }
.island .icon-btn.hang { background: var(--live); color: #fff; }

/* Members */
.members .row { padding: 7px 8px; }
.members .row.off { opacity: .45; }
.crown { color: var(--amber); }

/* Live */
.live-page { flex: 1; overflow-y: auto; padding: 26px; }
.live-hero { border-radius: 26px; padding: 28px; margin-bottom: 22px; background: radial-gradient(500px 200px at 90% 0%, rgba(255, 166, 61, .25), transparent), radial-gradient(500px 240px at 0% 100%, rgba(255, 46, 85, .25), transparent), var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.live-hero h1 { margin: 0 0 6px; font-size: 30px; }
.live-hero p { margin: 0; color: var(--muted); max-width: 520px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.live-card { border-radius: 22px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, border-color .15s; }
.live-card:hover { transform: translateY(-3px); border-color: rgba(255, 120, 90, .35); }
.live-thumb { aspect-ratio: 16 / 9; position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 70%, transparent), transparent 60%), radial-gradient(circle at 80% 80%, rgba(255, 166, 61, .35), transparent 55%), #121118; }
.live-thumb .avatar { box-shadow: 0 0 0 6px rgba(255, 255, 255, .06), 0 0 0 14px rgba(255, 255, 255, .03); }
.live-thumb .tl { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.live-thumb .tl .tag { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55); font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.live-meta { padding: 12px 14px 14px; display: flex; gap: 10px; align-items: center; }
.live-meta .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-meta .s { font-size: 13px; color: var(--muted); }
.live-view { flex: 1; display: grid; grid-template-columns: 1fr 340px; min-height: 0; }
.live-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; }
.player { position: relative; background: #000; aspect-ratio: 16 / 9; max-height: 68vh; width: 100%; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player video.mirror { transform: scaleX(-1); }
.player .ov { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); background: rgba(0, 0, 0, .6); }
.player .ptl { position: absolute; top: 14px; left: 14px; display: flex; gap: 6px; z-index: 2; }
.player .ptl .tag { margin: 0; font-size: 12px; padding: 4px 8px; }
.player .unmute { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3; }
.floaters { position: absolute; right: 20px; bottom: 20px; width: 60px; height: 70%; pointer-events: none; z-index: 2; }
.floaters span { position: absolute; bottom: 0; font-size: 30px; animation: floatUp 2.6s ease-out forwards; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.1); } 100% { transform: translateY(-340px) translateX(var(--dx, 0)) scale(1); opacity: 0; } }
.live-info { padding: 18px 20px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.live-info .meta { flex: 1; min-width: 200px; }
.live-info h2 { margin: 0 0 4px; font-size: 20px; }
.live-info .s { color: var(--muted); font-size: 14px; }
.studio-bar { display: flex; gap: 8px; padding: 0 20px 20px; flex-wrap: wrap; }
.viewer-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 20px; }
.viewer-chips .vc { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.live-chat { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.live-chat .head { padding: 16px; font-family: Sora, "DM Sans", system-ui, sans-serif; font-weight: 700; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.live-chat .list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.lc { font-size: 14px; line-height: 1.4; }
.lc b { margin-right: 6px; }
.lc.sys { color: var(--faint); font-size: 12.5px; }
.lc .host { background: var(--grad); color: #1a0d10; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 5px; margin-right: 5px; }
.reacts { display: flex; justify-content: space-around; padding: 8px 10px 0; }
.reacts button { font-size: 22px; width: 42px; height: 42px; border-radius: 12px; transition: transform .1s; }
.reacts button:hover { background: var(--hover); transform: scale(1.15); }
.reacts button:active { transform: scale(.9); }
.live-chat form { padding: 10px 12px 14px; }

/* Bot portal */
.portal { flex: 1; overflow-y: auto; padding: 28px; }
.portal-inner { max-width: 900px; margin: 0 auto; }
.portal h1 { margin: 0 0 4px; font-size: 30px; }
.portal .lead { color: var(--muted); margin: 0 0 22px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.card h3 { margin: 0 0 12px; }
.app-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; }
.app-card .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-card .desc { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.token-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.token { flex: 1; min-width: 200px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select, .inline input { padding: 9px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); outline: none; }
pre.code { background: #08070b; border: 1px solid var(--line); border-radius: 16px; padding: 16px; overflow-x: auto; font: 13px/1.55 ui-monospace, Menlo, monospace; color: #ffd9b8; margin: 0; }
.api-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.api-table td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.api-table td:first-child { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: #ffb07a; white-space: nowrap; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dir-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.dir-card .desc { color: var(--muted); font-size: 14px; flex: 1; }
.switch { position: relative; width: 42px; height: 24px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; transition: .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--mint); }
.switch.on::after { left: 20px; }

/* Modal / menu / toast */
.overlay { position: fixed; inset: 0; background: rgba(5, 4, 8, .7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 26px; width: 100%; max-width: 460px; box-shadow: var(--shadow); animation: pop .18s; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 24px 24px 6px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-head p { margin: 6px 0 0; color: var(--muted); }
.modal-body { padding: 14px 24px; }
.modal-foot { padding: 14px 24px 24px; display: flex; gap: 10px; justify-content: flex-end; }
.choice { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line-2); border-radius: 18px; margin-bottom: 10px; cursor: pointer; width: 100%; text-align: left; background: var(--panel-2); }
.choice:hover { border-color: rgba(255, 120, 90, .4); }
.choice .ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--grad); color: #1a0d10; flex-shrink: 0; }
.choice b { display: block; }
.choice small { color: var(--muted); }
.radio-row { display: flex; gap: 10px; margin-bottom: 14px; }
.radio-row label { flex: 1; display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; }
.radio-row label:has(input:checked) { border-color: var(--coral); background: rgba(255, 77, 109, .08); }
.radio-row input { accent-color: var(--coral); }
.radio-row label small { display: block; color: var(--muted); font-size: 12px; }
.pick-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.pick-list label:hover { background: var(--panel-2); }
.pick-list input { accent-color: var(--coral); width: 18px; height: 18px; }
.pick-list .meta { flex: 1; min-width: 0; }
.pick-list small { color: var(--muted); }
.invite-box { display: flex; gap: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 14px; align-items: center; }
.invite-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.profile-card { padding: 0 24px 6px; text-align: center; }
.profile-card .banner { height: 110px; margin: 0 -24px; background: radial-gradient(circle at 20% 30%, var(--c), transparent 70%), var(--grad); border-radius: 26px 26px 0 0; opacity: .9; }
.profile-card .avatar { margin: -48px auto 10px; border: 6px solid var(--panel); }
.profile-card h2 { margin: 0; }
.profile-card .u { color: var(--muted); }
.stats { display: flex; justify-content: center; gap: 28px; margin: 14px 0 4px; }
.stats b { display: block; font-family: Sora, "DM Sans", system-ui, sans-serif; font-size: 20px; }
.stats span { font-size: 12px; color: var(--muted); }
.profile-card .bio { margin: 12px 0 0; padding: 12px; background: var(--bg); border-radius: 14px; text-align: left; font-size: 14px; }
.live-banner { margin-top: 12px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 46, 85, .12); border: 1px solid rgba(255, 46, 85, .3); text-align: left; cursor: pointer; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row button { width: 32px; height: 32px; border-radius: 11px; border: 3px solid transparent; }
.color-row button.sel { border-color: #fff; }
.menu { position: fixed; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 6px; min-width: 230px; box-shadow: var(--shadow); z-index: 90; animation: pop .12s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left; font-weight: 600; font-size: 14px; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: #ff7d93; }
.menu button.danger:hover { background: var(--live); color: #fff; }
.notif-pop { width: 360px; max-height: 480px; overflow-y: auto; padding: 8px; }
.notif-pop h4 { margin: 6px 8px 8px; }
.notif { display: flex; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 14px; font-size: 14px; cursor: pointer; }
.notif:hover { background: var(--hover); }
.notif.unread { background: rgba(255, 77, 109, .07); }
.notif .when { font-size: 12px; color: var(--faint); }
.incoming { text-align: center; padding: 32px 24px; }
.incoming .avatar { margin: 0 auto 14px; animation: ring 1.4s infinite; }
.incoming .btns { display: flex; justify-content: center; gap: 36px; margin-top: 24px; }
.incoming .btns .icon-btn { width: 64px; height: 64px; color: #fff; border-radius: 22px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); } 100% { box-shadow: 0 0 0 26px rgba(61, 220, 151, 0); } }
.toasts { position: fixed; top: 80px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 14px; border-radius: 16px; box-shadow: var(--shadow); max-width: 340px; animation: slide .2s; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.toast .tx { flex: 1; }
.toast b { display: block; }
.toast.err { border-color: rgba(255, 46, 85, .4); }
.toast.live { border-color: rgba(255, 46, 85, .5); background: linear-gradient(120deg, rgba(255, 46, 85, .15), transparent), var(--panel-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

/* Responsive */
@media (max-width: 1150px) { .members { position: absolute; right: 12px; top: 80px; bottom: 12px; z-index: 30; box-shadow: var(--shadow); } .live-view { grid-template-columns: 1fr 300px; } }
@media (max-width: 900px) { .live-view { grid-template-columns: 1fr; } .live-chat { border-left: 0; border-top: 1px solid var(--line); min-height: 320px; } .nav button span.lbl { display: none; } }
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .topbar { padding: 0 10px; gap: 8px; height: 60px; }
  .topbar .logo span.word { display: none; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; padding: 8px; background: rgba(12, 11, 16, .95); border-top: 1px solid var(--line); }
  .nav-inner { width: 100%; justify-content: space-around; }
  .nav button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; }
  .nav button span.lbl { display: block; }
  .body { padding: 0 6px 72px; gap: 0; }
  .sidebar { width: 100%; }
  .main { display: none; }
  .app.show-main .sidebar { display: none; }
  .app.show-main .main { display: flex; }
  .back-btn { display: grid; }
  .island { bottom: 80px; }
  .go-live .lbl { display: none; }
  .msg-group .stack { max-width: 82%; }
}
.composer .input-wrap { flex: 1; display: flex; align-items: flex-end; min-width: 0; }
.composer .input-wrap textarea { flex: 1; min-width: 0; }
.top-right { margin-left: auto; }

/* ===== Coins, wallet, Flux, creator, admin ===== */
.coin-ico { display: inline-block; width: 22px; height: 22px; border-radius: 50%; vertical-align: -4px; margin-right: 6px; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #fff6c9 0 12%, transparent 13%), radial-gradient(circle, #ffd84d 0 52%, #f5a30b 53% 64%, #ffcf3a 65%); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 2px 8px rgba(255, 190, 40, .35); }
.coin-ico.sm { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }
.coin-ico.xs { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.coin-pill { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 14px; }
.coin-pill:hover { border-color: rgba(255, 200, 60, .45); }
.me-btn.flux { border-color: transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, linear-gradient(120deg, #7c5cff, #2ec5ff, #ff4dd8) border-box; border: 2px solid transparent; }
.avatar.has-img { background: #111; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.flux-badge { display: inline-grid; place-items: center; margin-left: 5px; color: #b9a2ff; vertical-align: -1px; filter: drop-shadow(0 0 6px rgba(140, 110, 255, .6)); }
.flux-name { background: linear-gradient(90deg, #c9b8ff, #8fe3ff, #ffb3ec); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.flux-name .flux-badge, .flux-name .tag { -webkit-text-fill-color: initial; }
.tag-creator { background: rgba(255, 196, 61, .16); color: #ffcf6b; }
.tag-flux { background: linear-gradient(90deg, rgba(124, 92, 255, .3), rgba(46, 197, 255, .3)); color: #d7ccff; }
.demo-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; margin-bottom: 18px; font-size: 14px; background: rgba(255, 196, 61, .08); border: 1px solid rgba(255, 196, 61, .28); color: #f1dfb8; }
.demo-banner svg { color: #ffcf6b; margin-top: 1px; }
.portal-inner.wide { max-width: 1100px; }
.portal h3 { margin: 22px 0 12px; }
.portal .card h3 { margin: 0 0 12px; }
.acct-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #1a0d10; background: var(--grad); flex-shrink: 0; }
.acct-ico.wallet { background: linear-gradient(135deg, #ffd84d, #f5a30b); }
.acct-ico.flux { background: linear-gradient(135deg, #7c5cff, #2ec5ff); color: #fff; }
.acct-ico.creator { background: linear-gradient(135deg, #ff4d6d, #ffa63d); }
.acct-ico.admin { background: linear-gradient(135deg, #3ddc97, #19a7a0); color: #06231a; }
.wallet-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px; border-radius: 24px; border: 1px solid rgba(255, 200, 60, .25);
  background: radial-gradient(400px 200px at 90% 0%, rgba(255, 200, 60, .2), transparent), radial-gradient(400px 220px at 0% 100%, rgba(255, 120, 60, .14), transparent), var(--panel-2); }
.big-coins { font-family: Sora, "DM Sans", sans-serif; font-size: 44px; font-weight: 800; display: flex; align-items: center; margin: 4px 0; }
.big-coins .coin-ico { width: 38px; height: 38px; margin-right: 12px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 10px; }
.pack-grid.compact { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack { position: relative; padding: 18px 14px 14px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pack.popular { border-color: rgba(255, 200, 60, .55); box-shadow: 0 0 0 3px rgba(255, 200, 60, .08); }
.pack .pop { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: linear-gradient(90deg, #ffd84d, #f5a30b); color: #2a1a00; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 8px; white-space: nowrap; }
.pack .pc { font-family: Sora, "DM Sans", sans-serif; font-weight: 800; font-size: 22px; display: flex; align-items: center; }
.pack .btn { width: 100%; }
.compact .pack { padding: 12px 8px 10px; }
.compact .pack .pc { font-size: 16px; }
.ledger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ledger-row:first-of-type { border-top: 0; }
.ledger-row .meta { min-width: 0; }
.ledger-row small { color: var(--faint); font-size: 12px; }
.pos { color: var(--mint); }
.neg { color: #ff8da1; }
.status { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 8px; text-transform: capitalize; }
.s-pending { background: rgba(255, 196, 61, .15); color: #ffcf6b; }
.s-paid { background: rgba(61, 220, 151, .15); color: var(--mint); }
.s-rejected { background: rgba(255, 46, 85, .15); color: #ff8da1; }
.flux-hero { position: relative; overflow: hidden; padding: 34px; border-radius: 28px; margin-bottom: 18px; border: 1px solid rgba(140, 110, 255, .35);
  background: linear-gradient(135deg, #160f2e, #0d1a2e 60%, #1d0f26); }
.flux-glow { position: absolute; inset: -40%; background: conic-gradient(from 0deg, rgba(124, 92, 255, .35), rgba(46, 197, 255, .25), rgba(255, 77, 216, .3), rgba(124, 92, 255, .35)); filter: blur(60px); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flux-logo { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-family: Sora, "DM Sans", sans-serif; color: #d7ccff; }
.flux-logo b { background: linear-gradient(90deg, #c9b8ff, #8fe3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flux-hero h1 { font-size: 36px; line-height: 1.12; margin: 16px 0 10px; }
.flux-hero p { color: #cfc8e6; margin: 0 0 18px; }
.flux-hero .btn.grad { background: linear-gradient(120deg, #7c5cff, #2ec5ff); color: #fff; box-shadow: 0 10px 30px rgba(100, 120, 255, .35); }
.perk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 14px; }
.perk-grid.three { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 16px 0; }
.perk { padding: 18px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.perk .pi { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; background: linear-gradient(135deg, rgba(124, 92, 255, .25), rgba(46, 197, 255, .2)); color: #c9b8ff; }
.perk span { color: var(--muted); font-size: 14px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 10px 8px; text-align: left; border-top: 1px solid var(--line); }
.cmp th { border-top: 0; color: var(--muted); font-weight: 700; }
.cmp .fx { color: #c9b8ff; font-weight: 700; }
.theme-row { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-sw { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 1px solid var(--line-2); font-weight: 700; font-size: 14px; }
.theme-sw span { width: 26px; height: 26px; border-radius: 9px; }
.theme-sw.sel { border-color: #fff; }
.t-coral span { background: linear-gradient(120deg, #ff4d6d, #ffa63d); } .t-ocean span { background: linear-gradient(120deg, #2e8bff, #6af0c8); }
.t-neon span { background: linear-gradient(120deg, #39ff88, #d4ff3a); } .t-grape span { background: linear-gradient(120deg, #8a5cff, #ff5cd6); }
.t-gold span { background: linear-gradient(120deg, #ffb703, #fff1a8); } .t-mono span { background: linear-gradient(120deg, #e8e8ee, #8d8d99); }
.space-mini { width: 40px; height: 40px; border-radius: 13px; background: var(--c); display: grid; place-items: center; font-family: Sora, "DM Sans", sans-serif; font-weight: 800; color: #fff; flex-shrink: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 16px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b { font-family: Sora, "DM Sans", sans-serif; font-size: 24px; }
.stat.big { grid-column: span 2; background: radial-gradient(300px 140px at 100% 0%, rgba(61, 220, 151, .16), transparent), var(--panel-2); border-color: rgba(61, 220, 151, .25); }
.stat.big b { font-size: 36px; }
.stat.big .btn { align-self: flex-start; margin-top: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.creator-hero { display: flex; gap: 20px; align-items: center; padding: 28px; border-radius: 26px; background: radial-gradient(500px 200px at 100% 0%, rgba(255, 166, 61, .2), transparent), var(--panel-2); border: 1px solid var(--line); flex-wrap: wrap; }
.creator-hero > div:first-child { flex: 1; min-width: 260px; }
.creator-hero h1 { margin: 0 0 8px; font-size: 32px; }
.gift-wall { display: grid; grid-template-columns: repeat(4, 54px); gap: 8px; }
.gift-wall span { font-size: 30px; width: 54px; height: 54px; border-radius: 16px; background: rgba(255, 255, 255, .05); display: grid; place-items: center; animation: bob 3s ease-in-out infinite; }
.gift-wall span:nth-child(odd) { animation-delay: -1.5s; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.agree { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); cursor: pointer; }
.agree input { accent-color: var(--coral); width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.field select { appearance: auto; }
.app-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.app-row:first-of-type { border-top: 0; }
.app-row .meta { flex: 1; min-width: 220px; }
.table-wrap { overflow-x: auto; }
.admin-t td { font-family: inherit !important; color: inherit !important; white-space: normal !important; font-size: 14px !important; }
.admin-t tr:first-child td { color: var(--faint) !important; font-weight: 700; font-size: 12px !important; text-transform: uppercase; }

/* Gifts on live */
.gift-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #1a0d10; background: linear-gradient(135deg, #ffd84d, #ff8a3d); box-shadow: 0 6px 18px rgba(255, 170, 60, .3); }
.gift-btn:hover { filter: brightness(1.08); transform: scale(1.06); }
.live-chat { position: relative; }
.gift-tray { position: absolute; left: 10px; right: 10px; bottom: 126px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); padding: 10px; z-index: 5; animation: pop .15s; }
.tray-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.tray-head b { flex: 1; font-family: Sora, "DM Sans", sans-serif; }
.tray-head .icon-btn { width: 30px; height: 30px; border-radius: 10px; }
.gift-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.gift { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 6px; border-radius: 14px; border: 1px solid transparent; transition: .12s; }
.gift:hover { background: var(--hover); border-color: rgba(255, 200, 60, .35); transform: translateY(-2px); }
.gift.poor { opacity: .45; }
.gift .ge { font-size: 28px; line-height: 1.1; }
.gift .gn { font-size: 11px; color: var(--muted); }
.gift .gc { font-size: 11px; font-weight: 800; display: flex; align-items: center; }
.tray-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.tray-foot .seg button { padding: 5px 9px; font-size: 13px; }
.lc.gifted { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 200, 60, .14), transparent); border: 1px solid rgba(255, 200, 60, .2); }
.lc.gifted .ge { font-size: 22px; }
.gift-burst { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; animation: burst 3s ease-out forwards; }
.gift-burst .ge { font-size: 90px; filter: drop-shadow(0 10px 30px rgba(255, 200, 60, .6)); }
.gift-burst.big .ge { font-size: 130px; }
.gift-burst.huge .ge { font-size: 170px; animation: wobble .6s ease-in-out 3; }
.gift-burst.huge { animation-duration: 4.2s; }
.gift-burst .gcap { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 16px; background: rgba(10, 9, 13, .75); backdrop-filter: blur(8px); font-size: 15px; border: 1px solid rgba(255, 200, 60, .35); }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 22% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(.9); } }
@keyframes wobble { 50% { transform: rotate(-8deg) scale(1.08); } }

/* Attachments */
.composer > .icon-btn:first-child { margin-left: -10px; }
.atts { display: flex; flex-direction: column; gap: 6px; margin-top: 3px; max-width: 100%; }
.mine .atts { align-items: flex-end; }
.att-img { max-width: min(340px, 100%); max-height: 320px; border-radius: 16px; display: block; border: 1px solid var(--line); background: var(--panel-2); }
.att-vid { max-width: min(420px, 100%); max-height: 320px; border-radius: 16px; background: #000; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; max-width: 340px; }
.att-file:hover { border-color: rgba(255, 120, 90, .4); }
.att-file .fi, .att-chip .fi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); color: var(--amber); flex-shrink: 0; }
.att-file .meta { min-width: 0; flex: 1; }
.att-file b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.att-file small { color: var(--muted); }
.att-pending { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 4px 8px; }
.att-chip { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2); width: 230px; }
.att-chip.err { border-color: rgba(255, 46, 85, .5); }
.att-chip img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.att-chip .meta { flex: 1; min-width: 0; }
.att-chip .n { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip small { color: var(--muted); font-size: 12px; }
.att-chip.err small { color: #ff8da1; }
.att-chip .icon-btn { width: 26px; height: 26px; border-radius: 8px; }
.att-chip .bar { height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; margin-top: 3px; }
.att-chip .bar i { display: block; height: 100%; background: var(--grad); transition: width .2s; }
.main.dropping::after { content: "Drop files to send"; position: absolute; inset: 10px; border: 2px dashed var(--amber); border-radius: 18px; display: grid; place-items: center; font-family: Sora, "DM Sans", sans-serif; font-size: 22px; background: rgba(12, 11, 16, .8); z-index: 40; pointer-events: none; }
.pf-media { margin-bottom: 18px; }
.pf-banner { height: 110px; border-radius: 18px; background: var(--grad); position: relative; display: flex; justify-content: flex-end; align-items: flex-start; padding: 10px; }
.pf-banner .btn { background: rgba(10, 9, 13, .6); backdrop-filter: blur(6px); }
.pf-av { margin: -42px 0 0 14px; width: 84px; position: relative; }
.pf-av .avatar { border: 5px solid var(--panel); }

/* Flux app themes */
body[data-theme="ocean"] { --coral: #2e8bff; --amber: #6af0c8; --grad: linear-gradient(120deg, #2e6bff 0%, #2ec5ff 55%, #6af0c8 100%); --grad-soft: linear-gradient(120deg, rgba(46, 139, 255, .2), rgba(106, 240, 200, .12)); }
body[data-theme="neon"] { --coral: #39ff88; --amber: #d4ff3a; --grad: linear-gradient(120deg, #19e07a 0%, #39ff88 50%, #d4ff3a 100%); --grad-soft: linear-gradient(120deg, rgba(57, 255, 136, .16), rgba(212, 255, 58, .1)); }
body[data-theme="grape"] { --coral: #8a5cff; --amber: #ff5cd6; --grad: linear-gradient(120deg, #6a4cff 0%, #a95cff 50%, #ff5cd6 100%); --grad-soft: linear-gradient(120deg, rgba(138, 92, 255, .2), rgba(255, 92, 214, .12)); }
body[data-theme="gold"] { --coral: #ffb703; --amber: #ffe08a; --grad: linear-gradient(120deg, #f59e0b 0%, #ffb703 50%, #fff1a8 100%); --grad-soft: linear-gradient(120deg, rgba(255, 183, 3, .18), rgba(255, 241, 168, .1)); }
body[data-theme="mono"] { --coral: #d9d9e3; --amber: #ffffff; --grad: linear-gradient(120deg, #9a9aa6 0%, #d9d9e3 50%, #ffffff 100%); --grad-soft: linear-gradient(120deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .05)); }
body[data-theme="grape"] .mine .bubble, body[data-theme="ocean"] .mine .bubble { color: #fff; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } .stat.big { grid-column: span 1; } .gift-grid { grid-template-columns: repeat(5, 1fr); } .coin-pill { padding: 6px 9px; font-size: 13px; } .flux-hero h1 { font-size: 26px; } }
