:root {
  --bg: #e8ecef;
  --bg-soft: #f3f5f7;
  --paper: #ffffff;
  --paper-soft: #f7f8fa;
  --paper-muted: #eef1f4;
  --line: #dce3ea;
  --line-strong: #cfd8e0;
  --text: #1f2329;
  --muted: #7d8896;
  --muted-strong: #5f6976;
  --brand: #2f8bff;
  --brand-soft: rgba(47, 139, 255, 0.12);
  --accent: #95ec69;
  --accent-dark: #173700;
  --danger: #dc5b65;
  --danger-soft: rgba(220, 91, 101, 0.12);
  --success: #20a464;
  --shadow-soft: 0 12px 30px rgba(28, 39, 54, 0.08);
  --shadow-card: 0 20px 48px rgba(28, 39, 54, 0.12);
  --rail-width: 76px;
  --sidebar-width: 356px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: linear-gradient(180deg, #edf1f4 0%, #e7ecef 100%);
}

body {
  font-family: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

svg {
  width: 20px;
  height: 20px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.chip-btn,
.mini-btn,
.send-chip,
.end-call-btn,
.rail-btn,
.emoji-pill {
  border-radius: 14px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.primary-btn,
.ghost-btn,
.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.primary-btn {
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #5fa9ff);
  box-shadow: 0 14px 26px rgba(47, 139, 255, 0.24);
}

.ghost-btn,
.chip-btn,
.icon-btn {
  color: var(--text);
  background: var(--paper-muted);
}

.ghost-btn {
  padding: 10px 14px;
}

.chip-btn {
  padding: 10px 14px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.primary-btn:hover,
.ghost-btn:hover,
.chip-btn:hover,
.icon-btn:hover,
.rail-btn:hover,
.send-chip:hover,
.end-call-btn:hover,
.emoji-pill:hover {
  transform: translateY(-1px);
}

.ghost-btn:hover,
.chip-btn:hover,
.icon-btn:hover,
.rail-btn:hover {
  background: #e8edf2;
}

.primary-btn:disabled,
.ghost-btn:disabled,
.chip-btn:disabled,
.icon-btn:disabled,
.mini-btn:disabled,
.send-chip:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.full-width {
  width: 100%;
}

.danger-btn,
.ghost-btn.danger,
.danger-text {
  color: var(--danger);
}

.mini-btn {
  min-width: 48px;
  padding: 4px 10px;
  color: var(--muted-strong);
  background: rgba(31, 35, 41, 0.08);
}

.mini-btn:hover {
  background: rgba(31, 35, 41, 0.12);
}

.error-text {
  margin: 12px 0 0;
  color: var(--danger);
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-shell {
  width: min(440px, 100%);
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.login-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--brand), #69b3ff);
  box-shadow: 0 0 0 10px rgba(47, 139, 255, 0.12);
}

.login-brand h1,
.admin-header h1 {
  margin: 0 0 10px;
}

.login-form,
.user-form {
  display: grid;
  gap: 16px;
}

.login-form label,
.user-form label,
.sheet-field {
  display: grid;
  gap: 8px;
}

.login-form input,
.user-form input,
.user-form select,
.sheet-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: var(--paper-soft);
  outline: none;
}

.login-form input:focus,
.user-form input:focus,
.user-form select:focus,
.sheet-field input:focus {
  border-color: rgba(47, 139, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 139, 255, 0.12);
}

.chat-body {
  min-height: 100vh;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.workspace-rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 16px 12px;
  background: linear-gradient(180deg, #e2e6ea 0%, #dde2e6 100%);
  border-right: 1px solid rgba(207, 216, 224, 0.9);
}

.rail-top,
.rail-bottom {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.rail-brand,
.rail-btn {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
}

.rail-brand {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #2f8bff, #63b0ff);
  box-shadow: 0 14px 26px rgba(47, 139, 255, 0.24);
}

.rail-btn {
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(204, 213, 222, 0.76);
}

.rail-btn.active {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.96);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f3f4f6;
  border-right: 1px solid rgba(207, 216, 224, 0.82);
}

.sidebar-top,
.panel-block,
.chat-header,
.composer {
  padding: 18px;
}

.sidebar-top {
  display: grid;
  gap: 14px;
}

.sidebar-title-row,
.sidebar-title-copy,
.sidebar-top-actions,
.panel-header,
.chat-header,
.chat-header-left,
.chat-header-actions,
.conversation-row,
.message-row,
.message-footer,
.composer-toolbar,
.composer-tools,
.composer-meta,
.admin-header,
.admin-header-actions,
.dialog-actions,
.table-actions,
.call-hero,
.call-hero-actions,
.call-actions,
.search-shell,
.sheet-header,
.sheet-list-head,
.sheet-actions,
.member-summary,
.member-chip {
  display: flex;
  align-items: center;
}

.sidebar-title-row,
.panel-header,
.chat-header,
.admin-header,
.call-hero,
.sheet-header,
.sheet-list-head {
  justify-content: space-between;
}

.sidebar-title-copy,
.sidebar-top-actions,
.chat-header-left,
.chat-header-actions,
.message-row,
.composer-tools,
.composer-meta,
.admin-header-actions,
.dialog-actions,
.table-actions,
.call-hero-actions,
.call-actions,
.sheet-actions,
.member-summary {
  gap: 10px;
}

.summary-badge {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), #67b1ff);
  box-shadow: 0 10px 18px rgba(47, 139, 255, 0.2);
}

.sidebar-top-actions {
  flex-shrink: 0;
}

.search-shell {
  width: 100%;
  gap: 10px;
  padding: 0 8px 0 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(220, 227, 234, 0.92);
}

.search-icon {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.search-input {
  width: 100%;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
  outline: none;
}

.search-clear {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.search-clear:hover {
  background: var(--paper-muted);
}

.panel-block {
  padding-top: 0;
}

.panel-block.grow,
.conversations-only {
  flex: 1;
  min-height: 0;
}

.panel-header {
  margin-bottom: 10px;
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
}

.panel-meta,
.typing-badge,
.notification-hint,
.conversation-meta,
.sheet-tip,
.sheet-list-head,
.lightbox-caption {
  font-size: 13px;
  color: var(--muted);
}

.conversation-list,
.sheet-list {
  display: grid;
  gap: 6px;
  overflow: auto;
}

.conversation-list {
  max-height: calc(100vh - 176px);
}

.empty-list-card,
.message-empty-card {
  padding: 18px 16px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.84);
  text-align: center;
}

.conversation-row,
.sheet-user-row,
.group-choice-row {
  width: 100%;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: left;
}

.conversation-row {
  justify-content: space-between;
}

.conversation-row:hover,
.conversation-row.active,
.sheet-user-row:hover,
.group-choice-row:hover {
  background: rgba(255, 255, 255, 0.92);
}

.conversation-row.unread {
  background: rgba(255, 255, 255, 0.98);
}

.avatar,
.chat-peer-avatar,
.message-avatar {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar,
.chat-peer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2f8bff, #69b4ff);
}

.avatar.group,
.chat-peer-avatar.group {
  background: linear-gradient(135deg, #ffad33, #ff7b54);
}

.avatar {
  position: relative;
}

.avatar.online::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #f3f4f6;
}

.chat-peer-avatar {
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(47, 139, 255, 0.18);
}

.user-meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.user-meta strong,
.chat-header-copy h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  flex-shrink: 0;
  text-align: right;
  display: grid;
  gap: 6px;
}

.conversation-tags {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.mini-tag,
.unread-pill {
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.mini-tag {
  color: var(--muted-strong);
  background: rgba(31, 35, 41, 0.08);
}

.unread-pill {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #69b4ff);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  background: #fff;
}

.chat-header {
  gap: 18px;
  border-bottom: 1px solid rgba(220, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.96);
}

.chat-header-left {
  min-width: 0;
  flex: 1;
}

.chat-header-copy {
  min-width: 0;
}

.chat-header-copy h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.chat-header-copy p {
  margin: 4px 0 0;
}

.message-list {
  overflow: auto;
  padding: 20px 26px;
  display: grid;
  gap: 10px;
  align-content: start;
  background:
    linear-gradient(rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.96)),
    radial-gradient(circle at 24px 24px, rgba(230, 235, 240, 0.7) 2px, transparent 0);
  background-size: auto, 22px 22px;
}

.empty-state {
  display: grid;
  place-items: center;
}

.placeholder-card,
.message-empty-card {
  max-width: 420px;
  padding: 26px;
  border-radius: 24px;
  text-align: center;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.placeholder-card h3,
.message-empty-card h3 {
  margin-top: 0;
}

.message-separator {
  display: flex;
  justify-content: center;
  margin: 6px 0 2px;
}

.message-separator span {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(241, 244, 247, 0.92);
}

.message-row {
  align-items: flex-end;
}

.message-row.mine {
  justify-content: flex-end;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #7c8ea5, #97a7bb);
}

.message-avatar.mine {
  background: linear-gradient(135deg, #78bf5c, #95ec69);
  color: var(--accent-dark);
}

.message-stack {
  max-width: min(70%, 500px);
}

.message-bubble {
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f3f4f6;
}

.message-row.mine .message-bubble {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-dark);
}

.media-bubble {
  min-width: 220px;
}

.message-author {
  margin-bottom: 6px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.message-content p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-footer {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  color: rgba(31, 35, 41, 0.52);
  font-size: 11px;
}

.message-row.mine .message-footer {
  color: rgba(23, 55, 0, 0.56);
}

.expires-tip {
  font-style: italic;
}

.message-image,
.message-video {
  width: min(100%, 340px);
  max-height: 340px;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  background: #101418;
  cursor: zoom-in;
}

.audio-card,
.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.42);
}

.media-preview-shell {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.message-row.mine .audio-card,
.message-row.mine .file-card {
  background: rgba(255, 255, 255, 0.28);
}

.audio-card-icon,
.file-card-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  background: rgba(47, 139, 255, 0.1);
  flex-shrink: 0;
}

.audio-card-main,
.file-card-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.audio-card-main strong,
.file-card-meta strong {
  font-size: 14px;
}

.audio-card-main span,
.file-card-meta span {
  color: var(--muted);
  font-size: 12px;
}

.message-audio {
  width: min(100%, 220px);
}

.composer {
  position: relative;
  padding-top: 14px;
  background: #fff;
  border-top: 1px solid rgba(220, 227, 234, 0.9);
}

.emoji-panel {
  position: absolute;
  left: 18px;
  bottom: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 320px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-card);
  z-index: 5;
}

.emoji-pill {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  background: var(--paper-soft);
}

.composer-panel {
  width: 100%;
  padding: 16px 16px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(220, 227, 234, 0.96);
}

.composer-editor {
  min-height: 112px;
}

#messageInput {
  width: 100%;
  min-height: 78px;
  max-height: 170px;
  padding: 0;
  border: 0;
  resize: none;
  color: var(--text);
  background: transparent;
  outline: none;
}

.composer-toolbar {
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(220, 227, 234, 0.72);
}

.composer-tools {
  gap: 4px;
}

.composer-meta {
  min-width: 0;
  flex: 1;
  gap: 8px;
}

.inner-tool-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted-strong);
  background: transparent;
}

.inner-tool-btn:hover,
.inner-tool-btn.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.recording-badge {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  background: var(--danger-soft);
}

.notification-hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-hint.error {
  color: var(--danger);
}

.send-chip {
  min-width: 74px;
  height: 34px;
  padding: 0 16px;
  border-radius: 10px;
  color: #8e99a7;
  background: #eef1f4;
}

.send-chip.ready {
  color: #fff;
  background: linear-gradient(135deg, #1aad19, #44c538);
  box-shadow: 0 12px 20px rgba(26, 173, 25, 0.18);
}

.sheet-dialog,
.user-dialog {
  width: min(520px, calc(100vw - 24px));
  border: 0;
  border-radius: 26px;
  padding: 0;
  box-shadow: var(--shadow-card);
}

.sheet-dialog::backdrop,
.user-dialog::backdrop {
  background: rgba(9, 16, 27, 0.42);
  backdrop-filter: blur(8px);
}

.sheet-card,
.user-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.sheet-card h3 {
  margin: 0;
}

.sheet-tip {
  margin: -4px 0 0;
}

.sheet-actions.spaced {
  justify-content: space-between;
}

.sheet-list {
  max-height: 320px;
  padding: 4px;
  border-radius: 18px;
  background: var(--paper-soft);
}

.sheet-user-row,
.group-choice-row {
  display: flex;
  align-items: center;
}

.group-choice-row input {
  margin: 0 2px 0 0;
}

.sheet-user-row-main,
.group-choice-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.member-summary {
  flex-wrap: wrap;
}

.member-chip {
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--paper-soft);
}

.member-chip strong {
  font-size: 13px;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 14, 24, 0.82);
  backdrop-filter: blur(16px);
  z-index: 11;
}

