:root {
  --bg: #0c0716; --bg-2: #120a20; --panel: #170d28; --panel-2: #221338; --panel-3: #2f1b4b;
  --line: #34204f; --text: #f7eefe; --muted: #b6a3d4; --faint: #85729f;
  --honey: #ff3ea5; --honey-2: #e0198a; --on-honey: #fff; --mint: #2de2c4; --red: #ff5470; --blue: #33e1ff;
  --own: #4b1747; --r: 16px; --chip: polygon(28% 0, 72% 0, 100% 24%, 100% 76%, 72% 100%, 28% 100%, 0 76%, 0 24%); --hex: polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3ecdf; --bg-2: #fbf6ec; --panel: #fffaf1; --panel-2: #f2e8d6; --panel-3: #e8dbc3;
  --line: #e2d4bb; --text: #271e10; --muted: #6f6250; --faint: #8d7f6a; --own: #ffe3a6; --honey: #e89400; --honey-2: #d97706; --on-honey: #fff;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, #root { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 1px; }
.ico { flex: none; display: block; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
.muted { color: var(--muted); } .small { font-size: 13px; } .grow { flex: 1; min-width: 0; } .row { display: flex; align-items: center; gap: 10px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Вход */
.auth { height: 100%; display: grid; grid-template-columns: 1.15fr minmax(360px, .85fr); background: var(--bg); overflow: auto; }
.auth-art { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(150deg, #2b1e08, #120f0a 62%); }
.auth-comb { position: absolute; right: -60px; top: -30px; display: grid; grid-template-columns: repeat(4, 130px); gap: 8px; transform: rotate(8deg); opacity: .95; }
.auth-comb i { width: 130px; height: 148px; clip-path: var(--chip); background: #2c2110; display: block; }
.auth-comb i:nth-child(even) { transform: translateY(74px); } .auth-comb i:nth-child(3n) { background: var(--honey); } .auth-comb i:nth-child(5n) { background: #4a3510; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; position: relative; }
.brand img { width: 34px; height: 34px; }
.auth-art h1 { position: relative; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 16px; max-width: 620px; }
.auth-art h1 em { color: var(--honey); font-style: normal; }
.auth-art p { position: relative; max-width: 480px; color: #d3c6b0; font-size: 17px; margin: 0; }
.auth-form { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 40px clamp(24px, 6vw, 72px); background: var(--bg-2); }
.auth-form h2 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }

/* Поля и кнопки */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 15px; font-weight: 400; color: var(--text); outline: none; }
.input:focus { border-color: var(--honey); } textarea.input { resize: vertical; min-height: 72px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--panel-3); font-weight: 650; transition: filter .12s, transform .12s; }
.btn:hover { filter: brightness(1.12); } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--honey); color: var(--on-honey); } .btn.danger { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); } .btn.ghost { background: none; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--muted); transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--panel-3); color: var(--text); } .icon-btn.on { color: var(--honey); }

/* Каркас */
.app { height: 100%; display: grid; grid-template-columns: 76px 320px minmax(0, 1fr) auto; }
.dock { background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.dock-sep { width: 30px; height: 2px; background: var(--line); border-radius: 2px; margin: 3px 0; flex: none; }
.hexbtn { position: relative; width: 52px; height: 58px; flex: none; display: grid; place-items: center; color: var(--muted); }
.hexbtn > .shape { position: absolute; inset: 0; clip-path: var(--chip); background: var(--panel-2); transition: background .15s, transform .15s; }
.hexbtn > :not(.shape) { position: relative; } .hexbtn:hover > .shape { background: var(--panel-3); transform: scale(1.06); } .hexbtn:hover { color: var(--text); }
.hexbtn.active > .shape { background: var(--honey); } .hexbtn.active { color: var(--on-honey); font-weight: 800; }
.hexbtn .glyph { font-size: 20px; font-weight: 750; } .hexbtn .dot { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 800; line-height: 18px; background: var(--red); color: #fff; text-align: center; }
.hexbtn .livedot { position: absolute; bottom: 4px; right: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--mint); border: 2px solid var(--bg); }
.side { background: var(--bg-2); border-radius: 18px 0 0 0; margin-top: 8px; display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px 14px 8px; display: flex; align-items: center; gap: 6px; } .side-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; flex: 1; min-width: 0; }
.searchbtn { margin: 0 12px 8px; display: flex; align-items: center; gap: 8px; padding: 8px 11px; background: var(--panel-2); border-radius: 11px; color: var(--faint); text-align: left; }
.searchbtn kbd { margin-left: auto; font: 11px var(--font); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.chips { display: flex; gap: 5px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.chip { padding: 4px 11px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--honey); color: var(--on-honey); }
.list { flex: 1; overflow-y: auto; padding: 0 7px 8px; min-height: 0; }
.sec { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 3px; color: var(--faint); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 12px; text-align: left; position: relative; }
.item:hover { background: var(--panel); } .item.active { background: var(--panel-3); }
.item .t { font-weight: 650; } .item .s { color: var(--muted); font-size: 13px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--honey); color: var(--on-honey); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; flex: none; }
.badge.mute { background: var(--panel-3); color: var(--muted); }
.room { padding: 5px 8px; } .room .glyph { width: 24px; text-align: center; color: var(--muted); }
.room-live { display: flex; margin-left: 40px; gap: 3px; padding: 1px 0 5px; }
.live-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 800; color: #06281f; background: var(--mint); flex: none; }

