:root {
  --bg: #1a1d21;
  --bg-elevated: #222529;
  --bg-elevated-2: #2a2d33;
  --bg-input: #222529;
  --bg-hover: rgba(255,255,255,0.06);
  --bg-active: rgba(255,255,255,0.1);
  --border: #3f3f46;
  --border-light: #53535b;
  --text: #d1d2d3;
  --text-heading: #e0e1e2;
  --text-muted: #9a9b9e;
  --text-link: #1d9bd1;
  --text-mention: #1d9bd1;
  --sidebar-bg: #19171d;
  --sidebar-header: #1a0b2e;
  --sidebar-section: #9a9b9e;
  --accent: #36c5f0;
  --accent-green: #2eb67d;
  --accent-red: #e01e5a;
  --accent-yellow: #ecb22e;
  --presence-active: #2eb67d;
  --presence-away: #ecb22e;
  --presence-dnd: #e01e5a;
  --unread-badge: #e01e5a;
  --code-bg: #1b1d21;
  --code-text: #e6e6e7;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-pop: 0 8px 24px rgba(0,0,0,0.45);
  --topbar-h: 44px;
  --sidebar-w: 260px;
  --right-w: 360px;
  --header-h: 64px;
  --composer-h: 84px;
  --thread-h: 56px;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4667;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; padding: 0; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: flex; flex-direction: column; height: 100vh; width: 100vw; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--sidebar-header);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 16px 0 12px;
  position: relative; z-index: 30;
}
.topbar__menu { display: none; width: 36px; height: 36px; border-radius: var(--radius); color: var(--text-muted); }
.topbar__menu:hover { color: var(--text-heading); background: var(--bg-hover); }
.topbar__brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text-heading); user-select: none; border-radius: var(--radius); padding: 4px 6px; margin-left: -6px; }
.topbar__brand:hover { background: var(--bg-hover); }
.brand-lozenges { display: inline-grid; grid-template-columns: 7px 7px; grid-template-rows: 7px 7px; gap: 2px; transform: rotate(0deg); }
.brand-lozenges--small { grid-template-columns: 5px 5px; grid-template-rows: 5px 5px; gap: 1px; }
.lozenge { display: block; border-radius: 2px; }
.lozenge--1 { background: var(--accent); }
.lozenge--2 { background: var(--accent-green); }
.lozenge--3 { background: var(--accent-red); }
.lozenge--4 { background: var(--accent-yellow); }
.brand-text { letter-spacing: -0.3px; }

.topbar__search {
  flex: 1; max-width: 560px; margin: 0 auto;
  height: 30px; border-radius: 6px; background: rgba(255,255,255,0.12);
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  color: var(--text-muted); font-size: 13px; justify-content: space-between;
}
.topbar__search:hover { background: rgba(255,255,255,0.16); border-color: var(--border-light); }
.topbar__search-text { opacity: 0.9; }
.topbar__search-key { font-size: 11px; opacity: 0.7; border: 1px solid var(--border-light); border-radius: 4px; padding: 1px 5px; }

.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__help { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-light); color: var(--text-muted); font-size: 14px; font-weight: 700; }
.topbar__help:hover { color: var(--text-heading); border-color: var(--text-muted); }
.topbar__user { position: relative; width: 32px; height: 32px; border-radius: 8px; }
.topbar__user:hover { background: var(--bg-hover); }

/* Workspace layout */
.workspace { display: grid; grid-template-columns: var(--sidebar-w) 1fr 0; flex: 1; min-height: 0; overflow: hidden; }
.workspace[data-right-open="true"] { grid-template-columns: var(--sidebar-w) 1fr var(--right-w); }

