@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --shadow: 0 24px 56px rgba(5, 14, 28, 0.4);
  --bg-main-accent: #041423;
  --text-soft: #9bb8d1;
}

body[data-theme="dark"] {
  --bg-main: #071a2f;
  --bg-main-accent: #041423;
  --bg-panel: #0f243a;
  --bg-panel-2: #102942;
  --bg-hover: #173451;
  --bg-active: #1f4061;
  --line: #1f3e5a;
  --text: #edf5ff;
  --muted: #89a8c3;
  --text-soft: #9bb8d1;
  --primary: #4a9fff;
  --primary-2: #3e82ef;
  --danger: #e66a82;
}

body[data-theme="light"] {
  --bg-main: #f2f7fd;
  --bg-main-accent: #dfecfb;
  --bg-panel: #ffffff;
  --bg-panel-2: #f5f9ff;
  --bg-hover: #e9f2fc;
  --bg-active: #d5e8fb;
  --line: #b8cee4;
  --text: #132c46;
  --muted: #486582;
  --text-soft: #5a7692;
  --primary: #1f7be8;
  --primary-2: #3063d4;
  --danger: #b63552;
  --shadow: 0 24px 56px rgba(59, 99, 142, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  color: var(--text);
  background: linear-gradient(170deg, var(--bg-main), var(--bg-main-accent));
  overflow: hidden;
}

@media (min-width: 1081px) {
  body {
    zoom: 0.96;
  }
}

.bg-glow {
  display: none;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 14px;
}

.hidden {
  display: none !important;
}

.ui-placeholder-red {
  border-color: rgba(255, 96, 116, 0.9) !important;
  background-color: rgba(131, 20, 39, 0.22) !important;
  color: #ffb5bf !important;
}

.ui-placeholder-red .chat-profile-quick-text,
.ui-placeholder-red .chat-profile-quick-ico,
.ui-placeholder-red span {
  color: inherit !important;
}

body[data-theme="light"] .ui-placeholder-red {
  border-color: rgba(196, 44, 69, 0.62) !important;
  background-color: rgba(255, 92, 119, 0.14) !important;
  color: #a62a40 !important;
}

.auth-screen {
  width: min(960px, 100%);
  margin: auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.brand h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: -0.04em;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
}

.brand-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-content: center;
  color: #fff;
  margin-top: 4px;
}

.brand-mark-fox {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(255, 141, 61, 0.24));
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--text);
  border-color: #629bd7;
  background: var(--bg-panel-2);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-public-profile {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-panel-2);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.auth-public-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.auth-public-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.auth-public-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-public-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-public-body {
  min-width: 0;
}

.auth-public-name {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-public-username {
  margin-top: 2px;
  color: var(--primary);
  font-family: "IBM Plex Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-public-secondary {
  margin-top: 2px;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-public-info {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg-panel-2);
}

input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--primary);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(89, 155, 224, 0.6);
  border-color: #5d9ce0;
}

textarea {
  resize: vertical;
  min-height: 52px;
}

.primary-btn,
.ghost-btn {
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.primary-btn {
  border: 0;
  color: #fff;
  padding: 10px 14px;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
}

.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}

.ghost-btn.small {
  padding: 7px 10px;
  font-size: 12px;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.app-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 388px minmax(0, 1fr);
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.left-pane {
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.left-pane.swipe-dragging {
  will-change: transform;
}

.left-pane-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 22;
  background: var(--bg-panel);
  grid-column: 2;
  grid-row: 1;
}

.left-folder-rail {
  grid-column: 1;
  grid-row: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 8px;
  border-right: 1px solid rgba(82, 122, 166, 0.42);
  background: linear-gradient(180deg, rgba(7, 19, 32, 0.76), rgba(10, 27, 45, 0.8));
  z-index: 23;
}

.menu-toggle-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.folder-rail-menu-btn {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 14px;
  background: rgba(14, 35, 57, 0.82);
  border-color: rgba(103, 151, 197, 0.34);
  color: #d6ebff;
  display: grid;
  place-items: center;
  padding: 4px 2px;
}

.menu-toggle-btn:hover {
  background: var(--bg-hover);
}

.folder-rail-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 12px 0 2px;
  border-top: 1px solid rgba(95, 139, 183, 0.28);
}

.folder-rail-item,
.folder-rail-settings {
  width: 48px;
  min-height: 48px;
  border: 1px solid rgba(101, 150, 197, 0.28);
  border-radius: 14px;
  background: rgba(13, 35, 58, 0.58);
  color: #b9d7f4;
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 4px 2px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 140ms ease;
}

.folder-rail-item {
  gap: 2px;
}

.folder-rail-item:hover,
.folder-rail-settings:hover {
  background: rgba(34, 68, 101, 0.74);
  border-color: rgba(122, 181, 236, 0.48);
  transform: translateY(-1px);
}

.folder-rail-item.active {
  border-color: rgba(123, 190, 255, 0.64);
  background: linear-gradient(180deg, rgba(43, 96, 148, 0.72), rgba(24, 66, 106, 0.78));
  color: #f1f8ff;
}

.folder-rail-list.folder-drag-active {
  overflow: visible;
}

.folder-rail-item.drag-target {
  border-color: rgba(136, 206, 255, 0.86);
  background: linear-gradient(180deg, rgba(63, 120, 171, 0.88), rgba(35, 81, 124, 0.92));
  color: #f6fbff;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 10px 24px rgba(3, 17, 31, 0.34), 0 0 0 1px rgba(139, 204, 255, 0.18);
}

.folder-rail-icon {
  font-size: 18px;
  line-height: 1;
}

.folder-rail-label {
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 700;
}

.folder-rail-settings {
  align-self: auto;
  font-size: 18px;
}

.main-search-wrap {
  display: block;
}

.main-search-wrap input {
  height: 40px;
  border-radius: 20px;
  padding: 0 14px;
}

.left-pane-filters {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 10px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}

.left-pane-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(103, 145, 186, 0.3);
  border-radius: 999px;
  background: rgba(20, 46, 72, 0.18);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.14s ease;
}

.left-pane-filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.left-pane-filter-btn.active {
  background: rgba(87, 155, 228, 0.18);
  border-color: rgba(108, 169, 233, 0.62);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(141, 197, 252, 0.12);
}

.left-pane-filter-btn:active {
  transform: translateY(1px);
}

.left-pane-filter-icon {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}

.private-incoming-call-bar {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(92, 141, 190, 0.34);
  background: linear-gradient(180deg, rgba(27, 52, 78, 0.92), rgba(20, 44, 68, 0.94));
}

.private-incoming-call-text {
  min-width: 0;
}

.private-incoming-call-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8bb5de;
}

.private-incoming-call-caller {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #e1efff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.private-incoming-call-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.private-incoming-call-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(121, 163, 206, 0.45);
  background: rgba(20, 47, 73, 0.7);
  color: #d7ebff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, filter 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.private-incoming-call-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.private-incoming-call-btn.decline {
  border-color: rgba(223, 120, 139, 0.62);
  background: rgba(89, 29, 42, 0.64);
}

.private-incoming-call-btn.accept {
  border-color: rgba(116, 188, 144, 0.62);
  background: rgba(27, 88, 55, 0.62);
}

.private-active-call-bar {
  grid-column: 2;
  grid-row: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(110, 152, 195, 0.34);
  background: linear-gradient(180deg, rgba(24, 57, 87, 0.92), rgba(17, 46, 74, 0.94));
}

.private-active-call-text {
  min-width: 0;
}

.private-active-call-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #83b1dd;
}

.private-active-call-caller {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #e2f0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.private-active-call-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.private-active-call-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(121, 163, 206, 0.45);
  background: rgba(20, 47, 73, 0.7);
  color: #d7ebff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, filter 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.private-active-call-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.private-active-call-btn.expand {
  border-color: rgba(124, 189, 255, 0.58);
  background: rgba(25, 78, 121, 0.72);
}

.private-active-call-btn.hangup {
  border-color: rgba(223, 120, 139, 0.62);
  background: rgba(89, 29, 42, 0.64);
}

.chat-list {
  grid-column: 2;
  grid-row: 5;
  overflow: auto;
  padding: 8px;
  min-height: 0;
}

.chat-search-panel {
  grid-column: 2;
  grid-row: 5;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 8px;
  gap: 8px;
  overflow: hidden;
}

.chat-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 0;
  position: sticky;
  top: 0;
  z-index: 21;
  background: var(--bg-panel);
}

.chat-search-title {
  font-size: 14px;
  color: var(--muted);
}

.chat-search-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chat-search-close-btn:hover {
  background: var(--bg-hover);
}

.chat-search-results {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 38, 60, 0.35);
}

body[data-theme="light"] .chat-search-results {
  background: rgba(220, 236, 255, 0.42);
}

.chat-search-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
}

.chat-search-count {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.chat-search-result {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  padding: 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.chat-search-result:last-child {
  border-bottom: 0;
}

.chat-search-result:hover {
  background: var(--bg-hover);
}

.chat-search-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #3f75c8, #57a2ea);
}

.chat-search-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.chat-search-sender {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-search-date {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-search-preview {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-section-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 10px 6px 8px;
}

.list-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 8px;
}

.chat-row,
.user-result-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.chat-row:hover,
.user-result-row:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.chat-row.active {
  background: var(--bg-active);
  box-shadow: inset 0 0 0 1px rgba(124, 179, 237, 0.28);
}

.chat-list.chat-list-folder-dragging {
  cursor: grabbing;
  user-select: none;
}

.chat-row.folder-drag-source,
.chat-row.folder-drag-source:hover {
  opacity: 0.42;
  transform: none;
}

.chat-row-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  z-index: 48;
  pointer-events: none;
  background: rgba(23, 53, 83, 0.96);
  box-shadow: 0 18px 36px rgba(4, 18, 33, 0.42), 0 0 0 1px rgba(120, 183, 241, 0.28);
  transform: translate3d(-9999px, -9999px, 0);
}

.chat-row-drag-ghost:hover {
  transform: translate3d(-9999px, -9999px, 0);
}

.chat-storage-separator {
  height: 0;
  border-top: 1px solid rgba(112, 166, 220, 0.44);
  margin: 6px 10px 8px;
  pointer-events: none;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.chat-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #4a81d8, #5aa8f5);
}

.chat-row-body {
  min-width: 0;
}

.chat-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.chat-row-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-row-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.chat-row-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-account-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.official-account-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.official-account-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(24, 50, 77, 0.28);
  box-shadow: inset 0 0 0 1px rgba(122, 174, 223, 0.28);
  cursor: help;
  overflow: hidden;
}

.official-account-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chat-profile-name .official-account-badge {
  width: 20px;
  height: 20px;
}

.message-sender .official-account-badge {
  width: 14px;
  height: 14px;
}

body[data-theme="light"] .official-account-badge {
  background: rgba(203, 224, 244, 0.88);
  box-shadow: inset 0 0 0 1px rgba(122, 164, 201, 0.42);
}

.account-name-restricted {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 150, 150, 0.78);
}

.account-avatar-restricted {
  position: relative;
  background: linear-gradient(145deg, rgba(31, 45, 61, 0.95), rgba(17, 28, 40, 0.98)) !important;
  border: 1px dashed rgba(255, 160, 160, 0.32) !important;
  color: transparent !important;
  box-shadow: inset 0 0 0 1px rgba(255, 170, 170, 0.08);
}

.account-avatar-restricted::before {
  content: "";
  width: 36%;
  height: 36%;
  border-radius: 50%;
  border: 2px solid rgba(255, 231, 231, 0.7);
  border-bottom-color: transparent;
  opacity: 0.5;
}

.account-avatar-restricted::after {
  content: "";
  position: absolute;
  width: 58%;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 172, 172, 0.76);
  transform: rotate(-34deg);
  box-shadow: 0 0 10px rgba(255, 133, 133, 0.18);
}

.account-avatar-restricted img {
  display: none !important;
}

.chat-row-date {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}

.chat-row-mention {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid rgba(139, 202, 255, 0.42);
  background: rgba(86, 152, 221, 0.25);
  color: #d8eeff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.chat-row-unread {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  color: #f2f8ff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: linear-gradient(140deg, #5b9fe8, #2b67b7);
}

.chat-row-preview {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row-preview-with-avatar {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chat-row-preview-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(141, 193, 243, 0.42);
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: rgba(9, 30, 50, 0.72);
}

.chat-row-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-row-preview-avatar.fallback {
  color: #d8ebff;
  font-size: 9px;
  font-weight: 700;
}

.chat-row-preview-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-theme="light"] .chat-row-preview-avatar {
  border-color: rgba(106, 161, 212, 0.44);
  background: rgba(232, 244, 255, 0.92);
}

body[data-theme="light"] .chat-row-preview-avatar.fallback {
  color: #376996;
}

body[data-theme="light"] .chat-row-mention {
  border-color: rgba(83, 141, 200, 0.45);
  background: rgba(95, 155, 214, 0.2);
  color: #1d5c96;
}

body[data-theme="light"] .chat-storage-separator {
  border-top-color: rgba(105, 152, 198, 0.42);
}

.right-pane {
  background: #021a31;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}

.right-pane.swipe-dragging {
  will-change: transform;
  transform-origin: left center;
}

.right-pane.drop-file-active {
  box-shadow: inset 0 0 0 2px rgba(112, 183, 255, 0.85);
  background: linear-gradient(180deg, rgba(4, 35, 62, 0.98), rgba(2, 25, 47, 0.98));
}

.chat-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 23;
  background: rgba(2, 16, 31, 0.64);
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.right-pane.drop-file-active .chat-drop-overlay {
  opacity: 1;
}

.chat-drop-overlay-label {
  border: 1px solid rgba(134, 195, 255, 0.72);
  background: rgba(8, 31, 53, 0.86);
  color: #dff1ff;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 26px rgba(3, 12, 22, 0.46);
}

body[data-theme="light"] .right-pane {
  background: #f4f9ff;
}

body[data-theme="light"] .right-pane.drop-file-active {
  box-shadow: inset 0 0 0 2px rgba(62, 137, 216, 0.82);
  background: linear-gradient(180deg, rgba(236, 247, 255, 0.98), rgba(226, 240, 255, 0.98));
}

body[data-theme="light"] .chat-drop-overlay {
  background: rgba(209, 227, 247, 0.66);
}

body[data-theme="light"] .chat-drop-overlay-label {
  border-color: rgba(68, 141, 216, 0.72);
  background: rgba(238, 247, 255, 0.95);
  color: #1f4f80;
}

.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  box-sizing: border-box;
  background: rgba(3, 28, 50, 0.95);
  position: relative;
  z-index: 18;
  overflow: visible;
  isolation: isolate;
}

.chat-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.chat-header.profile-trigger {
  cursor: pointer;
  transition: background-color 170ms ease;
}

.chat-header.profile-trigger:hover {
  background: var(--bg-hover);
}

.chat-closure-banner {
  margin: 8px 12px 0;
  border: 1px solid rgba(105, 154, 198, 0.36);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(16, 43, 69, 0.95), rgba(10, 31, 53, 0.97)),
    radial-gradient(circle at 88% 18%, rgba(112, 181, 240, 0.16), transparent 54%);
  box-shadow:
    inset 0 1px 0 rgba(159, 210, 255, 0.08),
    0 10px 24px rgba(4, 16, 29, 0.34);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title timer"
    "meta timer";
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.chat-closure-banner::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(121, 186, 243, 0), rgba(121, 186, 243, 0.48), rgba(121, 186, 243, 0));
  pointer-events: none;
}

.chat-closure-banner.write-locked {
  border-color: rgba(126, 171, 210, 0.44);
  box-shadow:
    inset 4px 0 0 rgba(237, 168, 103, 0.72),
    inset 0 1px 0 rgba(159, 210, 255, 0.08),
    0 10px 24px rgba(4, 16, 29, 0.34);
}

.chat-closure-banner.write-allowed {
  border-color: rgba(113, 181, 149, 0.46);
  box-shadow:
    inset 4px 0 0 rgba(106, 204, 160, 0.68),
    inset 0 1px 0 rgba(159, 210, 255, 0.08),
    0 10px 24px rgba(4, 16, 29, 0.34);
}

.chat-closure-banner-title {
  grid-area: title;
  color: #e3f2ff;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chat-closure-banner-meta {
  grid-area: meta;
  color: #bad8f4;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.chat-closure-banner-timer {
  grid-area: timer;
  justify-self: end;
  color: #eaf5ff;
  font-size: 23px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(121, 176, 225, 0.5);
  background: linear-gradient(180deg, rgba(13, 35, 56, 0.84), rgba(10, 27, 44, 0.84));
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 164px;
  text-align: center;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(167, 217, 255, 0.12);
}

.chat-closure-banner.write-locked .chat-closure-banner-timer {
  border-color: rgba(235, 176, 117, 0.55);
  background: linear-gradient(180deg, rgba(59, 40, 24, 0.72), rgba(42, 28, 15, 0.74));
  color: #ffdcb9;
}

.chat-closure-banner.write-allowed .chat-closure-banner-timer {
  border-color: rgba(105, 190, 146, 0.56);
  background: linear-gradient(180deg, rgba(18, 52, 37, 0.72), rgba(12, 38, 26, 0.74));
  color: #d5f3e3;
}

.chat-closure-banner.write-locked .chat-closure-banner-title,
.chat-closure-banner.write-locked .chat-closure-banner-meta {
  color: #ffe8d1;
}

.chat-closure-banner.write-allowed .chat-closure-banner-title,
.chat-closure-banner.write-allowed .chat-closure-banner-meta {
  color: #d9f6e8;
}

.chat-closure-banner.closed {
  border-color: rgba(94, 140, 183, 0.5);
  background: linear-gradient(160deg, rgba(16, 43, 70, 0.96), rgba(11, 34, 56, 0.96));
  box-shadow:
    inset 4px 0 0 rgba(116, 170, 222, 0.64),
    inset 0 1px 0 rgba(159, 210, 255, 0.08),
    0 10px 24px rgba(4, 16, 29, 0.34);
}

.chat-closure-banner.closed .chat-closure-banner-title {
  color: #d7ebff;
}

.chat-closure-banner.closed .chat-closure-banner-meta {
  color: #b9d8f7;
}

.chat-closure-banner.closed .chat-closure-banner-timer {
  display: none;
}

.chat-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title .official-account-badge {
  width: 18px;
  height: 18px;
}

.mobile-back-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.mobile-back-btn:hover {
  background: var(--bg-hover);
}

.chat-mentions-back-btn {
  flex: 0 0 auto;
}

.selection-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selection-count-label {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.selection-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-secondary-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 8px 12px;
  cursor: pointer;
}

.selection-secondary-btn:hover {
  background: var(--bg-hover);
}

.selection-secondary-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.selection-delete-btn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  color: #fff;
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
}

.selection-delete-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.selection-cancel-btn {
  border: 0;
  background: transparent;
  color: #68b1f3;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-transform: uppercase;
}

body[data-theme="light"] .selection-cancel-btn {
  color: #1f6fbf;
}

.selection-range-card {
  width: min(420px, calc(100vw - 28px));
  display: grid;
  gap: 14px;
}

body[data-theme="light"] .selection-range-card {
  border-color: rgba(121, 163, 200, 0.46);
  background: linear-gradient(180deg, #f8fbff, #edf4ff);
  color: #214567;
  box-shadow: 0 24px 60px rgba(71, 107, 142, 0.22);
}

body[data-theme="light"] .selection-range-card .modal-head h3 {
  color: #204668;
}

.selection-range-field {
  margin: 0;
}

.selection-range-field input {
  width: 100%;
}

.selection-range-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.selection-range-actions .ghost-btn,
.selection-range-actions .primary-btn {
  border: 0;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
}

.selection-range-actions .ghost-btn:hover,
.selection-range-actions .primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(56, 111, 173, 0.34);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chat-header-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-panel-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, background-color 170ms ease, border-color 170ms ease;
}

.chat-header-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-header-btn:not(:disabled):hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.chat-menu-wrap {
  position: relative;
  z-index: 30;
}

.chat-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #10273f, #0d2237);
  box-shadow: 0 16px 36px rgba(4, 11, 21, 0.46);
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 40;
  transform-origin: top right;
  animation: menu-pop-in 140ms ease-out both;
}

body[data-theme="light"] .chat-menu {
  background: linear-gradient(170deg, #f8fbff, #ecf4ff);
}

.chat-list-context-menu {
  position: fixed;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 16px));
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #10273f, #0d2237);
  box-shadow: 0 16px 36px rgba(4, 11, 21, 0.46);
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 38;
  transform-origin: top left;
  animation: menu-pop-in 140ms ease-out both;
}