.lightbox-card {
  position: relative;
  width: min(960px, 100%);
  max-height: calc(100vh - 40px);
  padding: 54px 18px 18px;
  border-radius: 28px;
  background: rgba(17, 25, 38, 0.92);
  box-shadow: 0 30px 68px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-image,
.lightbox-video {
  width: 100%;
  max-height: calc(100vh - 150px);
  border-radius: 18px;
  object-fit: contain;
  background: #05080d;
}

.lightbox-caption {
  margin: 12px 0 0;
  text-align: center;
}

.admin-body {
  min-height: 100vh;
  padding: 30px;
}

.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.admin-header {
  margin-bottom: 22px;
}

.admin-table-wrap {
  overflow: hidden;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.call-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 16, 27, 0.78);
  backdrop-filter: blur(18px);
  z-index: 12;
}

.call-card {
  width: min(960px, 100%);
  padding: 24px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(90, 169, 255, 0.25), transparent 28%),
    linear-gradient(180deg, rgba(17, 27, 40, 0.98), rgba(12, 20, 31, 0.98));
  box-shadow: 0 30px 68px rgba(0, 0, 0, 0.3);
}

.call-hero {
  gap: 18px;
}

.call-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
}

.call-card h3 {
  margin: 12px 0 8px;
  font-size: 34px;
}