/* Sidebar */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0;
  position: relative; z-index: 20;
}
.sidebar__header {
  height: 64px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: var(--sidebar-header);
}
.sidebar__workspace { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text-heading); cursor: pointer; border-radius: var(--radius); padding: 4px 6px; margin-left: -6px; }
.sidebar__workspace:hover { background: var(--bg-hover); }
.sidebar__workspace-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__workspace-chevron { color: var(--text-muted); }
.sidebar__new { width: 36px; height: 36px; border-radius: 50%; background: var(--text-heading); color: var(--sidebar-header); display: flex; align-items: center; justify-content: center; }
.sidebar__new:hover { background: #fff; }

.sidebar__scroller { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.sidebar__section { margin-bottom: 8px; }
.sidebar__section-title {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px 4px; font-size: 15px; font-weight: 700;
  color: var(--sidebar-section); user-select: none; cursor: pointer;
}
.sidebar__section-title:hover { color: var(--text-heading); }
.sidebar__section-title svg { width: 12px; height: 12px; transition: transform 0.15s; }
.sidebar__section--collapsed .sidebar__section-title svg { transform: rotate(-90deg); }
.sidebar__section--collapsed .sidebar__section-body { display: none; }

.sidebar__item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 24px; min-height: 28px;
  color: var(--text-muted); cursor: pointer; position: relative;
}
.sidebar__item:hover { background: var(--bg-hover); color: var(--text-heading); }
.sidebar__item--active { background: var(--bg-active); color: var(--text-heading); }
.sidebar__item-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.sidebar__item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.sidebar__item-badge { font-size: 11px; font-weight: 700; height: 18px; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--unread-badge); color: #fff; display: flex; align-items: center; justify-content: center; }
.sidebar__item-mention { color: var(--text-heading); }
.sidebar__item--unread .sidebar__item-name { font-weight: 900; color: var(--text-heading); }
.sidebar__item--unread .sidebar__item-icon { color: var(--text-heading); }
.sidebar__item--muted { opacity: 0.6; }
.sidebar__item--presence { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }

.sidebar__footer { padding: 10px 16px; border-top: 1px solid var(--border); }
.sidebar__compose {
  width: 100%; height: 36px; border-radius: var(--radius);
  background: var(--accent); color: #111; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sidebar__compose:hover { filter: brightness(1.1); }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); position: relative; }

.channel-header {
  height: var(--header-h); border-bottom: 1px solid var(--border);
  padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg); z-index: 10;
}
.channel-header__left { min-width: 0; }
.channel-header__title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 900; color: var(--text-heading); }
.channel-header__topic { font-size: 13px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-header__right { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.channel-header__members { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); }
.channel-header__members:hover { background: var(--bg-hover); }
.channel-header__info { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.channel-header__info:hover { background: var(--bg-hover); color: var(--text-heading); }

.messages-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; min-height: 0; }
.messages { padding: 10px 0 20px; min-height: 100%; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state__icon { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.empty-state__title { font-size: 17px; font-weight: 900; color: var(--text-heading); margin-bottom: 6px; }
.empty-state__body { font-size: 14px; line-height: 1.5; max-width: 360px; margin: 0 auto; }

.day-divider, .unread-divider {
  display: flex; align-items: center; text-align: center; margin: 20px 0; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.day-divider { color: var(--text-muted); }
.unread-divider { color: var(--accent-red); }
.day-divider::before, .day-divider::after, .unread-divider::before, .unread-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.day-divider span, .unread-divider span { padding: 0 16px; }

.message-group { display: flex; gap: 8px; padding: 8px 20px; transition: background 0.1s; }
.message-group:hover { background: var(--bg-hover); }
.message-group--active { background: var(--bg-active); }
.message-group__avatar { flex: none; width: 36px; }
.message-group__avatar .avatar { width: 36px; height: 36px; border-radius: 8px; font-size: 15px; }
.message-group__body { flex: 1; min-width: 0; }
.message-group__header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.message-group__name { font-weight: 900; color: var(--text-heading); cursor: pointer; }
.message-group__name:hover { text-decoration: underline; }
.message-group__time { font-size: 12px; color: var(--text-muted); }
.message { position: relative; padding: 2px 0 6px; }
.message__text { word-break: break-word; line-height: 1.4667; }
.message__text p { margin: 0 0 6px; }
.message__text p:last-child { margin-bottom: 0; }
.message__text a { color: var(--text-link); text-decoration: none; }
.message__text a:hover { text-decoration: underline; }
.message__text .mention, .message__text .channel-mention { background: rgba(29,155,209,0.15); color: var(--text-mention); border-radius: 3px; padding: 0 3px; font-weight: 700; cursor: pointer; }
.message__text .mention:hover, .message__text .channel-mention:hover { background: rgba(29,155,209,0.25); }
.message__text code { font-family: var(--font-mono); background: var(--code-bg); color: var(--code-text); padding: 2px 4px; border-radius: 4px; font-size: 0.92em; }
.message__text pre { margin: 8px 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; overflow-x: auto; }
.message__text pre code { background: transparent; padding: 0; font-size: 0.9em; }
.message__text ul { margin: 6px 0; padding-left: 24px; }
.message__text li { margin: 3px 0; }
.message__text blockquote { margin: 6px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--border-light); color: var(--text-muted); }
.message__text .edited { color: var(--text-muted); font-size: 12px; margin-left: 6px; }

.message__reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.reaction {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 7px; border-radius: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: 12px; cursor: pointer; user-select: none;
}
.reaction:hover { border-color: var(--border-light); }
.reaction--me { background: rgba(29,155,209,0.15); border-color: rgba(29,155,209,0.4); }
.reaction__emoji { line-height: 1; }
.reaction__count { color: var(--text-muted); font-weight: 700; }
.reaction--me .reaction__count { color: var(--text-link); }

.message__thread { margin-top: 6px; }
.thread-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius); background: var(--bg-elevated); color: var(--text-link); font-size: 13px; cursor: pointer;
}
.thread-pill:hover { text-decoration: underline; }
.thread-pill__count { font-weight: 700; }
.thread-pill__avatars { display: flex; }

.message__actions {
  position: absolute; right: 20px; top: -10px;
  display: flex; align-items: center; gap: 1px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-2px); transition: opacity 0.08s;
}
.message-group:hover .message__actions, .message-group--active .message__actions { opacity: 1; pointer-events: auto; }