.me-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel); }
.ava { position: relative; flex: none; display: grid; place-items: center; font-weight: 800; color: #1a1305; }
.ava .pic { position: absolute; inset: 0; clip-path: var(--hex); background: var(--c, var(--honey)); display: grid; place-items: center; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; } .ava .st { position: absolute; right: -1px; bottom: 1px; width: 30%; height: 30%; min-width: 10px; min-height: 10px; border-radius: 50%; border: 2px solid var(--bg-2); background: var(--faint); }
.st.online { background: var(--mint) !important; } .st.away { background: var(--honey) !important; } .st.dnd { background: var(--red) !important; }

/* Чат */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); margin-top: 8px; }
.main::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .035; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98'%3E%3Cpath fill='none' stroke='%23ffb627' stroke-width='2' d='M28 0 56 16v33L28 65 0 49V16zM28 65v33'/%3E%3C/svg%3E"); }
.head { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.head .title { font-weight: 750; font-size: 16px; } .back { display: none; }
.pinbar { position: relative; z-index: 1; display: flex; gap: 8px; align-items: center; padding: 6px 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: 13px; width: 100%; text-align: left; color: var(--muted); }
.msgs { position: relative; flex: 1; overflow-y: auto; padding: 14px clamp(10px, 3vw, 34px) 8px; min-height: 0; overflow-anchor: none; }
.msgs-inner { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; min-height: 100%; justify-content: flex-end; }
.day { align-self: center; margin: 12px 0; padding: 3px 12px; background: var(--panel-3); border-radius: 99px; color: var(--muted); font-size: 12px; font-weight: 650; }
.unread-line { display: flex; align-items: center; gap: 10px; color: var(--honey); font-size: 12px; font-weight: 750; margin: 8px 0; } .unread-line::before, .unread-line::after { content: ""; flex: 1; height: 1px; background: var(--honey); opacity: .5; }
.msg { position: relative; display: flex; gap: 9px; padding: 1px 0; align-items: flex-end; max-width: 100%; }
.msg.first { margin-top: 9px; } .msg.mine { flex-direction: row-reverse; } .msg .spacer { width: 36px; flex: none; }
.msg.flash .bubble { animation: flash 1.4s; } @keyframes flash { 0%, 50% { box-shadow: 0 0 0 3px var(--honey); } }
.bubble { position: relative; min-width: 72px; max-width: min(78%, 640px); padding: 7px 11px 6px; background: var(--panel-2); border-radius: 15px; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--own); } .msg.scheduled .bubble { border: 1px dashed var(--honey); opacity: .85; }
.who { font-weight: 750; font-size: 13px; color: var(--c); display: flex; gap: 6px; align-items: center; background: none; }
.body { white-space: pre-wrap; } .body code { background: #0005; padding: 1px 5px; border-radius: 5px; font: 13px Consolas, monospace; } .body pre { background: #0006; padding: 9px; border-radius: 9px; overflow-x: auto; margin: 4px 0; } .body pre code { background: none; padding: 0; }
.spoiler { background: var(--faint); color: transparent; border-radius: 4px; cursor: pointer; } .spoiler.open { background: #0003; color: inherit; }
.mention { color: var(--honey); font-weight: 650; } .mention.me { background: color-mix(in srgb, var(--honey) 25%, transparent); border-radius: 4px; padding: 0 3px; }
.meta { float: right; display: inline-flex; align-items: center; gap: 4px; margin: 5px 0 -2px 10px; color: var(--muted); font-size: 11px; }
.quote { display: block; width: 100%; text-align: left; border-left: 3px solid var(--c, var(--honey)); background: #0002; padding: 3px 8px; border-radius: 5px; font-size: 13px; margin: 3px 0 5px; }
.fwd { color: var(--muted); font-size: 12px; font-style: italic; }
.att-img { display: block; max-width: 100%; max-height: 360px; border-radius: 10px; margin: 3px 0; cursor: zoom-in; } video.att-img { cursor: default; }
.att-file { display: flex; gap: 9px; align-items: center; padding: 7px; background: #0002; border-radius: 10px; color: inherit; text-decoration: none; margin: 3px 0; }
audio { width: 260px; max-width: 100%; height: 38px; display: block; margin: 3px 0; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; clear: both; }
.react { padding: 1px 7px; border-radius: 99px; background: #0003; font-size: 13px; border: 1px solid transparent; } .react.mine { border-color: var(--honey); background: color-mix(in srgb, var(--honey) 20%, transparent); }
.thread-link { display: flex; gap: 6px; align-items: center; margin-top: 5px; color: var(--honey); font-size: 13px; font-weight: 650; clear: both; }
.tools { position: absolute; top: -15px; right: 8px; z-index: 4; display: none; background: var(--panel-3); border-radius: 10px; padding: 2px; box-shadow: 0 5px 16px #0007; } .msg.mine .tools { right: auto; left: 8px; }
.msg:hover .tools, .msg:focus-within .tools { display: flex; } .tools .icon-btn { width: 29px; height: 29px; }
.poll { min-width: min(320px, 62vw); } .poll h4 { margin: 2px 0 7px; font-size: 15px; }
.opt { position: relative; display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 9px; margin-bottom: 4px; border-radius: 8px; background: #0002; overflow: hidden; text-align: left; font-size: 14px; }
.opt i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--honey) 32%, transparent); transition: width .25s; } .opt span { position: relative; } .opt.mine { font-weight: 750; box-shadow: inset 0 0 0 1px var(--honey); }
.typing { position: relative; height: 20px; padding: 0 clamp(14px, 4vw, 40px); color: var(--muted); font-size: 12px; }

.composer-wrap { position: relative; z-index: 3; padding: 0 clamp(10px, 3vw, 34px) 12px; } .composer-box { max-width: 880px; margin: 0 auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; }
.composer-box:focus-within { border-color: var(--honey); } .ctx { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pending { display: flex; gap: 6px; padding: 7px 9px 0; flex-wrap: wrap; } .pending > div { display: flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; background: var(--panel-3); border-radius: 9px; font-size: 12px; max-width: 200px; }
.composer { display: flex; align-items: flex-end; gap: 2px; padding: 5px; } .composer textarea { flex: 1; min-width: 0; resize: none; background: none; border: 0; outline: none; max-height: 180px; padding: 7px 6px; line-height: 1.4; }
.sendbtn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; clip-path: var(--chip); background: var(--honey); color: var(--on-honey); } .readonly { padding: 13px; text-align: center; color: var(--muted); }
.rec { color: var(--red); font-weight: 750; flex: 1; padding: 8px; }

/* Эфир */
.stage { position: relative; z-index: 2; background: #0c0a06; border-bottom: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 58%; min-height: 200px; }
.tiles { flex: 1; min-height: 130px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); overflow: auto; }
.tile { position: relative; min-height: 128px; border-radius: 14px; background: #221b10; display: grid; place-items: center; overflow: hidden; border: 2px solid transparent; transition: border-color .12s; } .tile.speaking { border-color: var(--mint); } .tile.wide { grid-column: 1 / -1; min-height: 260px; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; } .tile video.mirror { transform: scaleX(-1); object-fit: cover; }
.tile .tag { position: absolute; left: 7px; bottom: 6px; display: flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 7px; background: #000a; color: #fff; font-size: 12px; font-weight: 650; }
.controls { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; } .ctl { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #342a1a; color: #fff; } .ctl:hover { filter: brightness(1.2); } .ctl.on { background: var(--honey); color: var(--on-honey); } .ctl.off { background: #5d2820; color: #ffb4a8; } .ctl.end { background: var(--red); width: 60px; border-radius: 22px; }
.mini-live { display: flex; align-items: center; gap: 7px; padding: 7px 10px; background: color-mix(in srgb, var(--mint) 16%, var(--panel)); border-top: 1px solid var(--line); }

/* Правая панель */
.drawer { width: 340px; background: var(--bg-2); border-left: 1px solid var(--line); margin-top: 8px; display: flex; flex-direction: column; min-height: 0; } .drawer-body { flex: 1; overflow-y: auto; padding: 10px; min-height: 0; }
.drawer .msg .bubble { max-width: 92%; } .drawer .composer-wrap { padding: 0 8px 8px; }
.profile { text-align: center; padding: 12px; } .profile h3 { margin: 8px 0 0; font-size: 20px; }

/* Главная */
.home { position: relative; flex: 1; overflow-y: auto; padding: clamp(18px, 4vw, 44px); } .home-inner { max-width: 820px; margin: 0 auto; }
.home h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.03em; line-height: 1.05; margin: 0 0 6px; } .home h3 { margin: 26px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 9px; margin-top: 20px; } .quick button { display: flex; flex-direction: column; gap: 8px; padding: 14px; text-align: left; background: var(--panel-2); border-radius: var(--r); font-weight: 700; transition: transform .12s, background .12s; } .quick button:hover { background: var(--panel-3); transform: translateY(-2px); } .quick .ico { color: var(--honey); } .quick small { color: var(--muted); font-weight: 400; }
.card { display: block; width: 100%; text-align: left; padding: 11px 13px; background: var(--panel-2); border-radius: 13px; margin-bottom: 7px; } button.card:hover { background: var(--panel-3); } .card .body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Оверлеи */
.overlay { position: fixed; inset: 0; z-index: 50; background: #0009; display: grid; place-items: center; padding: 16px; animation: fade .12s; } @keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 70px #000a; } .modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; padding: 14px 14px 8px 20px; } .modal-head h3 { margin: 0; flex: 1; font-size: 19px; } .modal-body { padding: 4px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; } .check { display: flex; align-items: center; gap: 9px; padding: 3px 0; cursor: pointer; } .check input { accent-color: var(--honey); width: 17px; height: 17px; }
.menu { position: fixed; z-index: 70; min-width: 190px; padding: 5px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px #0009; } .menu button { display: flex; width: 100%; gap: 9px; align-items: center; padding: 7px 9px; border-radius: 8px; text-align: left; } .menu button:hover { background: var(--panel-2); } .menu .danger { color: var(--red); }
.picker { position: fixed; z-index: 70; display: grid; grid-template-columns: repeat(8, 34px); padding: 7px; background: var(--panel-3); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 12px 34px #0009; } .picker button { height: 34px; border-radius: 7px; font-size: 19px; } .picker button:hover { background: var(--panel-2); }
.lightbox { position: fixed; inset: 0; z-index: 80; background: #000d; display: grid; place-items: center; padding: 20px; } .lightbox img { max-width: 100%; max-height: 100%; }
#toasts { position: fixed; z-index: 90; left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92vw, 420px); } .toast { padding: 9px 15px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line); box-shadow: 0 8px 26px #0008; font-weight: 600; font-size: 14px; } .toast.bad { color: #ffc4bb; border-color: var(--red); } .toast.good { border-color: var(--mint); }
.conn { position: absolute; z-index: 5; left: 50%; top: 66px; transform: translateX(-50%); background: var(--red); color: #fff; padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; }

@media (max-width: 1180px) { .drawer { position: fixed; z-index: 30; right: 0; top: 0; bottom: 0; margin: 0; width: min(380px, 100vw); box-shadow: -14px 0 40px #0008; } }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; } .auth-art { min-height: 230px; padding: 24px; gap: 26px; } .auth-comb { opacity: .28; } .auth-art h1 { font-size: 36px; } .auth-art p { font-size: 15px; } .auth-form { padding: 24px 16px; justify-content: flex-start; }
  .app { grid-template-columns: 62px minmax(0, 1fr); } .side { margin: 0; border-radius: 0; } .hexbtn { width: 46px; height: 52px; } .main { display: none; margin: 0; grid-column: 1 / -1; grid-row: 1; }
  .app.in-chat .dock, .app.in-chat .side { display: none; } .app.in-chat .main { display: flex; height: 100dvh; } .back { display: grid; } .bubble { max-width: 86%; } .tools { top: -30px; } .composer .opt-tool { display: none; } .drawer { width: 100vw; }
  .searchbtn kbd { display: none; }
  .head { gap: 4px; padding: 8px; } .head .btn { font-size: 0; gap: 0; padding: 9px; } .head .icon-btn[title="Поиск в канале"], .head .icon-btn[title="Информация"] { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