body[data-theme="light"] .chat-list-context-menu {
  background: linear-gradient(170deg, #f8fbff, #ecf4ff);
}

.chat-menu-item {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  padding: 9px 10px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.chat-menu-item:hover {
  background: var(--bg-hover);
}

.chat-menu-item.active {
  background: var(--bg-hover);
  color: #93cbff;
}

.chat-list-submenu-wrap {
  position: relative;
}

.chat-list-submenu-wrap::before,
.chat-list-submenu-wrap::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 16px;
  height: calc(100% + 20px);
  z-index: 40;
}

.chat-list-submenu-wrap::before {
  left: -12px;
}

.chat-list-submenu-wrap::after {
  right: -12px;
}

.chat-menu-item-submenu {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-menu-item-arrow {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  opacity: 0.78;
}

.chat-list-submenu {
  position: absolute;
  top: -8px;
  left: calc(100% + 8px);
  min-width: 220px;
  max-width: min(280px, calc(100vw - 16px));
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #10273f, #0d2237);
  box-shadow: 0 16px 36px rgba(4, 11, 21, 0.46);
  padding: 8px;
  display: grid;
  gap: 4px;
  z-index: 39;
  transform-origin: top left;
  animation: menu-pop-in 140ms ease-out both;
}

.chat-list-submenu.align-left {
  left: auto;
  right: calc(100% + 8px);
  transform-origin: top right;
}

.chat-list-submenu-list {
  display: grid;
  gap: 4px;
}

.chat-list-submenu-divider {
  height: 1px;
  background: var(--line);
  opacity: 0.9;
  margin: 2px 0;
}

.chat-list-folder-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-list-folder-toggle-icon,
.chat-list-folder-action-icon {
  flex: 0 0 16px;
  width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.chat-list-folder-toggle-icon {
  color: rgba(143, 203, 255, 0.92);
}

.chat-list-folder-item.active .chat-list-folder-toggle-icon {
  color: #9ad56f;
}

.chat-list-submenu-create {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-list-submenu-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.chat-menu-item.danger {
  color: #ff8ea7;
}

body[data-theme="light"] .chat-menu-item.active {
  color: #1f6fbf;
}

body[data-theme="light"] .chat-list-submenu {
  background: linear-gradient(170deg, #f8fbff, #ecf4ff);
}

body[data-theme="light"] .chat-list-folder-toggle-icon {
  color: #2f79c0;
}

body[data-theme="light"] .chat-list-folder-item.active .chat-list-folder-toggle-icon {
  color: #3d9b45;
}

.chat-workspace {
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.chat-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.message-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.chat-mentions-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-main.mentions-mode .message-list,
.chat-main.mentions-mode .jump-unread-btn {
  display: none !important;
}

.chat-main.mentions-mode .chat-mentions-view {
  display: flex;
}

.chat-mentions-view-meta {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chat-mentions-view-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-mentions-empty {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(15, 37, 58, 0.48);
}

.chat-mentions-result {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 45, 72, 0.62);
  color: var(--text);
  text-align: left;
  font: inherit;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 140ms ease;
}

.chat-mentions-result:hover {
  background: rgba(26, 62, 96, 0.76);
  border-color: rgba(116, 169, 221, 0.62);
  transform: translateY(-1px);
}

.chat-mentions-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(82, 138, 201, 0.26);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #d9edff;
}

.chat-mentions-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-mentions-avatar.fallback {
  border: 1px solid rgba(117, 173, 228, 0.46);
}

.chat-mentions-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-mentions-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-mentions-sender {
  min-width: 0;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-mentions-date {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.chat-mentions-preview {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-list::-webkit-scrollbar {
  width: 10px;
}

.message-list::-webkit-scrollbar-track {
  background: rgba(10, 24, 39, 0.36);
}

.message-list::-webkit-scrollbar-thumb {
  background: rgba(104, 156, 210, 0.52);
  border-radius: 999px;
}

body[data-theme="light"] .message-list::-webkit-scrollbar-track {
  background: rgba(189, 211, 235, 0.45);
}

body[data-theme="light"] .chat-mentions-empty {
  background: rgba(238, 245, 255, 0.92);
  color: #4b6280;
}

body[data-theme="light"] .chat-mentions-result {
  background: rgba(233, 243, 255, 0.86);
}

body[data-theme="light"] .chat-mentions-result:hover {
  background: rgba(219, 235, 254, 0.98);
  border-color: rgba(102, 158, 218, 0.56);
}

body[data-theme="light"] .chat-mentions-avatar {
  background: rgba(88, 145, 209, 0.23);
  color: #184a7c;
}

body[data-theme="light"] .message-list::-webkit-scrollbar-thumb {
  background: rgba(67, 127, 196, 0.55);
}

body[data-theme="light"] .chat-header {
  background: rgba(243, 249, 255, 0.98);
}

body[data-theme="light"] .chat-closure-banner {
  border-color: rgba(134, 173, 207, 0.48);
  background:
    linear-gradient(180deg, rgba(228, 241, 253, 0.98), rgba(215, 233, 250, 0.99)),
    radial-gradient(circle at 88% 24%, rgba(111, 170, 226, 0.18), transparent 52%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.66),
    0 8px 20px rgba(64, 108, 154, 0.16);
}

body[data-theme="light"] .chat-closure-banner-title {
  color: #1f5788;
}

body[data-theme="light"] .chat-closure-banner-meta {
  color: #2d628f;
}

body[data-theme="light"] .chat-closure-banner-timer {
  color: #1d4e78;
  border-color: rgba(116, 164, 205, 0.5);
  background: linear-gradient(180deg, rgba(245, 251, 255, 0.95), rgba(235, 246, 255, 0.9));
}

body[data-theme="light"] .chat-closure-banner.closed {
  border-color: rgba(124, 163, 200, 0.5);
  background: linear-gradient(160deg, rgba(214, 232, 249, 0.98), rgba(200, 223, 245, 0.98));
}

body[data-theme="light"] .chat-closure-banner.write-locked .chat-closure-banner-timer {
  border-color: rgba(201, 151, 105, 0.52);
  background: linear-gradient(180deg, rgba(252, 239, 225, 0.94), rgba(247, 227, 203, 0.9));
  color: #7d4e26;
}

body[data-theme="light"] .chat-closure-banner.write-allowed .chat-closure-banner-timer {
  border-color: rgba(104, 168, 128, 0.52);
  background: linear-gradient(180deg, rgba(235, 248, 240, 0.92), rgba(223, 242, 230, 0.88));
  color: #1f6841;
}

body[data-theme="light"] .chat-closure-banner.closed .chat-closure-banner-title {
  color: #205283;
}

body[data-theme="light"] .chat-closure-banner.closed .chat-closure-banner-meta {
  color: #35638f;
}

.chat-list,
.chat-search-results,
.participant-list,
.forward-target-list,
.chat-profile-info-column,
.chat-profile-modal-card,
.chat-profile-members-list,
.group-manage-modal-card,
.chat-media-modal-card,
.chat-media-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(104, 156, 210, 0.52) rgba(10, 24, 39, 0.36);
}

.chat-list::-webkit-scrollbar,
.chat-search-results::-webkit-scrollbar,
.participant-list::-webkit-scrollbar,
.forward-target-list::-webkit-scrollbar,
.chat-profile-info-column::-webkit-scrollbar,
.chat-profile-modal-card::-webkit-scrollbar,
.chat-profile-members-list::-webkit-scrollbar,
.group-manage-modal-card::-webkit-scrollbar,
.chat-media-modal-card::-webkit-scrollbar,
.chat-media-content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.chat-list::-webkit-scrollbar-track,
.chat-search-results::-webkit-scrollbar-track,
.participant-list::-webkit-scrollbar-track,
.forward-target-list::-webkit-scrollbar-track,
.chat-profile-info-column::-webkit-scrollbar-track,
.chat-profile-modal-card::-webkit-scrollbar-track,
.chat-profile-members-list::-webkit-scrollbar-track,
.group-manage-modal-card::-webkit-scrollbar-track,
.chat-media-modal-card::-webkit-scrollbar-track,
.chat-media-content::-webkit-scrollbar-track {
  background: rgba(10, 24, 39, 0.36);
  border-radius: 999px;
}

.chat-list::-webkit-scrollbar-thumb,
.chat-search-results::-webkit-scrollbar-thumb,
.participant-list::-webkit-scrollbar-thumb,
.forward-target-list::-webkit-scrollbar-thumb,
.chat-profile-info-column::-webkit-scrollbar-thumb,
.chat-profile-modal-card::-webkit-scrollbar-thumb,
.chat-profile-members-list::-webkit-scrollbar-thumb,
.group-manage-modal-card::-webkit-scrollbar-thumb,
.chat-media-modal-card::-webkit-scrollbar-thumb,
.chat-media-content::-webkit-scrollbar-thumb {
  background: rgba(104, 156, 210, 0.52);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body[data-theme="light"] .chat-list,
body[data-theme="light"] .chat-search-results,
body[data-theme="light"] .participant-list,
body[data-theme="light"] .forward-target-list,
body[data-theme="light"] .chat-profile-info-column,
body[data-theme="light"] .chat-profile-modal-card,
body[data-theme="light"] .chat-profile-members-list,
body[data-theme="light"] .group-manage-modal-card,
body[data-theme="light"] .chat-media-modal-card,
body[data-theme="light"] .chat-media-content {
  scrollbar-color: rgba(67, 127, 196, 0.55) rgba(189, 211, 235, 0.45);
}

body[data-theme="light"] .left-pane-filters {
  background: var(--bg-panel);
}

body[data-theme="light"] .left-pane-filter-btn {
  border-color: rgba(126, 166, 205, 0.38);
  background: rgba(236, 245, 253, 0.92);
  color: #567792;
}

body[data-theme="light"] .left-pane-filter-btn:hover {
  background: rgba(223, 238, 251, 0.96);
  color: #294d72;
}

body[data-theme="light"] .left-pane-filter-btn.active {
  background: rgba(196, 224, 249, 0.95);
  border-color: rgba(102, 157, 211, 0.62);
  color: #214468;
  box-shadow: inset 0 0 0 1px rgba(150, 190, 228, 0.28);
}

body[data-theme="light"] .private-incoming-call-bar {
  border-bottom-color: rgba(120, 166, 209, 0.46);
  background: linear-gradient(180deg, rgba(224, 239, 252, 0.96), rgba(213, 232, 249, 0.96));
}

body[data-theme="light"] .private-incoming-call-label {
  color: #4f7698;
}

body[data-theme="light"] .private-incoming-call-caller {
  color: #1f476d;
}

body[data-theme="light"] .private-incoming-call-btn {
  border-color: rgba(118, 165, 210, 0.5);
  background: rgba(239, 247, 255, 0.95);
  color: #2a5379;
}

body[data-theme="light"] .private-incoming-call-btn.decline {
  border-color: rgba(201, 119, 138, 0.58);
  background: rgba(249, 227, 232, 0.92);
  color: #883b50;
}

body[data-theme="light"] .private-incoming-call-btn.accept {
  border-color: rgba(113, 176, 141, 0.62);
  background: rgba(222, 243, 231, 0.94);
  color: #245f3f;
}

body[data-theme="light"] .private-active-call-bar {
  border-bottom-color: rgba(120, 166, 209, 0.46);
  background: linear-gradient(180deg, rgba(221, 238, 252, 0.96), rgba(209, 231, 249, 0.96));
}

body[data-theme="light"] .private-active-call-label {
  color: #4e789f;
}

body[data-theme="light"] .private-active-call-caller {
  color: #1f466f;
}

body[data-theme="light"] .private-active-call-btn {
  border-color: rgba(118, 165, 210, 0.5);
  background: rgba(239, 247, 255, 0.95);
  color: #2a5379;
}

body[data-theme="light"] .private-active-call-btn.expand {
  border-color: rgba(110, 168, 218, 0.6);
  background: rgba(222, 239, 255, 0.95);
  color: #28597f;
}

body[data-theme="light"] .private-active-call-btn.hangup {
  border-color: rgba(201, 119, 138, 0.58);
  background: rgba(249, 227, 232, 0.92);
  color: #883b50;
}

body[data-theme="light"] .chat-list::-webkit-scrollbar-track,
body[data-theme="light"] .chat-search-results::-webkit-scrollbar-track,
body[data-theme="light"] .participant-list::-webkit-scrollbar-track,
body[data-theme="light"] .forward-target-list::-webkit-scrollbar-track,
body[data-theme="light"] .chat-profile-info-column::-webkit-scrollbar-track,
body[data-theme="light"] .chat-profile-modal-card::-webkit-scrollbar-track,
body[data-theme="light"] .chat-profile-members-list::-webkit-scrollbar-track,
body[data-theme="light"] .group-manage-modal-card::-webkit-scrollbar-track,
body[data-theme="light"] .chat-media-modal-card::-webkit-scrollbar-track,
body[data-theme="light"] .chat-media-content::-webkit-scrollbar-track {
  background: rgba(189, 211, 235, 0.45);
}

body[data-theme="light"] .chat-list::-webkit-scrollbar-thumb,
body[data-theme="light"] .chat-search-results::-webkit-scrollbar-thumb,
body[data-theme="light"] .participant-list::-webkit-scrollbar-thumb,
body[data-theme="light"] .forward-target-list::-webkit-scrollbar-thumb,
body[data-theme="light"] .chat-profile-info-column::-webkit-scrollbar-thumb,
body[data-theme="light"] .chat-profile-modal-card::-webkit-scrollbar-thumb,
body[data-theme="light"] .chat-profile-members-list::-webkit-scrollbar-thumb,
body[data-theme="light"] .group-manage-modal-card::-webkit-scrollbar-thumb,
body[data-theme="light"] .chat-media-modal-card::-webkit-scrollbar-thumb,
body[data-theme="light"] .chat-media-content::-webkit-scrollbar-thumb {
  background: rgba(67, 127, 196, 0.55);
}

.empty-chat-bubble {
  margin: auto;
  color: #d8e6f8;
  padding: 18px 26px;
  border: 1px solid rgba(124, 181, 236, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(92, 156, 216, 0.26), transparent 58%),
    rgba(20, 48, 77, 0.58);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

body[data-theme="light"] .empty-chat-bubble {
  color: #1d324d;
  border-color: rgba(87, 142, 200, 0.26);
  background:
    radial-gradient(circle at top left, rgba(137, 190, 242, 0.48), transparent 58%),
    rgba(233, 244, 255, 0.84);
  box-shadow: 0 18px 44px rgba(74, 104, 138, 0.16);
}

.message {
  align-self: flex-start;
  width: fit-content;
  max-width: min(72ch, 82%);
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(124, 166, 211, 0.32);
  background: rgba(28, 59, 93, 0.7);
  position: relative;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 200ms ease;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 100%;
}

.message-row.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(133, 188, 241, 0.4);
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: rgba(8, 31, 52, 0.76);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.message-row-avatar:hover {
  border-color: rgba(152, 202, 249, 0.76);
  box-shadow: 0 0 0 2px rgba(100, 173, 238, 0.22);
}

.message-row-avatar:focus-visible {
  outline: none;
  border-color: rgba(155, 206, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(111, 183, 248, 0.36);
}

.message-row-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.message-row-avatar.fallback {
  color: #e1f0ff;
  font-size: 12px;
  font-weight: 700;
}

.message.swipe-dragging {
  will-change: transform, box-shadow;
}

.message.reply-swipe-ready {
  border-color: rgba(128, 191, 255, 0.65);
  box-shadow: 0 0 0 1px rgba(120, 186, 255, 0.32), 0 10px 26px rgba(5, 16, 31, 0.36);
}

.message.own {
  align-self: flex-end;
  background: rgba(57, 117, 195, 0.6);
}

.message.message-system {
  align-self: center;
  max-width: min(84%, 560px);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(112, 160, 208, 0.34);
  background: rgba(19, 46, 73, 0.56);
}

.message-system-text {
  font-size: 12px;
  line-height: 1.35;
  color: #b9d8f6;
  text-align: center;
}

.message-single-media {
  max-width: min(88vw, 560px);
}

.message-single-media .message-media,
.message-single-media .message-video {
  width: auto;
  height: auto;
  max-width: min(74vw, 520px);
  max-height: min(66vh, 540px);
  object-fit: contain;
}

.message.search-highlight {
  box-shadow: 0 0 0 2px rgba(108, 178, 255, 0.74), 0 0 22px rgba(68, 145, 233, 0.38);
}

.message-day-separator {
  align-self: center;
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 6px 0 4px;
  pointer-events: none;
}

.message-day-separator-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(87, 132, 177, 0.28);
  background: rgba(18, 42, 67, 0.94);
  box-shadow: 0 10px 22px rgba(3, 10, 19, 0.2);
  color: #eef6ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.message.selection-enabled {
  cursor: pointer;
}

.message.selection-picked {
  box-shadow: 0 0 0 2px rgba(92, 163, 235, 0.62);
}

.message-select-mark {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(144, 193, 244, 0.82);
  background: rgba(12, 35, 57, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  color: #eff7ff;
  font-size: 12px;
  font-weight: 700;
}

.message.selection-enabled .message-select-mark {
  display: flex;
}

.message.selection-picked .message-select-mark {
  border-color: #5daeff;
  background: #2f7fd2;
}

body[data-theme="light"] .message {
  background: #fff;
}

body[data-theme="light"] .message-row-avatar {
  border-color: rgba(114, 167, 217, 0.46);
  background: rgba(236, 246, 255, 0.9);
}

body[data-theme="light"] .message-row-avatar.fallback {
  color: #3f6f9d;
}

body[data-theme="light"] .message.own {
  background: #e4f2ff;
}

body[data-theme="light"] .message.message-system {
  border-color: rgba(130, 168, 204, 0.42);
  background: rgba(208, 227, 245, 0.72);
}

body[data-theme="light"] .member-tag-badge {
  border-color: rgba(161, 132, 219, 0.62);
  background: rgba(214, 232, 249, 0.92);
  color: var(--text);
}

body[data-theme="light"] .message-system-text {
  color: #355d83;
}

body[data-theme="light"] .message.reply-swipe-ready {
  border-color: rgba(56, 129, 206, 0.58);
  box-shadow: 0 0 0 1px rgba(64, 140, 221, 0.28), 0 10px 24px rgba(63, 107, 156, 0.24);
}

body[data-theme="light"] .message.search-highlight {
  box-shadow: 0 0 0 2px rgba(42, 118, 204, 0.52), 0 0 18px rgba(49, 127, 214, 0.3);
}

body[data-theme="light"] .message-day-separator-chip {
  border-color: rgba(122, 159, 195, 0.42);
  background: rgba(225, 236, 247, 0.96);
  box-shadow: 0 10px 20px rgba(133, 162, 193, 0.2);
  color: #234364;
}

.message-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  padding-right: 0;
}

.message-head-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-tag-badge {
  display: inline-flex;
  align-items: center;
  max-width: min(180px, 100%);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(190, 161, 250, 0.56);
  background: rgba(16, 45, 72, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-sender-tag {
  margin-left: 0;
  transform: none;
  align-self: center;
}

.message-sender,
.message-time {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
}

.message-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  min-height: 14px;
}

.message-edited-mark {
  font-size: 11px;
  color: var(--muted);
}

.message-receipt {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: -0.02em;
}

.message-receipt.sent {
  color: #68bcff;
}

.message-receipt.read {
  color: #69db8b;
}

.message-actions-menu {
  position: absolute;
  top: var(--menu-top, 30px);
  left: var(--menu-left, 6px);
  right: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #122f4c;
  box-shadow: 0 14px 28px rgba(5, 14, 26, 0.46);
  min-width: 188px;
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 6;
  transform-origin: top left;
  animation: menu-pop-in 130ms ease-out both;
}

.message-action-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #deedff;
  text-align: left;
  font: inherit;
  padding: 8px 10px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.message-action-item:hover {
  background: rgba(101, 162, 225, 0.2);
}

.message-action-item.danger {
  color: #ffacc0;
}

.composer {
  --composer-control-height: 46px;
  border-top: 1px solid var(--line);
  padding: 10px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.channel-action-bar {
  appearance: none;
  width: 100%;
  border-top: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: #0f243a;
  color: #eef6ff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.channel-action-bar:hover {
  background: #14304c;
}

.channel-action-bar:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(128, 191, 255, 0.42);
}

.channel-action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.channel-action-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.channel-action-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.channel-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.channel-action-buttons .primary-btn,
.channel-action-buttons .ghost-btn {
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

.composer-reply {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 43, 72, 0.62);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.composer-reply-body {
  min-width: 0;
}

.composer-reply-title {
  color: #74bcff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.composer-reply-preview {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-reply-cancel {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.composer-reply-cancel:hover {
  background: var(--bg-hover);
}

.composer-link-preview {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 43, 72, 0.62);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.composer-link-preview-thumb {
  width: 62px;
  height: 62px;
  border-radius: 9px;
  border: 1px solid rgba(116, 165, 219, 0.35);
  background: rgba(9, 27, 44, 0.56);
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #d4e8ff;
  overflow: hidden;
}

.composer-link-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.composer-link-preview-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.composer-link-preview-title {
  color: #74bcff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-link-preview-meta {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-mention {
  grid-column: 1 / -1;
  border: 1px solid rgba(121, 176, 232, 0.34);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(14, 36, 56, 0.95), rgba(11, 29, 46, 0.95));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  min-height: 62px;
  max-height: 286px;
  box-shadow: 0 12px 24px rgba(4, 13, 23, 0.36);
}

.composer-mention-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(111, 164, 218, 0.2);
}

.composer-mention-title {
  color: #d8e9fb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.composer-mention-close {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(16, 36, 56, 0.76);
  color: #d5e7fa;
  cursor: pointer;
}

.composer-mention-close:hover {
  background: rgba(43, 78, 114, 0.86);
}

.composer-mention-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
}

.composer-mention-item {
  border: 0;
  margin: 0;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid rgba(101, 152, 205, 0.16);
  transition: background-color 140ms ease;
}

.composer-mention-item:last-child {
  border-bottom: 0;
}

.composer-mention-item:hover,
.composer-mention-item.active {
  background: rgba(60, 110, 159, 0.28);
}

.composer-mention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(116, 167, 221, 0.34);
  background: rgba(22, 52, 81, 0.84);
  color: #dbeeff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  overflow: hidden;
  user-select: none;
}

.composer-mention-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-mention-body {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.composer-mention-name {
  font-size: 17px;
  font-weight: 600;
  color: #eaf4ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-mention-meta {
  font-size: 14px;
  color: #7cb0e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-mention-empty {
  padding: 12px 10px 14px;
  color: var(--muted);
  font-size: 13px;
}

.jump-unread-btn {
  position: absolute;
  right: 18px;
  bottom: 92px;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(124, 170, 222, 0.28);
  background: rgba(18, 44, 70, 0.58);
  color: #e9f4ff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  z-index: 9;
  box-shadow: 0 12px 24px rgba(6, 15, 29, 0.36);
  transition: transform 150ms ease, background-color 180ms ease, box-shadow 200ms ease;
}

.jump-unread-btn:hover {
  background: rgba(38, 74, 110, 0.82);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 16px 30px rgba(6, 15, 29, 0.46);
}

body[data-theme="light"] .jump-unread-btn {
  background: rgba(227, 240, 255, 0.6);
  color: #1c3959;
}

body[data-theme="light"] .composer-mention {
  border-color: rgba(131, 173, 215, 0.45);
  background: linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(228, 240, 253, 0.98));
  box-shadow: 0 10px 22px rgba(41, 87, 129, 0.16);
}

body[data-theme="light"] .composer-mention-head {
  border-bottom-color: rgba(124, 162, 200, 0.28);
}

body[data-theme="light"] .composer-mention-title {
  color: #2f5a84;
}

body[data-theme="light"] .composer-mention-close {
  background: rgba(255, 255, 255, 0.86);
  color: #33597e;
}

body[data-theme="light"] .composer-mention-close:hover {
  background: rgba(225, 238, 252, 0.96);
}

body[data-theme="light"] .composer-mention-item {
  border-bottom-color: rgba(118, 163, 209, 0.26);
}

body[data-theme="light"] .composer-mention-item:hover,
body[data-theme="light"] .composer-mention-item.active {
  background: rgba(185, 214, 241, 0.52);
}

body[data-theme="light"] .composer-mention-avatar {
  border-color: rgba(112, 161, 209, 0.38);
  background: rgba(174, 207, 237, 0.74);
  color: #224d77;
}

body[data-theme="light"] .composer-mention-name {
  color: #1f4367;
}

body[data-theme="light"] .composer-mention-meta {
  color: #3f6b92;
}

.composer textarea {
  min-height: var(--composer-control-height);
  height: var(--composer-control-height);
  max-height: 180px;
  resize: none;
  overflow-y: hidden;
  padding-top: 11px;
  padding-bottom: 11px;
  box-sizing: border-box;
  align-self: center;
}

.composer-voice {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(120, 178, 236, 0.26);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 49, 79, 0.92), rgba(14, 40, 66, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.composer-voice.paused {
  border-color: rgba(230, 185, 118, 0.28);
  background: linear-gradient(180deg, rgba(56, 51, 34, 0.9), rgba(40, 34, 23, 0.88));
}

.composer-voice-delete,
.composer-voice-send {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(129, 181, 234, 0.3);
  background: rgba(10, 27, 43, 0.48);
  color: #eef7ff;
  font-size: 18px;
  cursor: pointer;
  transition: transform 140ms ease, background-color 160ms ease, border-color 160ms ease;
}

.composer-voice-delete:hover,
.composer-voice-send:hover {
  transform: translateY(-1px);
  background: rgba(31, 69, 105, 0.74);
}

.composer-voice-delete {
  color: #ffb5c0;
}

.composer-voice-send {
  color: #8fd2ff;
}

.composer-voice-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.composer-voice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-voice-status {
  color: #f0f7ff;
  font-size: 13px;
  font-weight: 700;
}

.composer-voice-time {
  color: #b9d9f8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
}

.composer-voice-wave {
  height: 34px;
  display: grid;
  grid-template-columns: repeat(42, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
}

.composer-voice-wave-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(140, 205, 255, 0.96), rgba(97, 156, 231, 0.7));
  transition: height 90ms linear, opacity 120ms ease;
}

.composer-voice-wave-bar.empty {
  opacity: 0.12;
}

.composer-voice-wave-bar.active {
  opacity: 1;
}

.composer-attach {
  position: relative;
  align-self: center;
  display: flex;
  align-items: center;
}

.composer-attach::before {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  bottom: 100%;
  height: 14px;
}

.attach-btn {
  width: var(--composer-control-height);
  height: var(--composer-control-height);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  align-self: center;
}

.attach-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto;
  pointer-events: none;
}

.attach-btn:hover {
  background: var(--bg-hover);
}

.composer-emoji-btn {
  font-size: 20px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.composer-emoji-btn.active {
  background: rgba(111, 190, 255, 0.16);
  border-color: rgba(121, 189, 247, 0.4);
  color: #d9edff;
}

.composer-voice-btn.active {
  background: rgba(119, 200, 255, 0.18);
  border-color: rgba(129, 208, 255, 0.52);
  color: #a6ddff;
}

.composer-voice-btn.paused {
  background: rgba(236, 188, 102, 0.16);
  border-color: rgba(233, 182, 98, 0.4);
  color: #ffd791;
}

.attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 190px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #10253a, #0f2a45);
  box-shadow: 0 16px 44px rgba(3, 11, 22, 0.55);
  padding: 8px;
  display: grid;
  gap: 6px;
  z-index: 10;
  transform-origin: bottom left;
  animation: menu-pop-in 140ms ease-out both;
}

.composer-attach:hover .attach-menu {
  display: grid !important;
}

.attach-menu-item {
  border: 0;
  text-align: left;
  border-radius: 10px;
  padding: 10px 12px;
  color: #e7f2ff;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.attach-menu-item:hover {
  background: rgba(117, 173, 231, 0.16);
}

.emoji-picker-panel {
  flex: 0 0 320px;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(13, 31, 48, 0.98), rgba(10, 25, 39, 0.98)),
    radial-gradient(circle at top right, rgba(88, 153, 214, 0.12), transparent 48%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.emoji-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(105, 153, 202, 0.18);
}

.emoji-picker-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #e7f3ff;
}

.emoji-picker-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 58, 0.7);
  color: var(--muted);
  cursor: pointer;
}

.emoji-picker-close-btn:hover {
  background: rgba(35, 66, 98, 0.88);
  color: var(--text);
}

.emoji-picker-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 0 10px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 38, 58, 0.76);
}

.emoji-picker-search input {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
}

.emoji-picker-search input:focus {
  outline: none;
  border-color: transparent;
}

.emoji-picker-search-ico {
  font-size: 14px;
  opacity: 0.8;
}

.emoji-picker-body {
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.emoji-picker-section {
  display: grid;
  gap: 10px;
}

.emoji-picker-section-title {
  color: #9cc6ee;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
}

.emoji-picker-item {
  min-width: 0;
  height: 36px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(16, 35, 53, 0.72);
  color: #f3f9ff;
  font-size: 23px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 120ms ease, background-color 160ms ease, border-color 160ms ease;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.emoji-picker-item:hover {
  transform: translateY(-1px);
  background: rgba(46, 80, 114, 0.92);
  border-color: rgba(116, 175, 234, 0.34);
}

.emoji-picker-item:focus {
  outline: 2px solid rgba(103, 175, 245, 0.55);
  outline-offset: 1px;
}

.emoji-picker-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-link {
  color: #9fd1ff;
  text-decoration: underline;
  text-decoration-color: rgba(161, 210, 255, 0.68);
  text-underline-offset: 2px;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

.message-link:hover {
  color: #d8ebff;
  text-decoration-color: rgba(216, 235, 255, 0.96);
}

.message-mention {
  color: #9ad7ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(154, 215, 255, 0.58);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}

.message-mention:hover {
  color: #d9f0ff;
  border-bottom-color: rgba(217, 240, 255, 0.94);
}

.message-mention:focus-visible {
  outline: 2px solid rgba(112, 185, 247, 0.55);
  outline-offset: 1px;
  border-radius: 3px;
}

.message-link-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 9px;
  width: min(680px, 100%);
  margin-top: 8px;
  border: 1px solid rgba(120, 171, 227, 0.4);
  border-radius: 13px;
  background: rgba(14, 37, 60, 0.5);
  padding: 10px;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 160ms ease, background-color 180ms ease, transform 140ms ease;
}

.message-link-preview:hover {
  border-color: rgba(144, 194, 245, 0.72);
  background: rgba(19, 47, 74, 0.66);
  transform: translateY(-1px);
}

.message-link-preview.loading {
  opacity: 0.9;
}

.message-link-preview-image {
  width: 100%;
  height: auto;
  max-height: min(500px, 58vh);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(118, 166, 219, 0.35);
  background: rgba(9, 27, 45, 0.52);
}

.message-link-preview-video {
  width: 100%;
  height: auto;
  max-height: min(500px, 58vh);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(118, 166, 219, 0.35);
  background: rgba(0, 0, 0, 0.24);
}

.message-link-preview-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.message-link-preview-site {
  font-size: 12px;
  color: #8ec9ff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-link-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #e4f1ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-link-preview-desc {
  font-size: 13px;
  color: #c2d9ef;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-invite-preview {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  max-width: 560px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(24, 66, 105, 0.76), rgba(15, 43, 72, 0.86));
}

.message-invite-preview.unavailable {
  opacity: 0.78;
}

.message-invite-preview-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #4fa8ff, #306dd5);
  color: #f3f9ff;
  font-size: 16px;
  font-weight: 800;
}

.message-invite-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-invite-preview-content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.message-invite-preview-label {
  color: #8fd0ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.message-invite-preview-title {
  color: #f0f7ff;
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-invite-preview-meta {
  color: #a9c7e4;
  font-size: 12px;
  font-weight: 600;
}

.message-invite-preview-join {
  border: 1px solid rgba(120, 190, 255, 0.56);
  border-radius: 12px;
  background: rgba(75, 159, 255, 0.2);
  color: #dff1ff;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 140ms ease;
}

.message-invite-preview-join:hover:not(:disabled) {
  border-color: rgba(156, 211, 255, 0.86);
  background: rgba(83, 169, 255, 0.34);
  color: #ffffff;
  transform: translateY(-1px);
}

.message-invite-preview-join:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}


.message-bundle {
  border-left: 3px solid rgba(117, 186, 252, 0.82);
  border-radius: 10px;
  background: rgba(17, 46, 76, 0.4);
  padding: 8px 10px;
  margin-bottom: 8px;
  display: grid;
  gap: 6px;
  transition: background-color 170ms ease, border-color 170ms ease, box-shadow 190ms ease;
}

.message-bundle.nested {
  margin: 6px 0 0;
  padding: 7px 9px;
  border-left-width: 2px;
  background: rgba(16, 42, 68, 0.46);
}

.message-bundle-head {
  font-size: 12px;
  color: #7fc2ff;
  font-weight: 700;
}

.message-bundle-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
}

.message-bundle.mode-reply .message-bundle-item {
  background: rgba(24, 63, 100, 0.52);
  border: 1px solid rgba(127, 194, 255, 0.26);
  border-radius: 10px;
  padding: 7px 8px;
  gap: 4px;
}

.message-bundle.mode-reply .message-bundle-item.clickable {
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 140ms ease;
}

.message-bundle.mode-reply .message-bundle-item.clickable:hover {
  background: rgba(31, 75, 116, 0.66);
  border-color: rgba(146, 208, 255, 0.52);
  transform: translateY(-1px);
}

.message-bundle.mode-forward .message-bundle-item {
  background: rgba(18, 50, 81, 0.42);
  border: 1px solid rgba(104, 168, 230, 0.2);
  border-radius: 10px;
  padding: 7px 8px;
}

.message-bundle.mode-reply .message-bundle-item.clickable:focus-visible {
  outline: 2px solid rgba(156, 214, 255, 0.9);
  outline-offset: 1px;
}

.message-bundle-sender {
  font-size: 12px;
  color: #c9e6ff;
  font-weight: 600;
}

.message-bundle-text {
  font-size: 13px;
  color: #d6e8fb;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.message-bundle-nested {
  margin-top: 4px;
  display: grid;
  gap: 6px;
}

.message-bundle .bundle-attachment {
  margin-top: 4px;
}

.message-bundle .bundle-media-image {
  width: min(240px, 56vw);
  max-width: 100%;
  max-height: min(180px, 32vh);
  border-radius: 10px;
}

.message-bundle .bundle-media-video {
  width: min(260px, 58vw);
  max-width: 100%;
  max-height: min(190px, 34vh);
  border-radius: 10px;
  cursor: pointer;
}

.message-bundle .bundle-document {
  width: min(280px, 60vw);
  max-width: 100%;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 10px;
}

.message-bundle .bundle-document .message-document-thumb,
.message-bundle .bundle-document .message-document-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.message-bundle .bundle-document .message-document-icon {
  font-size: 18px;
}

.message-bundle .bundle-document .message-document-name {
  font-size: 13px;
}

.message-bundle .bundle-document .message-document-meta {
  font-size: 11px;
}

.message-bundle .message-media-groups {
  width: min(320px, 100%);
  gap: 8px;
}

.message-bundle .message-media-group {
  padding: 6px;
  gap: 6px;
}

.message-bundle .message-media-group-items {
  gap: 6px;
}

.message-bundle .message-media-group-image {
  width: min(180px, 100%);
  max-height: min(170px, 24vh);
}

.message-bundle .message-media-group-video {
  width: min(220px, 100%);
  max-height: min(180px, 26vh);
}

.message-bundle .message-media-group-document {
  width: min(240px, 100%);
}

.message-bundle .message-media-stacks {
  width: min(320px, 100%);
  gap: 8px;
}

.message-bundle .message-media-stack {
  padding: 6px;
  gap: 6px;
  border-radius: 10px;
}

.message-bundle .message-media-stack-cover {
  max-height: min(190px, 28vh);
  border-radius: 8px;
}

.message-bundle .message-media-stack-badge {
  right: 10px;
  top: 10px;
}

.message-bundle .message-media-stack-title {
  font-size: 12px;
}

.message-bundle-text-toggle {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  padding: 3px 8px;
  background: rgba(83, 145, 210, 0.2);
  color: #b6dcff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 140ms ease;
}

.message-bundle-text-toggle:hover {
  background: rgba(100, 168, 238, 0.3);
  transform: translateY(-1px);
}

.message-bundle-toggle {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(91, 152, 214, 0.22);
  color: #bfe1ff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 140ms ease;
}

.message-bundle-toggle:hover {
  background: rgba(106, 171, 238, 0.34);
  transform: translateY(-1px);
}

.message-upload-state {
  width: min(300px, 70vw);
  max-width: 100%;
  display: grid;
  gap: 8px;
}

.message-upload-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.message-upload-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-upload-status {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.message-upload-progress {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(111, 161, 216, 0.27);
}

.message-upload-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #75c7ff);
}

.message-upload-cancel {
  justify-self: flex-start;
  border: 0;
  background: transparent;
  color: #8ed2ff;
  font: inherit;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}

.message-upload-cancel:hover {
  text-decoration: underline;
}

body[data-theme="light"] .message-upload-progress {
  background: rgba(36, 104, 178, 0.2);
}

body[data-theme="light"] .composer-reply {
  background: rgba(222, 237, 255, 0.68);
}

body[data-theme="light"] .composer-link-preview {
  background: rgba(222, 237, 255, 0.68);
}

body[data-theme="light"] .composer-link-preview-thumb {
  border-color: rgba(97, 152, 211, 0.38);
  background: rgba(194, 216, 243, 0.58);
  color: #24578f;
}

body[data-theme="light"] .message-bundle {
  background: rgba(207, 230, 255, 0.72);
}

body[data-theme="light"] .message-bundle.nested {
  background: rgba(191, 218, 247, 0.76);
}

body[data-theme="light"] .message-bundle.mode-reply .message-bundle-item {
  background: rgba(219, 236, 255, 0.88);
  border-color: rgba(91, 148, 206, 0.34);
}

body[data-theme="light"] .message-bundle.mode-forward .message-bundle-item {
  background: rgba(214, 232, 252, 0.92);
  border-color: rgba(103, 152, 204, 0.3);
}

body[data-theme="light"] .message-bundle.mode-reply .message-bundle-item.clickable:hover {
  background: rgba(206, 228, 252, 0.95);
  border-color: rgba(73, 135, 198, 0.58);
}

body[data-theme="light"] .message-bundle.mode-forward .message-bundle-item .message-bundle-sender {
  color: #24527e;
}

body[data-theme="light"] .message-bundle.mode-forward .message-bundle-item .message-bundle-text {
  color: #35587d;
}

body[data-theme="light"] .message-bundle.mode-reply .message-bundle-item.clickable:focus-visible {
  outline-color: rgba(47, 117, 186, 0.86);
}

body[data-theme="light"] .message-bundle-head {
  color: #1d74c4;
}

body[data-theme="light"] .message-bundle-sender {
  color: #204e7b;
}

body[data-theme="light"] .message-bundle-text {
  color: #2a4f77;
}

body[data-theme="light"] .message-bundle-text-toggle {
  background: rgba(72, 128, 188, 0.18);
  color: #1d5d98;
}

body[data-theme="light"] .message-bundle-toggle {
  background: rgba(72, 128, 188, 0.2);
  color: #1d5d98;
}

body[data-theme="light"] .message-link {
  color: #1b64ac;
  text-decoration-color: rgba(38, 105, 172, 0.48);
}

body[data-theme="light"] .message-link:hover {
  color: #0e4d8c;
  text-decoration-color: rgba(20, 91, 164, 0.72);
}

body[data-theme="light"] .message-mention {
  color: #1f5d98;
  border-bottom-color: rgba(31, 93, 152, 0.52);
}

body[data-theme="light"] .message-mention:hover {
  color: #0d4a84;
  border-bottom-color: rgba(13, 74, 132, 0.8);
}

body[data-theme="light"] .message-link-preview {
  border-color: rgba(82, 136, 196, 0.46);
  background: rgba(227, 239, 255, 0.84);
}

body[data-theme="light"] .message-link-preview:hover {
  border-color: rgba(64, 125, 191, 0.72);
  background: rgba(213, 232, 252, 0.95);
}

body[data-theme="light"] .message-link-preview-image {
  border-color: rgba(97, 152, 211, 0.38);
}

body[data-theme="light"] .message-link-preview-video {
  border-color: rgba(97, 152, 211, 0.38);
  background: rgba(197, 219, 244, 0.36);
}

body[data-theme="light"] .message-link-preview-site {
  color: #2a6cac;
}

body[data-theme="light"] .message-link-preview-title {
  color: #173a5f;
}

body[data-theme="light"] .message-link-preview-desc {
  color: #2f5479;
}

body[data-theme="light"] .message-invite-preview {
  background: linear-gradient(135deg, rgba(220, 238, 255, 0.96), rgba(199, 224, 249, 0.96));
}

body[data-theme="light"] .message-invite-preview-avatar {
  background: linear-gradient(145deg, #5aa8f5, #2f76d6);
  color: #ffffff;
}

body[data-theme="light"] .message-invite-preview-label {
  color: #246da7;
}

body[data-theme="light"] .message-invite-preview-title {
  color: #16395d;
}

body[data-theme="light"] .message-invite-preview-meta {
  color: #547696;
}

body[data-theme="light"] .message-invite-preview-join {
  border-color: rgba(55, 126, 196, 0.44);
  background: rgba(42, 125, 220, 0.14);
  color: #1f5e9f;
}

body[data-theme="light"] .message-invite-preview-join:hover:not(:disabled) {
  border-color: rgba(39, 117, 196, 0.72);
  background: rgba(42, 125, 220, 0.24);
  color: #164d84;
}

.message-media {
  display: block;
  width: min(420px, 70vw);
  max-height: min(360px, 48vh);
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
}

.message-media + .message-text {
  margin-top: 8px;
}

.message-media-groups {
  display: grid;
  gap: 10px;
  width: min(560px, 78vw);
  max-width: 100%;
}

.message-media-groups + .message-text {
  margin-top: 8px;
}

.message-media-group {
  border: 1px solid rgba(111, 160, 216, 0.3);
  border-radius: 10px;
  padding: 8px;
  background: rgba(11, 36, 60, 0.34);
  display: grid;
  gap: 8px;
}

.message-media-group-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #9ec7f2;
}

.message-media-group-items {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.message-media-group-item {
  max-width: 100%;
}

.message-media-group-image {
  width: min(220px, 42vw);
  max-height: min(200px, 32vh);
}

.message-media-group-video {
  width: min(260px, 48vw);
  max-height: min(220px, 34vh);
}

.message-media-group-document {
  width: min(280px, 52vw);
}

.message-media-stacks {
  display: grid;
  gap: 10px;
  width: min(420px, 70vw);
  max-width: 100%;
}

.message-media-stack {
  border: 1px solid rgba(111, 160, 216, 0.32);
  border-radius: 12px;
  background: rgba(11, 36, 60, 0.42);
  padding: 8px;
  display: grid;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}

.message-media-stack-cover {
  width: 100%;
  max-height: min(280px, 44vh);
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.message-media-stack-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(2, 14, 26, 0.72);
  border: 1px solid rgba(130, 180, 235, 0.58);
  font-size: 12px;
  font-weight: 700;
  color: #dff1ff;
}

.message-media-stack-title {
  font-size: 13px;
  font-weight: 600;
  color: #b7dbff;
}

.message .message-media,
.message .message-video,
.message .message-document,
.message .message-media-groups,
.message .message-media-stacks,
.message .message-media-stack,
.message .message-media-group-image,
.message .message-media-group-video,
.message .message-media-group-document {
  max-width: 100%;
}

.message-media.blurred {
  filter: blur(16px);
}

.message-media-stack-cover.blurred {
  filter: blur(16px);
}

body[data-theme="light"] .message-media-group {
  background: rgba(209, 228, 249, 0.6);
  border-color: rgba(83, 132, 189, 0.28);
}

body[data-theme="light"] .message-media-group-head {
  color: #24609a;
}

body[data-theme="light"] .message-media-stack {
  background: rgba(209, 228, 249, 0.62);
  border-color: rgba(83, 132, 189, 0.3);
}

body[data-theme="light"] .message-media-stack-badge {
  background: rgba(233, 244, 255, 0.88);
  color: #215684;
  border-color: rgba(80, 128, 180, 0.58);
}

body[data-theme="light"] .message-media-stack-title {
  color: #2c628f;
}

body[data-theme="light"] .composer-voice {
  background: linear-gradient(180deg, rgba(230, 241, 252, 0.98), rgba(219, 234, 249, 0.98));
  border-color: rgba(111, 160, 209, 0.34);
}

body[data-theme="light"] .composer-voice.paused {
  background: linear-gradient(180deg, rgba(251, 242, 224, 0.98), rgba(247, 233, 206, 0.98));
  border-color: rgba(208, 169, 104, 0.34);
}

body[data-theme="light"] .composer-voice-status {
  color: #204a73;
}

body[data-theme="light"] .composer-voice-time {
  color: #416b93;
}

body[data-theme="light"] .composer-voice-delete,
body[data-theme="light"] .composer-voice-send {
  background: rgba(243, 249, 255, 0.92);
  border-color: rgba(105, 159, 214, 0.32);
}

body[data-theme="light"] .composer-voice-wave-bar {
  background: linear-gradient(180deg, rgba(114, 176, 235, 0.76), rgba(83, 141, 207, 0.58));
}

body[data-theme="light"] .message-voice {
  background: linear-gradient(180deg, rgba(219, 236, 252, 0.96), rgba(209, 228, 248, 0.95));
  border-color: rgba(103, 153, 206, 0.3);
}

body[data-theme="light"] .message-voice-play {
  border-color: rgba(105, 160, 214, 0.28);
  background: linear-gradient(180deg, rgba(87, 158, 229, 0.94), rgba(75, 136, 214, 0.9));
}

body[data-theme="light"] .message-voice-slider {
  background: transparent;
}

body[data-theme="light"] .message-voice-slider-track {
  background: rgba(88, 142, 198, 0.18);
}

body[data-theme="light"] .message-voice-slider-fill {
  background: rgba(84, 154, 225, 0.96);
}

body[data-theme="light"] .message-voice-meta {
  color: #356086;
}

.message-video {
  display: block;
  width: min(460px, 72vw);
  max-height: min(380px, 56vh);
  border-radius: 12px;
  background: #031324;
}

.message-document {
  width: min(340px, 64vw);
  max-width: 100%;
  border: 1px solid rgba(137, 183, 233, 0.3);
  border-radius: 12px;
  background: rgba(18, 43, 69, 0.56);
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  transition: background-color 170ms ease, border-color 170ms ease, transform 150ms ease, box-shadow 200ms ease;
}

.message-document:hover {
  background: rgba(39, 80, 122, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(8, 22, 39, 0.28);
}

.message-document-photo {
  width: min(420px, 70vw);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
}

.message-document-photo-preview {
  display: block;
  width: 100%;
  max-height: min(360px, 48vh);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(153, 201, 255, 0.35);
  background: #031324;
}

.message-document-photo-info {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.message-document-photo .message-document-name {
  margin: 0;
}

.message-document-photo .message-document-meta {
  margin-top: 0;
}

.message-voice {
  width: fit-content;
  max-width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(122, 184, 242, 0.24);
  background: linear-gradient(180deg, rgba(34, 82, 127, 0.5), rgba(25, 64, 100, 0.46));
  box-sizing: border-box;
  overflow: hidden;
}

.message-voice.playing {
  border-color: rgba(138, 203, 255, 0.48);
  box-shadow: 0 0 0 1px rgba(124, 191, 250, 0.14);
}

.message-voice-play {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(141, 196, 247, 0.26);
  background: linear-gradient(180deg, rgba(85, 164, 236, 0.92), rgba(68, 125, 211, 0.9));
  color: #eff8ff;
  font-size: 15px;
  cursor: pointer;
  flex: 0 0 auto;
}

.message-voice-body {
  width: 204px;
  min-width: 204px;
  display: grid;
  gap: 8px;
}

.message-voice-slider {
  --progress: 0%;
  --progress-ratio: 0;
  --slider-side-gap: 8px;
  width: 100%;
  height: 20px;
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.message-voice-slider.locked {
  opacity: 0.62;
  cursor: default;
}

.message-voice-slider-track,
.message-voice-slider-fill {
  position: absolute;
  left: var(--slider-side-gap);
  right: var(--slider-side-gap);
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
}

.message-voice-slider-track {
  background: rgba(202, 228, 255, 0.2);
}

.message-voice-slider-fill {
  right: auto;
  width: var(--progress);
  background: rgba(141, 204, 255, 0.98);
}

.message-voice-slider-thumb {
  position: absolute;
  top: 50%;
  left: calc(var(--slider-side-gap) + (100% - (var(--slider-side-gap) * 2)) * var(--progress-ratio));
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(224, 243, 255, 0.92);
  border-radius: 50%;
  background: #f2fbff;
  box-shadow: 0 0 0 3px rgba(93, 163, 233, 0.26);
}

.message-voice-total {
  color: #8fbbe0;
}

.message-voice-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c7e2fa;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
}

.message-voice-size {
  position: relative;
  padding-left: 10px;
}

.message-voice-size::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: rgba(150, 205, 255, 0.75);
}

@keyframes menu-pop-in {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes overlay-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes modal-card-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes side-panel-slide-in {
  0% {
    opacity: 0;
    transform: translateX(-18px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.message-document-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(153, 201, 255, 0.35);
}

.message-document-icon {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(91, 148, 210, 0.35);
}

.message-document-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-document-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

body[data-theme="light"] .message-document {
  background: rgba(218, 233, 248, 0.86);
  border-color: rgba(101, 149, 202, 0.34);
}

body[data-theme="light"] .message-document:hover {
  background: rgba(204, 225, 247, 0.96);
}

body[data-theme="light"] .message-document-meta {
  color: #4d6f92;
}

body[data-theme="light"] .message-document-photo-preview {
  border-color: rgba(92, 141, 195, 0.35);
  background: rgba(220, 235, 250, 0.92);
}

.media-compose-card {
  width: min(860px, calc(100vw - 24px));
  height: min(96svh, 900px);
  max-height: min(96svh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 10px;
  overflow: hidden;
}

.media-compose-card.drop-file-active {
  border-color: #73bcff;
  box-shadow: 0 0 0 2px rgba(115, 188, 255, 0.42), 0 12px 28px rgba(6, 18, 33, 0.45);
}

.media-preview-wrap {
  width: 100%;
  min-height: clamp(180px, 24vh, 300px);
  height: 100%;
  max-height: none;
  border-radius: 12px;
  border: 1px solid #2d4a66;
  background: rgba(9, 25, 42, 0.55);
  padding: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.media-preview {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

#mediaPreviewImage.media-preview {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.media-preview.editable {
  cursor: crosshair;
}

.media-composer-thumbs {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 8px;
  scrollbar-gutter: stable both-edges;
}

.media-composer-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  border: 1px solid rgba(104, 155, 214, 0.38);
  background: rgba(13, 30, 49, 0.75);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: #cbe6ff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  position: relative;
  transition: border-color 150ms ease, transform 140ms ease, box-shadow 160ms ease;
}

.media-composer-thumb.active {
  border-color: #6fb4ff;
  box-shadow: 0 0 0 1px rgba(111, 180, 255, 0.38);
}

.media-composer-thumb:hover {
  transform: translateY(-1px);
}

.media-composer-thumbs.live-dragging {
  cursor: grabbing;
  user-select: none;
}

.media-composer-thumbs.live-dragging .media-composer-thumb {
  transition: transform 140ms ease, border-color 150ms ease, box-shadow 160ms ease;
}

.media-composer-thumbs.live-dragging .media-composer-thumb:hover {
  transform: none;
}

.media-composer-thumb.live-drag {
  z-index: 14;
  opacity: 0.96;
  cursor: grabbing;
  transition: none !important;
  box-shadow: 0 8px 24px rgba(4, 17, 31, 0.45), 0 0 0 1px rgba(111, 180, 255, 0.44);
}

.media-composer-thumb.drag-over-before::after,
.media-composer-thumb.drag-over-after::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: #75beff;
  box-shadow: 0 0 0 1px rgba(117, 190, 255, 0.28);
  pointer-events: none;
}

.media-composer-thumb.drag-over-before::after {
  left: 2px;
}

.media-composer-thumb.drag-over-after::after {
  right: 2px;
}

.media-composer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-composer-thumb.stack-thumb {
  position: relative;
}

.media-composer-thumb-stack-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  border-radius: 999px;
  border: 1px solid rgba(157, 204, 248, 0.62);
  background: rgba(9, 24, 40, 0.82);
  color: #d7efff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
}

.media-composer-thumb.has-doc-toggle {
  position: relative;
}

.media-composer-thumb-doc-toggle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(163, 204, 245, 0.65);
  background: rgba(10, 26, 43, 0.82);
  color: #d4edff;
  padding: 3px 6px;
  cursor: pointer;
}

.media-composer-thumb-doc-toggle.active {
  border-color: rgba(117, 200, 255, 0.9);
  color: #fff;
  background: rgba(38, 112, 190, 0.84);
}

.media-composer-thumb-remove {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid rgba(166, 208, 247, 0.68);
  background: rgba(10, 28, 46, 0.86);
  color: #dff2ff;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.media-composer-thumb.video::before {
  content: "▶";
  font-size: 20px;
  line-height: 1;
}

.media-option-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e3f0ff;
  font-size: 16px;
}

.media-option-row input {
  width: 20px;
  height: 20px;
}

.media-caption-wrap {
  margin-top: 0;
}

.media-caption-wrap textarea {
  margin-top: 6px;
  min-height: 72px;
  max-height: 140px;
  resize: vertical;
}

@media (max-width: 920px), (max-height: 860px) {
  .media-compose-card {
    width: calc(100vw - 16px);
    height: calc(100svh - 12px);
    max-height: calc(100svh - 12px);
    gap: 8px;
  }

  .media-composer-thumb {
    width: 82px;
    height: 82px;
  }
}

.image-editor-card {
  width: min(920px, calc(100% - 24px));
}

#imageEditorModal {
  z-index: 36;
}

.image-editor-stage {
  margin-top: 8px;
  border: 1px solid #2d4a66;
  border-radius: 12px;
  background: rgba(7, 23, 38, 0.78);
  padding: 10px;
  display: grid;
  place-items: center;
  overflow: auto;
}

.image-editor-surface {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.image-editor-canvas {
  display: block;
  max-width: min(100%, 820px);
  max-height: min(58vh, 560px);
  width: auto;
  height: auto;
  border-radius: 8px;
  background: #041525;
}

.image-editor-crop {
  position: absolute;
  border: 2px solid #72b7ff;
  box-shadow: 0 0 0 9999px rgba(1, 6, 12, 0.42);
  border-radius: 6px;
  touch-action: none;
  cursor: move;
}

.image-editor-crop.avatar-circle {
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  box-shadow: 0 0 0 9999px rgba(1, 6, 12, 0.52);
}

.image-editor-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #f5fbff;
  background: #2992ff;
  cursor: pointer;
  padding: 0;
}

.image-editor-handle.nw {
  left: -8px;
  top: -8px;
  cursor: nwse-resize;
}

.image-editor-handle.ne {
  right: -8px;
  top: -8px;
  cursor: nesw-resize;
}

.image-editor-handle.sw {
  left: -8px;
  bottom: -8px;
  cursor: nesw-resize;
}

.image-editor-handle.se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.image-editor-toolbar {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.image-editor-avatar-preview {
  margin-top: 12px;
  border: 1px solid rgba(110, 166, 223, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(11, 31, 50, 0.86), rgba(8, 24, 40, 0.88)),
    radial-gradient(circle at 76% 20%, rgba(118, 186, 245, 0.14), transparent 56%);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.image-editor-avatar-preview-title {
  font-size: 14px;
  font-weight: 700;
  color: #d7ecff;
}

.image-editor-avatar-preview-list {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.image-editor-avatar-preview-item {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.image-editor-avatar-preview-item canvas {
  display: block;
  border-radius: 999px;
  border: 1px solid rgba(123, 179, 236, 0.44);
  background: rgba(5, 20, 34, 0.68);
  box-shadow: inset 0 1px 0 rgba(169, 217, 255, 0.12);
}

.image-editor-avatar-preview-item.large canvas {
  width: 62px;
  height: 62px;
}

.image-editor-avatar-preview-item.medium canvas {
  width: 42px;
  height: 42px;
}

.image-editor-avatar-preview-item.small canvas {
  width: 30px;
  height: 30px;
}

.image-editor-avatar-preview-item span {
  font-size: 12px;
  font-weight: 600;
  color: #9fc4e4;
  text-align: center;
}

body[data-theme="light"] .image-editor-stage {
  border-color: rgba(95, 137, 184, 0.45);
  background: rgba(224, 238, 255, 0.82);
}

body[data-theme="light"] .image-editor-canvas {
  background: #cfe3f9;
}

body[data-theme="light"] .image-editor-crop {
  border-color: #2f86dc;
  box-shadow: 0 0 0 9999px rgba(20, 44, 72, 0.22);
}

body[data-theme="light"] .image-editor-crop.avatar-circle {
  box-shadow: 0 0 0 9999px rgba(25, 52, 84, 0.3);
}

body[data-theme="light"] .image-editor-avatar-preview {
  border-color: rgba(123, 166, 205, 0.45);
  background:
    linear-gradient(180deg, rgba(232, 243, 255, 0.97), rgba(221, 236, 252, 0.97)),
    radial-gradient(circle at 76% 20%, rgba(114, 174, 229, 0.18), transparent 56%);
}

body[data-theme="light"] .image-editor-avatar-preview-title {
  color: #255584;
}

body[data-theme="light"] .image-editor-avatar-preview-item canvas {
  border-color: rgba(109, 160, 209, 0.5);
  background: rgba(244, 250, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-theme="light"] .image-editor-avatar-preview-item span {
  color: #3f6f9d;
}

.stack-editor-card {
  width: min(680px, calc(100% - 24px));
}

.stack-editor-card.drop-file-active {
  border-color: #73bcff;
  box-shadow: 0 0 0 2px rgba(115, 188, 255, 0.4), 0 12px 28px rgba(6, 18, 33, 0.42);
}

.stack-editor-list {
  margin-top: 10px;
  border: 1px solid #2d4a66;
  border-radius: 12px;
  background: rgba(9, 25, 42, 0.45);
  min-height: 140px;
  max-height: min(44vh, 420px);
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.stack-editor-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 8px;
}

.stack-editor-item {
  border: 1px solid rgba(109, 160, 218, 0.32);
  border-radius: 10px;
  background: rgba(13, 34, 55, 0.58);
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px;
  transition: transform 140ms ease, border-color 150ms ease, box-shadow 160ms ease, background-color 160ms ease;
  cursor: grab;
  touch-action: none;
  -webkit-user-drag: none;
}

.stack-editor-list.live-dragging {
  cursor: grabbing;
  user-select: none;
}

.stack-editor-list.live-dragging .stack-editor-item {
  transition: transform 140ms ease, border-color 150ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.stack-editor-item.live-drag {
  z-index: 8;
  opacity: 0.96;
  cursor: grabbing;
  transition: none !important;
  box-shadow: 0 10px 24px rgba(4, 17, 31, 0.45), 0 0 0 1px rgba(111, 180, 255, 0.42);
}

.stack-editor-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(6, 22, 37, 0.62);
  -webkit-user-drag: none;
  user-select: none;
}

.stack-editor-name {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-editor-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stack-editor-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(112, 166, 226, 0.4);
  background: rgba(16, 42, 67, 0.72);
  color: #cbe6ff;
  cursor: pointer;
  padding: 0;
}

.stack-editor-tools {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stack-editor-tools-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.stack-editor-tools-left .ghost-btn.small {
  white-space: nowrap;
}

.stack-editor-sort-reset-btn {
  min-width: 34px;
  width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stack-editor-sort-reset-ico {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 220ms ease;
}

.stack-editor-sort-reset-btn.has-undo .stack-editor-sort-reset-ico {
  transform: rotate(180deg);
}

.stack-editor-limit {
  color: var(--muted);
  font-size: 12px;
}

.stack-editor-pool-list {
  margin-top: 10px;
  border: 1px solid rgba(83, 124, 164, 0.34);
  border-radius: 12px;
  background: rgba(8, 22, 37, 0.36);
  min-height: 56px;
  max-height: min(28vh, 240px);
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.stack-editor-pool-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 2px;
}

.stack-editor-pool-item {
  border: 1px solid rgba(98, 145, 194, 0.28);
  border-radius: 10px;
  background: rgba(13, 34, 55, 0.5);
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
}

.stack-editor-pool-check-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.stack-editor-pool-check {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.stack-editor-pool-add {
  border-radius: 8px;
  border: 1px solid rgba(110, 167, 226, 0.45);
  background: rgba(17, 47, 77, 0.72);
  color: #d6efff;
  font-size: 12px;
  padding: 5px 8px;
  cursor: pointer;
}

.stack-editor-pool-bulk {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.stack-editor-pool-bulk .ghost-btn.small,
.stack-editor-pool-bulk .primary-btn.small {
  white-space: nowrap;
}

body[data-theme="light"] .stack-editor-list {
  border-color: rgba(95, 137, 184, 0.45);
  background: rgba(224, 238, 255, 0.72);
}

body[data-theme="light"] .stack-editor-item {
  border-color: rgba(98, 143, 193, 0.34);
  background: rgba(214, 232, 251, 0.7);
}

body[data-theme="light"] .stack-editor-item.live-drag {
  box-shadow: 0 8px 20px rgba(72, 112, 156, 0.26), 0 0 0 1px rgba(55, 124, 195, 0.35);
}

body[data-theme="light"] .stack-editor-icon-btn {
  background: rgba(230, 241, 255, 0.95);
  border-color: rgba(86, 128, 177, 0.48);
  color: #2a5e8f;
}

body[data-theme="light"] .stack-editor-pool-list {
  border-color: rgba(95, 137, 184, 0.42);
  background: rgba(227, 240, 255, 0.78);
}

body[data-theme="light"] .stack-editor-pool-item {
  border-color: rgba(95, 137, 184, 0.3);
  background: rgba(215, 234, 253, 0.74);
}

body[data-theme="light"] .stack-editor-pool-add {
  border-color: rgba(86, 128, 177, 0.48);
  background: rgba(233, 244, 255, 0.96);
  color: #2a5e8f;
}

body[data-theme="light"] .stack-editor-pool-check {
  accent-color: #2f6db0;
}

body[data-theme="light"] .stack-editor-sort-reset-btn {
  border-color: rgba(86, 128, 177, 0.48);
  background: rgba(233, 244, 255, 0.96);
  color: #2a5e8f;
}

body[data-theme="light"] .media-compose-card.drop-file-active,
body[data-theme="light"] .stack-editor-card.drop-file-active {
  border-color: rgba(67, 143, 219, 0.72);
  box-shadow: 0 0 0 2px rgba(67, 143, 219, 0.32), 0 10px 24px rgba(63, 107, 156, 0.22);
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 24px;
  overscroll-behavior: none;
}

.media-viewer.swipe-dragging .media-viewer-item,
.media-viewer.swipe-dragging .media-viewer-thumbs,
.media-viewer.swipe-dragging .media-viewer-overlay {
  will-change: transform;
}

.media-viewer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 20, 0.9);
}

.media-viewer-card {
  position: relative;
  width: min(1320px, calc(100vw - 64px));
  max-width: 100%;
  height: min(88dvh, calc(100dvh - 52px));
  max-height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(82, 122, 166, 0.45);
  background: #041426;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  touch-action: none;
  overscroll-behavior: contain;
  box-shadow: 0 26px 56px rgba(3, 12, 24, 0.52);
}

.media-viewer:not(.hidden) .media-viewer-overlay {
  animation: overlay-fade-in 170ms ease-out both;
}

.media-viewer:not(.hidden) .media-viewer-card {
  animation: modal-card-pop 190ms cubic-bezier(0.22, 0.78, 0.2, 1) both;
}

.media-viewer-close {
  display: none !important;
}

.media-viewer-item {
  width: 100%;
  height: 100%;
  object-fit: contain;
  grid-row: 1;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 2;
}

#mediaViewerImage.media-viewer-item {
  touch-action: none;
}

.media-viewer-item-secondary {
  pointer-events: none;
  z-index: 1;
}

.media-viewer-nav-zone {
  position: absolute;
  top: 0;
  bottom: calc(96px + env(safe-area-inset-bottom));
  width: min(132px, 14vw);
  border: 0;
  padding: 0;
  margin: 0;
  background: linear-gradient(90deg, rgba(6, 14, 24, 0.4), rgba(6, 14, 24, 0));
  color: #d8ebff;
  cursor: pointer;
  z-index: 6;
  display: grid;
  place-items: center;
  transition: background 140ms ease, color 140ms ease;
}

.media-viewer-nav-zone.prev {
  left: 0;
}

.media-viewer-nav-zone.next {
  right: 0;
  background: linear-gradient(270deg, rgba(6, 14, 24, 0.4), rgba(6, 14, 24, 0));
}

.media-viewer-nav-zone:hover {
  color: #fff;
}

.media-viewer-nav-arrow {
  font-size: 42px;
  line-height: 1;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.media-viewer-thumbs {
  grid-row: 2;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  min-height: 96px;
  border-top: 1px solid rgba(87, 127, 166, 0.4);
  background: rgba(8, 20, 35, 0.78);
  scrollbar-gutter: stable;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.media-viewer-thumbs.drag-hidden {
  opacity: 0;
  pointer-events: none;
}

.media-viewer-thumbs.zoom-hidden {
  display: none !important;
}

.media-viewer-thumb {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  border: 1px solid rgba(92, 139, 184, 0.5);
  background: rgba(12, 27, 44, 0.7);
  color: #d3ebff;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: border-color 150ms ease, transform 140ms ease;
}

.media-viewer-thumb.active {
  border-color: #83c3ff;
}

.media-viewer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-viewer-thumb.video::before {
  content: "▶";
  font-size: 24px;
  line-height: 1;
}

.media-viewer.switching .media-viewer-item,
.media-viewer.switching .media-viewer-thumbs {
  pointer-events: none;
}

body[data-theme="light"] .media-composer-thumb {
  background: rgba(228, 241, 255, 0.82);
  border-color: rgba(78, 126, 181, 0.38);
  color: #244f7b;
}

body[data-theme="light"] .media-composer-thumb.drag-over-before::after,
body[data-theme="light"] .media-composer-thumb.drag-over-after::after {
  background: #2b7ed0;
  box-shadow: 0 0 0 1px rgba(43, 126, 208, 0.2);
}

body[data-theme="light"] .media-composer-thumb.live-drag {
  box-shadow: 0 8px 18px rgba(72, 112, 156, 0.26), 0 0 0 1px rgba(55, 124, 195, 0.35);
}

body[data-theme="light"] .media-composer-thumb-stack-badge {
  background: rgba(237, 247, 255, 0.96);
  color: #2a5b88;
  border-color: rgba(78, 126, 181, 0.52);
}

body[data-theme="light"] .media-composer-thumb-doc-toggle {
  background: rgba(236, 246, 255, 0.95);
  color: #295784;
  border-color: rgba(78, 126, 181, 0.5);
}

body[data-theme="light"] .media-composer-thumb-doc-toggle.active {
  background: rgba(62, 132, 206, 0.92);
  color: #fff;
  border-color: rgba(50, 113, 180, 0.9);
}

body[data-theme="light"] .media-composer-thumb-remove {
  background: rgba(236, 246, 255, 0.96);
  color: #2a5e8f;
  border-color: rgba(86, 128, 177, 0.56);
}

body[data-theme="light"] .media-viewer-thumbs {
  background: rgba(237, 246, 255, 0.95);
  border-top-color: rgba(92, 137, 189, 0.3);
}

body[data-theme="light"] .media-viewer-thumb {
  background: rgba(231, 242, 255, 0.9);
  border-color: rgba(87, 130, 181, 0.4);
  color: #1f4f84;
}

body[data-theme="light"] .media-viewer-nav-zone {
  background: linear-gradient(90deg, rgba(217, 234, 250, 0.56), rgba(217, 234, 250, 0));
  color: #2e567f;
}

body[data-theme="light"] .media-viewer-nav-zone.next {
  background: linear-gradient(270deg, rgba(217, 234, 250, 0.56), rgba(217, 234, 250, 0));
}

.delete-message-card {
  width: min(420px, calc(100% - 24px));
}

.delete-message-hint {
  margin: 4px 0 0;
  color: #9abada;
  font-size: 14px;
}

.side-menu {
  position: fixed;
  inset: 0;
  z-index: 25;
}

.side-menu.dragging .side-menu-overlay,
.side-menu.dragging .side-menu-panel {
  animation: none !important;
  will-change: transform;
}

.side-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 20, 0.56);
}

.side-menu-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(320px, 90vw);
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.side-menu:not(.hidden) .side-menu-overlay {
  animation: overlay-fade-in 180ms ease-out both;
}

.side-menu:not(.hidden) .side-menu-panel {
  animation: side-panel-slide-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.menu-user-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-panel-2);
  margin-bottom: 6px;
}

.user-name {
  font-weight: 700;
}

.user-meta {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}

.menu-item-btn {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.menu-item-btn:hover {
  background: var(--bg-hover);
}

.side-menu-action {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.side-menu-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(72, 132, 190, 0.18);
  color: #9ecfff;
  font-size: 17px;
}

.side-menu-action-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.side-menu-action-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 700;
}

.side-menu-action-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.menu-item-btn.disabled {
  cursor: default;
  opacity: 0.7;
}

.menu-theme-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.theme-switch {
  position: relative;
  width: 46px;
  height: 26px;
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
}

.theme-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.theme-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(86, 133, 177, 0.42);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.theme-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(93, 126, 162, 0.6);
  background: #f7fbff;
  left: 2px;
  top: 2px;
  transition: transform 0.2s ease;
}

.theme-switch input:checked + .theme-slider {
  border-color: rgba(96, 160, 227, 0.65);
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
}

.theme-switch input:checked + .theme-slider::before {
  transform: translateX(22px);
}

.folder-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 32;
}

.folder-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 20, 0.58);
  backdrop-filter: blur(2px);
}

.folder-menu-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(398px, 94vw);
  overflow-y: auto;
  border-right: 1px solid rgba(69, 110, 151, 0.46);
  background: linear-gradient(180deg, #172638, #101d2b 54%, #0d1825);
  color: #edf6ff;
  box-shadow: 18px 0 42px rgba(3, 10, 20, 0.38);
  animation: side-panel-slide-in 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.folder-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
}

.folder-menu-kicker {
  color: #69baff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.folder-menu-head h3 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.1;
}

.folder-menu-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(131, 176, 222, 0.35);
  border-radius: 12px;
  background: rgba(12, 30, 48, 0.72);
  color: #d8ecff;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.folder-menu-close:hover {
  background: rgba(28, 61, 92, 0.76);
}

.folder-menu-hero {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 28px 22px;
  background: rgba(31, 47, 65, 0.72);
  text-align: center;
}

.folder-menu-hero-icon {
  font-size: 62px;
  line-height: 1;
  filter: drop-shadow(0 14px 18px rgba(4, 12, 21, 0.28));
}

.folder-menu-hero p {
  margin: 0;
  color: #9db5cc;
  font-size: 14px;
  line-height: 1.45;
  max-width: 270px;
}

.folder-menu-section {
  display: grid;
  gap: 4px;
  padding: 14px 22px;
}

.folder-menu-section-title {
  margin-bottom: 8px;
  color: #72c3ff;
  font-size: 15px;
  font-weight: 700;
}

.folder-menu-folder-list {
  display: grid;
  gap: 4px;
}

.folder-menu-row,
.folder-menu-recommendation {
  min-height: 52px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 12px;
  padding: 7px 6px;
}

.folder-menu-row:hover,
.folder-menu-recommendation:hover {
  background: rgba(44, 74, 105, 0.32);
}

.folder-menu-row-icon {
  color: #55aef2;
  font-size: 19px;
  text-align: center;
}

.folder-menu-row-body {
  min-width: 0;
}

.folder-menu-row-title {
  color: #eef7ff;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.22;
}

.folder-menu-row-meta,
.folder-menu-note {
  color: #8ea8c3;
  font-size: 13px;
  line-height: 1.35;
}

.folder-menu-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8fa9c2;
  cursor: pointer;
}

.folder-menu-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.folder-menu-edit-btn:hover {
  background: rgba(105, 174, 242, 0.14);
  color: #9cd0ff;
}

.folder-menu-delete-btn:hover {
  background: rgba(255, 110, 138, 0.16);
  color: #ff9daf;
}

.folder-menu-empty {
  min-height: 52px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(125, 169, 210, 0.24);
  border-radius: 12px;
  color: #8ea8c3;
  font-size: 13px;
  font-weight: 700;
}

.folder-menu-add-btn,
.folder-menu-pill-btn {
  border: 0;
  border-radius: 999px;
  background: rgba(68, 151, 230, 0.28);
  color: #9ed3ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.folder-menu-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  justify-self: start;
  min-height: 42px;
  padding: 0 8px;
  background: transparent;
}

.folder-menu-add-btn span:first-child {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #4aa1ea;
  color: #fff;
}

.folder-menu-recommendation {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 6px;
}

.folder-menu-pill-btn {
  min-width: 98px;
  min-height: 34px;
  padding: 0 16px;
  background: linear-gradient(145deg, #4a9fff, #2f75d6);
  color: #fff;
}

.folder-menu-divider {
  height: 8px;
  background: rgba(29, 45, 62, 0.86);
  border-top: 1px solid rgba(81, 119, 158, 0.18);
  border-bottom: 1px solid rgba(81, 119, 158, 0.18);
}

.folder-menu-toggle-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
}

.folder-menu-note {
  padding: 0 22px 14px;
}

.folder-menu-radio-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #edf6ff;
  font-size: 15px;
}

.folder-menu-radio-row input {
  width: 20px;
  height: 20px;
  accent-color: #5aa8f5;
}

body[data-theme="light"] .side-menu-action-icon {
  background: rgba(60, 135, 210, 0.12);
  color: #2d72b3;
}

body[data-theme="light"] .folder-menu-overlay {
  background: rgba(80, 100, 120, 0.34);
}

body[data-theme="light"] .folder-menu-panel {
  border-color: rgba(168, 192, 217, 0.76);
  background: linear-gradient(180deg, #f5faff, #edf5ff 55%, #e8f1fc);
  color: #18334e;
  box-shadow: 18px 0 42px rgba(74, 105, 139, 0.24);
}

body[data-theme="light"] .folder-menu-kicker,
body[data-theme="light"] .folder-menu-section-title {
  color: #2473b8;
}

body[data-theme="light"] .folder-menu-close {
  border-color: rgba(114, 158, 202, 0.46);
  background: rgba(229, 241, 253, 0.92);
  color: #23496d;
}

body[data-theme="light"] .folder-menu-hero {
  background: rgba(216, 232, 248, 0.82);
}

body[data-theme="light"] .folder-menu-hero p,
body[data-theme="light"] .folder-menu-row-meta,
body[data-theme="light"] .folder-menu-note {
  color: #58728d;
}

body[data-theme="light"] .folder-menu-row-title,
body[data-theme="light"] .folder-menu-radio-row {
  color: #18334e;
}

body[data-theme="light"] .folder-menu-empty {
  border-color: rgba(96, 145, 193, 0.32);
  color: #607e9b;
  background: rgba(234, 244, 254, 0.62);
}

body[data-theme="light"] .folder-menu-delete-btn:hover {
  background: rgba(217, 68, 99, 0.12);
  color: #bb3655;
}

body[data-theme="light"] .folder-menu-edit-btn:hover {
  background: rgba(64, 136, 210, 0.14);
  color: #2d72b3;
}

body[data-theme="light"] .folder-menu-row:hover,
body[data-theme="light"] .folder-menu-recommendation:hover {
  background: rgba(201, 224, 247, 0.64);
}

body[data-theme="light"] .folder-menu-divider {
  background: rgba(210, 226, 242, 0.9);
  border-color: rgba(174, 200, 224, 0.72);
}

.modal.folder-create-modal {
  z-index: 34;
}

.modal.folder-delete-modal {
  z-index: 35;
}

.folder-create-card {
  width: min(540px, calc(100% - 28px));
}

.folder-create-field {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
  color: #9eb8d2;
  font-size: 13px;
  font-weight: 700;
}

.folder-create-field input {
  height: 44px;
  border: 1px solid rgba(124, 169, 214, 0.42);
  border-radius: 12px;
  background: rgba(7, 21, 36, 0.38);
  color: #edf6ff;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.folder-create-field input:focus {
  border-color: #64b7ff;
  box-shadow: 0 0 0 3px rgba(85, 171, 246, 0.16);
}

body[data-theme="light"] .folder-create-field {
  color: #59738e;
}

body[data-theme="light"] .folder-create-field input {
  border-color: rgba(116, 158, 198, 0.5);
  background: rgba(248, 252, 255, 0.96);
  color: #17324d;
}

.folder-create-picker {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.folder-create-picker-title {
  color: #d9ecff;
  font-size: 14px;
  font-weight: 800;
}

.folder-create-chat-list {
  max-height: min(340px, 42vh);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(103, 151, 197, 0.34);
  border-radius: 16px;
  background: rgba(5, 18, 32, 0.26);
}

.folder-create-chat-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(111, 162, 213, 0.24);
  border-radius: 14px;
  background: rgba(13, 35, 55, 0.58);
  color: #eef7ff;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.folder-create-chat-row:hover {
  border-color: rgba(120, 185, 247, 0.48);
  background: rgba(26, 57, 87, 0.72);
  transform: translateY(-1px);
}

.folder-create-chat-row:has(.folder-create-chat-checkbox:checked) {
  border-color: rgba(95, 178, 255, 0.58);
  background: linear-gradient(135deg, rgba(38, 91, 141, 0.78), rgba(21, 62, 101, 0.76));
}

.folder-create-chat-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #58a8f5;
}

.folder-create-chat-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #4da1f2, #346eaf);
  color: #f2f8ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.folder-create-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.folder-create-chat-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.folder-create-chat-title {
  min-width: 0;
  overflow: hidden;
  color: #f1f8ff;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-create-chat-meta {
  min-width: 0;
  overflow: hidden;
  color: #8fb2d0;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-create-chat-empty {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(116, 163, 211, 0.34);
  border-radius: 14px;
  color: #94adc8;
  font-size: 14px;
}