.message__action {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); border-radius: var(--radius);
}
.message__action:hover { background: var(--bg-hover); color: var(--text-heading); }
.message__action--more { position: relative; }

.typing {
  height: 20px; padding: 0 20px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; opacity: 0; transition: opacity 0.15s;
}
.typing--visible { opacity: 1; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: typing 1.4s infinite both; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

.composer {
  padding: 0 20px 20px; background: var(--bg); flex: none;
}
.composer__wrap {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 6px;
}
.composer__wrap:focus-within { border-color: var(--border-light); box-shadow: 0 0 0 1px var(--border-light); }
.composer__toolbar { display: flex; align-items: center; gap: 2px; padding-bottom: 2px; }
.composer__tool {
  width: 32px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); border-radius: var(--radius);
}
.composer__tool:hover { background: var(--bg-hover); color: var(--text-heading); }
.composer__tool svg { width: 18px; height: 18px; }
.composer__input {
  resize: none; border: 0; outline: none; background: transparent; color: var(--text-heading);
  font: inherit; min-height: 44px; max-height: 160px; line-height: 1.5; overflow-y: auto;
  padding: 6px 0;
}
.composer__footer { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.composer__hint { opacity: 0.7; }
.composer__send {
  height: 30px; padding: 0 14px; border-radius: var(--radius); background: var(--accent); color: #111; font-weight: 700;
}
.composer__send:disabled { opacity: 0.4; cursor: not-allowed; }
.composer__send:hover:not(:disabled) { filter: brightness(1.1); }

/* Right panel */
.right-panel {
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  transform: translateX(100%); transition: transform 0.2s; position: relative;
}
.workspace[data-right-open="true"] .right-panel { transform: translateX(0); }
.right-panel__header {
  height: var(--thread-h); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
}
.right-panel__title { font-weight: 900; color: var(--text-heading); }
.right-panel__subtitle { font-size: 13px; color: var(--text-muted); }
.right-panel__close { width: 32px; height: 32px; border-radius: var(--radius); color: var(--text-muted); }
.right-panel__close:hover { background: var(--bg-hover); color: var(--text-heading); }
.right-panel__scroller { flex: 1; overflow-y: auto; padding: 10px 0; }
.right-panel__thread .message-group { padding: 8px 16px; }
.right-panel__composer { padding: 0 16px 16px; flex: none; }

/* Modals */
.modal-root, .popover-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.modal-root[aria-hidden="false"], .popover-root[aria-hidden="false"] { pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.modal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); width: min(560px, 92vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.modal--wide { width: min(720px, 95vw); }
.modal__header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal__title { font-size: 18px; font-weight: 900; color: var(--text-heading); }
.modal__close { width: 32px; height: 32px; border-radius: var(--radius); color: var(--text-muted); }
.modal__close:hover { background: var(--bg-hover); color: var(--text-heading); }
.modal__body { padding: 16px 20px; overflow-y: auto; }

/* Popovers */
.popover { position: absolute; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 8px; z-index: 110; }

/* Search modal */
.search-input {
  width: 100%; height: 44px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 14px; color: var(--text-heading); font: inherit; margin-bottom: 12px;
}
.search-input:focus { outline: none; border-color: var(--text-link); }
.search-section { margin-bottom: 12px; }
.search-section__title { font-size: 12px; font-weight: 900; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.search-result { display: flex; gap: 10px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; }
.search-result:hover { background: var(--bg-hover); }
.search-result__icon { flex: none; width: 20px; height: 20px; color: var(--text-muted); }
.search-result__body { flex: 1; min-width: 0; }
.search-result__title { font-weight: 700; color: var(--text-heading); font-size: 15px; }
.search-result__snippet { font-size: 14px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { text-align: center; color: var(--text-muted); padding: 24px 0; }

/* Channel details */
.channel-detail__header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.channel-detail__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-elevated-2); display: flex; align-items: center; justify-content: center; color: var(--text-heading); font-size: 24px; }
.channel-detail__meta h2 { margin: 0 0 4px; font-size: 18px; color: var(--text-heading); }
.channel-detail__meta p { margin: 0; color: var(--text-muted); font-size: 13px; }
.channel-detail__section { margin-bottom: 16px; }
.channel-detail__section h3 { font-size: 13px; font-weight: 900; color: var(--text-muted); text-transform: uppercase; margin: 0 0 8px; }
.channel-detail__members { display: flex; flex-wrap: wrap; gap: 8px; }
.member-chip { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius); background: var(--bg-elevated-2); color: var(--text-heading); font-size: 13px; cursor: pointer; }
.member-chip:hover { background: var(--bg-hover); }

/* Profile */
.profile-card { width: 320px; padding: 0; overflow: hidden; border-radius: var(--radius-lg); }
.profile-card__header { background: linear-gradient(135deg, var(--sidebar-header) 0%, var(--bg-elevated-2) 100%); padding: 20px; text-align: center; border-bottom: 1px solid var(--border); }
.profile-card__avatar { width: 72px; height: 72px; border-radius: 12px; margin: 0 auto 10px; font-size: 28px; }
.profile-card__name { font-size: 18px; font-weight: 900; color: var(--text-heading); }
.profile-card__role { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.profile-card__body { padding: 16px 20px; }
.profile-card__row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.profile-card__row:last-child { border-bottom: 0; }
.profile-card__label { color: var(--text-muted); }
.profile-card__value { color: var(--text-heading); display: flex; align-items: center; gap: 6px; }
.profile-card__actions { display: flex; gap: 8px; padding: 0 20px 20px; }
.profile-card__btn { flex: 1; height: 36px; border-radius: var(--radius); background: var(--bg-elevated-2); color: var(--text-heading); font-weight: 700; }
.profile-card__btn:hover { background: var(--bg-hover); }

/* Avatar & presence */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; font-weight: 800; color: #fff;
  text-transform: uppercase; user-select: none; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-green));
}
.avatar--small { width: 26px; height: 26px; font-size: 11px; border-radius: 6px; }
.avatar--tiny { width: 20px; height: 20px; font-size: 9px; border-radius: 4px; }

