:root {
  --bg: #0a0b12; --rail: #07080d; --side: #10121b; --main: #141621; --panel: rgba(20, 22, 33, 0.86); --panel-solid: #191b28; --panel2: rgba(255,255,255,0.06);
  --line: rgba(255,255,255,0.09); --text: #eef0f7; --muted: #a9adc2; --dim: #747891; --accent: #6366f1; --accent2: #818cf8; --pink: #22d3ee;
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --radius: 16px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; overflow: hidden; }
a { color: var(--accent2); }
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
#bglayer { position: fixed; inset: 0; z-index: -1; opacity: .35; }

/* ---------- layout: rail | sidebar | chat | members ---------- */
#shell { display: grid; grid-template-columns: 72px 250px 1fr; height: 100vh; height: 100dvh; }
#shell.with-members { grid-template-columns: 72px 250px 1fr 250px; }
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.rail .sep { width: 32px; height: 2px; background: var(--line); border-radius: 2px; margin: 2px 0; }
.ricon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; cursor: pointer; position: relative; text-decoration: none; color: #fff; transition: border-radius .15s, transform .1s; background: var(--panel-solid); flex: none; border: 0; }
.ricon:hover, .ricon.on { border-radius: 16px; }
.ricon.on::before { content: ''; position: absolute; left: -12px; width: 4px; height: 36px; border-radius: 0 4px 4px 0; background: #fff; }
.ricon.dot::after { content: ''; position: absolute; left: -12px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: #fff; }
.ricon .badge { position: absolute; bottom: -2px; right: -4px; }
.ricon.add { color: var(--ok); font-size: 26px; } .ricon.home { background: #161827; border: 1px solid var(--line); }
.side { background: var(--side); display: flex; flex-direction: column; min-width: 0; }
.side-head { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--line); font-weight: 800; flex: none; position: relative; overflow: hidden; }
.side-head .bgstrip { position: absolute; inset: 0; opacity: .55; z-index: 0; } .side-head > *:not(.bgstrip) { position: relative; z-index: 1; }
.side-head .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.side-list { flex: 1; overflow-y: auto; padding: 10px 8px; }
.side-list h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 14px 8px 6px; display: flex; justify-content: space-between; align-items: center; }
.side-list h4 button { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 16px; padding: 0; }
.chan { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--dim); text-decoration: none; font-weight: 500; margin-bottom: 1px; }
.chan:hover { background: var(--panel2); color: var(--muted); } .chan.on { background: rgba(255,255,255,.1); color: var(--text); }
.chan.unread { color: var(--text); font-weight: 700; } .chan.unread::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-left: auto; }
.chan .hash { font-size: 18px; opacity: .7; width: 18px; text-align: center; }
.me-bar { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: rgba(0,0,0,.25); flex: none; }
.me-bar .n { flex: 1; min-width: 0; line-height: 1.15; } .me-bar .n b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; } .me-bar .n small { color: var(--dim); font-size: 12px; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; padding: 6px; border-radius: 8px; line-height: 1; }
.icon-btn:hover { background: var(--panel2); color: var(--text); }