body[data-theme="light"] .folder-create-picker-title {
  color: #244a70;
}

body[data-theme="light"] .folder-create-chat-list {
  border-color: rgba(116, 158, 198, 0.44);
  background: rgba(236, 246, 255, 0.68);
}

body[data-theme="light"] .folder-create-chat-row {
  border-color: rgba(130, 169, 207, 0.34);
  background: rgba(249, 253, 255, 0.86);
  color: #1e3c5a;
}

body[data-theme="light"] .folder-create-chat-row:hover {
  border-color: rgba(77, 139, 199, 0.52);
  background: rgba(224, 239, 253, 0.92);
}

body[data-theme="light"] .folder-create-chat-row:has(.folder-create-chat-checkbox:checked) {
  border-color: rgba(62, 135, 205, 0.58);
  background: linear-gradient(135deg, rgba(209, 232, 253, 0.98), rgba(190, 219, 247, 0.92));
}

body[data-theme="light"] .folder-create-chat-title {
  color: #163653;
}

body[data-theme="light"] .folder-create-chat-meta {
  color: #617f9c;
}

body[data-theme="light"] .folder-create-chat-empty {
  border-color: rgba(103, 150, 197, 0.38);
  color: #607d98;
  background: rgba(248, 252, 255, 0.72);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

#channelDeleteModal {
  z-index: 35;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 19, 33, 0.65);
}