.call-card .muted {
  color: rgba(255, 255, 255, 0.76);
}

.call-stage {
  margin-top: 24px;
}

.call-audio-stage,
.call-video-stage {
  min-height: 420px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.call-audio-stage {
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 28px;
  text-align: center;
}

.call-avatar-ring {
  width: 164px;
  height: 164px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 54px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(99, 176, 255, 0.96), rgba(47, 139, 255, 0.92));
  box-shadow:
    0 0 0 18px rgba(47, 139, 255, 0.11),
    0 0 0 34px rgba(47, 139, 255, 0.08);
}

.call-secondary-status {
  max-width: 360px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

.call-video-stage {
  position: relative;
  display: none;
}

.call-video-stage video {
  width: 100%;
  height: 420px;
  object-fit: cover;
  background: #090e14;
}

.local-video-frame {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(28vw, 220px);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.26);
}

.local-video-frame video {
  height: 160px;
}

.call-overlay[data-mode="video"] .call-video-stage {
  display: block;
}

.call-overlay[data-mode="video"] .call-audio-stage {
  display: none;
}

.end-call-btn {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff7885, var(--danger));
  box-shadow: 0 16px 28px rgba(220, 91, 101, 0.26);
}

.call-actions {
  justify-content: center;
  margin-top: 18px;
}

