html, body { height: 100%; }
body { font-family: var(--font); background: radial-gradient(circle at top left, #232844, var(--bg-primary) 42%); color: var(--text-primary); overflow: hidden; }
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr) 260px; height: 100vh; min-height: 0; }
body.desktop-client .layout { height: calc(100vh - 36px); }
.layout.auth-required { grid-template-columns: 1fr; }
.layout.auth-required .channels-shell, .layout.auth-required .topbar, .layout.auth-required #messages, .layout.auth-required .voice-panel, .layout.auth-required .composer, .layout.auth-required .members-shell { display: none; }
.layout.auth-required .content { grid-column: 1; height: 100vh; }
body.desktop-client .layout.auth-required .content { height: calc(100vh - 36px); }
.app-titlebar { display: none; height: 36px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, 0.06); background: linear-gradient(90deg, rgba(8, 10, 15, 0.98), rgba(18, 21, 31, 0.96) 42%, rgba(13, 16, 25, 0.98)); color: var(--text-secondary); user-select: none; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16); }
body.desktop-client .app-titlebar { display: flex; }
.titlebar-brand { height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 14px; min-width: 0; font-size: 12px; font-weight: 900; letter-spacing: 0.02em; }
.titlebar-brand img { width: 20px; height: 20px; display: block; border-radius: 7px; box-shadow: 0 8px 22px rgba(88, 101, 242, 0.26); }
.titlebar-brand strong { color: var(--text-primary); font-size: 12px; opacity: 0.94; }
.titlebar-window-controls { height: 100%; display: flex; align-items: stretch; margin-left: auto; }
.titlebar-window-controls button { position: relative; width: 46px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 0; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 0; line-height: 1; transition: background 120ms ease, color 120ms ease; }
.titlebar-window-controls button svg { width: 12px; height: 12px; display: block; fill: currentColor; opacity: 0.86; }
.titlebar-window-controls button::before, .titlebar-window-controls button::after { content: ""; display: block; position: absolute; box-sizing: border-box; }
#window-minimize-btn::before { width: 12px; height: 1.5px; border-radius: 2px; background: currentColor; transform: translateY(4px); }
#window-maximize-btn::before { width: 11px; height: 11px; border: 1.6px solid currentColor; border-radius: 2px; }
#window-close-btn::before, #window-close-btn::after { width: 13px; height: 1.7px; border-radius: 2px; background: currentColor; }
#window-close-btn::before { transform: rotate(45deg); }
#window-close-btn::after { transform: rotate(-45deg); }
.titlebar-window-controls button:hover { background: rgba(255, 255, 255, 0.075); color: var(--text-primary); }
.titlebar-window-controls button.danger:hover { background: rgba(239, 68, 68, 0.9); color: white; }
.servers-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 14px 12px; background: rgba(8, 10, 15, 0.86); }
.brand, .server-btn, .icon-btn, .avatar { display: grid; place-items: center; border-radius: 18px; font-weight: 800; }
.brand { width: 54px; height: 54px; background: linear-gradient(135deg, var(--accent), #22d3ee); box-shadow: var(--shadow); font-size: 24px; }
.servers { display: grid; align-content: start; gap: 10px; overflow: auto; }
.server-btn { width: 54px; height: 54px; border: 0; background: var(--bg-tertiary); color: var(--text-primary); transition: 120ms ease; }
.server-btn.active, .server-btn:hover { border-radius: 14px; background: var(--accent); transform: translateY(-1px); }
.icon-btn { width: 54px; height: 54px; border: 1px dashed var(--border); background: var(--accent-soft); color: var(--text-primary); font-size: 24px; cursor: pointer; }
.channels-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: rgba(18, 21, 31, 0.94); min-width: 0; min-height: 0; overflow: hidden; }
.server-head, .topbar, .user-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--border); }
.server-head { border-bottom: 0; }
.server-head, .topbar, .members-head { min-height: 74px; box-sizing: border-box; }
.server-title { min-width: 0; }
.server-host-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#active-server-host { color: var(--accent); font-weight: 900; }
.server-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.server-head strong, .topbar strong { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
small, .muted { color: var(--text-muted); }
.channels { min-height: 0; display: grid; align-content: start; gap: 6px; padding: 14px; overflow-y: auto; overflow-x: hidden; }
.channel-item { position: relative; display: grid; gap: 4px; }
.channel-item[draggable="true"] { cursor: grab; }
.channel-item.dragging { opacity: 0.55; }
.channel-item.drag-over .channel-btn { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.channel-drag-handle { position: absolute; right: 6px; top: 11px; display: none; width: 18px; height: 24px; place-items: center; color: var(--text-muted); cursor: grab; font-size: 14px; letter-spacing: -0.18em; }
.channel-item:hover .channel-drag-handle { display: grid; }
.channel-item:hover .channel-btn { padding-right: 30px; }
.channel-btn { width: 100%; border: 0; border-radius: 12px; background: transparent; color: var(--text-secondary); cursor: pointer; padding: 12px 14px; text-align: left; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.channel-btn small { color: var(--success); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.channel-btn.active, .channel-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.channel-btn.unread:not(.active) { background: rgba(88, 101, 242, 0.12); color: var(--text-primary); box-shadow: inset 3px 0 0 var(--accent); }
.channel-btn.unread:not(.active) span { font-weight: 900; }
.channel-btn .unread-badge { min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--danger); color: #fff !important; font-size: 11px; font-weight: 900; line-height: 1; letter-spacing: 0; text-transform: none; box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28); }
.channel-btn.voice { color: #b6f7c8; }
.channel-btn.voice.active, .channel-btn.voice:hover { background: rgba(87, 242, 135, 0.1); color: #d8ffe2; }
.channel-voice-members { display: grid; gap: 2px; padding: 0 4px 6px 26px; }
.channel-voice-member { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px; border-radius: 9px; color: var(--text-secondary); font-size: 13px; font-weight: 700; }
.channel-voice-member:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }
.channel-voice-avatar { width: 24px; height: 24px; border: 2px solid transparent; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; background: var(--bg-tertiary); color: var(--text-primary); font-size: 10px; font-weight: 900; background-size: cover; background-position: center; transition: border-color 120ms ease, box-shadow 120ms ease; }
.channel-voice-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.channel-voice-member strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.channel-voice-member.speaking .channel-voice-avatar { border-color: var(--success); box-shadow: 0 0 0 2px rgba(87, 242, 135, 0.16), 0 0 16px rgba(87, 242, 135, 0.5); }
.channel-voice-mute-icons { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: #f87171; }
.voice-muted-icon { width: 15px; height: 15px; display: grid; place-items: center; color: inherit; opacity: 0.95; }
.voice-muted-icon svg { width: 15px; height: 15px; display: block; fill: currentColor; }
.channel-voice-member small { margin-left: auto; color: var(--text-muted); font-size: 11px; }
.channel-voice-mute-icons + small { margin-left: 4px; }
.channel-item.connected .channel-btn { color: #d8ffe2; background: rgba(87, 242, 135, 0.08); }
.voice-dock { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 34px); gap: 4px 8px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border); background: rgba(87, 242, 135, 0.07); }
.voice-dock.hidden { display: none; }
.voice-dock small { grid-column: 1 / -1; color: var(--success); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }
.voice-dock strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d8ffe2; }
.voice-dock button { width: 34px; height: 34px; padding: 0; border-radius: 11px; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.voice-dock button.active-danger, .voice-dock button.danger-btn:hover { background: rgba(239, 68, 68, 0.22); color: #fecaca; box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45); }
.voice-volume-menu { position: fixed; z-index: 20; width: 230px; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: rgba(18, 21, 31, 0.98); box-shadow: var(--shadow); color: var(--text-primary); }
.voice-volume-menu strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-volume-menu label { display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.voice-volume-menu input { padding: 0; accent-color: var(--accent); }
.user-popover { position: fixed; z-index: 32; width: 300px; overflow: hidden; border: 1px solid rgba(124, 92, 255, 0.24); border-radius: 18px; background: rgba(18, 21, 31, 0.98); box-shadow: var(--shadow); color: var(--text-primary); }
.user-popover-banner { height: 72px; background: linear-gradient(135deg, rgba(88, 101, 242, 0.95), rgba(34, 211, 238, 0.82)); }
.user-popover-body { position: relative; display: grid; gap: 8px; padding: 42px 16px 16px; }
.user-popover-avatar { position: absolute; top: -42px; left: 16px; width: 76px; height: 76px; display: grid; place-items: center; overflow: hidden; border: 6px solid rgba(18, 21, 31, 0.98); border-radius: 50%; background: linear-gradient(135deg, #22c55e, #14b8a6); color: #04130e; font-size: 22px; font-weight: 900; }
.user-popover-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.user-popover-body > strong { font-size: 20px; line-height: 1.1; }
.user-popover-body > small { font-size: 12px; font-weight: 800; }
.status-offline { color: var(--text-muted); }
.user-popover dl { display: grid; gap: 8px; margin: 8px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.user-popover dl div { display: grid; gap: 2px; }
.user-popover dt { color: var(--text-muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; }
.user-popover dd { margin: 0; color: var(--text-primary); font-size: 13px; font-weight: 700; }
.user-popover-roles { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.user-popover-roles span { padding: 5px 8px; border: 1px solid currentColor; border-radius: 999px; background: rgba(88, 101, 242, 0.16); color: #cfd3ff; font-size: 12px; font-weight: 800; }
.user-popover-roles em { color: var(--text-muted); font-size: 12px; font-style: normal; font-weight: 700; }
.context-menu { position: fixed; z-index: 30; min-width: 210px; display: grid; gap: 6px; padding: 8px; border: 1px solid rgba(124, 92, 255, 0.24); border-radius: 16px; background: rgba(18, 21, 31, 0.98); box-shadow: var(--shadow); }
.context-menu button { width: 100%; display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: transparent; text-align: left; color: var(--text-primary); }
.context-menu button:hover { background: var(--bg-hover); }
.context-menu button span { color: var(--text-primary); font-size: 13px; font-weight: 900; }
.context-menu button small { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.context-menu button.danger span { color: #fecaca; }
.context-menu button.danger:hover { background: rgba(239, 68, 68, 0.16); }
.hidden { display: none !important; }
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(5, 8, 13, 0.68); backdrop-filter: blur(8px); }
.modal-card { width: min(430px, 100%); display: grid; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 22px; background: rgba(18, 21, 31, 0.98); box-shadow: var(--shadow); }
.modal-card header, .modal-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-card header strong { font-size: 18px; }
.modal-close { width: 34px; height: 34px; padding: 0; border-radius: 12px; }
.modal-body { display: grid; gap: 12px; }
.modal-field { display: grid; gap: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-field input, .modal-field select { width: 100%; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-tertiary); color: var(--text-primary); padding: 12px 13px; outline: none; }
.modal-message { color: var(--text-secondary); line-height: 1.5; }
.role-list { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.role-manage-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px auto; gap: 8px; align-items: center; }
.role-check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); color: var(--text-primary); cursor: pointer; }
.role-check:hover { background: rgba(255, 255, 255, 0.07); }
.role-check input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.role-check span { min-width: 0; flex: 1; display: grid; gap: 2px; }
.role-check strong, .role-check small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-check small { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.role-access-mode { width: 112px; margin-left: auto; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-tertiary); color: var(--text-primary); padding: 8px 9px; font-size: 12px; font-weight: 800; outline: none; }
.role-access-mode:disabled { opacity: 0.45; }
.role-color-input { width: 42px; height: 42px; padding: 4px; border-radius: 12px; cursor: pointer; }
.role-delete-btn { height: 42px; color: #fecaca; }
.modal-inline-create { display: grid; grid-template-columns: minmax(0, 1fr) 42px auto; gap: 10px; align-items: center; }
.modal-card footer { justify-content: flex-end; }
.modal-confirm.danger-btn { background: rgba(239, 68, 68, 0.9); }
.user-card { border-top: 0; border-bottom: 0; justify-content: start; min-width: 0; }
.user-card > div:nth-child(2) { min-width: 0; flex: 1; }
.user-card strong, .user-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card small { font-size: 12px; font-weight: 700; }
.status-online { color: var(--success); }
.status-dnd { color: var(--danger); }
.profile-menu-wrap { position: relative; margin-left: auto; flex: 0 0 auto; }
.profile-menu-btn { width: 38px; height: 34px; padding: 0; border-radius: 12px; display: grid; place-items: center; letter-spacing: 0.12em; }
.profile-menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 220px; display: grid; gap: 6px; padding: 8px; border: 1px solid rgba(124, 92, 255, 0.24); border-radius: 16px; background: rgba(18, 21, 31, 0.98); box-shadow: var(--shadow); z-index: 15; }
.profile-menu.hidden { display: none; }
.profile-menu button { width: 100%; display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: transparent; text-align: left; }
.profile-menu button:hover { background: var(--bg-hover); }
.profile-menu button span { color: var(--text-primary); font-size: 13px; font-weight: 900; }
.profile-menu button small { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.profile-menu button.danger-menu-btn:hover { background: rgba(239, 68, 68, 0.14); }
.profile-menu button.danger-menu-btn:hover span, .profile-menu button.danger-menu-btn:hover small { color: #fecaca; }
.avatar { width: 42px; height: 42px; flex: 0 0 auto; background: linear-gradient(135deg, #22c55e, #14b8a6); color: #04130e; background-size: cover; background-position: center; cursor: pointer; }
.avatar.has-image { background-color: var(--bg-tertiary); background-image: var(--avatar-url); color: transparent; }
.user-card .avatar { border-radius: 50%; }
.content { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; }
.members-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; background: rgba(18, 21, 31, 0.9); }
.members-head { padding: 18px; }
.members-head strong { display: block; margin-top: 4px; }
.members-list { min-height: 0; overflow-y: auto; padding: 14px; display: grid; align-content: start; gap: 8px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--text-secondary); font-weight: 800; }
.member-row:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }
.member-row.offline { opacity: 0.48; filter: grayscale(0.35); }
.member-row.offline:hover { opacity: 0.7; }
.member-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-tertiary); color: var(--text-primary); font-size: 11px; flex: 0 0 auto; background-size: cover; background-position: center; }
.member-avatar.has-image { color: transparent; }
.member-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.member-row.available .member-avatar { background: linear-gradient(135deg, #22c55e, #14b8a6); color: #04130e; }
.member-info { min-width: 0; flex: 1; }
.member-info strong, .member-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-info strong { font-size: 14px; }
.member-info small { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.member-row.available .member-info small { color: var(--success); }
.member-row.dnd .member-info small { color: var(--danger); }
.admin-crown { color: #facc15; font-size: 16px; margin-left: auto; text-shadow: 0 0 12px rgba(250, 204, 21, 0.35); }
.topbar { background: rgba(15, 17, 23, 0.78); backdrop-filter: blur(10px); }
.topbar #active-channel-kind, .topbar #status { display: none; }
.topbar strong { margin-top: 0; }
.auth-panel { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; background: rgba(15, 17, 23, 0.86); backdrop-filter: blur(18px); }
.layout.authenticated .auth-panel { display: none; }
.auth-card { width: min(440px, 100%); display: grid; gap: 14px; padding: 28px; border: 1px solid var(--border); border-radius: 28px; background: linear-gradient(180deg, rgba(29, 34, 48, 0.96), rgba(21, 24, 35, 0.96)); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 36px; letter-spacing: -0.04em; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; font-weight: 800; }
.row { display: flex; gap: 10px; }
input, button { font: inherit; }
input { width: 100%; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-tertiary); color: var(--text-primary); padding: 13px 14px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
button { border: 0; border-radius: 14px; background: var(--accent); color: white; cursor: pointer; padding: 12px 14px; font-weight: 800; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.secondary-btn, .ghost-btn { background: var(--bg-tertiary); color: var(--text-primary); }
.ghost-btn { padding: 9px 11px; font-size: 12px; }
#messages { min-height: 0; max-height: 100%; padding: 20px 0 28px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 10px; }
#messages.hidden, .composer.hidden, .voice-panel.hidden { display: none; }
.new-messages-pill { position: absolute; left: 50%; bottom: 92px; z-index: 12; display: flex; align-items: center; gap: 12px; transform: translateX(-50%); padding: 10px 14px; border: 1px solid rgba(88, 101, 242, 0.45); border-radius: 999px; background: rgba(88, 101, 242, 0.94); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32); color: #fff; font-size: 13px; }
.new-messages-pill span { color: rgba(255, 255, 255, 0.82); font-weight: 700; }
.new-messages-pill strong { color: #fff; font-weight: 900; }
.voice-panel { min-height: 0; overflow-y: auto; padding: 24px; display: grid; align-content: start; gap: 18px; }
.voice-panel strong { display: block; margin-top: 4px; font-size: 24px; }
.voice-panel p { margin-top: 8px; color: var(--text-secondary); }
.voice-actions { display: flex; gap: 10px; }
.voice-peers { display: grid; gap: 10px; max-width: 520px; }
.voice-peer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); color: var(--text-primary); }
.voice-peer::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 16px rgba(87, 242, 135, 0.45); }
.empty-state { margin: auto; max-width: 360px; text-align: center; color: var(--text-muted); }
.message-group { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 0; align-items: start; padding: 6px 48px 6px 0; border-radius: 0; background: transparent; }
.message-group:hover { background: transparent; }
.message-group .avatar { width: 40px; height: 40px; margin: 3px 16px 0 16px; border-radius: 50%; font-size: 13px; box-shadow: none; }
.message-group.me .avatar:not(.has-image) { background: linear-gradient(135deg, var(--accent), #22d3ee); color: white; }
.message-body { min-width: 0; padding: 0; position: relative; }
.message-header { display: flex; align-items: baseline; gap: 8px; min-width: 0; min-height: 22px; padding-top: 1px; }
.message-header strong { color: var(--text-primary); font-size: 16px; font-weight: 700; letter-spacing: 0; }
.message-user-trigger { cursor: pointer; }
.message-user-trigger:hover { text-decoration: underline; }
.message-header small { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.message-group.me .message-header strong { color: var(--text-primary); }
.message-row { min-width: 0; padding: 0; }
.message-row.compact { position: relative; display: block; margin-top: 5px; padding: 0 58px 0 0; }
.message-row.compact:hover { background: transparent; }
.compact-time { position: absolute; right: 0; top: 3px; width: 50px; color: transparent; font-size: 11px; font-weight: 700; line-height: 1.35; text-align: right; }
.message-row.compact:hover .compact-time { color: var(--text-muted); }
.content-text { margin: 0; color: #dbdee1; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; min-width: 0; font-size: 16px; }
.message-row:not(.compact) .content-text { padding-bottom: 1px; }
.message-group:hover .content-text, .message-row.compact:hover .content-text { color: #dbdee1; }
.message-attachment { display: block; width: fit-content; max-width: min(520px, 100%); margin-top: 8px; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(0, 0, 0, 0.18); cursor: zoom-in; }
.message-attachment img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; }
.image-modal-card { width: min(94vw, 1240px); max-height: 92vh; }
.image-preview-wrap { display: grid; place-items: center; height: 74vh; max-height: 74vh; overflow: auto; border-radius: 18px; background: rgba(0, 0, 0, 0.35); cursor: zoom-in; user-select: none; text-align: center; }
.image-preview-wrap.zoomed { display: block; cursor: grab; text-align: left; }
.image-preview-wrap.dragging { cursor: grabbing; }
.image-preview-wrap img { display: block; width: auto; max-width: min(520px, 100%); max-height: 420px; margin: 0 auto; object-fit: contain; transform-origin: top left; pointer-events: none; }
.image-preview-wrap.zoomed img { max-width: none; max-height: none; margin: 0; }
.image-preview-hint { display: block; color: var(--text-muted); text-align: center; }
.composer { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 10px; padding: 18px; border-top: 1px solid rgba(255, 255, 255, 0.05); background: linear-gradient(180deg, rgba(15, 17, 23, 0.7), rgba(15, 17, 23, 0.86)); }
.composer input { height: 48px; padding-top: 0; padding-bottom: 0; }
.attachment-btn { width: 48px; height: 48px; min-width: 48px; padding: 0; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: var(--text-secondary); line-height: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.attachment-btn svg { width: 30px; height: 24px; min-width: 30px; display: block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
.attachment-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 12px 28px rgba(0, 0, 0, 0.16); }
#send-btn { width: 48px; height: 48px; padding: 0; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #22d3ee); color: #fff; font-size: 19px; line-height: 1; box-shadow: 0 12px 28px rgba(88, 101, 242, 0.24); }
#send-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(88, 101, 242, 0.32); }
#send-btn:disabled { opacity: 0.45; box-shadow: none; transform: none; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); }
  .content { grid-column: 1 / -1; }
  .channels-shell, .members-shell { display: none; }
}
