@import url("https://fonts.googleapis.com/css2?family=Sora:wght@500;700&family=Inter:wght@400;500;600&display=swap");
:root {
	color-scheme: dark;
	--bg: #0b0d14;
	--rail: #07080d;
	--side: #11131d;
	--panel: #161927;
	--fg: #e7e9f3;
	--muted: #8a8fa8;
	--accent: #7c5cff;
	--accent2: #22d3ee;
	--border: #23263a;
	--radius: 12px;
	--font: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body, #root { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.btn { background: linear-gradient(135deg, var(--accent), #5b3df5); border: 0; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: transform .15s, filter .15s; }
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:disabled { opacity: .6; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.input { width: 100%; background: #0d0f18; border: 1px solid var(--border); color: var(--fg); padding: 11px 14px; border-radius: 10px; font: inherit; }
.input:focus { border-color: var(--accent); outline: none; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.link { background: none; border: 0; color: var(--accent2); font-size: 13px; text-decoration: none; padding: 0; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 8px 16px; font-size: 14px; }
.alert-error { background: #3a1420; color: #ffb4c2; border: 1px solid #6b2236; }
.loading { display: grid; place-items: center; padding: 48px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.empty { text-align: center; padding: 48px 16px; }
.empty-title { font: 700 22px "Sora", sans-serif; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 0 40px var(--accent); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.logo { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font: 700 22px "Sora", sans-serif; color: #fff; background: conic-gradient(from 200deg, var(--accent), var(--accent2), var(--accent)); box-shadow: 0 6px 24px #7c5cff55; flex: none; }
.logo.big { width: 72px; height: 72px; font-size: 32px; border-radius: 22px; margin: 0 auto; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
.boot { height: 100%; display: grid; place-content: center; gap: 16px; text-align: center; color: var(--muted); }

.app { display: grid; grid-template-columns: 72px 240px 1fr 240px; height: 100vh; overflow: hidden; }
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; overflow-y: auto; }
.rail-sep { width: 32px; height: 2px; background: var(--border); border-radius: 2px; }
.srv { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--panel); font: 700 18px "Sora", sans-serif; transition: border-radius .2s, background .2s; position: relative; flex: none; }
.srv:hover, .srv.on { border-radius: 16px; background: var(--accent); }
.srv.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: #fff; }
.srv.add { color: #34d399; font-size: 24px; }
.srv.add:hover { background: #34d399; color: #fff; }

.side { background: var(--side); display: flex; flex-direction: column; min-width: 0; }
.side-head { height: 52px; padding: 0 16px; display: flex; align-items: center; border-bottom: 1px solid var(--border); font-family: "Sora", sans-serif; }
.chan-list { flex: 1; overflow-y: auto; padding: 12px 8px; }
.cat { display: flex; justify-content: space-between; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px; font-weight: 600; }
.icon { background: none; border: 0; color: var(--muted); font-size: 18px; padding: 0 4px; }
.icon:hover { color: var(--fg); }
.chan { display: flex; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 8px; color: var(--muted); transition: background .15s; }
.chan:hover { background: var(--panel); color: var(--fg); }
.chan.on { background: #262a40; color: #fff; }
.hash { color: var(--muted); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; background: #0d0f18; }
.me-info { flex: 1; min-width: 0; display: grid; }
.me-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.me-info small { color: var(--muted); font-size: 12px; }
.me-av { position: relative; flex: none; }
.dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--side); }
.dot.online { background: #34d399; }
.dot.offline { background: #6b7280; }
.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }

.chat { display: flex; flex-direction: column; min-width: 0; background: radial-gradient(1200px 400px at 50% -10%, #7c5cff14, transparent), var(--bg); }
.chat-head { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.topic { color: var(--muted); font-size: 13px; border-left: 1px solid var(--border); padding-left: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { display: none; }
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 12px 16px 0; padding: 12px 16px; border-radius: var(--radius); background: linear-gradient(90deg, #7c5cff33, #22d3ee22); border: 1px solid #7c5cff55; font-size: 14px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 0; }
.msg { display: flex; gap: 14px; padding: 6px 16px; margin-top: 10px; position: relative; animation: rise .25s ease; }
.msg.grouped { margin-top: 0; padding-top: 2px; }
.msg:hover { background: #ffffff06; }
.msg.pinged { background: #f59e0b14; box-shadow: inset 3px 0 #f59e0b; }
.gutter { width: 40px; flex: none; font-size: 10px; color: transparent; text-align: right; padding-top: 3px; }
.msg:hover .gutter { color: var(--muted); }
.body { min-width: 0; flex: 1; }
.meta { display: flex; gap: 8px; align-items: baseline; }
.meta time { font-size: 12px; color: var(--muted); }
.text { word-wrap: break-word; }
.text code { background: #1d2033; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.text pre { background: #0d0f18; border: 1px solid var(--border); padding: 10px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; }
.mention { background: #7c5cff33; color: #c4b5fd; padding: 0 3px; border-radius: 4px; font-weight: 500; }
.tools { position: absolute; right: 16px; top: -12px; display: none; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.msg:hover .tools, .msg:focus-within .tools { display: flex; }
.tools button { background: none; border: 0; padding: 4px 9px; }
.tools button:hover { background: #262a40; }
.composer { display: flex; gap: 8px; padding: 12px 16px 18px; }
.composer .input { background: var(--panel); border-radius: 14px; padding: 13px 16px; }

.members { background: var(--side); padding: 16px 10px; overflow-y: auto; }
.members h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 8px 10px; }
.member { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.member:hover { background: var(--panel); }
.member div:last-child { display: grid; min-width: 0; }
.member b { font-size: 14px; font-weight: 500; }
.member small { font-size: 11px; }
.role-admin { color: #f472b6; }

.overlay { position: fixed; inset: 0; background: #000a; backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: rise .2s; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 28px; width: 100%; max-width: 420px; display: grid; gap: 14px; box-shadow: 0 30px 80px #000c; }
.modal h2 { margin: 0; font-family: "Sora", sans-serif; text-align: center; }
.modal p { margin: 0; text-align: center; }

@media (max-width: 1000px) { .app { grid-template-columns: 72px 220px 1fr; } .members { display: none; } }
@media (max-width: 700px) {
	.app { grid-template-columns: 1fr; }
	.rail, .side { position: fixed; top: 0; bottom: 0; z-index: 20; transform: translateX(-110%); transition: transform .25s; }
	.rail { left: 0; width: 72px; }
	.side { left: 72px; width: min(260px, calc(100vw - 72px)); }
	.nav-open .rail, .nav-open .side { transform: none; }
	.menu { display: block; }
}