.presence { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); bottom: -2px; right: -2px; }
.presence--active { background: var(--presence-active); }
.presence--away { background: var(--presence-away); }
.presence--dnd { background: var(--presence-dnd); }
.presence--dnd::after { content: ""; display: block; width: 6px; height: 2px; background: var(--bg); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 1px; }

/* Emoji picker */
.emoji-picker { width: 280px; max-height: 320px; overflow-y: auto; }
.emoji-picker__category { font-size: 11px; font-weight: 900; color: var(--text-muted); text-transform: uppercase; padding: 6px 4px; }
.emoji-picker__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-picker__emoji { width: 32px; height: 32px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px; background: transparent; }
.emoji-picker__emoji:hover { background: var(--bg-hover); }

/* Toast */
.toast-root { position: fixed; bottom: 24px; right: 24px; z-index: 120; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 16px; border-radius: var(--radius); background: var(--bg-elevated-2); color: var(--text-heading); box-shadow: var(--shadow-pop); animation: toastIn 0.2s; pointer-events: auto; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* User status menu */
.status-menu { min-width: 220px; }
.status-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--radius); color: var(--text-heading); font-size: 14px; text-align: left; }
.status-menu__item:hover { background: var(--bg-hover); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Menus */
.menu { min-width: 180px; }
.menu__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: var(--radius); color: var(--text-heading); font-size: 14px; }
.menu__item:hover { background: var(--bg-hover); }
.menu__item--danger { color: var(--accent-red); }
.menu__item--danger:hover { background: rgba(224,30,90,0.12); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Mobile */
@media (max-width: 900px) {
  .workspace { grid-template-columns: 0 1fr 0 !important; }
  .workspace[data-right-open="true"] { grid-template-columns: 0 1fr 100% !important; }
  .sidebar, .right-panel { position: fixed; top: var(--topbar-h); bottom: 0; z-index: 25; width: min(320px, 85vw); }
  .sidebar { left: 0; transform: translateX(-100%); transition: transform 0.2s; border-right: 1px solid var(--border); }
  .sidebar--open { transform: translateX(0); }
  .right-panel { right: 0; width: 100%; transform: translateX(100%); }
  .topbar__menu { display: flex; align-items: center; justify-content: center; }
  .topbar__search-text, .topbar__search-key { display: none; }
  .topbar__search { justify-content: center; }
  .message__actions { position: relative; right: auto; top: auto; display: flex; opacity: 1; pointer-events: auto; background: transparent; border: 0; box-shadow: none; margin-top: 6px; transform: none; }
  .message__action { width: 34px; height: 34px; }
  .channel-header { padding: 0 14px; }
  .message-group { padding: 8px 14px; }
  .composer { padding: 0 14px 14px; }
  .modal, .modal--wide { width: min(560px, 95vw); }
}

@media (max-width: 520px) {
  .topbar__brand .brand-text { display: none; }
  .topbar__search { max-width: none; }
  .channel-header__topic { display: none; }
  .composer__hint { display: none; }
}