.mobile-only {
  display: none;
}

@media (max-width: 899px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace-rail {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), 92vw);
    z-index: 8;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    box-shadow: 16px 0 32px rgba(28, 39, 54, 0.16);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-grid;
  }

  body.mobile-chat-open .sidebar {
    transform: translateX(-104%);
  }

  .chat-header,
  .composer,
  .message-list {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chat-header {
    gap: 12px;
  }

  .chat-header-copy h2 {
    font-size: 18px;
  }

  .chat-header-actions {
    gap: 8px;
  }

  .chat-header-actions .chip-btn span {
    display: none;
  }

  .message-list {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .message-stack {
    max-width: 80%;
  }

  .composer {
    padding-top: 10px;
    padding-bottom: 14px;
  }

  .composer-panel {
    padding: 14px 12px 12px;
  }

  .composer-editor {
    min-height: 92px;
  }

  #messageInput {
    min-height: 64px;
  }

  .emoji-panel {
    left: 14px;
    right: 14px;
    max-width: none;
  }

  .composer-toolbar {
    flex-wrap: wrap;
    align-items: center;
  }

  .composer-meta {
    flex: 1 1 100%;
    order: 3;
  }

  .send-chip {
    margin-left: auto;
  }

  .sheet-dialog {
    width: calc(100vw - 20px);
  }

  .call-overlay,
  .lightbox {
    padding: 12px;
  }

  .call-card {
    height: calc(100vh - 24px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 18px;
  }

  .call-card h3 {
    font-size: 26px;
  }

  .call-audio-stage,
  .call-video-stage {
    min-height: 0;
    height: 100%;
  }

  .call-video-stage video {
    height: 100%;
  }

  .local-video-frame {
    right: 10px;
    bottom: 10px;
    width: 118px;
  }

  .local-video-frame video {
    height: 150px;
  }
}