.main { display: flex; flex-direction: column; min-width: 0; background: var(--main); }
.main-head { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.main-head .t { font-weight: 800; white-space: nowrap; display: flex; align-items: center; gap: 8px; min-width: 0; } .main-head .topic { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.menu-btn { display: none; }
.scroll { flex: 1; overflow-y: auto; }
.page { max-width: 820px; margin: 0 auto; padding: 18px 18px 60px; }

.members { background: var(--side); overflow-y: auto; padding: 12px 8px; }
.members h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 12px 8px 6px; }
.mem { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; cursor: pointer; } .mem:hover { background: var(--panel2); }
.mem .n { min-width: 0; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mem .n b { font-size: 14px; } .mem .n .status { display: block; }
.mem.off { opacity: .45; }

/* ---------- chat ---------- */
.msgs { flex: 1; overflow-y: auto; padding: 14px 0 6px; display: flex; flex-direction: column; }
.msgs .top { padding: 20px 18px 10px; }
.msgs .top .big { font-size: 40px; } .msgs .top h2 { margin: 6px 0 2px; font-size: 24px; }
.msg { display: flex; gap: 12px; padding: 3px 18px; position: relative; }
.msg:hover { background: rgba(255,255,255,.025); }
.msg.first { margin-top: 12px; }
.msg .gutter { width: 40px; flex: none; color: var(--dim); font-size: 10px; text-align: center; padding-top: 4px; opacity: 0; } .msg:hover .gutter { opacity: 1; }
.msg .body { min-width: 0; flex: 1; }
.msg .who { display: flex; align-items: baseline; gap: 8px; } .msg .who b { cursor: pointer; } .msg .who b:hover { text-decoration: underline; }
.msg .time { color: var(--dim); font-size: 12px; }
.msg .text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .text .edited { color: var(--dim); font-size: 11px; }
.msg.mention { background: rgba(245, 158, 11, .08); box-shadow: inset 2px 0 0 var(--warn); }
.msg .text code { background: rgba(0,0,0,.35); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.msg .text a { word-break: break-all; }
.ment { background: rgba(139, 92, 246, .25); color: #ddd6fe; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.reply-ref { font-size: 13px; color: var(--dim); display: flex; gap: 6px; align-items: center; margin-left: 52px; margin-top: 10px; padding: 0 18px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.reply-ref::before { content: '↱'; } .reply-ref b { color: var(--muted); }
.rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rx button { background: var(--panel2); border: 1px solid transparent; border-radius: 8px; padding: 1px 7px; cursor: pointer; font-size: 14px; }
.rx button.mine { border-color: var(--accent); background: rgba(139,92,246,.2); }
.tools { position: absolute; right: 16px; top: -14px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; display: none; padding: 2px; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.msg:hover .tools, .msg.tools-on .tools { display: flex; }
.tools button { background: none; border: 0; padding: 5px 7px; cursor: pointer; border-radius: 7px; font-size: 15px; } .tools button:hover { background: var(--panel2); }
.pinned-tag { font-size: 11px; color: var(--warn); }
.composer-wrap { padding: 0 16px 16px; flex: none; }
.replying { background: var(--panel-solid); border-radius: 12px 12px 0 0; padding: 7px 12px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.composer { display: flex; gap: 8px; align-items: flex-end; background: var(--panel-solid); border-radius: 14px; padding: 8px; border: 1px solid var(--line); }
.replying + .composer { border-radius: 0 0 14px 14px; }
.composer textarea { flex: 1; background: transparent; border: 0; outline: none; resize: none; max-height: 160px; min-height: 24px; padding: 6px 8px; line-height: 1.4; }
.composer .btn { padding: 8px 14px; }
.locked-note { text-align: center; color: var(--dim); padding: 12px; background: var(--panel-solid); border-radius: 12px; font-size: 14px; }
.newpill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 90px; background: var(--accent); color: #fff; border: 0; border-radius: 99px; padding: 6px 14px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.day { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; font-weight: 600; margin: 16px 18px 4px; } .day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- common bits ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
h1 { font-size: 26px; margin: 8px 0 4px; letter-spacing: -.02em; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 18px 0 8px; }
.sub { color: var(--muted); margin: 0 0 8px; } .dim { color: var(--dim); font-size: 13px; } .muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 9px 15px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); } .btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); color: var(--text); } .btn.danger { background: #b91c1c; } .btn.ok { background: #15803d; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; } .btn.block { width: 100%; justify-content: center; }
input, textarea, select { width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent2); }
textarea { resize: vertical; min-height: 64px; }
label { display: block; font-weight: 600; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--text); font-size: 14px; } .check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.err { color: #fca5a5; font-size: 14px; min-height: 20px; margin-top: 8px; }
.badge { background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 0 6px; line-height: 17px; min-width: 17px; text-align: center; border: 3px solid var(--rail); box-sizing: content-box; }
.pill { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.r-owner { background: #f59e0b33; color: #fcd34d; } .r-admin { background: #ef444433; color: #fca5a5; } .r-mod { background: #3b82f633; color: #93c5fd; }
.vf { color: #60a5fa; } .vf .ic { width: 15px; height: 15px; vertical-align: -2px; } .stf { background: linear-gradient(135deg, var(--accent), var(--pink)); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 5px; vertical-align: 2px; }
.tabs { display: flex; gap: 4px; background: var(--panel2); border-radius: 12px; padding: 4px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; border: 0; background: none; border-radius: 9px; padding: 8px 12px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; } .tabs button.on { background: var(--accent); color: #fff; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); } .empty .e { color: var(--dim); } .empty .e .ic { width: 40px; height: 40px; stroke-width: 1.5; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #23213d; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 90; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal .box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal .box.wide { max-width: 560px; padding: 0; }
.banner { padding: 8px 14px; text-align: center; font-weight: 700; font-size: 14px; display: flex; gap: 10px; justify-content: center; align-items: center; }
.banner.info { background: #2563eb; } .banner.success { background: #15803d; } .banner.warning { background: #b45309; } .banner.party { background: linear-gradient(90deg, #4f46e5, #0891b2); }
.banner button { background: rgba(0,0,0,.2); border: 0; color: #fff; border-radius: 6px; cursor: pointer; padding: 2px 8px; }
#app-wrap { display: flex; flex-direction: column; position: fixed; inset: 0; } #app-wrap > #shell { flex: 1; min-height: 0; height: auto; grid-template-rows: minmax(0, 1fr); }
.main, .side, .members, .rail { min-height: 0; }

/* avatars (+ rings and colours from profiles) */
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; flex: none; position: relative; }
.av.sm { width: 32px; height: 32px; font-size: 17px; } .av.xs { width: 22px; height: 22px; font-size: 12px; } .av.lg { width: 76px; height: 76px; font-size: 40px; } .av.xl { width: 96px; height: 96px; font-size: 50px; border: 5px solid var(--panel-solid); }
.av .on-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 3px solid var(--side); box-sizing: content-box; }
.av.xl .on-dot { width: 18px; height: 18px; border-width: 4px; right: 2px; bottom: 2px; border-color: var(--panel-solid); }
.c-violet { background: #7c3aed; } .c-blue { background: #2563eb; } .c-teal { background: #0d9488; } .c-green { background: #16a34a; } .c-yellow { background: #ca8a04; }
.c-orange { background: #ea580c; } .c-red { background: #dc2626; } .c-pink { background: #db2777; } .c-gray { background: #52525b; }
.ring-gold { box-shadow: 0 0 0 2px #fbbf24, 0 0 10px #fbbf2499; } .ring-rainbow { box-shadow: 0 0 0 2px #f43f5e, 0 0 0 4px #eab308, 0 0 0 6px #3b82f6; } .ring-neon { box-shadow: 0 0 0 2px #22d3ee, 0 0 14px #22d3ee; }
.nm { font-weight: 700; }
.f-rounded { font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Arial Rounded MT Bold', system-ui, sans-serif; } .f-mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.f-serif { font-family: Georgia, 'Times New Roman', serif; font-style: italic; } .f-bold { font-family: Impact, 'Arial Black', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .03em; font-weight: 400; }
.n-white { color: #fff; } .n-gold { color: #fbbf24; } .n-pink { color: #f472b6; } .n-cyan { color: #22d3ee; } .n-lime { color: #a3e635; }
.n-rainbow, .n-fire, .n-ocean { -webkit-background-clip: text; background-clip: text; color: transparent; }
.n-rainbow { background-image: linear-gradient(90deg, #f43f5e, #f97316, #eab308, #22c55e, #06b6d4, #8b5cf6); } .n-fire { background-image: linear-gradient(90deg, #fde047, #f97316, #ef4444); } .n-ocean { background-image: linear-gradient(90deg, #67e8f9, #3b82f6, #6366f1); }
.status { display: inline-block; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* profile card */
.pcard { border-radius: 18px; overflow: hidden; }
.pc-top { height: 100px; } .pc-body { padding: 0 20px 20px; margin-top: -50px; }
.pc-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 8px; } .pc-name h2 { font-size: 24px; margin: 0; }
.pron { font-size: 12px; color: var(--muted); background: var(--panel2); padding: 1px 8px; border-radius: 99px; }
.pc-sec { background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.pc-sec h3 { margin: 0 0 6px; } .pc-bio { white-space: pre-wrap; margin: 0; }
.tags, .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; font-size: 13px; }
.bdg { background: linear-gradient(135deg, #fbbf2433, #a855f733); border: 1px solid #fbbf2466; border-radius: 8px; padding: 3px 8px; font-size: 12px; font-weight: 700; cursor: help; }
.faves { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; } .fave span { display: block; font-size: 11px; color: var(--dim); }
.pstats { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 13px; } .pstats b { color: var(--text); }
.card-glass { background: var(--panel-solid); } .card-solid { background: #111020; } .card-outline { background: #0d0c1a; border: 2px solid rgba(255,255,255,.5); }
.card-neon { background: #0a0818; border: 2px solid var(--glow, #a855f7); box-shadow: 0 0 22px var(--glow, #a855f7); }
.c-glow-violet { --glow: #8b5cf6; } .c-glow-blue { --glow: #3b82f6; } .c-glow-teal { --glow: #14b8a6; } .c-glow-green { --glow: #22c55e; } .c-glow-yellow { --glow: #eab308; } .c-glow-orange { --glow: #f97316; } .c-glow-red { --glow: #ef4444; } .c-glow-pink { --glow: #ec4899; } .c-glow-gray { --glow: #a1a1aa; }

/* pickers */
.bgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.bgs button { height: 52px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 4px #000; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; }
.bgs button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; } .colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; } .colors button.on { border-color: #fff; }
.emojis { display: flex; gap: 6px; flex-wrap: wrap; } .emojis button { font-size: 21px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; } .emojis button.on { border-color: var(--accent2); background: #8b5cf633; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chipbtn { border: 1px solid var(--line); background: var(--panel2); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 700; font-size: 13px; } .chipbtn.on { border-color: var(--accent2); background: #8b5cf633; box-shadow: 0 0 0 1px var(--accent2); }

/* discover & owner */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ccard { border-radius: 16px; overflow: hidden; background: var(--panel-solid); border: 1px solid var(--line); display: flex; flex-direction: column; }
.ccard .top { height: 76px; position: relative; } .ccard .top .e { position: absolute; left: 14px; bottom: -22px; font-size: 30px; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--panel-solid); border: 3px solid var(--panel-solid); }
.ccard .b { padding: 28px 14px 14px; flex: 1; display: flex; flex-direction: column; } .ccard .b p { color: var(--muted); font-size: 13px; flex: 1; margin: 4px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border-radius: 14px; padding: 12px 14px; } .stat b { display: block; font-size: 26px; } .stat .si { color: var(--accent2); display: block; margin-bottom: 4px; } .stat .si .ic { width: 18px; height: 18px; } .stat span { color: var(--dim); font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; } .bars div { flex: 1; background: linear-gradient(180deg, var(--accent2), var(--accent)); border-radius: 4px 4px 0 0; min-height: 3px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tog { width: 46px; height: 26px; border-radius: 99px; background: #3f3f46; border: 0; position: relative; cursor: pointer; flex: none; }
.tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; } .tog.on { background: var(--ok); } .tog.on::after { left: 23px; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth { width: 100%; max-width: 420px; } .logo { font-weight: 900; font-size: 34px; letter-spacing: -.03em; text-align: center; } 
.notes { white-space: pre-wrap; line-height: 1.6; }
.chatlike { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--panel2); margin-bottom: 8px; text-decoration: none; color: var(--text); }

/* ---------- phones ---------- */
@media (max-width: 1100px) { #shell.with-members { grid-template-columns: 72px 250px 1fr; } #shell .members { display: none; } #shell.show-members .members { display: block; position: fixed; right: 0; top: 0; bottom: 0; width: 270px; z-index: 40; box-shadow: -10px 0 30px rgba(0,0,0,.5); } }
@media (max-width: 760px) {
  #shell, #shell.with-members { grid-template-columns: 1fr; }
  .rail, .side { position: fixed; top: 0; bottom: 0; z-index: 45; transform: translateX(-110%); transition: transform .2s; }
  .rail { left: 0; width: 72px; } .side { left: 72px; width: min(290px, calc(100vw - 72px)); transform: translateX(calc(-100% - 90px)); }
  #shell.drawer .rail, #shell.drawer .side { transform: none; }
  #shell.drawer::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 44; }
  .menu-btn { display: block; }
  .msg { padding: 3px 12px; } .msg .gutter { display: none; } .msg:not(.first) .body { margin-left: 52px; } .reply-ref { margin-left: 40px; padding: 0 12px; }
  .tools { right: 8px; }
  .composer-wrap { padding: 0 10px 10px; }
}

/* Nexo line icons and logo */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; flex: none; }
button .ic, a .ic { pointer-events: none; }
.hash .ic { width: 17px; height: 17px; opacity: .8; }
.bigic { color: var(--accent2); } .bigic .ic { width: 52px; height: 52px; stroke-width: 1.5; }
.ricon .mark { display: block; }
.wordmark { display: inline-flex; align-items: center; gap: .28em; font-weight: 800; letter-spacing: -.045em; color: var(--text); line-height: 1; }
.wordmark > span { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; }
.wordmark > i { width: .2em; height: .2em; border-radius: 50%; background: #22d3ee; margin-left: -.18em; align-self: flex-end; margin-bottom: .14em; }
body { font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* Photos */
.av.has-photo { background: #222536; }
.av > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.cimg { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.ricon .cimg { border-radius: inherit; } .ricon { overflow: hidden; }
.ricon.sm { width: 36px; height: 36px; font-size: 18px; flex: none; cursor: default; }
.ricon.big { width: 76px; height: 76px; font-size: 38px; border-radius: 22px; flex: none; cursor: default; }
.side-head .sicon { width: 26px; height: 26px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; flex: none; }
.ccard .top .e { overflow: hidden; } .ccard .top .e .cimg { border-radius: 13px; }
.photo-row { align-items: center; gap: 14px; flex-wrap: nowrap; margin: 4px 0 6px; }
.phs { font-size: 13px; margin-top: 6px; } .phs.busy { color: var(--accent2); } .phs.good { color: var(--ok); } .phs.bad { color: var(--bad); } .phs.wait { color: var(--warn); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ptile { background: var(--panel2); border-radius: 14px; overflow: hidden; } .ptile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ptile .pt-b { padding: 8px 10px 10px; display: grid; gap: 4px; font-size: 13px; } .ptile .row { margin-top: 4px; gap: 6px; }
.rimg { width: 140px; height: 140px; object-fit: cover; border-radius: 12px; display: block; margin: 6px 0; }
.warnbox { border-color: rgba(245, 158, 11, .5); }

/* ---------- free "perks": looks ---------- */
.n-violet { color: #a78bfa; } .n-mint { color: #6ee7b7; } .n-peach { color: #fdba74; } .n-red { color: #f87171; }
.n-aurora, .n-candy, .n-sunset, .n-toxic, .n-galaxy, .n-chrome { -webkit-background-clip: text; background-clip: text; color: transparent; }
.n-aurora { background-image: linear-gradient(90deg, #22d3ee, #818cf8, #34d399, #22d3ee); } .n-candy { background-image: linear-gradient(90deg, #f9a8d4, #c4b5fd, #93c5fd, #f9a8d4); }
.n-sunset { background-image: linear-gradient(90deg, #fb923c, #f472b6, #a78bfa, #fb923c); } .n-toxic { background-image: linear-gradient(90deg, #a3e635, #22c55e, #facc15, #a3e635); }
.n-galaxy { background-image: linear-gradient(90deg, #6366f1, #c084fc, #22d3ee, #6366f1); } .n-chrome { background-image: linear-gradient(90deg, #f8fafc, #94a3b8, #f8fafc, #64748b, #f8fafc); }
.nfx-shimmer { background-size: 200% 100%; animation: nx-shimmer 3s linear infinite; }
.nfx-shimmer:not([class*="n-rainbow"]):not([class*="n-fire"]):not([class*="n-ocean"]):not([class*="n-aurora"]):not([class*="n-candy"]):not([class*="n-sunset"]):not([class*="n-toxic"]):not([class*="n-galaxy"]):not([class*="n-chrome"]) { background-image: linear-gradient(90deg, currentColor 40%, #fff 50%, currentColor 60%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nfx-glow { filter: drop-shadow(0 0 6px rgba(255,255,255,.55)); }
.nfx-pulse { animation: nx-pulse 2s ease-in-out infinite; }
.nfx-wave { display: inline-block; animation: nx-wave 2.4s ease-in-out infinite; }
@keyframes nx-shimmer { to { background-position: -200% 0; } }
@keyframes nx-pulse { 50% { opacity: .55; } }
@keyframes nx-wave { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-2px) rotate(-2deg); } 75% { transform: translateY(1px) rotate(2deg); } }
.ring-pulse { animation: nx-ring-pulse 2s ease-in-out infinite; }
@keyframes nx-ring-pulse { 0%, 100% { box-shadow: 0 0 0 2px #818cf8, 0 0 4px #818cf8; } 50% { box-shadow: 0 0 0 3px #22d3ee, 0 0 18px #22d3ee; } }
.ring-fire { box-shadow: 0 0 0 2px #f97316, 0 0 14px #ef4444; animation: nx-fire 1.2s ease-in-out infinite alternate; }
@keyframes nx-fire { to { box-shadow: 0 0 0 2px #fde047, 0 0 22px #f97316; } }
.ring-aurora { box-shadow: 0 0 0 2px #34d399, 0 0 0 4px #22d3ee, 0 0 16px #818cf8; }
.ring-spin::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(#6366f1, #22d3ee, #34d399, #f472b6, #6366f1); z-index: 1; pointer-events: none; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); animation: nx-spin 3s linear infinite; }
.ring-spin { isolation: isolate; }
@keyframes nx-spin { to { transform: rotate(360deg); } }
.card-gradient { background: linear-gradient(160deg, color-mix(in srgb, var(--glow, #6366f1) 45%, #111) 0%, #10121b 70%); border: 1px solid color-mix(in srgb, var(--glow, #6366f1) 50%, transparent); }
.card-holo { background: linear-gradient(120deg, #1e1b4b, #164e63, #3b0764, #1e1b4b); background-size: 300% 300%; animation: nx-holo 8s ease infinite; border: 1px solid rgba(255,255,255,.25); }
@keyframes nx-holo { 50% { background-position: 100% 50%; } }
.pcard { position: relative; }
.pc-top { position: relative; overflow: hidden; } .pc-top img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfx { position: absolute; inset: 0; pointer-events: none; z-index: 3; border-radius: inherit; overflow: hidden; opacity: .75; }
.pfx::before, .pfx::after { content: ''; position: absolute; inset: -100% 0 0 0; background-repeat: repeat; animation: nx-fall 9s linear infinite; }
.pfx::after { animation-duration: 14s; opacity: .7; background-position: 37px 53px; }
@keyframes nx-fall { to { transform: translateY(50%); } }
.pfx-snow::before, .pfx-snow::after { background-image: radial-gradient(circle, #fff 1.6px, transparent 2.2px), radial-gradient(circle, #fff 1px, transparent 1.6px); background-size: 120px 120px, 77px 77px; }
.pfx-stars::before, .pfx-stars::after { background-image: radial-gradient(circle, #fde68a 1.4px, transparent 2px), radial-gradient(circle, #a5f3fc 1px, transparent 1.6px); background-size: 140px 140px, 93px 93px; animation-name: nx-twinkle; inset: 0; }
@keyframes nx-twinkle { 50% { opacity: .25; } }
.pfx-sparkles::before, .pfx-sparkles::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cpath d='M30 18l2 6 6 2-6 2-2 6-2-6-6-2 6-2z' fill='%23fde68a'/%3E%3Cpath d='M120 100l1.4 4 4 1.4-4 1.4L120 111l-1.4-4.2-4-1.4 4-1.4z' fill='%23c4b5fd'/%3E%3C/svg%3E"); animation-name: nx-twinkle; inset: 0; animation-duration: 2.6s; }
.pfx-sparkles::after { animation-duration: 3.7s; background-position: 85px 60px; }
.pfx-hearts::before, .pfx-hearts::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cpath d='M30 40c-6-5-10-8-10-12a5 5 0 0 1 10-2 5 5 0 0 1 10 2c0 4-4 7-10 12z' fill='%23f472b6' fill-opacity='.8'/%3E%3C/svg%3E"); animation-name: nx-rise; inset: 0 0 -100% 0; }
.pfx-bubbles::before, .pfx-bubbles::after { background-image: radial-gradient(circle, transparent 5px, rgba(165,243,252,.6) 6px, transparent 7px); background-size: 110px 110px; animation-name: nx-rise; inset: 0 0 -100% 0; }
@keyframes nx-rise { to { transform: translateY(-50%); } }
.pfx-confetti::before, .pfx-confetti::after { background-image: linear-gradient(45deg, #f472b6 3px, transparent 3px), linear-gradient(-45deg, #22d3ee 3px, transparent 3px), linear-gradient(90deg, #fde047 3px, transparent 3px); background-size: 121px 121px, 97px 97px, 143px 143px; }
.banner-prev { width: 180px; height: 60px; border-radius: 10px; overflow: hidden; flex: none; } .banner-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: reduce) { .nfx-shimmer, .nfx-pulse, .nfx-wave, .ring-pulse, .ring-fire, .ring-spin::before, .card-holo, .pfx::before, .pfx::after { animation: none !important; } }

/* ---------- chat extras ---------- */
.cemo { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; display: inline-block; }
.text.jumbo .cemo { width: 48px; height: 48px; vertical-align: middle; }
.rx .cemo { width: 18px; height: 18px; vertical-align: -4px; }
.emojis button .cemo { width: 28px; height: 28px; vertical-align: middle; }
.mimg { display: block; margin-top: 6px; padding: 0; border: 0; background: none; cursor: zoom-in; max-width: min(420px, 100%); }
.mimg img { max-width: 100%; max-height: 340px; border-radius: 12px; display: block; border: 1px solid var(--line); }
.bigimg { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: 12px; }
.pinimg { max-width: 220px; max-height: 160px; border-radius: 10px; margin-top: 6px; display: block; }
.composer { align-items: flex-end; }
.composer .icon-btn { flex: none; align-self: center; }
.attach { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin: 0 0 8px; font-size: 13px; }
.attach img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.eitem { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 6px 8px; font-size: 13px; } .eitem span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.eitem .cemo { width: 32px; height: 32px; }

/* ---------- big centered logo screens ---------- */
.splash-screen, .splash-bg { background: radial-gradient(600px 420px at 50% 42%, rgba(99, 102, 241, .16), transparent 70%), radial-gradient(500px 360px at 56% 56%, rgba(34, 211, 238, .08), transparent 70%), #0a0b12; }
.splash-screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; }
.splash { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; }
.splash-mark { width: 150px; height: 150px; border-radius: 40px; display: grid; place-items: center; background: #0d0f1a; border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 1px rgba(99,102,241,.15), 0 20px 60px rgba(99,102,241,.25), 0 0 120px rgba(34,211,238,.12); animation: nx-float 6s ease-in-out infinite; }
.splash-mark .mark { filter: drop-shadow(0 0 18px rgba(99,102,241,.45)); }
.splash-word { margin-top: 34px; font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; font-weight: 800; font-size: clamp(56px, 16vw, 84px); letter-spacing: -.055em; line-height: .9; color: #fff; display: flex; align-items: flex-end; }
.splash-word i { width: .17em; height: .17em; border-radius: 50%; background: #22d3ee; margin: 0 0 .06em .04em; box-shadow: 0 0 18px #22d3ee; }
.splash-sub { margin: 22px 0 0; max-width: 420px; font-size: clamp(17px, 4.6vw, 21px); line-height: 1.45; color: #a9adc2; }
.splash .btn { margin-top: 28px; }
.splash-link { margin-top: 30px; font-size: 13px; color: var(--dim); text-decoration: none; } .splash-link:hover { color: var(--text); }
.splash.small { margin-bottom: 22px; } .splash.small .splash-mark { width: 104px; height: 104px; border-radius: 30px; }
.splash.small .splash-mark .mark { width: 82px; height: 82px; } .splash.small .splash-word { font-size: 54px; margin-top: 22px; } .splash.small .splash-sub { font-size: 15px; margin-top: 14px; }
@keyframes nx-float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .splash-mark { animation: none; } }

/* ---------- roles ---------- */
.rpill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--rc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); color: var(--text); }
.rpill i { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }
.rpill.toggle { cursor: pointer; opacity: .55; font: inherit; font-size: 12px; font-weight: 600; } .rpill.toggle.on { opacity: 1; box-shadow: 0 0 0 1px var(--rc); } .rpill.toggle:disabled { cursor: default; }
.rdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; } .rdot.big { width: 14px; height: 14px; margin: 0; flex: none; }
.rlist { display: grid; gap: 6px; margin-top: 12px; }
.ritem { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 12px; padding: 8px 10px; font-size: 14px; } .ritem .icon-btn:disabled { opacity: .3; }
.ritem.locked { opacity: .65; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; } .swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.switch.off { opacity: .45; }

/* ---------- watch together ---------- */
#watch { flex: none; }
.watch { padding: 10px 16px 6px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.18); }
.wframe { width: 100%; max-width: 960px; margin: 0 auto; aspect-ratio: 16 / 9; max-height: 46vh; border-radius: 12px; overflow: hidden; background: #000; }
.wframe.tall { aspect-ratio: auto; height: min(58vh, 640px); max-width: 360px; }
.wframe iframe { width: 100%; height: 100%; border: 0; display: block; }
.wbar { display: flex; align-items: center; gap: 6px; max-width: 960px; margin: 8px auto 0; flex-wrap: wrap; }
.wsrc { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; } .wsrc .ic { color: var(--accent2); }
.whint { max-width: 960px; margin: 4px auto 0; font-size: 12px; }
.watch-hidden .wframe, .watch-hidden .whint { display: none; }
@media (max-width: 700px) { .watch { padding: 8px 10px 4px; } .wframe { max-height: 32vh; } .wframe.tall { height: 48vh; } }

/* ---------- tablets & touch screens ---------- */
@media (min-width: 761px) and (max-width: 1100px) {
  #shell, #shell.with-members { grid-template-columns: 72px 220px 1fr; }
  .wframe { max-height: 34vh; }
  .mimg { max-width: min(340px, 100%); } .mimg img { max-height: 280px; }
}
@media (min-width: 1101px) and (max-width: 1280px) { #shell.with-members { grid-template-columns: 72px 230px 1fr 230px; } .wframe { max-height: 40vh; } }
@media (hover: none) {
  .msg:hover .tools { display: none; } .msg.tools-on .tools { display: flex; }
  .tools button { padding: 9px 11px; } .icon-btn { min-width: 40px; min-height: 40px; }
  .msg.tools-on { background: rgba(255,255,255,.03); }
}

@media (min-width: 701px) and (max-width: 760px) { .wframe { max-height: 34vh; } }

/* ---------- landing + download page ---------- */
body:has(.lp) { overflow: auto; background: #0a0b12; }
.lp { min-height: 100vh; background: #0a0b12; color: var(--text); }
.lp a { color: inherit; }
.lp-nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 14px max(16px, calc(50% - 560px)); background: rgba(10, 11, 18, .82); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.06); }
.lp-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 20px; letter-spacing: -.04em; }
.lp-links { display: flex; gap: 4px; } .lp-links button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px; padding: 6px 10px; border-radius: 8px; cursor: pointer; } .lp-links button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.lp-login { text-decoration: none; color: var(--muted) !important; font-size: 15px; } .lp-login:hover { color: var(--text) !important; }
.btn.white { background: #fff; color: #0a0b12 !important; } .btn.white:hover { background: #e7e8ef; }
.btn.accent { background: var(--accent); color: #fff !important; }
.btn.big { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.lp-hero { position: relative; text-align: center; padding: 84px 16px 70px; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.lp-glow { position: absolute; inset: 0; background: radial-gradient(600px 380px at 50% 30%, rgba(99,102,241,.22), transparent 70%), radial-gradient(520px 340px at 60% 50%, rgba(34,211,238,.10), transparent 70%); pointer-events: none; }
.lp-hero > * { position: relative; }
.lp-hero h1 { font-size: clamp(42px, 8vw, 76px); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; margin: 34px 0 18px; }
.lp-hero > p { max-width: 560px; font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); margin: 0; line-height: 1.55; }
.lp-cta { justify-content: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.lp-note { font-size: 13px !important; color: var(--dim) !important; margin-top: 18px !important; }
.lp-sec { max-width: 1120px; margin: 0 auto; padding: 56px 16px; scroll-margin-top: 70px; }
.lp-sec h2 { text-align: center; font-size: clamp(30px, 5vw, 44px); letter-spacing: -.035em; margin: 0 0 10px; font-weight: 800; }
.lp-sub { text-align: center; color: var(--muted); margin: 0 auto 8px; max-width: 520px; font-size: 17px; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; } .lp-grid.four { grid-template-columns: repeat(4, 1fr); }
.lp-card { background: #13141d; border: 1px solid rgba(255,255,255,.07); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; }
.lp-card h3 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 10px; } .lp-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; flex: 1; }
.lp-card.dl .btn { margin-top: 18px; width: 100%; justify-content: center; text-align: center; } .lp-card.dl h3 .ic { color: var(--accent2); }
.lp-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(99,102,241,.14); color: var(--accent2); margin-bottom: 14px; }
.lp-safety { max-width: 720px; margin: 30px auto 0; } .lp-safety ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.lp-safety li { display: flex; gap: 12px; align-items: flex-start; background: #13141d; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 14px 16px; font-size: 15px; } .lp-safety li .ic { color: var(--ok); margin-top: 1px; }
.lp-safety a { color: var(--accent2); }
.lp-band { max-width: 1088px; margin: 30px auto 60px; border-radius: 28px; padding: 64px 16px; text-align: center; background: linear-gradient(135deg, #4f46e5, #6366f1 45%, #0891b2); width: calc(100% - 32px); box-sizing: border-box; }
.lp-band h2 { font-size: clamp(36px, 7vw, 60px); letter-spacing: -.045em; margin: 0 0 10px; font-weight: 800; } .lp-band p { margin: 0 0 26px; color: rgba(255,255,255,.85); font-size: 17px; }
.lp-foot { display: flex; align-items: center; gap: 10px; padding: 24px max(16px, calc(50% - 560px)); border-top: 1px solid rgba(255,255,255,.06); color: var(--muted); font-size: 14px; } .lp-foot a { text-decoration: none; color: var(--muted); margin-left: 14px; } .lp-foot a:hover { color: var(--text); }
.howto { padding-left: 22px; line-height: 1.6; } .howto li { margin-bottom: 8px; }
@media (max-width: 960px) { .lp-grid, .lp-grid.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .lp-links { display: none; } .lp-grid, .lp-grid.four { grid-template-columns: 1fr; } .lp-hero { padding-top: 56px; } .lp-sec { padding: 40px 16px; } .lp-band { padding: 48px 16px; } }
.lp-card h3 { text-transform: none; letter-spacing: -.01em; color: var(--text); font-size: 18px; font-weight: 700; }