.modal-card {
  position: relative;
  width: min(560px, calc(100% - 24px));
  border-radius: 16px;
  border: 1px solid #2d4662;
  background: linear-gradient(160deg, #10253a, #152d46);
  color: #d7e6f8;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(5, 13, 24, 0.6);
}

.modal:not(.hidden) .modal-overlay {
  animation: overlay-fade-in 170ms ease-out both;
}

.modal:not(.hidden) .modal-card {
  animation: modal-card-pop 200ms cubic-bezier(0.22, 0.78, 0.2, 1) both;
}

.create-entry-modal-card {
  width: min(420px, calc(100% - 24px));
}

.create-entry-list {
  display: grid;
  gap: 10px;
}

.create-entry-list .menu-item-btn {
  width: 100%;
  font-size: 16px;
}

.invite-preview-card {
  width: min(420px, calc(100% - 24px));
  overflow: hidden;
}

.invite-preview-head {
  padding-bottom: 12px;
}

.invite-preview-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(122, 166, 205, 0.26);
  background: linear-gradient(145deg, rgba(22, 57, 88, 0.76), rgba(11, 32, 52, 0.72));
}

.invite-preview-avatar {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #eff7ff;
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(145deg, #58a7ee, #2b6eae);
  box-shadow: 0 16px 30px rgba(2, 12, 24, 0.35);
}

.invite-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invite-preview-info {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.invite-preview-title {
  color: #f0f7ff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.invite-preview-meta {
  color: #9fc5e8;
  font-size: 14px;
  font-weight: 600;
}

.invite-preview-actions {
  margin-top: 18px;
}

.create-channel-modal-card {
  width: min(520px, calc(100% - 24px));
  padding: 18px 18px 14px;
}

.create-channel-head-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.create-channel-avatar-picker {
  width: 72px;
  height: 72px;
  border-radius: 50%;
}

.create-channel-title-wrap {
  display: grid;
  gap: 8px;
}

.create-channel-title-label,
.create-channel-description-label {
  color: #8fb3d5;
  font-size: 16px;
  line-height: 1.2;
}

.create-channel-title-wrap input,
.create-channel-description-wrap textarea {
  width: 100%;
  border: 0;
  border-bottom: 2px solid rgba(119, 167, 211, 0.8);
  background: transparent;
  color: #e5f2ff;
  border-radius: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1.3;
}

.create-channel-title-wrap input {
  min-height: 36px;
}

.create-channel-description-wrap {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.create-channel-description-wrap textarea {
  resize: none;
  height: 21px;
  min-height: 21px;
  max-height: none;
  overflow: hidden;
  border-bottom-width: 1px;
  font-size: 16px;
}

.create-channel-title-wrap input:focus,
.create-channel-description-wrap textarea:focus {
  outline: none;
  border-color: #73bcff;
}

.create-channel-actions {
  margin-top: 16px;
}

.create-channel-actions .ghost-btn,
.create-channel-actions .primary-btn {
  min-height: 34px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: #89bce8;
  box-shadow: none;
}

.create-channel-actions .primary-btn {
  color: #67c0ff;
}

.create-channel-actions .ghost-btn:hover,
.create-channel-actions .primary-btn:hover {
  background: rgba(66, 112, 156, 0.24);
  color: #b7dbfa;
}

.private-call-modal {
  pointer-events: none;
  z-index: 36;
}

.private-call-modal .modal-overlay {
  display: none;
}

.private-call-card {
  width: min(440px, calc(100% - 24px));
  position: fixed;
  top: 88px;
  right: 24px;
  left: auto;
  margin: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.private-call-modal.private-call-minimized .private-call-card {
  display: none;
}

.private-call-head {
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: grab;
  user-select: none;
}

.private-call-head.dragging {
  cursor: grabbing;
}

.private-call-head h3 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-call-minimize-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(136, 182, 224, 0.42);
  background: rgba(20, 48, 76, 0.74);
  color: #d7ebff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.14s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.private-call-minimize-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(157, 201, 241, 0.62);
  background: rgba(30, 63, 95, 0.86);
}

.private-call-meta {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #9fbfdf;
}

.private-call-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.private-call-connection-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(121, 177, 226, 0.42);
  background: rgba(29, 64, 96, 0.58);
  color: #d9edff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.private-call-connection-badge.good {
  border-color: rgba(125, 203, 156, 0.55);
  background: rgba(24, 89, 59, 0.58);
  color: #d8ffe8;
}

.private-call-connection-badge.poor {
  border-color: rgba(222, 149, 109, 0.58);
  background: rgba(101, 54, 28, 0.58);
  color: #ffe8d8;
}

.private-call-timer {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 16px;
  color: #e0f0ff;
}

.private-call-quick-controls {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.private-call-quick-controls .ghost-btn {
  padding: 7px 10px;
}

.private-call-mute-btn.active {
  border-color: rgba(219, 153, 120, 0.58);
  background: rgba(95, 51, 29, 0.58);
  color: #ffe6d8;
}

.private-call-mic-meter-wrap {
  margin-top: 10px;
  display: grid;
  gap: 5px;
}

.private-call-mic-meter-label {
  font-size: 12px;
  color: #9ebfdf;
}

.private-call-mic-meter-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(115, 162, 205, 0.34);
  background: rgba(18, 45, 70, 0.5);
  overflow: hidden;
}

.private-call-mic-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(95, 170, 233, 0.94), rgba(128, 219, 170, 0.92));
  transition: width 120ms linear;
}

.private-call-device-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.private-call-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #a3c4e4;
}

.private-call-field select {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(111, 160, 206, 0.38);
  background: rgba(18, 44, 68, 0.66);
  color: #e3f1ff;
  padding: 0 10px;
}

.private-call-volume-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9fbfdf;
}

.private-call-volume-row input[type="range"] {
  height: 6px;
  padding: 0;
}

.private-call-volume-row b {
  min-width: 48px;
  text-align: right;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: #dfedff;
  font-size: 12px;
}

.private-call-log-wrap {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.private-call-log-title {
  font-size: 12px;
  color: #a3c4e4;
}

.private-call-log {
  max-height: 112px;
  overflow: auto;
  border: 1px solid rgba(113, 160, 204, 0.28);
  border-radius: 10px;
  background: rgba(12, 33, 53, 0.58);
  padding: 6px;
  display: grid;
  gap: 5px;
}

.private-call-log-item {
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(34, 74, 112, 0.32);
  border: 1px solid rgba(110, 156, 201, 0.2);
  color: #d8eafc;
  font-size: 12px;
}

.private-call-actions {
  margin-top: 14px;
}

.private-call-leave-btn {
  border-color: rgba(233, 130, 146, 0.5);
  color: #ffc8cf;
  background: rgba(88, 23, 35, 0.34);
}

.private-call-leave-btn:hover {
  border-color: rgba(244, 165, 178, 0.72);
  background: rgba(112, 32, 47, 0.52);
  color: #ffe4e8;
}

.private-call-decline-btn {
  border-color: rgba(233, 130, 146, 0.5);
  color: #ffc8cf;
  background: rgba(88, 23, 35, 0.34);
}

.private-call-decline-btn:hover {
  border-color: rgba(244, 165, 178, 0.72);
  background: rgba(112, 32, 47, 0.52);
  color: #ffe4e8;
}

.private-call-accept-btn {
  min-width: 120px;
}

.chat-profile-modal-card {
  --profile-surface-0: #081b2d;
  --profile-surface-1: #0d2a44;
  --profile-surface-2: #123654;
  --profile-accent: #68bbff;
  width: min(920px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  max-height: min(90vh, 920px);
  border-color: rgba(125, 174, 219, 0.4);
  background:
    radial-gradient(120% 65% at 12% -10%, rgba(88, 170, 240, 0.34) 0%, rgba(88, 170, 240, 0) 60%),
    linear-gradient(176deg, var(--profile-surface-2), var(--profile-surface-1) 48%, var(--profile-surface-0) 100%);
  box-shadow: 0 36px 90px rgba(4, 12, 21, 0.72);
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

.chat-profile-modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.1) 0 4px, transparent 5px),
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.07) 0 3px, transparent 4px);
  background-size: 116px 116px, 92px 92px;
  opacity: 0.4;
  mix-blend-mode: screen;
  z-index: 0;
}

.chat-profile-modal-card > * {
  position: relative;
  z-index: 1;
}

.chat-profile-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(173, 214, 250, 0.48);
  background: rgba(13, 37, 58, 0.76);
  color: #f1f8ff;
  cursor: pointer;
  z-index: 2;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}

.chat-profile-close-btn:hover {
  background: rgba(26, 62, 95, 0.92);
  border-color: rgba(192, 225, 255, 0.66);
  transform: translateY(-1px);
}

.chat-profile-top {
  padding: 12px 64px 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  background:
    radial-gradient(circle at 15% 16%, rgba(255, 255, 255, 0.08) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.07) 0 3px, transparent 4px),
    linear-gradient(162deg, #4b7ab0 0%, #3c6797 44%, #355d89 100%);
  background-size: 128px 128px, 122px 122px, auto;
  border-bottom: 1px solid rgba(152, 197, 239, 0.2);
}

.chat-profile-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(222, 241, 255, 0.36);
  background: linear-gradient(145deg, #3d7ec8, #5eb9f8);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #f3f9ff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(4, 18, 31, 0.3);
}

.chat-profile-avatar-btn {
  border: 0;
  cursor: pointer;
  padding: 0;
}

.chat-profile-avatar-btn:disabled {
  cursor: default;
  opacity: 0.9;
}

.chat-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-profile-name {
  margin-top: 0;
  max-width: 100%;
  font-size: clamp(26px, 3.8vw, 30px);
  font-weight: 700;
  color: #f3f9ff;
  line-height: 1.15;
  word-break: break-word;
  text-align: left;
  text-shadow: 0 1px 10px rgba(7, 24, 41, 0.3);
  grid-column: 2;
  grid-row: 1;
}

.chat-profile-status {
  margin-top: 0;
  font-size: 15px;
  color: rgba(236, 246, 255, 0.94);
  text-align: left;
  grid-column: 2;
  grid-row: 2;
}

.chat-profile-avatar-btn {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.chat-profile-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  padding: 12px 16px 14px;
  background: rgba(16, 48, 77, 0.72);
  border-bottom: 1px solid rgba(147, 187, 226, 0.22);
}

.chat-profile-quick-btn {
  min-height: 72px;
  border: 1px solid rgba(166, 205, 240, 0.34);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(26, 62, 95, 0.82), rgba(16, 43, 69, 0.82));
  color: #edf7ff;
  display: grid;
  gap: 5px;
  place-items: center;
  padding: 10px 8px 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.chat-profile-quick-btn.hidden {
  display: none;
}

.chat-profile-quick-btn.active {
  border-color: rgba(194, 228, 255, 0.64);
  background: linear-gradient(180deg, rgba(39, 82, 121, 0.9), rgba(24, 58, 90, 0.92));
}

.chat-profile-quick-btn.muted {
  border-color: rgba(126, 163, 196, 0.38);
  background: linear-gradient(180deg, rgba(17, 45, 70, 0.82), rgba(13, 36, 57, 0.84));
}

.chat-profile-quick-btn:disabled {
  opacity: 0.64;
  cursor: default;
}

#chatProfileMoreBtn:disabled {
  opacity: 1;
  border-color: rgba(166, 205, 240, 0.34);
  background: linear-gradient(180deg, rgba(26, 62, 95, 0.82), rgba(16, 43, 69, 0.82));
  color: #edf7ff;
}

.chat-profile-quick-ico {
  font-size: 19px;
  line-height: 1;
}

.chat-profile-quick-btn:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(203, 232, 255, 0.6);
}

.chat-profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.chat-profile-body.has-members {
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.92fr);
}

.chat-profile-info-column {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chat-profile-body.has-members .chat-profile-info-column {
  display: contents;
}

.chat-profile-members-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(144, 187, 226, 0.2);
  background: rgba(6, 27, 44, 0.9);
}

.chat-profile-members-column.hidden {
  display: none;
}

.chat-profile-info-block {
  margin: 0;
  padding: 16px 18px;
  background: rgba(7, 28, 47, 0.88);
  border-bottom: 1px solid rgba(141, 181, 221, 0.2);
}

.chat-profile-body.has-members .chat-profile-info-block {
  grid-column: 1 / -1;
  grid-row: 1;
}

.chat-profile-info-row {
  margin-top: 16px;
}

.chat-profile-main-line {
  color: #deefff;
  font-size: 19px;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.chat-profile-main-line.collapsible {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.chat-profile-main-line.collapsible.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.chat-profile-bio-toggle-btn {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #8fc9ff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-profile-bio-toggle-btn:hover {
  color: #b4ddff;
}

.chat-profile-main-line.copyable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(130, 193, 255, 0.48);
  text-underline-offset: 2px;
}

.chat-profile-main-line.copyable:hover {
  color: #9dd4ff;
  text-decoration-color: rgba(157, 212, 255, 0.9);
}

.chat-profile-main-line#chatProfileUsername {
  color: #9cd3ff;
}

.chat-profile-sub-line {
  margin-top: 4px;
  color: #93bce1;
  font-size: 15px;
  line-height: 1.2;
}

.chat-profile-type-line {
  margin-top: 16px;
  color: #bfdaf3;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chat-profile-stats {
  padding: 12px 12px 16px;
  background: rgba(5, 23, 39, 0.94);
  display: grid;
  gap: 6px;
}

.chat-profile-body.has-members .chat-profile-stats {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(143, 185, 224, 0.18);
}

.chat-profile-body.has-members .chat-profile-members-column {
  grid-column: 2;
  grid-row: 2;
}

.chat-profile-stat-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  color: #e5f3ff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 16px;
  background: rgba(14, 40, 64, 0.5);
  border: 1px solid rgba(117, 161, 202, 0.22);
  line-height: 1.25;
}

.chat-profile-stat-action {
  width: 100%;
  border: 0;
  margin: 0;
  border-radius: 12px;
  text-align: left;
  font: inherit;
  background: rgba(14, 40, 64, 0.5);
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.chat-profile-stat-action:hover {
  background: rgba(70, 143, 210, 0.24);
  border-color: rgba(158, 205, 244, 0.34);
}

.chat-profile-stat-action:focus-visible {
  outline: none;
  background: rgba(84, 156, 220, 0.24);
  box-shadow: inset 0 0 0 1px rgba(145, 201, 255, 0.65);
}

.chat-profile-stat-action.disabled,
.chat-profile-stat-action:disabled {
  cursor: default;
  opacity: 0.5;
  background: transparent;
  box-shadow: none;
}

.chat-profile-stat-ico {
  width: 24px;
  display: grid;
  place-items: center;
  color: #aad4f9;
  font-size: 17px;
  line-height: 1;
}

.chat-profile-members-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-top: 0;
  border-bottom: 1px solid rgba(147, 187, 226, 0.22);
  background: rgba(10, 34, 53, 0.88);
  flex: 0 0 auto;
}

.chat-profile-members-block.hidden {
  display: none;
}

.chat-profile-members-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f1f8ff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.03em;
}

.chat-profile-members-ico {
  color: #92c8f4;
  font-size: 18px;
  line-height: 1;
}

.chat-profile-members-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-profile-members-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(172, 211, 246, 0.35);
  background: rgba(17, 47, 74, 0.78);
  color: #dff0ff;
  font: inherit;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.chat-profile-members-btn.hidden {
  display: none;
}

.chat-profile-members-btn:hover {
  transform: translateY(-1px);
  background: rgba(34, 70, 103, 0.95);
  border-color: rgba(195, 226, 253, 0.56);
}

.chat-profile-members-btn.active {
  border-color: rgba(110, 184, 255, 0.72);
  background: rgba(63, 137, 207, 0.32);
  color: #ffffff;
}

.chat-profile-members-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  margin: 10px 10px 0;
  padding: 8px 10px;
  border: 1px solid rgba(147, 187, 226, 0.28);
  border-radius: 14px;
  background: rgba(8, 29, 47, 0.72);
  box-shadow: inset 0 0 0 1px rgba(10, 34, 53, 0.28);
  flex: 0 0 auto;
}

.chat-profile-members-search.hidden {
  display: none;
}

.chat-profile-members-search-ico {
  color: #8fc7f5;
  line-height: 1;
}

.chat-profile-members-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eef8ff;
  font: inherit;
  font-size: 15px;
}

.chat-profile-members-search input::placeholder {
  color: #82a9c9;
}

.chat-profile-members-search-clear {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: rgba(65, 112, 155, 0.36);
  color: #dcedfb;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.chat-profile-members-search-clear:hover {
  background: rgba(88, 146, 200, 0.48);
}

.chat-profile-members-list {
  display: grid;
  gap: 8px;
  padding: 10px 10px 12px;
  max-height: none;
  flex: 1;
  min-height: 0;
  align-content: start;
  grid-auto-rows: min-content;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  border-top: 0;
}

.chat-profile-members-list.hidden {
  display: none;
}

.chat-profile-member-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(115, 158, 198, 0.18);
  background: rgba(14, 41, 64, 0.5);
}

.chat-profile-member-row.clickable {
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.chat-profile-member-row.clickable:hover {
  background: rgba(70, 143, 210, 0.2);
  border-color: rgba(153, 198, 237, 0.35);
}

.chat-profile-member-row.clickable:focus-visible {
  outline: none;
  background: rgba(86, 161, 233, 0.22);
  box-shadow: inset 0 0 0 1px rgba(146, 203, 255, 0.62);
}

.chat-profile-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3c79bf, #58b0f2);
  color: #eff8ff;
  font-size: 18px;
  font-weight: 700;
}

.chat-profile-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-profile-member-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-profile-member-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-profile-member-name {
  min-width: 0;
  flex: 1 1 auto;
  color: #eff8ff;
  font-size: 19px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-profile-member-status {
  color: #8fb8dc;
  font-size: 14px;
  line-height: 1.2;
}

.chat-profile-member-status.online {
  color: #79d8ff;
}

.chat-profile-member-tag {
  justify-self: end;
}

.chat-profile-member-role {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(190, 161, 250, 0.56);
  background: rgba(16, 45, 72, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.chat-profile-member-role.owner {
  border-color: rgba(190, 161, 250, 0.56);
  color: #e1ccff;
}

.chat-profile-member-role.admin {
  border-color: rgba(118, 225, 153, 0.52);
  color: #a3eec0;
}

.chat-profile-member-remove-btn {
  border: 0;
  background: transparent;
  color: #7ebef7;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.chat-profile-member-row:hover .chat-profile-member-remove-btn,
.chat-profile-member-row:focus-within .chat-profile-member-remove-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.chat-profile-member-remove-btn:hover {
  color: #d3ebff;
  background: rgba(76, 124, 168, 0.35);
}

.chat-profile-members-empty {
  padding: 18px 14px;
  text-align: center;
  color: #98bedf;
  font-size: 15px;
  border-radius: 12px;
  border: 1px dashed rgba(118, 161, 199, 0.35);
  background: rgba(15, 40, 62, 0.45);
}

.chat-member-tag-card {
  width: min(460px, calc(100vw - 28px));
}

.chat-member-tag-field {
  margin-bottom: 10px;
}

.chat-member-tag-target {
  border: 1px solid rgba(115, 158, 198, 0.2);
  border-radius: 14px;
  background: rgba(14, 41, 64, 0.44);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.chat-member-tag-target-name {
  color: #eff8ff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.chat-member-tag-target-hint {
  margin-top: 4px;
  color: #90b8db;
  font-size: 13px;
  line-height: 1.4;
}

.chat-member-tag-note {
  margin-top: -4px;
  color: #88afcf;
  font-size: 13px;
  line-height: 1.4;
}

.chat-member-tag-toggle-row {
  margin-bottom: 10px;
}

.chat-profile-member-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 320px;
  max-width: calc(100vw - 16px);
  border: 1px solid rgba(154, 198, 236, 0.34);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(10, 31, 49, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 46px rgba(3, 12, 22, 0.54);
}

.chat-profile-more-menu {
  position: absolute;
  z-index: 1201;
  min-width: 240px;
  max-width: calc(100vw - 16px);
  border: 1px solid rgba(154, 198, 236, 0.34);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(10, 31, 49, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(3, 12, 22, 0.54);
}

.chat-profile-more-menu.hidden {
  display: none;
}

.chat-profile-more-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #eaf6ff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.chat-profile-more-item:hover {
  background: rgba(77, 151, 217, 0.22);
}

.chat-profile-more-item.danger {
  color: #ffb8c0;
}

.chat-profile-more-item.danger:hover {
  background: rgba(139, 46, 63, 0.28);
}

.contact-edit-card {
  width: min(520px, calc(100% - 28px));
  border-color: rgba(125, 174, 219, 0.4);
  background:
    radial-gradient(120% 70% at 16% -10%, rgba(75, 150, 220, 0.28) 0%, rgba(75, 150, 220, 0) 58%),
    linear-gradient(176deg, #123654 0%, #0d2a44 52%, #081b2d 100%);
  color: #eaf6ff;
  box-shadow: 0 28px 66px rgba(3, 12, 22, 0.62);
}

.contact-edit-card .modal-head h3 {
  color: #f3f9ff;
}

.contact-edit-layout {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.contact-edit-avatar-btn {
  width: 86px;
  height: 86px;
  border: 1px solid rgba(154, 198, 236, 0.42);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(44, 103, 160, 0.9), rgba(84, 169, 242, 0.92));
  color: #f4fbff;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(4, 18, 31, 0.32);
}

.contact-edit-avatar-btn:hover {
  border-color: rgba(192, 225, 255, 0.66);
}

.contact-edit-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.contact-edit-avatar-fallback {
  font-size: 30px;
  font-weight: 800;
}

.contact-edit-fields {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.contact-edit-field {
  display: grid;
  gap: 7px;
  color: #9dc6e8;
  font-size: 13px;
  font-weight: 600;
}

.contact-edit-field input,
.contact-edit-field textarea {
  width: 100%;
  border: 1px solid rgba(154, 198, 236, 0.38);
  border-radius: 12px;
  background: rgba(8, 27, 45, 0.74);
  color: #f3f9ff;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  outline: none;
}

.contact-edit-field textarea {
  min-height: 96px;
  line-height: 1.45;
}

.contact-edit-field input:focus,
.contact-edit-field textarea:focus {
  border-color: rgba(101, 183, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(83, 166, 240, 0.18);
}

.contact-edit-actions {
  margin-top: 18px;
}

.contact-delete-card {
  width: min(460px, calc(100% - 28px));
  border-color: rgba(233, 130, 146, 0.38);
  background:
    radial-gradient(120% 70% at 12% -12%, rgba(169, 76, 91, 0.28) 0%, rgba(169, 76, 91, 0) 60%),
    linear-gradient(176deg, #123654 0%, #0d2a44 52%, #081b2d 100%);
  color: #eaf6ff;
  box-shadow: 0 28px 66px rgba(3, 12, 22, 0.62);
}

.folder-delete-card {
  width: min(440px, calc(100% - 28px));
}

.contact-delete-card .modal-head h3 {
  color: #ffe4e8;
}

.contact-delete-text {
  margin: 0;
  color: #b6d4ed;
  line-height: 1.55;
}

.folder-delete-text {
  margin-bottom: 2px;
}

.contact-delete-text strong {
  color: #fff1f3;
}

.contact-delete-actions {
  margin-top: 20px;
}

.danger-btn {
  border: 1px solid rgba(238, 138, 154, 0.58);
  border-radius: 14px;
  background: linear-gradient(180deg, #e45d72, #bb334d);
  color: #fff7f8;
  font: inherit;
  font-weight: 800;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.16s ease, opacity 0.16s ease;
}

.danger-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.danger-btn:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
  filter: none;
}

.chat-profile-member-context-menu.hidden {
  display: none;
}

.chat-profile-member-context-item {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(123, 164, 203, 0.22);
  background: transparent;
  color: #eaf6ff;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.chat-profile-member-context-item:first-child {
  border-top: 0;
}

.chat-profile-member-context-item:hover {
  background: rgba(77, 151, 217, 0.22);
}

.chat-profile-member-context-item.danger {
  color: #ffc3c3;
}

.chat-profile-member-context-item.danger:hover {
  background: rgba(214, 80, 80, 0.24);
}

.chat-profile-member-context-ico {
  display: grid;
  place-items: center;
  color: #bcdfff;
}

.chat-profile-add-members-card {
  width: min(560px, calc(100% - 24px));
  max-height: min(88vh, 900px);
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(126, 174, 217, 0.42);
  background: linear-gradient(178deg, #0f2d49 0%, #0c243d 100%);
}

.chat-profile-add-members-card .modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(19, 51, 79, 0.98), rgba(14, 39, 62, 0.95));
  border-bottom: 1px solid rgba(144, 186, 224, 0.2);
}

.chat-profile-add-members-card .search-wrap {
  display: block;
  padding: 12px 16px 10px;
}

.chat-profile-add-members-card .search-wrap input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(129, 174, 214, 0.42);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(14, 43, 68, 0.7);
  color: #e7f3ff;
}

.chat-profile-add-members-card .search-wrap input:focus {
  border-color: rgba(154, 206, 251, 0.72);
  box-shadow: 0 0 0 2px rgba(87, 162, 232, 0.2);
}

.chat-profile-add-members-card .participant-list {
  max-height: min(58vh, 520px);
  margin: 0 16px 14px;
  border: 1px solid rgba(117, 161, 201, 0.3);
  border-radius: 14px;
  background: rgba(9, 31, 50, 0.62);
}

.chat-profile-add-members-card .participant-item {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(109, 150, 188, 0.24);
  transition: background-color 0.16s ease;
}

.chat-profile-add-members-card .participant-item:hover {
  background: rgba(73, 145, 211, 0.2);
}

.chat-profile-add-members-card .participant-item.selected {
  background: rgba(97, 179, 236, 0.28);
}

.chat-profile-add-members-card .participant-meta {
  color: #9ac4e6;
}

.chat-profile-add-members-card .modal-actions {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, rgba(14, 39, 62, 0.9), rgba(12, 34, 54, 0.98));
  border-top: 1px solid rgba(140, 183, 222, 0.2);
}

.chat-media-modal-card {
  width: min(420px, calc(100% - 24px));
  max-height: min(86vh, 940px);
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
}

.chat-media-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(147, 187, 226, 0.16);
  background: rgba(15, 40, 64, 0.98);
}

.chat-media-title {
  margin: 0;
  min-width: 0;
  flex: 1;
  color: #eaf4ff;
  font-size: 31px;
  line-height: 1.2;
}

.chat-media-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-media-head-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(145, 185, 225, 0.26);
  background: rgba(19, 48, 75, 0.72);
  color: #d6eaff;
  font: inherit;
  font-size: 19px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-media-head-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.chat-media-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(147, 187, 226, 0.12);
  background: rgba(10, 31, 49, 0.96);
}

.chat-media-search-wrap.hidden {
  display: none;
}

.chat-media-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(141, 181, 221, 0.34);
  background: rgba(21, 49, 77, 0.78);
  color: #deedff;
  padding: 0 10px;
}

.chat-media-search-ico {
  opacity: 0.86;
  font-size: 14px;
  line-height: 1;
}

.chat-media-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #deedff;
  font: inherit;
  font-size: 15px;
}

.chat-media-content {
  padding: 0 0 10px;
  max-height: min(74vh, 760px);
  overflow: auto;
  background: rgba(10, 31, 49, 0.98);
}

.chat-media-empty {
  padding: 18px 14px;
  color: #90b4d8;
  font-size: 16px;
}

.chat-media-group-title {
  padding: 12px 14px 8px;
  color: #eef7ff;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.chat-media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 0 14px 10px;
}

.chat-media-tile {
  position: relative;
  width: 100%;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: rgba(16, 44, 70, 0.85);
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.chat-media-tile img,
.chat-media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-media-video-duration {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(3, 11, 18, 0.82);
  color: #f2f8ff;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
}

.chat-media-files-list,
.chat-media-links-list,
.chat-media-voices-list {
  display: grid;
}

.chat-media-file-row,
.chat-media-link-row {
  border: 0;
  border-top: 1px solid rgba(141, 181, 221, 0.12);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  margin: 0;
  padding: 10px 14px;
  transition: background-color 0.16s ease;
}

.chat-media-file-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.chat-media-file-row:hover,
.chat-media-link-row:hover {
  background: rgba(86, 161, 233, 0.12);
}

.chat-media-voice-row {
  border-top: 1px solid rgba(141, 181, 221, 0.12);
  padding: 10px 14px;
}

.chat-media-voice-card {
  width: min(520px, 100%);
}

.chat-media-file-thumb {
  width: 58px;
  height: 58px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(35, 82, 124, 0.86);
  display: grid;
  place-items: center;
  color: #eef7ff;
  font-size: 19px;
  font-weight: 700;
}

.chat-media-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-media-file-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-media-file-name {
  color: #eef8ff;
  font-size: 16px;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-media-file-size,
.chat-media-file-date {
  color: #8fb4d6;
  font-size: 14px;
  line-height: 1.2;
}

.chat-media-link-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.chat-media-link-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: rgba(62, 117, 174, 0.9);
  color: #ecf7ff;
  font-size: 24px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.chat-media-link-body {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.chat-media-link-title {
  color: #eef8ff;
  font-size: 16px;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-media-link-summary {
  color: #c6dcf2;
  font-size: 14px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-media-link-url {
  color: #82c1ff;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-theme="light"] .chat-profile-modal-card {
  border-color: rgba(126, 165, 204, 0.58);
  background:
    radial-gradient(120% 65% at 12% -10%, rgba(133, 187, 238, 0.42) 0%, rgba(133, 187, 238, 0) 62%),
    linear-gradient(176deg, #e6f3ff 0%, #dcebfa 58%, #d4e5f6 100%);
  box-shadow: 0 30px 58px rgba(42, 79, 115, 0.26);
}

body[data-theme="light"] .chat-profile-top {
  background:
    radial-gradient(circle at 15% 16%, rgba(255, 255, 255, 0.45) 0 4px, transparent 5px),
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.4) 0 4px, transparent 5px),
    linear-gradient(162deg, #8db6de 0%, #7ca5ce 44%, #7398c2 100%);
  border-bottom-color: rgba(120, 158, 194, 0.38);
}

body[data-theme="light"] .chat-profile-name {
  color: #f7fbff;
}

body[data-theme="light"] .chat-profile-status {
  color: rgba(241, 250, 255, 0.95);
}

body[data-theme="light"] .chat-profile-quick-actions {
  background: rgba(205, 226, 245, 0.8);
  border-bottom-color: rgba(124, 163, 201, 0.32);
}

body[data-theme="light"] .chat-profile-quick-btn {
  border-color: rgba(132, 171, 208, 0.5);
  background: linear-gradient(180deg, rgba(230, 241, 253, 0.96), rgba(219, 233, 248, 0.95));
  color: #234869;
}

body[data-theme="light"] .chat-profile-quick-btn.active {
  border-color: rgba(88, 143, 197, 0.65);
  background: linear-gradient(180deg, rgba(204, 228, 249, 0.98), rgba(191, 218, 244, 0.97));
}

body[data-theme="light"] .chat-profile-quick-btn.muted {
  border-color: rgba(124, 162, 196, 0.5);
  background: linear-gradient(180deg, rgba(223, 237, 251, 0.96), rgba(214, 230, 247, 0.96));
}

body[data-theme="light"] #chatProfileMoreBtn:disabled {
  opacity: 1;
  border-color: rgba(132, 171, 208, 0.5);
  background: linear-gradient(180deg, rgba(230, 241, 253, 0.96), rgba(219, 233, 248, 0.95));
  color: #234869;
}

body[data-theme="light"] .chat-profile-info-block {
  background: rgba(238, 247, 255, 0.92);
  border-bottom-color: rgba(134, 172, 210, 0.26);
}

body[data-theme="light"] .chat-profile-main-line {
  color: #1f4569;
}

body[data-theme="light"] .chat-profile-bio-toggle-btn {
  color: #2b6ea4;
}

body[data-theme="light"] .chat-profile-bio-toggle-btn:hover {
  color: #1e5a8a;
}

body[data-theme="light"] .chat-profile-main-line#chatProfileUsername {
  color: #2a73af;
}

body[data-theme="light"] .chat-profile-sub-line {
  color: #567a9d;
}

body[data-theme="light"] .chat-profile-type-line {
  color: #3d6488;
}

body[data-theme="light"] .chat-profile-stats {
  background: rgba(233, 245, 255, 0.95);
}

body[data-theme="light"] .chat-profile-stat-row {
  color: #1f4467;
  background: rgba(224, 238, 252, 0.9);
  border-color: rgba(130, 169, 207, 0.34);
}

body[data-theme="light"] .chat-profile-stat-ico {
  color: #3f7bb1;
}

body[data-theme="light"] .chat-profile-stat-action:hover {
  background: rgba(184, 216, 247, 0.88);
  border-color: rgba(106, 152, 198, 0.5);
}

body[data-theme="light"] .chat-profile-stat-action:focus-visible {
  background: rgba(176, 211, 244, 0.9);
  box-shadow: inset 0 0 0 1px rgba(101, 149, 196, 0.58);
}

body[data-theme="light"] .chat-profile-members-block {
  background: rgba(230, 243, 255, 0.96);
  border-top-color: rgba(129, 168, 206, 0.3);
}

body[data-theme="light"] .chat-profile-members-title-wrap {
  color: #1f4467;
}

body[data-theme="light"] .chat-profile-members-ico {
  color: #3f7fb5;
}

body[data-theme="light"] .chat-profile-members-btn {
  border-color: rgba(129, 168, 205, 0.48);
  background: rgba(221, 236, 251, 0.96);
  color: #2d5e8b;
}

body[data-theme="light"] .chat-profile-members-btn:hover {
  background: rgba(203, 223, 244, 0.97);
  border-color: rgba(101, 148, 194, 0.58);
}

body[data-theme="light"] .chat-profile-members-btn.active {
  border-color: rgba(51, 126, 198, 0.58);
  background: rgba(181, 219, 252, 0.92);
  color: #123a5d;
}

body[data-theme="light"] .chat-profile-members-search {
  border-color: rgba(126, 167, 206, 0.46);
  background: rgba(239, 247, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

body[data-theme="light"] .chat-profile-members-search-ico {
  color: #3c75aa;
}

body[data-theme="light"] .chat-profile-members-search input {
  color: #1e3f60;
}

body[data-theme="light"] .chat-profile-members-search input::placeholder {
  color: #6684a2;
}

body[data-theme="light"] .chat-profile-members-search-clear {
  background: rgba(204, 226, 247, 0.96);
  color: #2b5b87;
}

body[data-theme="light"] .chat-profile-members-search-clear:hover {
  background: rgba(178, 212, 245, 0.98);
}

body[data-theme="light"] .chat-profile-members-list {
  background: rgba(233, 245, 255, 0.98);
  border-top-color: rgba(128, 168, 206, 0.24);
}

body[data-theme="light"] .chat-profile-members-column {
  border-left-color: rgba(128, 168, 206, 0.34);
  background: rgba(226, 242, 255, 0.86);
}

body[data-theme="light"] .chat-profile-member-row {
  background: rgba(222, 238, 252, 0.86);
  border-color: rgba(129, 169, 207, 0.32);
}

body[data-theme="light"] .chat-profile-member-row.clickable:hover {
  background: rgba(198, 223, 246, 0.92);
  border-color: rgba(103, 153, 201, 0.46);
}

body[data-theme="light"] .chat-profile-member-row.clickable:focus-visible {
  background: rgba(191, 218, 244, 0.94);
  box-shadow: inset 0 0 0 1px rgba(84, 138, 191, 0.55);
}

body[data-theme="light"] .chat-profile-member-name {
  color: #163b5d;
}

body[data-theme="light"] .chat-profile-member-status {
  color: #587da0;
}

body[data-theme="light"] .chat-profile-member-status.online {
  color: #1670b6;
}

body[data-theme="light"] .chat-profile-member-role {
  background: rgba(214, 232, 249, 0.92);
  border-color: rgba(161, 132, 219, 0.62);
  color: var(--text);
}

body[data-theme="light"] .chat-profile-member-role.owner {
  border-color: rgba(161, 132, 219, 0.62);
  color: #704ca8;
}

body[data-theme="light"] .chat-profile-member-role.admin {
  border-color: rgba(93, 186, 123, 0.56);
  color: #2f8351;
}

body[data-theme="light"] .chat-profile-member-remove-btn {
  color: #2e72b2;
}

body[data-theme="light"] .chat-profile-member-remove-btn:hover {
  color: #1f527f;
  background: rgba(153, 193, 229, 0.42);
}

body[data-theme="light"] .chat-profile-members-empty {
  color: #557ea3;
  border-color: rgba(126, 167, 206, 0.44);
  background: rgba(221, 237, 251, 0.8);
}

body[data-theme="light"] .chat-member-tag-target {
  border-color: rgba(126, 163, 198, 0.3);
  background: rgba(235, 244, 252, 0.84);
}

body[data-theme="light"] .chat-member-tag-card {
  border-color: rgba(122, 165, 203, 0.58);
  background: linear-gradient(178deg, #ecf6ff 0%, #dcecff 100%);
  color: #214567;
  box-shadow: 0 28px 52px rgba(38, 72, 108, 0.24);
}

body[data-theme="light"] .chat-member-tag-card .modal-head h3 {
  color: #204668;
}

body[data-theme="light"] .chat-member-tag-target-name {
  color: #1e3650;
}

body[data-theme="light"] .chat-member-tag-target-hint,
body[data-theme="light"] .chat-member-tag-note {
  color: #6280a1;
}

body[data-theme="light"] .chat-profile-member-context-menu {
  border-color: rgba(127, 166, 206, 0.5);
  background: rgba(241, 247, 255, 0.97);
  box-shadow: 0 20px 36px rgba(39, 73, 109, 0.24);
}

body[data-theme="light"] .chat-profile-more-menu {
  border-color: rgba(127, 166, 206, 0.5);
  background: rgba(241, 247, 255, 0.98);
  box-shadow: 0 20px 36px rgba(39, 73, 109, 0.24);
}

body[data-theme="light"] .chat-profile-more-item {
  color: #214365;
}

body[data-theme="light"] .chat-profile-more-item:hover {
  background: rgba(189, 220, 249, 0.62);
}

body[data-theme="light"] .chat-profile-more-item.danger {
  color: #b04d4d;
}

body[data-theme="light"] .chat-profile-more-item.danger:hover {
  background: rgba(232, 174, 181, 0.32);
}

body[data-theme="light"] .contact-edit-card {
  border-color: rgba(126, 165, 204, 0.58);
  background:
    radial-gradient(120% 70% at 16% -10%, rgba(133, 187, 238, 0.34) 0%, rgba(133, 187, 238, 0) 60%),
    linear-gradient(176deg, #edf7ff 0%, #dfedfb 54%, #d4e5f6 100%);
  color: #1f4569;
  box-shadow: 0 28px 52px rgba(42, 79, 115, 0.24);
}

body[data-theme="light"] .contact-edit-card .modal-head h3 {
  color: #204668;
}

body[data-theme="light"] .contact-edit-avatar-btn {
  border-color: rgba(132, 171, 208, 0.5);
  background: linear-gradient(145deg, #7fb0e0, #5da4e8);
  color: #f8fcff;
}

body[data-theme="light"] .contact-edit-field {
  color: #567a9d;
}

body[data-theme="light"] .contact-edit-field input,
body[data-theme="light"] .contact-edit-field textarea {
  border-color: rgba(129, 168, 205, 0.48);
  background: rgba(247, 251, 255, 0.94);
  color: #1d3f60;
}

body[data-theme="light"] .contact-edit-field input:focus,
body[data-theme="light"] .contact-edit-field textarea:focus {
  border-color: rgba(75, 141, 203, 0.72);
  box-shadow: 0 0 0 3px rgba(83, 145, 202, 0.18);
}

body[data-theme="light"] .contact-delete-card {
  border-color: rgba(207, 120, 132, 0.5);
  background:
    radial-gradient(120% 70% at 12% -12%, rgba(228, 122, 138, 0.26) 0%, rgba(228, 122, 138, 0) 60%),
    linear-gradient(176deg, #fff2f4 0%, #eaf4ff 56%, #dcecff 100%);
  color: #1f4569;
  box-shadow: 0 28px 52px rgba(42, 79, 115, 0.24);
}

body[data-theme="light"] .folder-delete-card {
  border-color: rgba(207, 120, 132, 0.5);
}

body[data-theme="light"] .contact-delete-card .modal-head h3 {
  color: #8f3343;
}

body[data-theme="light"] .contact-delete-text {
  color: #4f7192;
}

body[data-theme="light"] .contact-delete-text strong {
  color: #7f2d3a;
}

body[data-theme="light"] .chat-profile-member-context-item {
  color: #214365;
  border-top-color: rgba(121, 161, 201, 0.26);
}

body[data-theme="light"] .chat-profile-member-context-item:hover {
  background: rgba(189, 220, 249, 0.62);
}

body[data-theme="light"] .chat-profile-member-context-item.danger {
  color: #b04d4d;
}

body[data-theme="light"] .chat-profile-member-context-item.danger:hover {
  background: rgba(244, 196, 196, 0.46);
}

body[data-theme="light"] .chat-profile-member-context-ico {
  color: #356995;
}

body[data-theme="light"] .chat-profile-add-members-card {
  border-color: rgba(122, 164, 203, 0.56);
  background: linear-gradient(178deg, #edf7ff 0%, #e1f0ff 100%);
  box-shadow: 0 24px 48px rgba(39, 73, 109, 0.22);
}

body[data-theme="light"] .chat-profile-add-members-card .modal-head {
  background: linear-gradient(180deg, rgba(223, 238, 252, 0.98), rgba(214, 233, 250, 0.96));
  border-bottom-color: rgba(124, 162, 198, 0.3);
}

body[data-theme="light"] .chat-profile-add-members-card .modal-head h3 {
  color: #214568;
}

body[data-theme="light"] .chat-profile-add-members-card .search-wrap input {
  border-color: rgba(119, 161, 199, 0.5);
  background: rgba(237, 247, 255, 0.94);
  color: #224467;
}

body[data-theme="light"] .chat-profile-add-members-card .search-wrap input:focus {
  border-color: rgba(97, 149, 198, 0.7);
  box-shadow: 0 0 0 2px rgba(101, 156, 208, 0.18);
}

body[data-theme="light"] .chat-profile-add-members-card .participant-list {
  border-color: rgba(121, 163, 201, 0.42);
  background: rgba(234, 245, 255, 0.93);
}

body[data-theme="light"] .chat-profile-add-members-card .participant-item {
  border-bottom-color: rgba(126, 166, 202, 0.28);
  color: #1e4265;
}

body[data-theme="light"] .chat-profile-add-members-card .participant-item:hover {
  background: rgba(190, 220, 247, 0.78);
}

body[data-theme="light"] .chat-profile-add-members-card .participant-item.selected {
  background: rgba(169, 208, 242, 0.8);
}

body[data-theme="light"] .chat-profile-add-members-card .participant-meta {
  color: #4f7598;
}

body[data-theme="light"] .chat-profile-add-members-card .modal-actions {
  background: linear-gradient(180deg, rgba(222, 238, 252, 0.94), rgba(212, 232, 250, 0.98));
  border-top-color: rgba(123, 164, 201, 0.32);
}

body[data-theme="light"] .group-manage-modal-card {
  border-color: rgba(122, 165, 203, 0.58);
  background: linear-gradient(178deg, #ecf6ff 0%, #dcecff 100%);
  box-shadow: 0 28px 52px rgba(38, 72, 108, 0.24);
}

body[data-theme="light"] .group-manage-members-card {
  border-color: rgba(122, 165, 203, 0.58);
  background: linear-gradient(178deg, #ecf6ff 0%, #dcecff 100%);
  box-shadow: 0 28px 52px rgba(38, 72, 108, 0.24);
}

body[data-theme="light"] .group-admin-permissions-card {
  border-color: rgba(122, 165, 203, 0.58);
  background: linear-gradient(178deg, #ecf6ff 0%, #dcecff 100%);
  box-shadow: 0 28px 52px rgba(38, 72, 108, 0.24);
}

body[data-theme="light"] .group-manage-members-list {
  border-color: rgba(123, 164, 201, 0.32);
  background: rgba(231, 243, 255, 0.88);
}

body[data-theme="light"] .group-manage-members-search {
  border-color: rgba(123, 164, 201, 0.36);
  background: rgba(231, 243, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
}

body[data-theme="light"] .group-manage-members-search-ico {
  color: #3c75aa;
}

body[data-theme="light"] .group-manage-members-search input {
  color: #1e3f60;
}

body[data-theme="light"] .group-manage-members-search input::placeholder {
  color: #6684a2;
}

body[data-theme="light"] .group-manage-members-search-clear {
  background: rgba(204, 226, 247, 0.96);
  color: #2b5b87;
}

body[data-theme="light"] .group-manage-members-search-clear:hover {
  background: rgba(178, 212, 245, 0.98);
}

body[data-theme="light"] .group-manage-head {
  border-bottom-color: rgba(123, 163, 199, 0.3);
  background: linear-gradient(180deg, rgba(220, 236, 252, 0.98), rgba(210, 230, 248, 0.95));
}

body[data-theme="light"] .group-manage-head h3 {
  color: #204668;
}

body[data-theme="light"] .group-manage-top {
  background: rgba(232, 244, 255, 0.84);
  border-bottom-color: rgba(126, 168, 205, 0.24);
}

body[data-theme="light"] .group-manage-field {
  color: #4f7598;
}

body[data-theme="light"] .group-manage-field input,
body[data-theme="light"] .group-manage-field textarea {
  border-color: rgba(121, 163, 200, 0.48);
  background: rgba(236, 246, 255, 0.94);
  color: #214567;
}

body[data-theme="light"] .group-manage-field input:focus,
body[data-theme="light"] .group-manage-field textarea:focus {
  border-color: rgba(97, 148, 198, 0.72);
  box-shadow: 0 0 0 2px rgba(102, 156, 206, 0.18);
}

body[data-theme="light"] .group-manage-static-list {
  border-top-color: rgba(124, 164, 201, 0.28);
  border-bottom-color: rgba(124, 164, 201, 0.28);
  background: rgba(228, 242, 255, 0.84);
}

body[data-theme="light"] .group-manage-row {
  color: #234466;
  background: rgba(218, 235, 251, 0.88);
  border-color: rgba(123, 163, 200, 0.34);
}

body[data-theme="light"] .group-manage-invite-controls input {
  border-color: rgba(124, 166, 203, 0.52);
  background: rgba(238, 247, 255, 0.95);
  color: #1f456a;
}

body[data-theme="light"] .group-manage-invite-controls input:focus {
  border-color: rgba(95, 147, 191, 0.76);
  box-shadow: 0 0 0 2px rgba(93, 148, 197, 0.18);
}

body[data-theme="light"] .group-manage-row-button:hover {
  border-color: rgba(110, 156, 197, 0.56);
  background: rgba(207, 228, 247, 0.98);
}

body[data-theme="light"] .group-manage-row span:last-child {
  color: #2d6ba0;
}

body[data-theme="light"] .group-manage-danger {
  color: #b04865;
  border-color: rgba(198, 115, 137, 0.46);
  background: rgba(250, 219, 226, 0.72);
}

body[data-theme="light"] .chat-profile-closure-notice {
  border-color: rgba(198, 144, 82, 0.42);
  background: rgba(255, 239, 210, 0.88);
}

body[data-theme="light"] .chat-profile-closure-text {
  color: #6e4616;
}

body[data-theme="light"] .chat-profile-closure-cancel-btn {
  border-color: rgba(102, 148, 188, 0.46);
  background: rgba(227, 241, 255, 0.92);
  color: #244c73;
}

body[data-theme="light"] .chat-profile-closure-cancel-btn:hover {
  border-color: rgba(92, 138, 178, 0.66);
  background: rgba(218, 236, 252, 0.98);
}

body[data-theme="light"] .group-closure-title {
  color: #17314d;
}

body[data-theme="light"] .group-closure-note,
body[data-theme="light"] .group-closure-slider-labels {
  color: #4a7193;
}

body[data-theme="light"] .group-closure-step-dot {
  border-color: rgba(124, 165, 201, 0.34);
  color: #3e6890;
  background: rgba(226, 240, 252, 0.92);
}

body[data-theme="light"] .group-closure-step-dot.active {
  color: #ffffff;
  background: rgba(75, 143, 206, 0.88);
  border-color: rgba(79, 145, 207, 0.92);
}

body[data-theme="light"] .group-closure-toggle-row {
  border-color: rgba(123, 165, 202, 0.34);
  background: rgba(222, 238, 253, 0.9);
  color: #224162;
}

body[data-theme="light"] .group-closure-final-hint {
  color: #b56446;
}

body[data-theme="light"] .group-closure-final-hint.error {
  color: #b43f2f;
}

body[data-theme="light"] .group-closure-slider::-webkit-slider-runnable-track {
  border-color: rgba(93, 140, 180, 0.44);
  background: linear-gradient(
    90deg,
    #4b95d7 0%,
    #4b95d7 var(--group-closure-progress),
    rgba(168, 199, 228, 0.56) var(--group-closure-progress),
    rgba(168, 199, 228, 0.56) 100%
  );
}

body[data-theme="light"] .group-closure-slider::-moz-range-track {
  border-color: rgba(93, 140, 180, 0.44);
  background: rgba(168, 199, 228, 0.56);
}

body[data-theme="light"] .group-closure-slider::-moz-range-progress {
  background: #4b95d7;
}

body[data-theme="light"] .group-manage-actions {
  border-top-color: rgba(126, 168, 205, 0.3);
  background: linear-gradient(180deg, rgba(221, 238, 252, 0.94), rgba(211, 232, 250, 0.97));
}

body[data-theme="light"] .group-admin-permissions-target {
  color: #2f618f;
}

body[data-theme="light"] .chat-media-head {
  background: rgba(240, 247, 255, 0.98);
  border-bottom-color: rgba(138, 177, 216, 0.2);
}

body[data-theme="light"] .chat-media-title {
  color: #17314f;
}

body[data-theme="light"] .chat-media-head-btn {
  background: rgba(233, 243, 255, 0.94);
  border-color: rgba(118, 160, 201, 0.34);
  color: #27496e;
}

body[data-theme="light"] .chat-media-search-wrap,
body[data-theme="light"] .chat-media-content {
  background: rgba(244, 250, 255, 0.98);
}

body[data-theme="light"] .chat-media-search-wrap {
  border-bottom-color: rgba(138, 177, 216, 0.2);
}

body[data-theme="light"] .chat-media-search-box {
  background: rgba(236, 246, 255, 0.96);
  border-color: rgba(118, 160, 201, 0.4);
  color: #24456a;
}

body[data-theme="light"] .chat-media-search-box input {
  color: #24456a;
}

body[data-theme="light"] .chat-media-group-title {
  color: #183555;
}

body[data-theme="light"] .chat-media-empty {
  color: #5d7b9c;
}

body[data-theme="light"] .chat-media-file-row,
body[data-theme="light"] .chat-media-link-row {
  border-top-color: rgba(136, 176, 216, 0.2);
}

body[data-theme="light"] .chat-media-voice-row {
  border-top-color: rgba(136, 176, 216, 0.2);
}

body[data-theme="light"] .chat-media-file-row:hover,
body[data-theme="light"] .chat-media-link-row:hover {
  background: rgba(49, 108, 201, 0.12);
}

body[data-theme="light"] .chat-media-file-name,
body[data-theme="light"] .chat-media-link-title {
  color: #17324f;
}

body[data-theme="light"] .chat-media-file-size,
body[data-theme="light"] .chat-media-file-date,
body[data-theme="light"] .chat-media-link-summary {
  color: #4d6f93;
}

.group-manage-modal-card {
  width: min(620px, calc(100% - 24px));
  max-height: min(90vh, 940px);
  overflow-y: auto;
  padding: 0;
  border-radius: 22px;
  border-color: rgba(128, 175, 217, 0.45);
  background: linear-gradient(178deg, #0f2e49 0%, #0a253e 100%);
  box-shadow: 0 30px 70px rgba(5, 15, 27, 0.62);
}

.group-manage-members-card {
  width: min(620px, calc(100% - 24px));
  max-height: min(88vh, 860px);
  overflow: hidden;
  padding: 0;
  border-radius: 22px;
  border-color: rgba(128, 175, 217, 0.45);
  background: linear-gradient(178deg, #0f2e49 0%, #0a253e 100%);
  box-shadow: 0 30px 70px rgba(5, 15, 27, 0.62);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.group-admin-permissions-card {
  width: min(620px, calc(100% - 24px));
  max-height: min(88vh, 860px);
  overflow-y: auto;
  padding: 0;
  border-radius: 22px;
  border-color: rgba(128, 175, 217, 0.45);
  background: linear-gradient(178deg, #0f2e49 0%, #0a253e 100%);
  box-shadow: 0 30px 70px rgba(5, 15, 27, 0.62);
}

.group-admin-permissions-target {
  padding: 10px 18px 6px;
  color: #9fc8eb;
  font-size: 14px;
  font-weight: 600;
}

.group-admin-permissions-list {
  margin-top: 4px;
}

.group-admin-permissions-actions {
  position: sticky;
  bottom: 0;
}

.group-manage-members-list {
  max-height: none;
  margin: 12px;
  border-radius: 14px;
  border: 1px solid rgba(122, 166, 205, 0.24);
  background: rgba(8, 31, 49, 0.48);
  padding: 10px;
}

.group-manage-members-search {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 0;
  padding: 9px 12px;
  border: 1px solid rgba(122, 166, 205, 0.28);
  border-radius: 14px;
  background: rgba(8, 31, 49, 0.58);
  box-shadow: inset 0 0 0 1px rgba(18, 57, 89, 0.22);
}

.group-manage-members-search-ico {
  color: #95c9f5;
  line-height: 1;
}

.group-manage-members-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #edf7ff;
  font: inherit;
  font-size: 16px;
}

.group-manage-members-search input::placeholder {
  color: #89accd;
}

.group-manage-members-search-clear {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: rgba(66, 118, 166, 0.34);
  color: #ddecfb;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.group-manage-members-search-clear:hover {
  background: rgba(91, 153, 210, 0.46);
}

.group-manage-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(141, 181, 221, 0.22);
  background: linear-gradient(180deg, rgba(20, 53, 83, 0.98), rgba(16, 42, 66, 0.95));
}

.group-manage-head h3 {
  margin: 0;
  font-size: 31px;
  color: #f1f8ff;
}

.group-manage-top {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 16px 18px 14px;
  background: rgba(8, 31, 49, 0.5);
  border-bottom: 1px solid rgba(137, 178, 217, 0.17);
}

.group-manage-avatar {
  width: 96px;
  height: 96px;
  font-size: 30px;
  border: 2px solid rgba(202, 228, 252, 0.35);
  box-shadow: 0 12px 26px rgba(4, 17, 29, 0.34);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.group-manage-avatar:hover {
  border-color: rgba(159, 211, 255, 0.68);
  box-shadow: 0 14px 26px rgba(5, 19, 33, 0.42);
  transform: translateY(-1px);
}

.group-manage-avatar:focus-visible {
  outline: none;
  border-color: #79beff;
  box-shadow: 0 0 0 3px rgba(95, 167, 233, 0.25), 0 14px 26px rgba(5, 19, 33, 0.42);
}

.group-manage-main-fields {
  display: grid;
  gap: 14px;
}

.group-manage-field {
  display: grid;
  gap: 7px;
  font-size: 15px;
  color: #9cc3e4;
}

.group-manage-field input,
.group-manage-field textarea {
  border: 1px solid rgba(122, 168, 208, 0.38);
  border-radius: 12px;
  background: rgba(10, 34, 55, 0.62);
  color: #e6f0ff;
  padding: 10px 12px;
  font: inherit;
}

.group-manage-field textarea {
  min-height: 88px;
  resize: vertical;
}

.group-manage-field input:focus,
.group-manage-field textarea:focus {
  outline: none;
  border-color: #79beff;
  box-shadow: 0 0 0 2px rgba(95, 167, 233, 0.22);
}

.group-manage-static-list {
  border-top: 1px solid rgba(141, 181, 221, 0.18);
  border-bottom: 1px solid rgba(141, 181, 221, 0.18);
  margin: 8px 16px 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(9, 30, 48, 0.56);
  display: grid;
  gap: 6px;
}

.group-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #ddeeff;
  font-size: 15px;
  background: rgba(16, 44, 69, 0.52);
  border: 1px solid rgba(122, 166, 205, 0.2);
}

.group-manage-type-row {
  align-items: center;
}

.group-manage-invite-row {
  display: grid;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.group-manage-invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.group-manage-invite-controls {
  display: flex;
  width: 170%;
  min-width: 0;
  justify-self: stretch;
  gap: 8px;
  align-items: stretch;
}

.group-manage-invite-controls input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(122, 166, 205, 0.34);
  border-radius: 22px;
  background: rgba(8, 28, 45, 0.62);
  color: #d9ecff;
  height: 40px;
  min-height: 40px;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 600;
}

.group-manage-invite-controls input:focus {
  outline: none;
  border-color: rgba(122, 189, 236, 0.72);
  box-shadow: 0 0 0 2px rgba(94, 154, 214, 0.24);
}

.group-manage-invite-regenerate-btn {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  min-width: 40px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  transform-origin: center;
}

.group-manage-row-button {
  width: 100%;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.group-manage-row-button:hover {
  border-color: rgba(143, 189, 230, 0.46);
  background: rgba(22, 57, 88, 0.7);
}

.group-manage-history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-manage-row span:last-child {
  color: #94d0ff;
  font-weight: 600;
}

.group-manage-danger {
  margin: 14px 16px 0;
  padding: 12px 14px;
  color: #ff9caf;
  font-size: 19px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid rgba(204, 105, 129, 0.44);
  background: rgba(89, 23, 40, 0.34);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.group-manage-danger:hover {
  border-color: rgba(225, 130, 153, 0.72);
  background: rgba(109, 31, 51, 0.42);
}

.group-manage-danger:active {
  transform: translateY(1px);
}

.group-manage-channel-delete-btn {
  width: calc(100% - 32px);
  display: block;
  text-align: left;
}

.channel-delete-modal-card {
  width: min(520px, calc(100% - 24px));
  padding: 0;
  border-radius: 22px;
  border-color: rgba(128, 175, 217, 0.45);
  background: linear-gradient(178deg, #0f2e49 0%, #0a253e 100%);
  box-shadow: 0 30px 70px rgba(5, 15, 27, 0.62);
}

.channel-delete-head {
  margin: 0;
  padding: 16px 18px 10px;
  border-bottom: 1px solid rgba(141, 181, 221, 0.22);
}

.channel-delete-note {
  padding: 16px 18px 0;
  color: #9fc3e4;
  font-size: 15px;
  line-height: 1.45;
}

.channel-delete-summary {
  margin: 16px 18px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(122, 166, 205, 0.26);
  background: rgba(8, 31, 49, 0.5);
}

.channel-delete-summary-label {
  color: #8fb7d8;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.channel-delete-summary-name {
  margin-top: 6px;
  color: #eef7ff;
  font-size: 22px;
  font-weight: 700;
  word-break: break-word;
}

.channel-delete-field {
  padding: 16px 18px 0;
}

.channel-delete-actions {
  margin-top: 16px;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(141, 181, 221, 0.2);
  background: linear-gradient(180deg, rgba(14, 39, 61, 0.88), rgba(12, 33, 53, 0.96));
}

body[data-theme="light"] .channel-delete-modal-card {
  border-color: rgba(121, 171, 217, 0.34);
  background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
  box-shadow: 0 26px 60px rgba(88, 128, 176, 0.22);
}

body[data-theme="light"] .channel-delete-head {
  border-bottom-color: rgba(147, 181, 214, 0.28);
}

body[data-theme="light"] .channel-delete-note {
  color: #567598;
}

body[data-theme="light"] .channel-delete-summary {
  border-color: rgba(135, 175, 214, 0.28);
  background: rgba(255, 255, 255, 0.78);
}

body[data-theme="light"] .channel-delete-summary-label {
  color: #6888ab;
}

body[data-theme="light"] .channel-delete-summary-name {
  color: #17324f;
}

body[data-theme="light"] .channel-delete-actions {
  border-top-color: rgba(147, 181, 214, 0.26);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(231, 241, 252, 0.98));
}

.group-manage-actions {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(141, 181, 221, 0.2);
  background: linear-gradient(180deg, rgba(14, 39, 61, 0.88), rgba(12, 33, 53, 0.96));
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  color: #eef6ff;
}

.group-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.avatar-picker {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2a5ea5, #4da6f0);
  position: relative;
  cursor: pointer;
}

.avatar-picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-picker span {
  position: absolute;
  font-size: 26px;
  color: #f7fbff;
}

.group-name-wrap input,
.search-wrap input {
  background: transparent;
  border: 0;
  border-bottom: 2px solid #4a84c0;
  color: #e6f0ff;
  border-radius: 0;
  padding-left: 4px;
}

.group-name-wrap input:focus,
.search-wrap input:focus {
  outline: none;
  border-color: #74baff;
}

.selected-counter {
  font-size: 13px;
  color: #8fb0cf;
}

.chat-profile-closure-notice {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(243, 186, 112, 0.4);
  background: rgba(96, 64, 22, 0.34);
  display: grid;
  gap: 9px;
}

.chat-profile-closure-text {
  color: #ffdba8;
  font-size: 14px;
  line-height: 1.35;
}

.chat-profile-closure-cancel-btn {
  justify-self: start;
  border: 1px solid rgba(143, 193, 235, 0.46);
  background: rgba(18, 53, 84, 0.7);
  color: #e2f0ff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-profile-closure-cancel-btn:hover {
  border-color: rgba(164, 210, 248, 0.66);
  background: rgba(28, 72, 110, 0.78);
}

.group-closure-modal-card {
  width: min(620px, calc(100% - 24px));
  max-height: min(90vh, 860px);
  overflow-y: auto;
  padding: 0;
  border-radius: 22px;
  border-color: rgba(128, 175, 217, 0.45);
  background: linear-gradient(178deg, #0f2e49 0%, #0a253e 100%);
  box-shadow: 0 30px 70px rgba(5, 15, 27, 0.62);
}

.group-closure-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 0;
}

.group-closure-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(130, 176, 215, 0.3);
  color: #9dc4e6;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  background: rgba(12, 39, 62, 0.66);
}

.group-closure-step-dot.active {
  color: #f4fbff;
  background: rgba(71, 143, 211, 0.48);
  border-color: rgba(147, 202, 255, 0.65);
}

.group-closure-step {
  display: grid;
  gap: 12px;
  padding: 14px 18px 16px;
}

.group-closure-title {
  color: #f0f8ff;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 700;
}

.group-closure-note {
  color: #a8c9e7;
  font-size: 15px;
  line-height: 1.45;
}

.group-closure-toggle-row {
  margin-top: 6px;
  border: 1px solid rgba(122, 166, 205, 0.26);
  background: rgba(14, 41, 64, 0.58);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #deefff;
  font-size: 15px;
}

.group-closure-slider-wrap {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}

.group-closure-slider {
  --group-closure-progress: 0%;
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 0;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: grab;
}

.group-closure-slider:active {
  cursor: grabbing;
}

.group-closure-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(121, 173, 216, 0.46);
  background: linear-gradient(
    90deg,
    #61b8ff 0%,
    #61b8ff var(--group-closure-progress),
    rgba(69, 108, 147, 0.42) var(--group-closure-progress),
    rgba(69, 108, 147, 0.42) 100%
  );
}

.group-closure-slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-top: -7px;
  border: 2px solid rgba(220, 241, 255, 0.9);
  background: radial-gradient(circle at 34% 30%, #ffffff 0%, #d9efff 40%, #79befb 100%);
  box-shadow: 0 6px 16px rgba(6, 20, 34, 0.46);
}

.group-closure-slider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(121, 173, 216, 0.46);
  background: rgba(69, 108, 147, 0.42);
}

.group-closure-slider::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: #61b8ff;
}

.group-closure-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(220, 241, 255, 0.9);
  background: radial-gradient(circle at 34% 30%, #ffffff 0%, #d9efff 40%, #79befb 100%);
  box-shadow: 0 6px 16px rgba(6, 20, 34, 0.46);
}

.group-closure-slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #92badb;
  font-size: 13px;
}

.group-closure-final-hint {
  color: #ffbea6;
  font-size: 13px;
  line-height: 1.3;
}

.group-closure-final-hint.error {
  color: #ff9e8a;
}

.participant-list {
  max-height: min(56vh, 480px);
  overflow: auto;
  border: 1px solid #2e4c69;
  border-radius: 12px;
  margin-top: 12px;
}

.participant-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #233a55;
  background: transparent;
  color: #d8e8f9;
  cursor: pointer;
  padding: 10px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.participant-item-empty {
  padding: 14px 12px;
  color: #a8c0d8;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
}

.participant-item:last-child {
  border-bottom: 0;
}

.participant-item.selected {
  background: rgba(106, 193, 235, 0.22);
}

.participant-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #396bc1, #56a3e9);
  overflow: hidden;
}

.participant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.participant-info {
  min-width: 0;
}

.participant-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-meta {
  font-size: 12px;
  color: #88a5c1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-check {
  font-size: 18px;
  color: #7fd2ff;
  opacity: 0;
}

.participant-item.selected .participant-check {
  opacity: 1;
}

.forward-modal-card {
  width: min(520px, calc(100% - 24px));
}

body[data-theme="light"] .forward-modal-card {
  border-color: rgba(131, 167, 201, 0.58);
  background: linear-gradient(180deg, #eef7ff, #e5f2ff 66%, #e0efff 100%);
  color: #1f3855;
  box-shadow: 0 18px 46px rgba(40, 74, 110, 0.2);
}

body[data-theme="light"] .forward-modal-card .modal-head h3 {
  color: #20486f;
}

body[data-theme="light"] .forward-modal-card .search-wrap input {
  border-bottom-color: #7fa9d1;
  color: #23496f;
}

body[data-theme="light"] .forward-modal-card .search-wrap input::placeholder {
  color: #6b8db0;
}

body[data-theme="light"] .forward-modal-card .search-wrap input:focus {
  border-bottom-color: #4d8cc6;
}

.forward-target-list {
  margin-top: 12px;
  max-height: min(56vh, 470px);
  overflow: auto;
  border: 1px solid #2f4c69;
  border-radius: 12px;
}

.forward-list-section {
  padding: 8px 10px;
  color: #8fb0d1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #2a4360;
  background: rgba(17, 42, 68, 0.48);
}

.forward-target-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #233a55;
  background: transparent;
  color: #d8e8f9;
  cursor: pointer;
  padding: 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
}

.forward-target-row:last-child {
  border-bottom: 0;
}

.forward-target-row:hover {
  background: rgba(106, 161, 220, 0.16);
}

.forward-target-row.selected {
  background: rgba(97, 162, 230, 0.26);
}

.forward-target-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(141, 189, 236, 0.4);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3a73b2, #4ea0e8);
  color: #f4f9ff;
  font-weight: 700;
}

.forward-target-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.forward-target-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-target-meta {
  color: #90b4d4;
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-target-empty {
  padding: 12px;
  color: #8eafcf;
  font-size: 13px;
}

body[data-theme="light"] .forward-list-section {
  color: #51779e;
  background: rgba(216, 232, 249, 0.82);
  border-bottom-color: #bfd5eb;
}

body[data-theme="light"] .forward-target-list {
  border-color: #bfd5eb;
  background: rgba(244, 250, 255, 0.94);
}

body[data-theme="light"] .forward-target-row {
  color: #1f3855;
  border-bottom-color: #c8dcef;
}

body[data-theme="light"] .forward-target-row:hover {
  background: rgba(119, 170, 227, 0.2);
}

body[data-theme="light"] .forward-target-row.selected {
  background: rgba(102, 164, 230, 0.3);
}

body[data-theme="light"] .forward-target-meta,
body[data-theme="light"] .forward-target-empty {
  color: #567a9f;
}

body[data-theme="light"] .forward-modal-card .ghost-btn {
  border-color: rgba(122, 164, 202, 0.52);
  background: rgba(236, 247, 255, 0.95);
  color: #426f99;
}

body[data-theme="light"] .forward-modal-card .ghost-btn:hover {
  background: rgba(208, 228, 247, 0.9);
  color: #21456b;
}

.settings-modal-card {
  width: min(430px, calc(100% - 20px));
  border-color: #2c4764;
  background: linear-gradient(180deg, #10253a, #102338 64%, #0f2133 100%);
  color: #d6e8fb;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 640px;
  max-height: min(92vh, 900px);
}

.settings-modal-card.swipe-dragging {
  will-change: transform, box-shadow;
}

.settings-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
}

.settings-modal-head h3 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  color: #eff7ff;
}

.settings-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-head-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(125, 168, 208, 0.36);
  background: rgba(12, 34, 54, 0.64);
  color: #e7f2ff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.settings-head-btn:hover:not(:disabled) {
  background: rgba(21, 52, 80, 0.9);
}

.settings-head-btn:disabled {
  opacity: 0.58;
  cursor: default;
}

.settings-pages {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(125, 169, 211, 0.16);
}

.settings-page {
  position: absolute;
  inset: 0;
  background: transparent;
  padding: 0 0 12px;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(14px, 0, 0);
  transition: opacity 140ms ease, transform 170ms cubic-bezier(0.22, 0.78, 0.2, 1);
  overflow-y: auto;
}

.settings-pages[data-dir="back"] .settings-page.before {
  transform: translate3d(-16px, 0, 0);
}

.settings-pages[data-dir="back"] .settings-page.after {
  transform: translate3d(16px, 0, 0);
}

.settings-pages[data-dir="forward"] .settings-page.before {
  transform: translate3d(-16px, 0, 0);
}

.settings-pages[data-dir="forward"] .settings-page.after {
  transform: translate3d(16px, 0, 0);
}

.settings-page.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

.settings-home-page {
  align-content: start;
  gap: 0;
}

.settings-home-profile-card {
  width: 100%;
  border: 0;
  background: linear-gradient(180deg, #224160, #1d3956);
  border-bottom: 1px solid rgba(134, 176, 216, 0.22);
  padding: 14px;
  color: #e5f3ff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: default;
}

.settings-home-profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2f67a8, #56a6ef);
  font-size: 28px;
  color: #f1f8ff;
  font-weight: 700;
}

.settings-home-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-home-profile-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-home-profile-name {
  color: #f2f9ff;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-home-profile-username {
  color: #85bdee;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-home-profile-extra {
  color: #78c0ff;
  font-size: 22px;
  line-height: 1;
  opacity: 0.42;
}

.settings-entry-separator {
  height: 10px;
  border-top: 1px solid rgba(126, 170, 210, 0.15);
  border-bottom: 1px solid rgba(126, 170, 210, 0.15);
  background: rgba(11, 31, 49, 0.52);
}

.settings-entry-btn {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(129, 174, 214, 0.18);
  border-radius: 0;
  background: transparent;
  color: #e4f2ff;
  text-align: left;
  font: inherit;
  padding: 11px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 150ms ease;
}

.settings-entry-btn:hover {
  background: rgba(35, 65, 93, 0.52);
}

.settings-entry-separator-danger {
  border-top-color: rgba(255, 142, 142, 0.26);
  border-bottom-color: rgba(255, 142, 142, 0.24);
  background: rgba(57, 17, 22, 0.36);
}

.settings-entry-btn.settings-entry-danger {
  border-bottom-color: rgba(255, 146, 146, 0.24);
  color: #ffd8de;
}

.settings-entry-btn.settings-entry-danger .settings-entry-icon {
  color: #ff9dac;
}

.settings-entry-btn.settings-entry-danger .settings-entry-hint {
  color: #ff9fb0;
}

.settings-entry-btn.settings-entry-danger:hover {
  background: rgba(85, 28, 39, 0.45);
}

.settings-entry-btn.muted {
  opacity: 0.9;
}

.settings-entry-btn:disabled {
  cursor: default;
}

.settings-entry-main .settings-entry-icon {
  width: 28px;
  min-width: 28px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #a8d0f8;
}

.settings-entry-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settings-entry-body.row {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.settings-entry-title {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
}

.settings-entry-hint {
  font-size: 13px;
  color: #8db5d9;
}

.settings-entry-hint.value {
  color: #73beff;
}

.settings-language-entry {
  cursor: default;
}

.settings-language-select {
  border: 1px solid rgba(122, 169, 212, 0.45);
  border-radius: 10px;
  background: rgba(14, 41, 64, 0.82);
  color: #dff0ff;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  padding: 7px 10px;
  min-width: 150px;
  outline: none;
}

.settings-language-select:focus {
  border-color: #6eb5f8;
  box-shadow: 0 0 0 2px rgba(86, 165, 233, 0.28);
}

.settings-page-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(126, 170, 210, 0.2);
  background: rgba(14, 36, 56, 0.72);
}

.settings-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 14px 0;
}

.settings-profile-avatar-picker {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.settings-profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.settings-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #eaf4ff;
}

.settings-back-btn {
  border: 1px solid rgba(130, 176, 217, 0.42);
  border-radius: 10px;
  background: rgba(15, 41, 63, 0.65);
  color: #b8d7f4;
  font: inherit;
  font-size: 14px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.settings-back-btn:hover {
  background: rgba(25, 56, 84, 0.9);
  color: #e5f2ff;
}

.settings-field {
  display: grid;
  gap: 6px;
  color: #91b5d7;
  font-size: 14px;
  margin: 0 14px;
}

.settings-field input {
  border: 1px solid rgba(123, 168, 209, 0.34);
  border-radius: 10px;
  background: rgba(10, 32, 52, 0.86);
  color: #e4f2ff;
  padding: 10px 11px;
}

.settings-field textarea {
  border: 1px solid rgba(123, 168, 209, 0.34);
  border-radius: 10px;
  background: rgba(10, 32, 52, 0.86);
  color: #e4f2ff;
  padding: 10px 11px;
  resize: vertical;
  min-height: 92px;
}

.settings-field input:focus {
  outline: 2px solid rgba(103, 170, 238, 0.5);
  border-color: var(--primary);
}

.settings-field textarea:focus {
  outline: 2px solid rgba(103, 170, 238, 0.5);
  border-color: var(--primary);
}

.settings-field-counter {
  justify-self: end;
  font-size: 12px;
  color: #7ea6cb;
}

.settings-block {
  display: grid;
  gap: 12px;
  margin: 0 14px;
  padding: 12px;
  border: 1px solid rgba(124, 170, 210, 0.24);
  border-radius: 12px;
  background: rgba(13, 36, 57, 0.64);
}

.settings-profile-password-block {
  margin-top: 8px;
}

.settings-profile-password-block .settings-field {
  margin: 0;
}

.settings-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-block-head .theme-switch {
  margin-left: auto;
}

.settings-block-title {
  font-size: 15px;
  font-weight: 600;
  color: #e6f3ff;
}

.settings-admin-hero {
  display: grid;
  gap: 12px;
}

.settings-admin-hero-head {
  align-items: start;
}

.settings-admin-hero-subtitle {
  margin-top: 6px;
  color: #8fb8dc;
  font-size: 13px;
  line-height: 1.35;
}

.settings-admin-error {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(221, 117, 136, 0.36);
  background: rgba(94, 29, 44, 0.4);
  color: #ffc4cf;
  font-size: 14px;
  line-height: 1.35;
}

.settings-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-admin-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.settings-admin-value {
  color: #f3f9ff;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.settings-admin-note {
  color: #8fb8dc;
  font-size: 14px;
  line-height: 1.35;
}

.settings-admin-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #deefff;
  font-size: 15px;
}

.settings-admin-service-badge {
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  text-align: center;
  border: 1px solid rgba(136, 183, 224, 0.34);
  background: rgba(18, 50, 80, 0.64);
  color: #f2f8ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.settings-admin-db-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-admin-metric {
  border: 1px solid rgba(123, 168, 208, 0.26);
  border-radius: 16px;
  padding: 14px;
  background: rgba(12, 35, 55, 0.48);
  display: grid;
  gap: 8px;
}

.settings-admin-metric span {
  color: #8fb8dc;
  font-size: 13px;
  line-height: 1.3;
}

.settings-admin-metric b {
  color: #eef7ff;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
}

.settings-version-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 176, 222, 0.45);
  background: rgba(16, 52, 83, 0.64);
  color: #9fd6ff;
  font-size: 13px;
  line-height: 1;
}

.settings-logs-block {
  gap: 10px;
}

.settings-logs-list {
  display: grid;
  gap: 10px;
}

.settings-log-entry {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid rgba(124, 169, 210, 0.22);
  border-radius: 10px;
  background: rgba(9, 28, 45, 0.64);
}

.settings-log-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.settings-log-entry-version {
  color: #dff0ff;
  font-size: 14px;
  font-weight: 600;
}

.settings-log-entry-date {
  color: #8fb4d6;
  font-size: 12px;
}

.settings-log-entry-items {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #d6e8fa;
  font-size: 14px;
}

.sound-settings-grid {
  display: grid;
  gap: 10px;
  transition: opacity 140ms ease;
}

.sound-settings-grid.disabled {
  opacity: 0.54;
}

.sound-settings-grid.disabled input {
  pointer-events: none;
}

.sound-setting {
  display: grid;
  gap: 6px;
  align-items: stretch;
  color: var(--muted);
  font-size: 13px;
}

.sound-setting > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sound-setting b {
  color: var(--text);
  font-weight: 600;
}

.sound-setting input[type="range"] {
  appearance: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(98, 141, 184, 0.38);
  background: rgba(98, 141, 184, 0.22);
  accent-color: var(--primary);
}

.sound-setting input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(98, 141, 184, 0.24);
}

.sound-setting input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg-panel-2);
  margin-top: -5px;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  box-shadow: 0 2px 10px rgba(20, 39, 62, 0.38);
}

.sound-setting input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(98, 141, 184, 0.24);
}

.sound-setting input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
}

.sound-setting input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg-panel-2);
  background: linear-gradient(145deg, var(--primary), var(--primary-2));
  box-shadow: 0 2px 10px rgba(20, 39, 62, 0.38);
}

.sound-setting input[type="range"]:focus-visible {
  outline: 2px solid rgba(103, 170, 238, 0.48);
  outline-offset: 2px;
}

.settings-actions-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-switch-row {
  align-items: center;
  gap: 14px;
}

.settings-switch-label {
  color: #d6e9fb;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

.settings-profile-actions-row {
  margin: 0 14px;
  justify-content: flex-end;
}

.settings-profile-password-btn {
  margin-right: auto;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 10px;
}

.settings-profile-actions-row .primary-btn {
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
}

.settings-password-modal-card {
  width: min(440px, calc(100vw - 24px));
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, #13395d, #0f2f4d 62%, #0b2742 100%);
  border: 1px solid rgba(118, 167, 210, 0.34);
  box-shadow: 0 22px 62px rgba(6, 17, 30, 0.45);
}

.settings-password-head {
  margin-bottom: 0;
}

.settings-password-head h3 {
  font-size: 28px;
}

.settings-password-modal-card .settings-field {
  margin: 0;
}

.settings-password-actions {
  margin-top: 2px;
  justify-content: flex-end;
}

.settings-trash-btn {
  min-width: 86px;
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  color: #ff9bb0;
  border-color: rgba(209, 137, 160, 0.56);
}

.settings-trash-btn:hover {
  background: rgba(103, 30, 48, 0.38);
  color: #ffe5ec;
  border-color: rgba(235, 154, 180, 0.74);
}

body[data-theme="light"] .settings-modal-card {
  background: linear-gradient(180deg, #eef7ff, #e5f2ff 66%, #e0efff 100%);
  border-color: rgba(131, 167, 201, 0.58);
  color: #1f3855;
  box-shadow: 0 18px 46px rgba(40, 74, 110, 0.2);
}

body[data-theme="light"] .settings-modal-head h3 {
  color: #20486f;
}

body[data-theme="light"] .settings-head-btn {
  border-color: rgba(120, 158, 194, 0.54);
  background: rgba(237, 246, 255, 0.94);
  color: #2b5b87;
}

body[data-theme="light"] .settings-home-profile-card {
  background: linear-gradient(180deg, #d6e9fb, #cfe3f7);
  border-bottom-color: rgba(120, 157, 193, 0.4);
  color: #204262;
}

body[data-theme="light"] .settings-home-profile-name {
  color: #1f456b;
}

body[data-theme="light"] .settings-home-profile-username {
  color: #376996;
}

body[data-theme="light"] .settings-entry-btn {
  border-bottom-color: rgba(121, 159, 195, 0.3);
  color: #224365;
}

body[data-theme="light"] .settings-entry-btn:hover {
  background: rgba(131, 177, 222, 0.2);
}

body[data-theme="light"] .settings-entry-separator-danger {
  border-top-color: rgba(205, 78, 91, 0.36);
  border-bottom-color: rgba(205, 78, 91, 0.28);
  background: rgba(255, 228, 232, 0.72);
}

body[data-theme="light"] .settings-entry-btn.settings-entry-danger {
  border-bottom-color: rgba(204, 77, 90, 0.26);
  color: #8e2433;
}

body[data-theme="light"] .settings-entry-btn.settings-entry-danger .settings-entry-icon {
  color: #b43245;
}

body[data-theme="light"] .settings-entry-btn.settings-entry-danger .settings-entry-hint {
  color: #9d3f4f;
}

body[data-theme="light"] .settings-entry-btn.settings-entry-danger:hover {
  background: rgba(219, 106, 120, 0.16);
}

body[data-theme="light"] .settings-entry-hint {
  color: #547ca4;
}

body[data-theme="light"] .settings-language-select {
  background: rgba(239, 247, 255, 0.95);
  border-color: rgba(118, 159, 198, 0.42);
  color: #1f3a55;
}

body[data-theme="light"] .settings-page-head {
  border-bottom-color: rgba(121, 159, 195, 0.34);
  background: rgba(218, 236, 252, 0.72);
}

body[data-theme="light"] .settings-page-title {
  color: #234a71;
}

body[data-theme="light"] .settings-back-btn {
  border-color: rgba(122, 164, 202, 0.52);
  background: rgba(236, 247, 255, 0.95);
  color: #426f99;
}

body[data-theme="light"] .settings-field {
  color: #5e84ab;
}

body[data-theme="light"] .settings-field input {
  border-color: rgba(117, 161, 199, 0.44);
  background: rgba(238, 247, 255, 0.95);
  color: #1f4163;
}

body[data-theme="light"] .settings-field textarea {
  border-color: rgba(117, 161, 199, 0.44);
  background: rgba(238, 247, 255, 0.95);
  color: #1f4163;
}

body[data-theme="light"] .settings-field-counter {
  color: #5f85aa;
}

body[data-theme="light"] .settings-block {
  border-color: rgba(121, 167, 206, 0.38);
  background: rgba(222, 238, 252, 0.62);
}

body[data-theme="light"] .settings-block-title {
  color: #1d446b;
}

body[data-theme="light"] .settings-password-modal-card {
  background: linear-gradient(180deg, #eef7ff, #e5f2ff 66%, #e0efff 100%);
  border-color: rgba(131, 167, 201, 0.58);
  box-shadow: 0 18px 46px rgba(40, 74, 110, 0.2);
}

body[data-theme="light"] .settings-password-head h3 {
  color: #20486f;
}

body[data-theme="light"] .settings-admin-hero-subtitle {
  color: #567ca3;
}

body[data-theme="light"] .settings-admin-error {
  border-color: rgba(208, 93, 114, 0.28);
  background: rgba(255, 232, 236, 0.92);
  color: #962f43;
}

body[data-theme="light"] .settings-admin-value {
  color: #18395a;
}

body[data-theme="light"] .settings-admin-note {
  color: #547ca4;
}

body[data-theme="light"] .settings-admin-service-row {
  color: #25496d;
}

body[data-theme="light"] .settings-admin-service-badge {
  border-color: rgba(107, 153, 194, 0.34);
  background: rgba(203, 225, 246, 0.92);
  color: #25547f;
}

body[data-theme="light"] .settings-admin-metric {
  border-color: rgba(119, 165, 206, 0.24);
  background: rgba(240, 248, 255, 0.92);
}

body[data-theme="light"] .settings-admin-metric span {
  color: #5a81a9;
}

body[data-theme="light"] .settings-admin-metric b {
  color: #1f456b;
}

body[data-theme="light"] .settings-switch-label {
  color: #2b547c;
}

body[data-theme="light"] .settings-version-value {
  border-color: rgba(96, 144, 192, 0.42);
  background: rgba(191, 218, 246, 0.75);
  color: #245586;
}

body[data-theme="light"] .settings-log-entry {
  border-color: rgba(118, 164, 206, 0.28);
  background: rgba(234, 245, 255, 0.92);
}

body[data-theme="light"] .settings-log-entry-version {
  color: #173450;
}

body[data-theme="light"] .settings-log-entry-date {
  color: #4f7398;
}

body[data-theme="light"] .settings-log-entry-items {
  color: #29496a;
}

body[data-theme="light"] .chat-profile-main-line#chatProfileUsername {
  color: #2e6aa0;
}

body[data-theme="light"] .chat-profile-close-btn {
  border-color: rgba(84, 129, 174, 0.38);
  background: rgba(243, 250, 255, 0.88);
  color: #24517a;
}

body[data-theme="light"] .sound-setting input[type="range"] {
  border-color: rgba(104, 149, 192, 0.45);
  background: rgba(104, 149, 192, 0.22);
}

body[data-theme="light"] .sound-setting input[type="range"]::-webkit-slider-runnable-track,
body[data-theme="light"] .sound-setting input[type="range"]::-moz-range-track {
  background: rgba(104, 149, 192, 0.26);
}

body[data-theme="light"] .settings-trash-btn {
  color: #bf425f;
  border-color: rgba(197, 112, 132, 0.5);
}

body[data-theme="light"] .settings-trash-btn:hover {
  background: rgba(224, 130, 152, 0.2);
  color: #a3334e;
  border-color: rgba(179, 96, 118, 0.58);
}

.settings-modal-card .ghost-btn {
  border-color: rgba(123, 172, 214, 0.42);
  color: #b8d6f1;
}

.settings-modal-card .ghost-btn:hover {
  background: rgba(34, 66, 96, 0.7);
  color: #e8f4ff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal .ghost-btn {
  border-color: #436487;
  color: #d3e2f4;
}

body[data-theme="light"] .private-call-card {
  border-color: rgba(122, 168, 210, 0.5);
  background: linear-gradient(160deg, #e8f3ff, #daeafc);
  color: #234c74;
}

body[data-theme="light"] .private-call-meta {
  color: #46698f;
}

body[data-theme="light"] .private-call-connection-badge {
  border-color: rgba(118, 166, 210, 0.54);
  background: rgba(222, 238, 252, 0.92);
  color: #2b587f;
}

body[data-theme="light"] .private-call-connection-badge.good {
  border-color: rgba(120, 186, 152, 0.58);
  background: rgba(216, 244, 229, 0.95);
  color: #275f41;
}

body[data-theme="light"] .private-call-connection-badge.poor {
  border-color: rgba(205, 142, 114, 0.58);
  background: rgba(250, 233, 221, 0.94);
  color: #8f4b2e;
}

body[data-theme="light"] .private-call-timer {
  color: #24517a;
}

body[data-theme="light"] .private-call-minimize-btn {
  border-color: rgba(126, 171, 212, 0.56);
  background: rgba(234, 244, 255, 0.95);
  color: #2d547a;
}

body[data-theme="light"] .private-call-minimize-btn:hover {
  border-color: rgba(103, 160, 213, 0.7);
  background: rgba(225, 239, 253, 0.98);
}

body[data-theme="light"] .private-call-leave-btn {
  border-color: rgba(190, 111, 133, 0.48);
  background: rgba(236, 198, 208, 0.4);
  color: #89364d;
}

body[data-theme="light"] .private-call-leave-btn:hover {
  border-color: rgba(182, 87, 114, 0.62);
  background: rgba(231, 174, 190, 0.5);
  color: #7b2d44;
}

body[data-theme="light"] .private-call-decline-btn {
  border-color: rgba(190, 111, 133, 0.48);
  background: rgba(236, 198, 208, 0.4);
  color: #89364d;
}

body[data-theme="light"] .private-call-decline-btn:hover {
  border-color: rgba(182, 87, 114, 0.62);
  background: rgba(231, 174, 190, 0.5);
  color: #7b2d44;
}

body[data-theme="light"] .private-call-mic-meter-label,
body[data-theme="light"] .private-call-field,
body[data-theme="light"] .private-call-volume-row,
body[data-theme="light"] .private-call-log-title {
  color: #4f7398;
}

body[data-theme="light"] .private-call-mic-meter-track,
body[data-theme="light"] .private-call-log {
  border-color: rgba(115, 163, 206, 0.36);
  background: rgba(235, 245, 254, 0.94);
}

body[data-theme="light"] .private-call-field select {
  border-color: rgba(113, 161, 205, 0.46);
  background: rgba(238, 247, 255, 0.96);
  color: #284f75;
}

body[data-theme="light"] .private-call-volume-row b {
  color: #2a547b;
}

body[data-theme="light"] .private-call-log-item {
  border-color: rgba(111, 159, 203, 0.28);
  background: rgba(215, 233, 249, 0.92);
  color: #285078;
}

body[data-theme="light"] .private-call-mute-btn.active {
  border-color: rgba(206, 147, 123, 0.58);
  background: rgba(248, 226, 215, 0.92);
  color: #8b4e30;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font-size: 13px;
  background: rgba(22, 33, 50, 0.95);
  z-index: 40;
}

/* Unified light theme surfaces for core layout and shared overlays */
body[data-theme="light"] .app-shell {
  border-color: rgba(121, 161, 198, 0.52);
  box-shadow:
    0 24px 56px rgba(59, 99, 142, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body[data-theme="light"] .left-pane,
body[data-theme="light"] .left-pane-top,
body[data-theme="light"] .left-pane-filters {
  background: linear-gradient(180deg, #f9fcff, #f1f7ff);
}

body[data-theme="light"] .left-folder-rail {
  border-right-color: rgba(122, 164, 202, 0.5);
  background: linear-gradient(180deg, rgba(230, 241, 252, 0.98), rgba(217, 233, 249, 0.96));
}

body[data-theme="light"] .folder-rail-menu-btn,
body[data-theme="light"] .folder-rail-item,
body[data-theme="light"] .folder-rail-settings {
  border-color: rgba(116, 158, 198, 0.42);
  background: rgba(244, 250, 255, 0.86);
  color: #315d85;
}

body[data-theme="light"] .folder-rail-item:hover,
body[data-theme="light"] .folder-rail-settings:hover {
  border-color: rgba(84, 144, 203, 0.56);
  background: rgba(223, 238, 252, 0.98);
  color: #1f456b;
}

body[data-theme="light"] .folder-rail-item.active {
  border-color: rgba(72, 143, 213, 0.66);
  background: linear-gradient(180deg, rgba(212, 232, 251, 0.98), rgba(191, 218, 245, 0.96));
  color: #17456e;
}

body[data-theme="light"] .folder-rail-item.drag-target {
  border-color: rgba(69, 144, 215, 0.76);
  background: linear-gradient(180deg, rgba(199, 225, 248, 0.99), rgba(180, 211, 243, 0.98));
  color: #163f66;
  box-shadow: 0 10px 22px rgba(73, 109, 149, 0.2), 0 0 0 1px rgba(77, 143, 208, 0.14);
}

body[data-theme="light"] .chat-row-drag-ghost {
  background: rgba(238, 247, 255, 0.98);
  box-shadow: 0 18px 34px rgba(69, 107, 147, 0.22), 0 0 0 1px rgba(108, 154, 199, 0.26);
}

body[data-theme="light"] .main-search-wrap input {
  border-color: rgba(121, 162, 201, 0.46);
  background: rgba(245, 250, 255, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body[data-theme="light"] .menu-toggle-btn,
body[data-theme="light"] .chat-header-btn {
  border-color: rgba(117, 158, 198, 0.48);
  background: rgba(239, 247, 255, 0.94);
  color: #2f5b86;
}

body[data-theme="light"] .menu-toggle-btn:hover,
body[data-theme="light"] .chat-header-btn:not(:disabled):hover {
  background: rgba(219, 236, 252, 0.96);
  color: #1f456b;
}

body[data-theme="light"] .right-pane {
  background: linear-gradient(180deg, #f8fcff, #eef6ff);
}

body[data-theme="light"] .chat-header {
  background: linear-gradient(180deg, rgba(246, 252, 255, 0.98), rgba(236, 246, 255, 0.98));
  border-bottom-color: rgba(123, 162, 198, 0.44);
}

body[data-theme="light"] .message-list,
body[data-theme="light"] .chat-mentions-view {
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(237, 247, 255, 0.98));
}

body[data-theme="light"] .composer {
  background: linear-gradient(180deg, rgba(245, 251, 255, 0.98), rgba(234, 245, 255, 0.98));
  border-top-color: rgba(123, 162, 198, 0.42);
}

body[data-theme="light"] .channel-action-bar {
  border-top-color: rgba(123, 162, 198, 0.42);
  background:
    linear-gradient(180deg, rgba(246, 252, 255, 0.98), rgba(232, 244, 255, 0.98)),
    radial-gradient(circle at top right, rgba(96, 157, 216, 0.12), transparent 54%);
  color: #23486f;
}

body[data-theme="light"] .channel-action-bar:hover {
  background:
    linear-gradient(180deg, rgba(238, 248, 255, 0.98), rgba(222, 238, 253, 0.98)),
    radial-gradient(circle at top right, rgba(96, 157, 216, 0.16), transparent 54%);
}

body[data-theme="light"] .channel-action-bar:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(93, 149, 205, 0.34);
}

body[data-theme="light"] .channel-action-title {
  color: #23486f;
}

body[data-theme="light"] .channel-action-hint {
  color: #5d7d9d;
}

body[data-theme="light"] .attach-btn {
  border-color: rgba(117, 158, 198, 0.46);
  background: rgba(243, 249, 255, 0.96);
  color: #2f5b86;
}

body[data-theme="light"] .attach-btn:hover {
  background: rgba(218, 236, 253, 0.98);
  color: #214569;
}

body[data-theme="light"] .attach-menu {
  border-color: rgba(122, 163, 201, 0.56);
  background: linear-gradient(180deg, #f8fcff, #eaf4ff);
  box-shadow: 0 18px 40px rgba(55, 95, 138, 0.22);
}

body[data-theme="light"] .attach-menu-item {
  color: #264a71;
}

body[data-theme="light"] .attach-menu-item:hover {
  background: rgba(196, 221, 246, 0.58);
}

body[data-theme="light"] .chat-menu,
body[data-theme="light"] .chat-list-context-menu {
  border-color: rgba(122, 163, 201, 0.56);
  background: linear-gradient(180deg, #f8fcff, #eaf4ff);
  box-shadow: 0 18px 40px rgba(55, 95, 138, 0.22);
}

body[data-theme="light"] .emoji-picker-panel {
  border-left-color: rgba(123, 161, 196, 0.44);
  background:
    linear-gradient(180deg, rgba(247, 252, 255, 0.99), rgba(235, 245, 255, 0.99)),
    radial-gradient(circle at top right, rgba(96, 157, 216, 0.16), transparent 52%);
}

body[data-theme="light"] .emoji-picker-head {
  border-bottom-color: rgba(120, 160, 199, 0.28);
}

body[data-theme="light"] .emoji-picker-title {
  color: #2a5178;
}

body[data-theme="light"] .emoji-picker-close-btn {
  border-color: rgba(117, 158, 197, 0.48);
  background: rgba(240, 248, 255, 0.94);
  color: #2f5b86;
}

body[data-theme="light"] .emoji-picker-close-btn:hover {
  background: rgba(220, 237, 253, 0.97);
  color: #214569;
}

body[data-theme="light"] .emoji-picker-search {
  border-color: rgba(118, 159, 197, 0.44);
  background: rgba(243, 249, 255, 0.95);
}

body[data-theme="light"] .emoji-picker-section-title {
  color: #4a759f;
}

body[data-theme="light"] .emoji-picker-item {
  background: rgba(227, 240, 252, 0.92);
  border-color: rgba(125, 167, 206, 0.12);
  color: #1f4469;
}

body[data-theme="light"] .emoji-picker-item:hover {
  background: rgba(203, 225, 247, 0.95);
  border-color: rgba(117, 161, 202, 0.52);
}

body[data-theme="light"] .modal-overlay {
  background: rgba(43, 69, 98, 0.34);
  backdrop-filter: blur(2px);
}

body[data-theme="light"] .modal-card {
  border-color: rgba(122, 163, 201, 0.56);
  background: linear-gradient(180deg, #f8fcff, #eaf4ff);
  color: #214366;
  box-shadow: 0 28px 60px rgba(50, 87, 125, 0.26);
}

body[data-theme="light"] .modal-head h3 {
  color: #234a71;
}

body[data-theme="light"] .modal .ghost-btn {
  border-color: rgba(118, 159, 198, 0.56);
  background: rgba(241, 248, 255, 0.95);
  color: #31597f;
}

body[data-theme="light"] .modal .ghost-btn:hover {
  background: rgba(218, 235, 252, 0.96);
  color: #1f4469;
}

body[data-theme="light"] .invite-preview-body {
  border-color: rgba(123, 163, 200, 0.34);
  background: linear-gradient(145deg, rgba(224, 239, 252, 0.98), rgba(210, 229, 247, 0.95));
}

body[data-theme="light"] .invite-preview-title {
  color: #234a71;
}

body[data-theme="light"] .invite-preview-meta {
  color: #517aa1;
}

body[data-theme="light"] .create-channel-title-label,
body[data-theme="light"] .create-channel-description-label {
  color: #4e7398;
}

body[data-theme="light"] .create-channel-title-wrap input,
body[data-theme="light"] .create-channel-description-wrap textarea {
  border-bottom-color: rgba(126, 166, 204, 0.9);
  color: #244a71;
}

body[data-theme="light"] .create-channel-title-wrap input:focus,
body[data-theme="light"] .create-channel-description-wrap textarea:focus {
  border-bottom-color: #5ea4e4;
}

body[data-theme="light"] .create-channel-actions .ghost-btn,
body[data-theme="light"] .create-channel-actions .primary-btn {
  background: transparent;
  color: #4d7398;
}

body[data-theme="light"] .create-channel-actions .primary-btn {
  color: #2f73c0;
}

body[data-theme="light"] .create-channel-actions .ghost-btn:hover,
body[data-theme="light"] .create-channel-actions .primary-btn:hover {
  background: rgba(197, 220, 243, 0.72);
  color: #1f4b76;
}

body[data-theme="light"] .media-compose-card .media-preview-wrap {
  border-color: rgba(117, 158, 198, 0.5);
  background: rgba(232, 242, 252, 0.9);
}

body[data-theme="light"] .media-compose-card .media-option-row {
  color: #2f5378;
}

body[data-theme="light"] .media-compose-card .media-option-row span {
  color: inherit;
}

body[data-theme="light"] .media-compose-card .media-caption-wrap {
  color: #3d6084;
}

body[data-theme="light"] .media-compose-card .media-caption-wrap textarea {
  border-color: rgba(117, 159, 199, 0.5);
  background: rgba(244, 249, 255, 0.96);
  color: #1f456b;
}

body[data-theme="light"] .media-compose-card .media-caption-wrap textarea::placeholder {
  color: #67839f;
  opacity: 1;
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder {
  color: #6b8198;
  opacity: 1;
}

body[data-theme="light"] .chat-title,
body[data-theme="light"] .chat-row-title,
body[data-theme="light"] .message-text {
  color: #133451;
}

body[data-theme="light"] .chat-row-preview,
body[data-theme="light"] .chat-search-preview,
body[data-theme="light"] .chat-row-date,
body[data-theme="light"] .message-sender,
body[data-theme="light"] .message-time,
body[data-theme="light"] .message-edited-mark,
body[data-theme="light"] .settings-entry-hint,
body[data-theme="light"] .chat-profile-sub-line,
body[data-theme="light"] .chat-profile-status {
  color: #4d6b88;
}

@media (max-width: 1080px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .page {
    padding: 0;
    height: 100dvh;
  }

  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    display: block;
    position: relative;
    overflow: hidden;
  }

  .app-shell.mobile-layout .left-pane,
  .app-shell.mobile-layout .right-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 220ms cubic-bezier(0.2, 0.75, 0.2, 1), visibility 0s linear 220ms;
    will-change: transform;
  }

  .app-shell.mobile-layout .left-pane {
    transform: translateX(0);
    z-index: 3;
    border-right: 0;
    visibility: visible;
    pointer-events: auto;
  }

  .app-shell.mobile-layout .right-pane {
    transform: translateX(100%);
    z-index: 4;
    visibility: hidden;
    pointer-events: none;
  }

  .app-shell.mobile-layout.mobile-chat-open .left-pane {
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
  }

  .app-shell.mobile-layout.mobile-chat-open .right-pane {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .left-pane-top {
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    z-index: 24;
  }

  .main-search-wrap input {
    height: 42px;
    font-size: 16px;
  }

  .chat-list {
    padding: 8px 6px 12px;
  }

  .chat-search-panel {
    padding: 8px 6px 12px;
  }

  .chat-row,
  .user-result-row {
    min-height: 60px;
    border-radius: 10px;
  }

  .chat-header {
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    gap: 8px;
  }

  .chat-title {
    font-size: 16px;
  }

  .chat-profile-modal-card {
    width: min(100%, calc(100% - 12px));
    max-height: calc(100dvh - 12px);
    overflow: hidden;
    border-radius: 18px;
  }

  .chat-profile-body,
  .chat-profile-body.has-members {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .chat-profile-body.has-members .chat-profile-info-column {
    display: flex;
  }

  .chat-profile-body.has-members .chat-profile-info-block,
  .chat-profile-body.has-members .chat-profile-stats,
  .chat-profile-body.has-members .chat-profile-members-column {
    grid-column: auto;
    grid-row: auto;
  }

  .chat-profile-body.has-members .chat-profile-stats {
    overflow: visible;
    border-right: 0;
  }

  .chat-profile-info-column {
    flex: 1 1 auto;
    min-height: 0;
  }

  .chat-profile-members-column {
    flex: 0 0 42%;
    min-height: 230px;
    border-left: 0;
    border-top: 1px solid rgba(143, 185, 224, 0.24);
  }

  .chat-profile-name {
    font-size: 30px;
    max-width: calc(100% - 44px);
  }

  .chat-profile-status {
    font-size: 16px;
  }

  .chat-profile-top {
    padding: 24px 16px 14px;
  }

  .chat-profile-avatar {
    width: 82px;
    height: 82px;
    font-size: 32px;
  }

  .chat-profile-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .chat-profile-quick-btn {
    min-height: 64px;
    border-radius: 12px;
  }

  .chat-profile-main-line {
    font-size: 17px;
  }

  .chat-profile-sub-line {
    font-size: 14px;
  }

  .chat-profile-stat-row {
    font-size: 15px;
    padding: 9px 10px;
  }

  .chat-profile-members-block {
    padding: 12px;
  }

  .chat-profile-members-title-wrap {
    font-size: 16px;
    gap: 7px;
  }

  .chat-profile-members-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .chat-profile-members-list {
    max-height: 42vh;
    padding: 8px;
    gap: 6px;
  }

  .chat-profile-member-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 8px 10px;
  }

  .chat-profile-member-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .chat-profile-member-name {
    font-size: 17px;
  }

  .chat-profile-member-role {
    font-size: 11px;
    padding: 3px 8px;
  }

  .chat-profile-member-remove-btn {
    grid-column: 2 / -1;
    justify-self: end;
    font-size: 14px;
    padding: 3px 6px;
  }

  .chat-profile-member-context-menu {
    min-width: min(300px, calc(100vw - 16px));
  }

  .chat-profile-member-context-item {
    font-size: 16px;
    padding: 11px 14px;
  }

  .chat-profile-add-members-card {
    border-radius: 16px;
  }

  .chat-profile-add-members-card .modal-head {
    padding: 12px 12px 10px;
  }

  .chat-profile-add-members-card .search-wrap {
    padding: 10px 12px 8px;
  }

  .chat-profile-add-members-card .participant-list {
    margin: 0 12px 12px;
    max-height: 46vh;
  }

  .chat-profile-add-members-card .modal-actions {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .group-manage-modal-card {
    border-radius: 16px;
  }

  .group-manage-head {
    padding: 12px 12px 8px;
  }

  .group-manage-head h3 {
    font-size: 24px;
  }

  .group-manage-top {
    grid-template-columns: 74px 1fr;
    gap: 10px;
    padding: 12px;
  }

  .group-manage-avatar {
    width: 74px;
    height: 74px;
    font-size: 24px;
  }

  .group-manage-static-list {
    margin: 8px 12px 0;
    padding: 8px;
    gap: 5px;
  }

  .group-manage-row {
    padding: 8px 10px;
    font-size: 14px;
  }

  .group-manage-invite-controls {
    display: flex;
  }

  .group-manage-invite-controls input {
    height: 40px;
    min-height: 40px;
    border-radius: 14px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
  }

  .group-manage-invite-regenerate-btn {
    height: 40px;
    min-height: 40px;
    flex-basis: 40px;
    width: 40px;
    min-width: 40px;
    border-radius: 999px;
    font-size: 18px;
  }

  .group-manage-danger {
    margin: 12px 12px 0;
    padding: 10px 12px;
    font-size: 16px;
  }

  .group-manage-actions {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .group-closure-modal-card {
    border-radius: 16px;
  }

  .chat-closure-banner {
    padding: 10px 12px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "meta"
      "timer";
    row-gap: 5px;
  }

  .chat-closure-banner-title {
    font-size: 10px;
    padding-left: 0;
  }

  .chat-closure-banner-meta {
    font-size: 12px;
    padding-left: 0;
  }

  .chat-closure-banner-timer {
    justify-self: stretch;
    min-width: 0;
    font-size: 19px;
    padding: 6px 8px;
  }

  .group-closure-steps {
    padding: 12px 12px 0;
  }

  .group-closure-step {
    padding: 12px;
  }

  .group-closure-title {
    font-size: 20px;
  }

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

  .chat-header-btn,
  .mobile-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .mobile-back-btn,
  .settings-back-btn,
  #closeSettingsBtn {
    display: none !important;
  }

  .selection-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .selection-actions {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .selection-secondary-btn,
  .selection-delete-btn {
    padding: 7px 11px;
    font-size: 13px;
  }

  .selection-cancel-btn {
    margin-left: auto;
    font-size: 12px;
  }

  .message-list {
    padding: 10px 10px 8px;
    gap: 8px;
  }

  .message-row {
    gap: 6px;
  }

  .message-day-separator {
    margin: 4px 0 2px;
  }

  .message-day-separator-chip {
    min-height: 24px;
    padding: 4px 10px;
    font-size: 13px;
  }

  .message-row-avatar {
    width: 32px;
    height: 32px;
  }

  .message {
    max-width: 92%;
    border-radius: 12px;
    padding: 9px 10px;
  }

  .message-single-media {
    max-width: 92%;
  }

  .message-single-media .message-media,
  .message-single-media .message-video {
    width: auto;
    max-width: min(100%, 78vw);
    max-height: min(52vh, 360px);
  }

  .message-head {
    margin-bottom: 4px;
    gap: 8px;
    padding-right: 0;
  }

  .empty-chat-bubble {
    font-size: 15px;
    text-align: center;
    max-width: 82%;
  }

  .message-media,
  .message-video,
  .message-media-stacks,
  .message-media-groups,
  .message-document {
    width: min(100%, 330px);
  }

  .message-media {
    max-height: min(44vh, 300px);
  }

  .message-video {
    max-height: min(46vh, 320px);
  }

  .message-media-group-image {
    width: min(45vw, 180px);
  }

  .message-media-group-video {
    width: min(50vw, 210px);
  }

  .jump-unread-btn {
    right: 12px;
    bottom: 84px;
    min-width: 40px;
    height: 40px;
  }

  .composer {
    --composer-control-height: 40px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    gap: 8px;
    align-items: center;
  }

  .channel-action-bar {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    min-height: 48px;
  }

  .composer textarea {
    min-height: var(--composer-control-height);
    height: var(--composer-control-height);
    max-height: 150px;
    font-size: 16px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .attach-btn {
    width: var(--composer-control-height);
    height: var(--composer-control-height);
    border-radius: 11px;
    font-size: 20px;
  }

  .composer .primary-btn {
    height: var(--composer-control-height);
    padding: 0 12px;
    border-radius: 11px;
    align-self: center;
  }

  .composer-voice {
    padding: 8px 10px;
    gap: 8px;
  }

  .composer-voice-delete,
  .composer-voice-send {
    width: 36px;
    height: 36px;
  }

  .composer-voice-wave {
    height: 28px;
  }

  .composer-mention {
    min-height: 56px;
    max-height: 220px;
  }

  .composer-mention-item {
    padding: 7px 9px;
    gap: 8px;
  }

  .composer-mention-avatar {
    width: 30px;
    height: 30px;
  }

  .composer-mention-name {
    font-size: 15px;
  }

  .composer-mention-meta {
    font-size: 13px;
  }

  .message-voice {
    width: fit-content;
    gap: 10px;
    padding: 9px 10px;
  }

  .message-voice-body {
    width: 168px;
    min-width: 168px;
  }

  .message-voice-play {
    width: 38px;
    height: 38px;
  }

  .attach-menu {
    max-width: calc(100vw - 16px);
  }

  .chat-workspace.emoji-open {
    display: flex;
  }

  .emoji-picker-panel {
    flex: 0 0 auto;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 14;
    border-left: 1px solid var(--line);
    border-top-left-radius: 14px;
    box-shadow: -18px 0 34px rgba(4, 13, 24, 0.34);
  }

  .chat-menu {
    width: min(240px, calc(100vw - 16px));
  }

  .modal {
    padding: 8px;
    place-items: end center;
  }

  .modal-card {
    width: min(720px, 100%);
    max-height: calc(100svh - 16px);
    overflow-y: auto;
    border-radius: 14px;
    padding: 14px;
  }

  .private-call-modal {
    padding: 0;
    place-items: unset;
  }

  .private-call-modal .private-call-card {
    width: min(380px, calc(100vw - 20px));
    max-height: none;
    overflow: visible;
    right: 10px;
    top: 74px;
  }

  .private-call-device-grid {
    grid-template-columns: 1fr;
  }

  .private-call-log {
    max-height: 92px;
  }

  .modal-head {
    margin-bottom: 10px;
  }

  .modal-head h3 {
    font-size: 22px;
  }

  .modal-actions {
    margin-top: 12px;
    flex-wrap: wrap;
  }

  .media-compose-card,
  .settings-modal-card,
  .image-editor-card,
  .stack-editor-card,
  .forward-modal-card,
  .chat-media-modal-card {
    width: 100%;
    max-width: 100%;
  }

  .chat-media-modal-card {
    max-height: calc(100svh - 16px);
  }

  .settings-admin-grid,
  .settings-admin-db-grid {
    grid-template-columns: 1fr;
  }

  .chat-media-title {
    font-size: 30px;
  }

  .chat-media-group-title {
    font-size: 27px;
    padding: 10px 12px 8px;
  }

  .chat-media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 12px 10px;
  }

  .chat-media-content {
    max-height: calc(100svh - 130px);
  }

  .media-compose-card {
    height: calc(100svh - 16px);
    max-height: calc(100svh - 16px);
  }

  .media-composer-thumb {
    width: 74px;
    height: 74px;
  }

  .image-editor-avatar-preview {
    padding: 10px;
    gap: 8px;
  }

  .image-editor-avatar-preview-list {
    gap: 10px;
  }

  .image-editor-avatar-preview-item.large canvas {
    width: 62px;
    height: 62px;
  }

  .media-viewer {
    place-items: stretch;
    padding: 0;
  }

  .media-viewer-card {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .media-viewer-nav-zone {
    display: none !important;
  }

  #settingsModal {
    padding: 0;
    place-items: stretch;
  }

  #settingsModal .modal-overlay {
    display: none;
  }

  #settingsModal .settings-modal-card {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding: calc(6px + env(safe-area-inset-top)) 0 calc(8px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
  }

  #settingsModal .settings-pages {
    min-height: 0;
    overflow: hidden;
  }

  #settingsModal .settings-page {
    min-height: 0;
    align-content: start;
  }

  .settings-modal-head {
    padding: 10px 12px 10px;
  }

  .settings-modal-head h3 {
    font-size: 28px;
  }

  .settings-home-profile-card {
    border-radius: 0;
  }

  .settings-entry-title {
    font-size: 16px;
  }

  .settings-entry-hint {
    font-size: 13px;
  }

  .settings-page-head {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .settings-page-title {
    font-size: 17px;
  }

  .sound-settings-grid {
    gap: 10px;
  }
}
/* Keep send button exactly aligned with attach/voice and input height */
.composer .primary-btn {
  height: var(--composer-control-height);
  min-height: var(--composer-control-height);
  padding: 0 14px;
  align-self: center;
}
