:root {
  color-scheme: dark;
  --bg: #0b111a;
  --rail: #101a26;
  --pane: #162433;
  --pane-2: #1d2e40;
  --chat: #0d1723;
  --surface: #172535;
  --surface-2: #20344a;
  --line: rgba(151, 175, 202, 0.14);
  --text: #f3f7fb;
  --muted: #8fa3b8;
  --accent: #4ea4e8;
  --accent-strong: #2f73a8;
  --green: #43c982;
  --danger: #f07066;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
}

body.light-mode {
  color-scheme: light;
  --bg: #edf2f7;
  --rail: #dce5ef;
  --pane: #f7fafc;
  --pane-2: #e8eef5;
  --chat: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef4fa;
  --line: rgba(51, 72, 96, 0.16);
  --text: #16202c;
  --muted: #647486;
  --accent: #277db8;
  --accent-strong: #176b87;
  --shadow: 0 24px 72px rgba(20, 32, 44, 0.18);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid rgba(78, 164, 232, 0.85);
  outline-offset: 2px;
}

input,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(78, 164, 232, 0.7);
  box-shadow: 0 0 0 3px rgba(78, 164, 232, 0.12);
}

textarea.input-error {
  border-color: rgba(240, 112, 102, 0.9);
  box-shadow: 0 0 0 3px rgba(240, 112, 102, 0.14);
}

textarea.input-error::placeholder {
  color: #ff9a9f;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  min-width: 0;
  overflow: hidden;
}

.mobile-list-toolbar,
.mobile-tabbar,
.mobile-chat-back {
  display: none;
}

body.logged-out .app-shell,
body.logged-out .drawer,
body.logged-out .drawer-backdrop,
body.logged-out .side-panel,
body.logged-out .chat-menu,
body.logged-out .mobile-tabbar,
body.logged-out .modal-overlay {
  display: none;
}

body.auth-loading .app-shell,
body.auth-loading .login-screen,
body.auth-loading .drawer,
body.auth-loading .drawer-backdrop,
body.auth-loading .side-panel,
body.auth-loading .chat-menu,
body.auth-loading .mobile-tabbar,
body.auth-loading .modal-overlay {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(78, 164, 232, 0.12), transparent 36%),
    #07111d;
}

body:not(.logged-out) .login-screen {
  display: none;
}

.login-card {
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  background: #152231;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.42);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-logo {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
}

.login-brand p {
  margin: 4px 0 0;
  color: #9fb1c4;
  font-size: 14px;
  line-height: 1.35;
}

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

.login-screen-form input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #0f1b29;
  color: var(--text);
  font: inherit;
}

.password-field {
  position: relative;
  display: block;
  width: 100%;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  border-radius: 8px;
  background: transparent;
  color: #8fb3d2;
}

.password-toggle:hover {
  background: rgba(143, 179, 210, 0.1);
  color: #d7ecff;
}

.password-toggle::before {
  content: "";
  position: absolute;
  inset: 7px 5px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='20' height='16' viewBox='0 0 20 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 2.2C5.4 2.2 2.1 6 1 8c1.1 2 4.4 5.8 9 5.8S17.9 10 19 8c-1.1-2-4.4-5.8-9-5.8Zm0 9.1A3.3 3.3 0 1 1 10 4.7a3.3 3.3 0 0 1 0 6.6Zm0-1.8A1.5 1.5 0 1 0 10 6.5a1.5 1.5 0 0 0 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg width='20' height='16' viewBox='0 0 20 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 2.2C5.4 2.2 2.1 6 1 8c1.1 2 4.4 5.8 9 5.8S17.9 10 19 8c-1.1-2-4.4-5.8-9-5.8Zm0 9.1A3.3 3.3 0 1 1 10 4.7a3.3 3.3 0 0 1 0 6.6Zm0-1.8A1.5 1.5 0 1 0 10 6.5a1.5 1.5 0 0 0 0 3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.password-toggle.visible::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-35deg);
  transform-origin: center;
}

.login-screen-form button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 650;
  cursor: pointer;
}

.login-screen-form .link-button {
  height: auto;
  padding: 4px 0;
  background: transparent;
  color: #8eb7dd;
  font-weight: 600;
}

.login-screen-form .link-button:hover {
  color: #ffffff;
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.login-links button {
  border: 0;
  background: transparent;
  color: #8eb7dd;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.login-links button.active {
  color: #ffffff;
}

.login-links button:disabled {
  color: #4d6073;
  cursor: default;
}

.rail {
  position: relative;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 8px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  overflow: hidden;
  min-width: 72px;
  max-width: 72px;
}

.rail-button {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 100%;
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: center;
}

.rail-button.active {
  background: rgba(78, 164, 232, 0.16);
  color: #9bd0ff;
}

.rail-button:not(.menu-button) > span:last-child {
  display: none;
}

.rail-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.menu-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  margin-bottom: 4px;
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 99px;
  background: var(--muted);
}

.chat-list-pane {
  min-width: 0;
  background: var(--pane);
  border-right: 1px solid var(--line);
}

.list-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--pane);
}

.list-menu-button {
  width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
}

.list-menu-button:hover {
  background: rgba(124, 159, 190, 0.12);
}

.search-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--pane-2);
  color: var(--muted);
}

.search-field input {
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder,
textarea::placeholder,
input::placeholder {
  color: #7890a8;
}

.connection-line {
  display: none;
}

.status {
  min-width: 82px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.status.online {
  background: rgba(67, 201, 130, 0.16);
  color: #8cf0bc;
}

.chat-list-content {
  height: calc(100vh - 68px);
  overflow-y: auto;
}

.archive-row,
.list-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(151, 175, 202, 0.06);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.archive-row {
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.archive-row:hover,
.archive-row.active {
  background: rgba(78, 164, 232, 0.16);
}

.archive-icon,
.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ea4e8, #43c982);
  background-position: center;
  background-size: cover;
  color: #fff;
  font-weight: 650;
}

.avatar.has-avatar {
  color: transparent;
  text-indent: -999px;
}

.archive-icon {
  background: #354b62;
  font-size: 22px;
}

.list-item::before {
  content: attr(data-avatar);
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #355572;
  background-position: center;
  background-size: cover;
  color: #fff;
  font-weight: 650;
}

.list-item.has-avatar::before,
.start-user-row.has-avatar::before {
  content: "";
  background-image: var(--avatar-url);
}

.list-item.active {
  background: rgba(78, 164, 232, 0.28);
}

.archive-row strong,
.archive-row span,
.list-item strong,
.list-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item > div {
  min-width: 0;
}

.chat-item-side {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 38px;
}

.list-item time {
  align-self: start;
  color: #9fb1c4;
  font-size: 12px;
}

.unread-badge {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.archive-row strong,
.list-item strong {
  font-size: 14px;
}

.archive-row span,
.list-item span {
  margin-top: 4px;
  color: #9fb1c4;
  font-size: 13px;
}

.start-chat-card.compact-start {
  gap: 6px;
  display: grid;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(151, 175, 202, 0.06);
}

.start-chat-card strong {
  color: var(--text);
  font-size: 15px;
}

.start-chat-card span,
.start-chat-card p,
.start-chat-status {
  margin: 0;
  color: #9fb1c4;
  font-size: 13px;
  line-height: 1.35;
}

.start-chat-title {
  display: grid;
  gap: 5px;
}

.start-section-label {
  margin-top: 4px;
  color: #b6ddff;
  font-weight: 600;
}

.start-chat-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(151, 175, 202, 0.06);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.start-chat-button:hover {
  background: rgba(78, 164, 232, 0.16);
}

.start-chat-button::before {
  content: attr(data-avatar);
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 22px;
  font-weight: 650;
}

.start-chat-button strong,
.start-chat-button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-chat-button strong {
  font-size: 15px;
}

.start-chat-button span {
  margin-top: 4px;
  color: #9fb1c4;
  font-size: 13px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(2 8 14 / 0.55);
  backdrop-filter: blur(2px);
}

.start-chat-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, auto) minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 10px;
  background: #152231;
  color: var(--text);
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-header span {
  display: block;
  margin-top: 5px;
  color: #9fb1c4;
  font-size: 13px;
}

.start-chat-modal-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0 18px;
}

.start-chat-modal-search input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #1a2b3d;
  color: var(--text);
  font: inherit;
}

.start-chat-modal-search button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 650;
  cursor: pointer;
}

.start-chat-dialog .start-chat-status {
  min-height: 18px;
  padding: 0 18px;
}

.start-chat-list {
  display: grid;
  gap: 6px;
  padding: 0 12px;
  overflow-y: auto;
}

.start-chat-list:last-child {
  padding-bottom: 14px;
}

.forward-targets {
  max-height: min(54vh, 520px);
}

.forward-targets .start-user-row.selected {
  background: rgba(78, 164, 232, 0.18);
}

.forward-targets .start-user-row.selected::after {
  content: "✓";
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #4ea4e8;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.start-user-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.start-user-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.start-user-row::before {
  content: attr(data-avatar);
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #355572;
  background-position: center;
  background-size: cover;
  color: #ffffff;
  font-weight: 650;
}

.forward-options {
  display: grid;
  gap: 8px;
  padding: 10px 18px 0;
  border-top: 1px solid var(--line);
}

.forward-option {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #c8def2;
  font-size: 14px;
}

.forward-option input {
  width: 18px;
  height: 18px;
}

.forward-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 18px 0;
}

.forward-compose textarea {
  min-height: 44px;
  max-height: 120px;
  padding: 11px 12px;
  resize: vertical;
  background: #101b28;
  color: var(--text);
}

.forward-compose button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 650;
}

.forward-compose button:disabled {
  cursor: default;
  opacity: 0.5;
}


.start-user-row strong,
.start-user-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--chat);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #111d2a;
}

body.light-mode .chat-header,
body.light-mode .composer {
  background: #f7fafc;
}

.voice-player {
  display: grid;
  grid-template-columns: 30px 34px 30px minmax(120px, 1fr) auto minmax(160px, 260px) auto 30px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 29, 42, 0.96);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

.voice-player.hidden {
  display: none;
}

.voice-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.voice-player span {
  color: #9fb1c4;
  font-size: 12px;
  white-space: nowrap;
}

.message-checks {
  display: inline-flex;
  letter-spacing: -3px;
  padding-right: 3px;
  color: #7cc9ff;
  font-weight: 700;
}

.voice-player-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #9bc5e8;
  transition: background 0.16s ease, color 0.16s ease;
}

.voice-player-button:hover,
.voice-speed:hover {
  background: rgba(255, 255, 255, 0.07);
}

.voice-player-button::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.voice-play-icon::before,
.voice-play-button::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M8%205v14l11-7z'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M8%205v14l11-7z'%2F%3E%3C%2Fsvg%3E");
}

.voice-play-icon.playing::before,
.voice-message.playing .voice-play-button::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M7%205h4v14H7zM13%205h4v14h-4z'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M7%205h4v14H7zM13%205h4v14h-4z'%2F%3E%3C%2Fsvg%3E");
}

.voice-back-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M11%206v12l-8-6 8-6Zm10%200v12l-8-6 8-6Z'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M11%206v12l-8-6 8-6Zm10%200v12l-8-6 8-6Z'%2F%3E%3C%2Fsvg%3E");
}

.voice-forward-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M13%206v12l8-6-8-6ZM3%206v12l8-6-8-6Z'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M13%206v12l8-6-8-6ZM3%206v12l8-6-8-6Z'%2F%3E%3C%2Fsvg%3E");
}

.voice-close-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%3E%3Cpath%20d='M18%206 6%2018M6%206l12%2012'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%3E%3Cpath%20d='M18%206 6%2018M6%206l12%2012'%2F%3E%3C%2Fsvg%3E");
}

.voice-seek,
.voice-volume {
  accent-color: #5aa7de;
}

.voice-seek {
  width: 100%;
  height: 18px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.voice-seek::-webkit-slider-runnable-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6bb4e8 0 calc(var(--voice-progress, 0) * 100%), rgba(139, 164, 188, 0.32) 0);
}

.voice-seek::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #77c4f4;
  box-shadow: 0 0 0 4px rgba(119, 196, 244, 0.14);
  -webkit-appearance: none;
  appearance: none;
}

.voice-seek::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(139, 164, 188, 0.32);
}

.voice-seek::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: #6bb4e8;
}

.voice-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #77c4f4;
}

.voice-volume {
  display: none;
}

.voice-speed {
  min-width: 38px;
  height: 28px;
  border-radius: 999px;
  background: rgba(90, 167, 222, 0.12);
  color: #9fd0ff;
  font-size: 12px;
  font-weight: 650;
}

.chat-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-identity {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  padding: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.chat-identity:hover h2 {
  color: #9fd0ff;
}

#activeUserLabel {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chat-message-search {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto 34px 34px 34px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #142233;
}

.chat-message-search.hidden {
  display: none;
}

.chat-message-search input {
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  background: #1b2d40;
  color: var(--text);
}

.chat-message-search span {
  min-width: 52px;
  color: #9fb1c4;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

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

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: #172a3e;
}

.selection-bar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.selection-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: #203a54;
  color: var(--text);
  font-weight: 650;
}

.selection-action:hover {
  background: #294967;
}

.selection-action.danger {
  background: rgba(240, 112, 102, 0.14);
  color: #ff7a83;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0;
  line-height: 0;
}

.icon-button:hover,
.icon-button[aria-expanded="true"],
.rail-button:hover,
.menu-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.icon-button::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.panel-close-icon::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%3E%3Cpath%20d='M18%206 6%2018M6%206l12%2012'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%3E%3Cpath%20d='M18%206 6%2018M6%206l12%2012'/%3E%3C/svg%3E");
}

.back-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2018l-6-6 6-6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2018l-6-6 6-6'/%3E%3C/svg%3E");
}

.search-chat-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='11'%20cy='11'%20r='7'%2F%3E%3Cpath%20d='M20%2020l-3.5-3.5'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='11'%20cy='11'%20r='7'%2F%3E%3Cpath%20d='M20%2020l-3.5-3.5'%2F%3E%3C%2Fsvg%3E");
}

.phone-call-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M22%2016.92v3a2%202%200%200%201-2.18%202%2019.8%2019.8%200%200%201-8.63-3.07%2019.5%2019.5%200%200%201-6-6A19.8%2019.8%200%200%201%202.12%204.18%202%202%200%200%201%204.11%202h3a2%202%200%200%201%202%201.72c.12.9.32%201.77.58%202.61a2%202%200%200%201-.45%202.11L8.09%209.91a16%2016%200%200%200%206%206l1.47-1.15a2%202%200%200%201%202.11-.45c.84.26%201.72.46%202.61.58A2%202%200%200%201%2022%2016.92Z'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M22%2016.92v3a2%202%200%200%201-2.18%202%2019.8%2019.8%200%200%201-8.63-3.07%2019.5%2019.5%200%200%201-6-6A19.8%2019.8%200%200%201%202.12%204.18%202%202%200%200%201%204.11%202h3a2%202%200%200%201%202%201.72c.12.9.32%201.77.58%202.61a2%202%200%200%201-.45%202.11L8.09%209.91a16%2016%200%200%200%206%206l1.47-1.15a2%202%200%200%201%202.11-.45c.84.26%201.72.46%202.61.58A2%202%200%200%201%2022%2016.92Z'%2F%3E%3C%2Fsvg%3E");
}

.more-chat-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Ccircle%20cx='12'%20cy='5'%20r='2'%2F%3E%3Ccircle%20cx='12'%20cy='12'%20r='2'%2F%3E%3Ccircle%20cx='12'%20cy='19'%20r='2'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Ccircle%20cx='12'%20cy='5'%20r='2'%2F%3E%3Ccircle%20cx='12'%20cy='12'%20r='2'%2F%3E%3Ccircle%20cx='12'%20cy='19'%20r='2'%2F%3E%3C%2Fsvg%3E");
}

.search-prev-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m15%2018-6-6 6-6'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m15%2018-6-6 6-6'%2F%3E%3C%2Fsvg%3E");
}

.search-next-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m9%2018 6-6-6-6'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m9%2018 6-6-6-6'%2F%3E%3C%2Fsvg%3E");
}

.search-close-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%3E%3Cpath%20d='M18%206 6%2018M6%206l12%2012'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%3E%3Cpath%20d='M18%206 6%2018M6%206l12%2012'%2F%3E%3C%2Fsvg%3E");
}

.chat-menu {
  position: fixed;
  z-index: 60;
  width: 260px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #142232;
  box-shadow: 0 18px 45px rgb(0 0 0 / 0.35);
}

.chat-menu button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 440;
  text-align: left;
  cursor: pointer;
}

.chat-menu button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.chat-menu button.danger {
  color: #ff5a6b;
}

.chat-menu button.muted-action {
  color: var(--muted);
}

.chat-menu hr {
  height: 1px;
  margin: 6px 4px;
  border: 0;
  background: var(--line);
}

.chat-menu-icon,
.dropdown-icon {
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 19px 19px;
  mask-size: 19px 19px;
}

.info-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M12%2016v-4M12%208h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M12%2016v-4M12%208h.01'/%3E%3C/svg%3E");
}

.archive-menu-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%207h16v13H4zM3%204h18v3H3zM9%2012h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%207h16v13H4zM3%204h18v3H3zM9%2012h6'/%3E%3C/svg%3E");
}

.clear-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%206h18M8%206V4h8v2M6%206l1%2015h10l1-15M10%2011v6M14%2011v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%206h18M8%206V4h8v2M6%206l1%2015h10l1-15M10%2011v6M14%2011v6'/%3E%3C/svg%3E");
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(2 8 14 / 0.52);
  backdrop-filter: blur(2px);
}

.confirm-dialog {
  width: min(320px, calc(100vw - 32px));
  padding: 20px 24px 16px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 8px;
  background: #152231;
  color: #ffffff;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.45);
}

.confirm-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.confirm-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #b87bff, #775df0);
  color: #ffffff;
  font-size: 20px;
  font-weight: 650;
}

.confirm-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.confirm-text,
.confirm-warning {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.45;
}

.confirm-warning {
  margin-bottom: 18px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
}

.confirm-button {
  min-width: 72px;
  padding: 8px 0;
  border: 0;
  color: #68b8ff;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.confirm-button:hover {
  color: #9fd0ff;
}

.confirm-button.danger {
  color: #ff4d5d;
}

.confirm-button.danger:hover {
  color: #ff7682;
}

.messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 16px clamp(12px, 3vw, 44px) 20px;
  scroll-padding-bottom: 28px;
  background:
    linear-gradient(rgba(13, 23, 35, 0.86), rgba(13, 23, 35, 0.86)),
    repeating-linear-gradient(135deg, #132233 0, #132233 1px, #0d1723 1px, #0d1723 16px);
}

body.light-mode .messages {
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)),
    repeating-linear-gradient(135deg, #edf2f7 0, #edf2f7 1px, #ffffff 1px, #ffffff 16px);
}

.messages-loading {
  align-self: center;
  margin: auto;
  color: rgba(172, 195, 216, 0.78);
  font-size: 13px;
}

.message-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, auto);
  align-items: end;
  align-self: flex-start;
  gap: 8px;
  max-width: min(760px, 96%);
  font-size: 14px;
  line-height: 1.35;
}

.message {
  position: relative;
  max-width: min(620px, 100%);
  padding: 7px 10px;
  border-radius: 9px;
  background: #18283a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.messages.selecting .message-row {
  cursor: pointer;
}

.message-row.selected .message,
.message-row.selected .video-note-shell,
.message-row.selected .photo-message-button {
  outline: 2px solid #64b5f6;
  box-shadow: 0 0 0 5px rgba(100, 181, 246, 0.14), 0 10px 30px rgba(0, 0, 0, 0.18);
}

.message-row.selected::after {
  content: "✓";
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #4ea4e8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.message-row.search-match .message,
.message-row.search-match .video-note-shell,
.message-row.search-match .photo-message-button {
  outline: 0;
  box-shadow: inset 0 0 0 999px rgba(94, 181, 255, 0.06);
}

.message-row.search-current .message,
.message-row.search-current .video-note-shell,
.message-row.search-current .photo-message-button {
  outline: 0;
  box-shadow: inset 0 0 0 999px rgba(94, 181, 255, 0.11);
}

body.light-mode .message {
  background: #ffffff;
}

.message.mine {
  background: #28577a;
}

body.light-mode .message.mine {
  background: #dff0fb;
}

.message.bot {
  border-left: 3px solid #8b7cf6;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
  color: #a7bdd2;
  font-size: 11px;
  font-weight: 600;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.video-note-row {
  max-width: min(330px, 82%);
}

.image-row {
  max-width: min(420px, 92%);
}

.video-note-body {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.media-message-body {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.message-avatar {
  position: relative;
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  margin-bottom: 6px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ea4e8, #43c982);
  background-position: center;
  background-size: cover;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.message-avatar.has-avatar {
  color: transparent;
  text-indent: -999px;
}

.message-avatar::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: -26px;
  z-index: 7;
  max-width: 180px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(12, 20, 30, 0.96);
  color: #d8ecff;
  font-size: 12px;
  font-weight: 500;
  text-indent: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-2px);
  transition: opacity 0.16s ease 1s, transform 0.16s ease 1s;
}

.message-avatar:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.video-note-row p {
  max-width: 240px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  background: #18283a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.video-note-row.mine p {
  background: #28577a;
}

.forward-meta {
  display: inline-grid;
  gap: 2px;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 0 0 0 9px;
  border-left: 2px solid #64b5f6;
  background: transparent;
  color: #9fd0ff;
  text-align: left;
}

.forward-meta span {
  color: #a7bdd2;
  font-size: 12px;
  font-weight: 600;
}

.forward-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.forward-meta.clickable {
  cursor: pointer;
}

.forward-meta.clickable:hover strong {
  color: #ffffff;
}

.reply-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  width: min(220px, 100%);
  margin: 2px 0 5px;
  padding: 5px 8px;
  border-left: 3px solid #5db4ee;
  border-radius: 7px;
  background: rgba(78, 164, 232, 0.16);
  color: var(--text);
  text-align: left;
}

.reply-meta.with-thumb {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
}

.reply-thumb {
  display: block;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.reply-thumb.hidden {
  display: none;
}

.reply-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reply-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.reply-meta strong,
.reply-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-meta strong {
  color: #7cc9ff;
  font-size: 12px;
}

.reply-meta span {
  color: #c9d7e5;
  font-size: 12px;
}

.video-note-row .forward-meta {
  max-width: 180px;
  margin: 0 0 2px 2px;
  padding: 5px 8px 5px 9px;
  border-left-color: #f25fa7;
  border-radius: 7px;
  background: rgba(34, 47, 65, 0.92);
}

.video-note-row .forward-meta span {
  color: #ff86c0;
}

.video-note-row .forward-meta strong {
  color: #ff86c0;
}

.message-attachment {
  margin-top: 6px;
}

.image-row .message-attachment,
.video-note-row .message-attachment {
  margin-top: 0;
}

.message-attachment img,
.message-attachment video {
  display: block;
  width: auto;
  height: auto;
  max-width: min(360px, 100%);
  max-height: 280px;
  border-radius: 7px;
  object-fit: contain;
  background: #0f1a27;
}

.photo-message-button {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}

.photo-message-button img {
  border-radius: 9px;
}

.media-overlay-time {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(12, 20, 30, 0.72);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.photo-message-button:hover .media-overlay-time,
.photo-message-button:focus-visible .media-overlay-time {
  opacity: 1;
  transform: translateY(0);
}

.message-attachment audio {
  display: block;
  width: min(360px, 100%);
}

.video-note-attachment {
  width: 236px;
  margin-top: 0;
}

.video-note-shell {
  --video-progress: 0;
  position: relative;
  width: 226px;
  height: 226px;
  border-radius: 50%;
}

.video-note-shell::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  border-radius: 50%;
  background: conic-gradient(rgba(235, 242, 248, 0.88) calc(var(--video-progress) * 1turn), rgba(235, 242, 248, 0.16) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
}

.video-note-progress-thumb {
  position: absolute;
  left: calc(50% + var(--video-thumb-x) - 5px);
  top: calc(50% + var(--video-thumb-y) - 5px);
  z-index: 4;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #eef5fb;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.video-note-shell.scrubbing .video-note-progress-thumb {
  opacity: 1;
}

.message-attachment video.video-note {
  width: 226px;
  height: 226px;
  max-width: 226px;
  max-height: 226px;
  border-radius: 50%;
  object-fit: cover;
  background: #0b1420;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.video-note-duration,
.video-note-time {
  position: absolute;
  bottom: 5px;
  z-index: 2;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(17, 29, 42, 0.88);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.video-note-duration {
  left: 12px;
}

.video-note-time {
  right: 12px;
}

.video-note-sound {
  position: absolute;
  right: 28px;
  bottom: 52px;
  z-index: 3;
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: rgba(12, 20, 30, 0.72);
  color: #ffffff;
}

.video-note-sound::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205%206%209H3v6h3l5%204V5Z'%2F%3E%3Cpath%20d='M15.5%208.5a5%205%200%200%201%200%207'%2F%3E%3Cpath%20d='M18.5%205.5a9%209%200%200%201%200%2013'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205%206%209H3v6h3l5%204V5Z'%2F%3E%3Cpath%20d='M15.5%208.5a5%205%200%200%201%200%207'%2F%3E%3Cpath%20d='M18.5%205.5a9%209%200%200%201%200%2013'%2F%3E%3C%2Fsvg%3E");
}

.video-note-sound.muted::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205%206%209H3v6h3l5%204V5Z'%2F%3E%3Cpath%20d='M16%209l5%205'%2F%3E%3Cpath%20d='M21%209l-5%205'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205%206%209H3v6h3l5%204V5Z'%2F%3E%3Cpath%20d='M16%209l5%205'%2F%3E%3Cpath%20d='M21%209l-5%205'%2F%3E%3C%2Fsvg%3E");
}

.voice-message {
  --voice-progress: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: min(330px, 100%);
  min-height: 58px;
}

.voice-play-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #55acee;
  color: #ffffff;
}

.voice-play-button::before {
  content: "";
  display: block;
  width: 19px;
  height: 19px;
  margin-left: 2px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.voice-message.playing .voice-play-button::before {
  margin-left: 0;
}

.voice-content {
  min-width: 0;
}

.voice-wave-button {
  width: 100%;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.voice-wave {
  position: relative;
  display: flex;
  align-items: center;
  height: 24px;
  gap: 2px;
  overflow: hidden;
}

.voice-wave::after {
  content: none;
  pointer-events: none;
}

.voice-wave span {
  flex: 1 1 2px;
  min-width: 2px;
  border-radius: 999px;
  background: rgba(157, 215, 255, 0.35);
  transition: height 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  opacity: 0.82;
}

.voice-wave span.played {
  background: rgba(211, 238, 255, 0.78);
  opacity: 1;
}

.voice-message.active .voice-wave span {
  background: rgba(198, 232, 255, 0.42);
}

.voice-message.active .voice-wave span.played {
  background: rgba(235, 248, 255, 0.9);
}

.voice-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  color: #9fd0ff;
  font-size: 11px;
}

.voice-meta span + span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #55acee;
  vertical-align: 1px;
}

.message-attachment a {
  color: #9fd0ff;
  font-weight: 600;
}

.image-preview-button {
  display: block;
  padding: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.date-divider {
  align-self: center;
  margin: 8px 0 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(29, 49, 70, 0.92);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.date-divider:hover {
  background: rgba(47, 83, 117, 0.96);
}

.chat-date-picker {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 36px;
  background: rgba(4, 10, 17, 0.92);
}

.media-viewer img {
  display: block;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.media-viewer-close {
  position: fixed;
  top: 18px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(23, 37, 53, 0.84);
  color: #ffffff;
  font-size: 0;
  line-height: 1;
}

.media-viewer-close:hover {
  background: rgba(78, 164, 232, 0.34);
}

.media-viewer-nav {
  position: fixed;
  top: 50%;
  z-index: 121;
  width: 54px;
  height: 74px;
  transform: translateY(-50%);
  border-radius: 12px;
  background: rgba(23, 37, 53, 0.62);
  color: #ffffff;
  font-size: 46px;
  line-height: 1;
}

.media-viewer-nav:hover {
  background: rgba(78, 164, 232, 0.34);
}

.media-viewer-nav.previous {
  left: 24px;
}

.media-viewer-nav.next {
  right: 24px;
}

.clipboard-image-dialog {
  width: min(430px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto auto auto auto;
  gap: 12px;
  overflow: hidden;
  padding: 22px 26px 18px;
  border: 1px solid rgba(132, 158, 184, 0.16);
  border-radius: 10px;
  background: #142333;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
}

.clipboard-image-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.clipboard-image-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
}

.clipboard-image-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  max-height: min(48vh, 360px);
  overflow: hidden;
  border: 1px solid rgba(135, 163, 190, 0.1);
  border-radius: 7px;
  background: #1b2d40;
}

.clipboard-image-preview img {
  display: block;
  max-width: 100%;
  max-height: min(48vh, 360px);
  object-fit: contain;
}

.clipboard-image-check {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #dbeafe;
  font-size: 14px;
  font-weight: 450;
}

.clipboard-image-check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.clipboard-caption {
  position: relative;
  display: grid;
  gap: 6px;
}

.clipboard-caption span {
  color: #8ea8c2;
  font-size: 14px;
}

.clipboard-caption textarea {
  min-height: 42px;
  max-height: 120px;
  padding: 10px 42px 9px 12px;
  resize: vertical;
  border: 1px solid rgba(91, 126, 158, 0.42);
  border-radius: 6px;
  background: #102032;
  color: var(--text);
}

.emoji-inline-button {
  position: absolute;
  right: 7px;
  bottom: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #8fb4d5;
  font-size: 21px;
}

.emoji-inline-button:hover {
  background: rgba(78, 164, 232, 0.14);
  color: #d9edff;
}

.clipboard-emoji-picker {
  display: grid;
  grid-template-columns: repeat(6, 34px);
  gap: 6px;
  justify-content: end;
  justify-self: end;
  padding: 8px;
  border: 1px solid rgba(132, 158, 184, 0.13);
  border-radius: 8px;
  background: #102032;
}

.clipboard-emoji-picker button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 7px;
  background: #1a3045;
  font-size: 19px;
}

.clipboard-emoji-picker button:hover {
  background: #274965;
}

.dialog-status {
  min-height: 18px;
  color: #8fb4d5;
  font-size: 13px;
}

.dialog-status.error {
  color: #ff7a83;
}

.clipboard-image-actions {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.clipboard-image-actions button {
  min-height: 34px;
  padding: 0 4px;
  background: transparent;
  color: #5eb5ff;
  font-weight: 560;
}

.clipboard-image-actions button:hover {
  color: #bfe4ff;
}

.clipboard-image-actions button:disabled {
  cursor: default;
  opacity: 0.55;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.message-reactions button {
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(78, 164, 232, 0.14);
  color: #c8def2;
  font-size: 12px;
  font-weight: 600;
}

.message-reactions button.active {
  background: rgba(78, 164, 232, 0.36);
  color: #ffffff;
}

.composer {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) repeat(3, 44px) minmax(108px, auto);
  gap: 10px;
  align-items: end;
  min-width: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: #111d2a;
}

.reply-composer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-left: 3px solid #5db4ee;
  border-radius: 8px;
  background: rgba(78, 164, 232, 0.12);
}

.reply-composer.hidden {
  display: none;
}

.reply-composer-icon::before {
  content: "↩";
  color: #6dbaf0;
  font-size: 18px;
  font-weight: 700;
}

.reply-composer-icon.has-thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background-position: center;
  background-size: cover;
}

.reply-composer-icon.has-thumb::before {
  content: "";
}

.reply-composer strong,
.reply-composer span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-composer strong {
  color: #7cc9ff;
  font-size: 13px;
}

.reply-composer span {
  color: #a9bdd0;
  font-size: 12px;
}

.composer textarea {
  min-width: 0;
  min-height: 46px;
  max-height: 160px;
  padding: 12px 14px;
  resize: vertical;
  background: #1a2a3b;
  color: var(--text);
}

body.light-mode .composer textarea,
body.light-mode .auth-form input,
body.light-mode .drawer-panel input {
  background: #ffffff;
}

.composer button,
.auth-form button,
.inline-form button,
.section-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(105, 151, 191, 0.18);
  background: rgba(78, 164, 232, 0.14);
  color: #d4eaff;
  font-size: 14px;
  font-weight: 560;
  letter-spacing: 0;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.auth-form button:hover,
.inline-form button:hover,
.section-action:hover {
  border-color: rgba(105, 178, 235, 0.34);
  background: rgba(78, 164, 232, 0.2);
  color: #ffffff;
}

.composer .emoji-toggle {
  width: 44px;
  min-width: 44px;
  min-height: 42px;
  padding: 0;
  background: #1d3146;
  color: #b8d7f1;
  font-size: 20px;
  touch-action: none;
  user-select: none;
}

body:not(.video-note-mode) #recordVideoNote {
  display: none;
}

body.video-note-mode #recordAudio {
  display: none;
}

.composer.recording::after {
  content: "Удерживайте для записи, вверх - закрепить";
  position: absolute;
  right: 74px;
  bottom: calc(100% + 8px);
  padding: 7px 10px;
  border: 1px solid rgba(137, 169, 197, 0.18);
  border-radius: 999px;
  background: rgba(16, 29, 42, 0.94);
  color: #b7d5ef;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.composer.recording-locked::after {
  content: "Запись закреплена. Нажмите кнопку, чтобы отправить";
  color: #ffffff;
}

.mic-record-icon::before,
.video-note-record-icon::before,
.call-icon::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: auto;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.camera-call-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2010l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-1.45.9L15%2014'%2F%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2010l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-1.45.9L15%2014'%2F%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'%2F%3E%3C%2Fsvg%3E");
}

.video-call-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2010l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-1.45.9L15%2014'%2F%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2010l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-1.45.9L15%2014'%2F%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'%2F%3E%3C%2Fsvg%3E");
}

.video-note-record-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2010l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-1.45.9L15%2014'%2F%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'%2F%3E%3Ccircle%20cx='7.5'%20cy='10'%20r='1'%2F%3E%3Cpath%20d='M7%2014h4'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%2010l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-1.45.9L15%2014'%2F%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'%2F%3E%3Ccircle%20cx='7.5'%20cy='10'%20r='1'%2F%3E%3Cpath%20d='M7%2014h4'%2F%3E%3C%2Fsvg%3E");
}

.camera-call-icon.camera-on::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10.66%206H13a2%202%200%200%201%202%202v2l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-.67.94'%2F%3E%3Cpath%20d='M15%2014v2a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V8c0-.6.26-1.13.67-1.5'%2F%3E%3Cpath%20d='M3%203l18%2018'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10.66%206H13a2%202%200%200%201%202%202v2l4.55-2.28A1%201%200%200%201%2021%208.62v6.76a1%201%200%200%201-.67.94'%2F%3E%3Cpath%20d='M15%2014v2a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V8c0-.6.26-1.13.67-1.5'%2F%3E%3Cpath%20d='M3%203l18%2018'%2F%3E%3C%2Fsvg%3E");
}

.mic-record-icon::before,
.mic-call-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%202a3%203%200%200%200-3%203v7a3%203%200%200%200%206%200V5a3%203%200%200%200-3-3Z'%2F%3E%3Cpath%20d='M19%2010v2a7%207%200%200%201-14%200v-2'%2F%3E%3Cpath%20d='M12%2019v3'%2F%3E%3Cpath%20d='M8%2022h8'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%202a3%203%200%200%200-3%203v7a3%203%200%200%200%206%200V5a3%203%200%200%200-3-3Z'%2F%3E%3Cpath%20d='M19%2010v2a7%207%200%200%201-14%200v-2'%2F%3E%3Cpath%20d='M12%2019v3'%2F%3E%3Cpath%20d='M8%2022h8'%2F%3E%3C%2Fsvg%3E");
}

.mic-call-icon.active::before,
.mic-record-icon.recording::before,
.video-note-record-icon.recording::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%209v3a3%203%200%200%200%205.12%202.12M15%209.34V5a3%203%200%200%200-5.94-.6'%2F%3E%3Cpath%20d='M17%2016.95A7%207%200%200%201%205%2012v-2'%2F%3E%3Cpath%20d='M19%2010v2c0%20.75-.12%201.47-.34%202.14'%2F%3E%3Cpath%20d='M12%2019v3'%2F%3E%3Cpath%20d='M8%2022h8'%2F%3E%3Cpath%20d='M3%203l18%2018'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%209v3a3%203%200%200%200%205.12%202.12M15%209.34V5a3%203%200%200%200-5.94-.6'%2F%3E%3Cpath%20d='M17%2016.95A7%207%200%200%201%205%2012v-2'%2F%3E%3Cpath%20d='M19%2010v2c0%20.75-.12%201.47-.34%202.14'%2F%3E%3Cpath%20d='M12%2019v3'%2F%3E%3Cpath%20d='M8%2022h8'%2F%3E%3Cpath%20d='M3%203l18%2018'%2F%3E%3C%2Fsvg%3E");
}

.video-note-record-icon.recording::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Crect%20x='7'%20y='7'%20width='10'%20height='10'%20rx='2'%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Crect%20x='7'%20y='7'%20width='10'%20height='10'%20rx='2'%2F%3E%3C%2Fsvg%3E");
}

.composer .emoji-toggle.recording,
.composer #recordAudio.recording,
.composer #recordVideoNote.recording {
  background: rgba(240, 112, 102, 0.22);
  color: #ff7a83;
}

.composer button:disabled {
  cursor: default;
  opacity: 0.5;
}

.emoji-picker {
  position: absolute;
  right: 128px;
  bottom: calc(100% + 8px);
  z-index: 16;
  display: grid;
  grid-template-columns: repeat(6, 36px);
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #172535;
  box-shadow: var(--shadow);
}

.emoji-picker button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 20px;
}

.emoji-picker button:hover {
  background: #20344a;
}

.voice-player {
  grid-template-columns: 30px 34px 30px minmax(120px, 1fr) auto minmax(160px, 260px) auto auto 30px;
}

.voice-volume-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205 6%209H3v6h3l5%204V5Z'/%3E%3Cpath%20d='M15.5%208.5a5%205%200%200%201%200%207'/%3E%3Cpath%20d='M18.5%205.5a9%209%200%200%201%200%2013'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205 6%209H3v6h3l5%204V5Z'/%3E%3Cpath%20d='M15.5%208.5a5%205%200%200%201%200%207'/%3E%3Cpath%20d='M18.5%205.5a9%209%200%200%201%200%2013'/%3E%3C/svg%3E");
}

.voice-volume-icon.muted::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205 6%209H3v6h3l5%204V5Z'/%3E%3Cpath%20d='M16%209l5%205'/%3E%3Cpath%20d='M21%209l-5%205'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M11%205 6%209H3v6h3l5%204V5Z'/%3E%3Cpath%20d='M16%209l5%205'/%3E%3Cpath%20d='M21%209l-5%205'/%3E%3C/svg%3E");
}

.voice-popover-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.voice-speed-menu,
.voice-volume-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 30;
  display: none;
  border: 1px solid rgba(126, 157, 188, 0.16);
  border-radius: 8px;
  background: #142231;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

.voice-popover-wrap:hover .voice-speed-menu,
.voice-popover-wrap:focus-within .voice-speed-menu,
.voice-popover-wrap:hover .voice-volume-popover,
.voice-popover-wrap:focus-within .voice-volume-popover {
  display: grid;
}

.voice-speed-menu {
  width: 205px;
  padding: 8px;
}

.voice-speed-menu.hidden {
  display: none !important;
}

.voice-speed-menu button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.voice-speed-menu button:hover,
.voice-speed-menu button.active {
  background: rgba(78, 164, 232, 0.14);
}

.voice-speed-menu button span {
  color: #7cc9ff;
  font-size: 12px;
}

.voice-speed-menu button strong {
  font-size: 13px;
  font-weight: 500;
}

.voice-volume-popover {
  width: 42px;
  height: 132px;
  place-items: center;
  padding: 12px 0;
}

.voice-volume-popover .voice-volume {
  display: block;
  width: 104px;
  transform: rotate(-90deg);
}

.composer {
  grid-template-columns: 34px minmax(0, 1fr) repeat(4, 38px);
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}

.attach-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

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

.attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 40;
  display: grid;
  min-width: 178px;
  padding: 8px;
  border: 1px solid rgba(126, 157, 188, 0.16);
  border-radius: 8px;
  background: #142231;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.attach-menu.hidden {
  display: none;
}

.attach-menu button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.attach-menu button:hover {
  background: rgba(78, 164, 232, 0.14);
}

.attach-menu strong {
  font-size: 13px;
  font-weight: 500;
}

.composer-icon,
.send-icon {
  display: grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #8fb3d1;
}

.composer-icon:hover,
.send-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #d9ecff;
}

.attach-icon::before,
.send-icon::before,
.attach-menu-icon::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.attach-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m21.4%2011.6-9.8%209.8a6%206%200%200%201-8.5-8.5l10-10a4%204%200%201%201%205.7%205.7l-10%2010a2%202%200%200%201-2.8-2.8l9.7-9.7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='m21.4%2011.6-9.8%209.8a6%206%200%200%201-8.5-8.5l10-10a4%204%200%201%201%205.7%205.7l-10%2010a2%202%200%200%201-2.8-2.8l9.7-9.7'/%3E%3C/svg%3E");
}

.media-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='5'%20width='18'%20height='14'%20rx='2'/%3E%3Ccircle%20cx='8.5'%20cy='10'%20r='1.5'/%3E%3Cpath%20d='m21%2015-5-5L5%2021'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='5'%20width='18'%20height='14'%20rx='2'/%3E%3Ccircle%20cx='8.5'%20cy='10'%20r='1.5'/%3E%3Cpath%20d='m21%2015-5-5L5%2021'/%3E%3C/svg%3E");
}

.document-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8Z'/%3E%3Cpath%20d='M14%202v6h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8Z'/%3E%3Cpath%20d='M14%202v6h6'/%3E%3C/svg%3E");
}

.location-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%2010c0%205-8%2012-8%2012S4%2015%204%2010a8%208%200%201%201%2016%200Z'/%3E%3Ccircle%20cx='12'%20cy='10'%20r='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%2010c0%205-8%2012-8%2012S4%2015%204%2010a8%208%200%201%201%2016%200Z'/%3E%3Ccircle%20cx='12'%20cy='10'%20r='3'/%3E%3C/svg%3E");
}

.send-icon {
  background: transparent;
  color: #66b9f1;
}

.send-icon.hidden {
  display: none;
}

.send-icon::before {
  width: 22px;
  height: 22px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012h13'/%3E%3Cpath%20d='m13%206%206%206-6%206'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012h13'/%3E%3Cpath%20d='m13%206%206%206-6%206'/%3E%3C/svg%3E");
}

.composer textarea {
  min-height: 42px;
  max-height: 220px;
  padding: 10px 8px;
  border-color: transparent;
  box-shadow: none;
  overflow-y: auto;
  resize: none;
  background: transparent;
  scrollbar-width: none;
}

.composer textarea::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.composer textarea:focus {
  border-color: transparent;
  box-shadow: none;
  background: transparent;
}

.composer .emoji-toggle.hidden,
.composer #recordAudio.hidden,
.composer #recordVideoNote.hidden {
  display: none;
}

.composer .emoji-toggle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #8fb3d1;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.composer .emoji-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.message-menu {
  position: fixed;
  z-index: 40;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172535;
  box-shadow: var(--shadow);
}

.reaction-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.reaction-row button {
  min-height: 34px;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
}

.reaction-row button:hover,
.message-menu > button:hover {
  background: #20344a;
}

.message-menu > button {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.message-menu .danger {
  color: #ff6573;
}

.split-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 12px;
}

.confirm-button:disabled {
  cursor: default;
  color: #6f8296;
  opacity: 0.58;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.54);
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(300px, 100vw);
  overflow: hidden;
  background: #142232;
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 180ms ease;
  visibility: hidden;
}

body.light-mode .drawer {
  background: #f7fafc;
}

.drawer.open {
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
}

.drawer-profile {
  padding: 22px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.account-toggle {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.account-toggle .avatar {
  width: 50px;
  height: 50px;
}

.account-toggle strong,
.account-toggle small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-toggle small {
  margin-top: 4px;
  color: #8eb7dd;
  font-size: 13px;
}

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

.auth-menu {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #101b28;
}

body.light-mode .auth-menu,
body.light-mode .drawer .list-item,
body.light-mode .check-item,
body.light-mode .settings-row {
  background: #ffffff;
}

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

.tab {
  min-height: 36px;
  border-radius: 8px;
  background: #1d2e40;
  color: var(--muted);
  font-weight: 600;
}

body.light-mode .tab {
  background: #e8eef5;
}

.tab.active {
  background: rgba(78, 164, 232, 0.18);
  color: #b6ddff;
}

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

.auth-form label,
.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.auth-form input,
.drawer-panel input,
.drawer-panel textarea,
.drawer-panel select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(126, 157, 188, 0.16);
  border-radius: 8px;
  background: #0f1a27;
  color: var(--text);
  font-size: 14px;
}

.drawer-panel textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.35;
}

.drawer-panel input::placeholder,
.drawer-panel textarea::placeholder {
  color: #7f94aa;
}

.auth-form .password-field input,
.drawer-panel .password-field input,
.login-screen-form .password-field input {
  padding-right: 42px;
}

.secondary {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(140, 166, 191, 0.14);
  background: rgba(145, 170, 196, 0.08);
  color: #aebfd1;
  font-weight: 540;
}

.secondary:hover {
  border-color: rgba(140, 166, 191, 0.26);
  background: rgba(145, 170, 196, 0.12);
  color: #d9e6f2;
}

body.light-mode .secondary {
  background: #e8eef5;
}

.full-width {
  width: 100%;
}

.hidden {
  display: none !important;
}

.account-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.contact-card-state {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b28;
}

.contact-profile-card {
  position: relative;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 7px;
  padding: 24px 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.contact-profile-card .avatar {
  width: 74px;
  height: 74px;
  font-size: 24px;
}

.contact-profile-card > strong {
  font-size: 16px;
  font-weight: 560;
}

.contact-profile-close {
  position: absolute;
  top: 4px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: #c7d6e5;
  font-size: 0;
}

.contact-profile-close:hover {
  background: rgba(255, 255, 255, 0.07);
}

.contact-profile-actions {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  margin-top: 10px;
}

.contact-profile-action {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 52px;
  padding: 8px 4px;
  border-radius: 8px;
  background: #111f2e;
  color: #dcecfb;
  font-size: 11px;
  font-weight: 460;
}

.contact-profile-action:hover,
.contact-profile-action.active {
  background: #1b3146;
  color: #ffffff;
}

.contact-profile-action > span {
  color: currentColor;
  font-size: 12px;
}

.contact-action-icon,
.dropdown-icon {
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.contact-action-chat .contact-action-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M4%205.8A3.8%203.8%200%200%201%207.8%202h8.4A3.8%203.8%200%200%201%2020%205.8v5.8a3.8%203.8%200%200%201-3.8%203.8H11l-4.55%203.35A.9.9%200%200%201%205%2018.02v-2.86a3.8%203.8%200%200%201-1-2.58V5.8Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M4%205.8A3.8%203.8%200%200%201%207.8%202h8.4A3.8%203.8%200%200%201%2020%205.8v5.8a3.8%203.8%200%200%201-3.8%203.8H11l-4.55%203.35A.9.9%200%200%201%205%2018.02v-2.86a3.8%203.8%200%200%201-1-2.58V5.8Z'/%3E%3C/svg%3E");
}

.contact-action-sound .contact-action-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M12%202a4%204%200%200%200-4%204v1.2c0%202.4-.65%203.8-1.42%204.9-.42.6-.58%201.05-.58%201.9h12c0-.85-.16-1.3-.58-1.9C16.65%2011%2016%209.6%2016%207.2V6a4%204%200%200%200-4-4Zm-2.2%2014a2.2%202.2%200%200%200%204.4%200h-4.4Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M12%202a4%204%200%200%200-4%204v1.2c0%202.4-.65%203.8-1.42%204.9-.42.6-.58%201.05-.58%201.9h12c0-.85-.16-1.3-.58-1.9C16.65%2011%2016%209.6%2016%207.2V6a4%204%200%200%200-4-4Zm-2.2%2014a2.2%202.2%200%200%200%204.4%200h-4.4Z'/%3E%3C/svg%3E");
}

.contact-action-call .contact-action-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M6.6%203.4c.45-.45%201.18-.45%201.63%200l2.48%202.48c.38.38.45.98.16%201.44l-1.2%201.94a13.2%2013.2%200%200%200%205.07%205.07l1.94-1.2c.46-.29%201.06-.22%201.44.16l2.48%202.48c.45.45.45%201.18%200%201.63l-1.1%201.1c-1.22%201.22-3.05%201.64-4.86.9A18.7%2018.7%200%200%201%204.6%209.36c-.74-1.81-.32-3.64.9-4.86l1.1-1.1Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M6.6%203.4c.45-.45%201.18-.45%201.63%200l2.48%202.48c.38.38.45.98.16%201.44l-1.2%201.94a13.2%2013.2%200%200%200%205.07%205.07l1.94-1.2c.46-.29%201.06-.22%201.44.16l2.48%202.48c.45.45.45%201.18%200%201.63l-1.1%201.1c-1.22%201.22-3.05%201.64-4.86.9A18.7%2018.7%200%200%201%204.6%209.36c-.74-1.81-.32-3.64.9-4.86l1.1-1.1Z'/%3E%3C/svg%3E");
}

.contact-action-more .contact-action-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Ccircle%20cx='5'%20cy='12'%20r='2'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2'/%3E%3Ccircle%20cx='19'%20cy='12'%20r='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Ccircle%20cx='5'%20cy='12'%20r='2'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2'/%3E%3Ccircle%20cx='19'%20cy='12'%20r='2'/%3E%3C/svg%3E");
}

.contact-dropdown {
  position: absolute;
  z-index: 35;
  top: 166px;
  right: 12px;
  display: grid;
  min-width: 224px;
  overflow: hidden;
  padding: 6px 0;
  border: 1px solid rgba(15, 23, 42, 0.3);
  border-radius: 8px;
  background: #172433;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

.contact-dropdown.sound-menu {
  right: 78px;
}

.contact-dropdown button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 0;
  background: transparent;
  color: #e4edf7;
  font-size: 13px;
  font-weight: 450;
  text-align: left;
}

.contact-dropdown button:hover {
  background: rgba(124, 159, 190, 0.12);
}

.contact-dropdown button.danger {
  color: #ff6470;
}

.contact-dropdown button:first-child {
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
}

.tone-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%2018V5l10-2v13'/%3E%3Ccircle%20cx='6'%20cy='18'%20r='3'/%3E%3Ccircle%20cx='16'%20cy='16'%20r='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M9%2018V5l10-2v13'/%3E%3Ccircle%20cx='6'%20cy='18'%20r='3'/%3E%3Ccircle%20cx='16'%20cy='16'%20r='3'/%3E%3C/svg%3E");
}

.mute-icon,
.notifications-off-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%205 6%209H3v6h3l4%204V5Z'/%3E%3Cpath%20d='m19%209-6%206M13%209l6%206'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%205 6%209H3v6h3l4%204V5Z'/%3E%3Cpath%20d='m19%209-6%206M13%209l6%206'/%3E%3C/svg%3E");
}

.snooze-icon,
.timer-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='13'%20r='7'/%3E%3Cpath%20d='M12%209v4l3%202M9%202h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='13'%20r='7'/%3E%3Cpath%20d='M12%209v4l3%202M9%202h6'/%3E%3C/svg%3E");
}

.share-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2012v7a1%201%200%200%200%201%201h14a1%201%200%200%200%201-1v-7M16%206l-4-4-4%204M12%202v14'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2012v7a1%201%200%200%200%201%201h14a1%201%200%200%200%201-1v-7M16%206l-4-4-4%204M12%202v14'/%3E%3C/svg%3E");
}

.edit-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%2020h9'/%3E%3Cpath%20d='M16.5%203.5a2.1%202.1%200%200%201%203%203L7%2019l-4%201%201-4%2012.5-12.5Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%2020h9'/%3E%3Cpath%20d='M16.5%203.5a2.1%202.1%200%200%201%203%203L7%2019l-4%201%201-4%2012.5-12.5Z'/%3E%3C/svg%3E");
}

.export-icon,
.copy-off-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2012h12M12%208l4%204-4%204M4%206h16M4%2018h16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%2012h12M12%208l4%204-4%204M4%206h16M4%2018h16'/%3E%3C/svg%3E");
}

.block-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='m5.7%205.7%2012.6%2012.6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='m5.7%205.7%2012.6%2012.6'/%3E%3C/svg%3E");
}

.delete-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%206h18M8%206V4h8v2M6%206l1%2015h10l1-15'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%206h18M8%206V4h8v2M6%206l1%2015h10l1-15'/%3E%3C/svg%3E");
}

.contact-info-list,
.contact-summary-list {
  display: grid;
  gap: 0;
  margin: 0 -18px;
  padding: 8px 18px;
  border-top: 8px solid rgba(255, 255, 255, 0.03);
  border-bottom: 8px solid rgba(255, 255, 255, 0.03);
  background: #111e2c;
}

.contact-summary-list {
  margin-top: 0;
  padding-block: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.contact-info-row,
.contact-summary-list button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 38px;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-weight: 480;
}

.contact-summary-list button {
  min-height: 42px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.contact-summary-list button:last-child {
  border-bottom: 0;
}

.contact-summary-list button:hover {
  background: rgba(124, 159, 190, 0.1);
}

.contact-info-row {
  grid-template-columns: minmax(0, 1fr);
}

.contact-info-row strong,
.contact-summary-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 520;
}

.contact-info-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.contact-summary-list button span {
  display: block;
  width: 24px;
  height: 24px;
  color: #a9c5dc;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 21px 21px;
  mask-size: 21px 21px;
}

[data-contact-tab="media"] .summary-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='5'%20width='18'%20height='14'%20rx='2'/%3E%3Ccircle%20cx='8'%20cy='10'%20r='1.5'/%3E%3Cpath%20d='m21%2015-5-5L5%2021'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='5'%20width='18'%20height='14'%20rx='2'/%3E%3Ccircle%20cx='8'%20cy='10'%20r='1.5'/%3E%3Cpath%20d='m21%2015-5-5L5%2021'/%3E%3C/svg%3E");
}

[data-contact-tab="videos"] .summary-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'/%3E%3Cpath%20d='m15%2010%205-3v10l-5-3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='6'%20width='12'%20height='12'%20rx='2'/%3E%3Cpath%20d='m15%2010%205-3v10l-5-3'/%3E%3C/svg%3E");
}

[data-contact-tab="files"] .summary-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linejoin='round'%3E%3Cpath%20d='M6%202h8l4%204v16H6z'/%3E%3Cpath%20d='M14%202v5h5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linejoin='round'%3E%3Cpath%20d='M6%202h8l4%204v16H6z'/%3E%3Cpath%20d='M14%202v5h5'/%3E%3C/svg%3E");
}

[data-contact-tab="audio"] .summary-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%3E%3Cpath%20d='M4%2018V9a8%208%200%200%201%2016%200v9'/%3E%3Cpath%20d='M4%2018h4v-7H4v7Zm12%200h4v-7h-4v7Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%3E%3Cpath%20d='M4%2018V9a8%208%200%200%201%2016%200v9'/%3E%3Cpath%20d='M4%2018h4v-7H4v7Zm12%200h4v-7h-4v7Z'/%3E%3C/svg%3E");
}

[data-contact-tab="links"] .summary-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%2013a5%205%200%200%200%207.07%200l2-2a5%205%200%200%200-7.07-7.07l-1%201'/%3E%3Cpath%20d='M14%2011a5%205%200%200%200-7.07%200l-2%202A5%205%200%200%200%2012%2020l1-1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M10%2013a5%205%200%200%200%207.07%200l2-2a5%205%200%200%200-7.07-7.07l-1%201'/%3E%3Cpath%20d='M14%2011a5%205%200%200%200-7.07%200l-2%202A5%205%200%200%200%2012%2020l1-1'/%3E%3C/svg%3E");
}

[data-contact-tab="voices"] .summary-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%202a3%203%200%200%200-3%203v7a3%203%200%200%200%206%200V5a3%203%200%200%200-3-3Z'/%3E%3Cpath%20d='M19%2010v2a7%207%200%200%201-14%200v-2M12%2019v3M8%2022h8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M12%202a3%203%200%200%200-3%203v7a3%203%200%200%200%206%200V5a3%203%200%200%200-3-3Z'/%3E%3Cpath%20d='M19%2010v2a7%207%200%200%201-14%200v-2M12%2019v3M8%2022h8'/%3E%3C/svg%3E");
}

[data-contact-tab="groups"] .summary-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='9'%20cy='7'%20r='4'/%3E%3Cpath%20d='M22%2021v-2a4%204%200%200%200-3-3.87M16%203.13a4%204%200%200%201%200%207.75'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='9'%20cy='7'%20r='4'/%3E%3Cpath%20d='M22%2021v-2a4%204%200%200%200-3-3.87M16%203.13a4%204%200%200%201%200%207.75'/%3E%3C/svg%3E");
}

.contact-card-state strong,
.contact-card-state span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-state div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.contact-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.contact-actions .section-action {
  min-height: 40px;
  font-size: 14px;
  font-weight: 520;
}

.contact-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.contact-tabs button {
  min-height: 34px;
  border-radius: 8px;
  background: #101b28;
  color: var(--muted);
  font-size: 12px;
  font-weight: 540;
}

.contact-tabs button.active,
.contact-tabs button:hover {
  background: #21435f;
  color: #ffffff;
}

.contact-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: min(48vh, 520px);
  margin: 8px 0 14px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
}

.contact-media-overlay {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 9, 16, 0.62);
}

.contact-media-dialog {
  width: min(430px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121f2d;
  box-shadow: var(--shadow);
}

.contact-media-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.contact-media-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 560;
}

.contact-media-body {
  min-height: 220px;
  overflow-y: auto;
  padding: 14px;
}

.contact-media-body .contact-media-grid {
  max-height: none;
  margin: 0;
  padding: 0;
}

.contact-media-section {
  display: grid;
  gap: 10px;
}

.voice-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border-radius: 8px;
  background: #172839;
  color: var(--text);
  text-align: left;
}

.voice-list-item:hover,
.voice-list-item.active {
  background: #1f3a54;
}

.voice-list-play {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
}

.voice-list-play::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M8%205v14l11-7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M8%205v14l11-7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.voice-list-item.active .voice-list-play::before {
  margin-left: 0;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M7%205h4v14H7zM13%205h4v14h-4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='white'%3E%3Cpath%20d='M7%205h4v14H7zM13%205h4v14h-4z'/%3E%3C/svg%3E");
}

.voice-list-item strong,
.voice-list-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-list-item strong {
  font-size: 13px;
  font-weight: 560;
}

.voice-list-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.contact-media-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.contact-media-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #101b28;
}

.contact-media-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-media-tile span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 18px 6px 6px;
  overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  color: #ffffff;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-media-row {
  grid-column: 1 / -1;
  display: block;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #101b28;
  color: var(--text);
  text-align: left;
}

.contact-media-row strong,
.contact-media-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-media-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.section-action.danger {
  border-color: rgba(240, 112, 102, 0.16);
  background: rgba(240, 112, 102, 0.1);
  color: #ff8d94;
}

.section-action.danger:hover {
  border-color: rgba(240, 112, 102, 0.3);
  background: rgba(240, 112, 102, 0.16);
  color: #ffb4b9;
}

.section-action:disabled,
.secondary:disabled {
  cursor: default;
  opacity: 0.5;
}

.account-card .avatar {
  width: 44px;
  height: 44px;
}

.avatar-large {
  width: 74px;
  height: 74px;
  font-size: 28px;
}

.profile-avatar-editor {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b28;
}

.profile-avatar-editor strong,
.profile-avatar-editor span {
  display: block;
}

.profile-avatar-editor span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-avatar-actions .section-action {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.profile-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b28;
}

.profile-form label {
  display: grid;
  gap: 6px;
}

.profile-form label span,
.profile-email-state span {
  color: var(--muted);
  font-size: 13px;
}

.profile-form input {
  min-height: 40px;
  background: #0d1825;
}

.profile-email-state {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 32px;
}

.profile-email-state strong {
  font-size: 13px;
  font-weight: 560;
}

.profile-email-state strong.verified {
  color: var(--green);
}

.profile-email-state strong.unverified {
  color: #ffb3b8;
}

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

.profile-actions-row .section-action {
  min-height: 38px;
}

.profile-actions-row .section-action.hidden + .section-action {
  grid-column: 1 / -1;
}

.avatar-crop-dialog {
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: #152231;
  color: var(--text);
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.45);
}

.avatar-crop-stage {
  display: grid;
  place-items: center;
  padding: 0 18px;
}

.avatar-crop-stage canvas {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 1px var(--line), 0 18px 45px rgba(0, 0, 0, 0.28);
}

.avatar-crop-stage canvas:active {
  cursor: grabbing;
}

.avatar-crop-controls {
  display: grid;
  gap: 10px;
  padding: 0 18px;
}

.avatar-crop-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.avatar-crop-controls input {
  width: 100%;
  min-height: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}

.modal-actions button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 650;
}

.modal-actions .secondary {
  background: #101b28;
  color: var(--text);
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

.call-dialog {
  position: absolute;
  right: 24px;
  bottom: 88px;
  width: min(420px, calc(100vw - 32px));
  min-width: 310px;
  max-width: calc(100vw - 24px);
  min-height: 280px;
  max-height: calc(100vh - 24px);
  display: grid;
  justify-items: center;
  gap: 12px;
  overflow: auto;
  resize: both;
  padding: 0 18px 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: #152231;
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.call-dialog.fullscreen {
  top: 12px !important;
  right: auto !important;
  bottom: auto !important;
  left: 12px !important;
  width: calc(100vw - 24px) !important;
  height: calc(100vh - 24px) !important;
  max-width: none;
  max-height: none;
  resize: none;
}

.call-dialog.fullscreen .call-video-stage {
  height: min(70vh, calc(100vh - 230px));
  aspect-ratio: auto;
}

.call-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-self: stretch;
  min-height: 38px;
  margin: 0 -18px 2px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: #c6d8e9;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.call-window-header:active {
  cursor: grabbing;
}

.call-window-header span {
  font-size: 13px;
  font-weight: 560;
}

.call-window-header div {
  display: flex;
  gap: 6px;
}

.call-window-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: #aecaeb;
}

.call-window-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.call-window-button::before {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.fullscreen-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%203H3v5M16%203h5v5M21%2016v5h-5M8%2021H3v-5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%203H3v5M16%203h5v5M21%2016v5h-5M8%2021H3v-5'/%3E%3C/svg%3E");
}

.call-dialog.fullscreen .fullscreen-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%203v5H3M16%203v5h5M21%2016h-5v5M3%2016h5v5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%203v5H3M16%203v5h5M21%2016h-5v5M3%2016h5v5'/%3E%3C/svg%3E");
}

.call-video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  background: #08111d;
  box-shadow: inset 0 0 0 1px var(--line);
}

.call-video-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#localVideo {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 30%;
  max-width: 150px;
  min-width: 92px;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: #101b28;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

.call-dialog h2 {
  margin: 6px 0 0;
  font-size: 22px;
}

.call-dialog p {
  margin: 0;
  color: var(--muted);
}

.call-media-status {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.35;
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.call-action {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 700;
}

.call-action.call-icon {
  width: 44px;
  min-width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.call-action.accept {
  background: #20a66b;
}

.call-action.active {
  background: rgba(78, 164, 232, 0.22);
  color: #b8d7f1;
}

.call-action.danger {
  background: rgba(240, 112, 102, 0.18);
  color: #ff7a83;
}

.switch-camera-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%207h3l2-2h6l2%202h3v11H4z'/%3E%3Ccircle%20cx='12'%20cy='13'%20r='3'/%3E%3Cpath%20d='M7%2013a5%205%200%200%201%208-4M17%2011V7h-4M17%2013a5%205%200%200%201-8%204M7%2015v4h4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.1'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M4%207h3l2-2h6l2%202h3v11H4z'/%3E%3Ccircle%20cx='12'%20cy='13'%20r='3'/%3E%3Cpath%20d='M7%2013a5%205%200%200%201%208-4M17%2011V7h-4M17%2013a5%205%200%200%201-8%204M7%2015v4h4'/%3E%3C/svg%3E");
}

.account-card strong,
.account-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card span,
.auth-message {
  color: var(--muted);
  font-size: 13px;
}

.auth-message.error {
  color: var(--danger);
}

.drawer-menu {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.menu-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 0 22px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  width: 100%;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.menu-row.active {
  background: rgba(78, 164, 232, 0.16);
  color: #b6ddff;
}

.menu-icon {
  display: grid;
  width: 24px;
  place-items: center;
  color: #b7c8d9;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drawer-footer {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 18px 24px;
  color: #8eb7dd;
  font-size: 13px;
}

.side-panel {
  position: fixed;
  inset: 0 auto 0 calc(72px + min(300px, calc(100vw - 72px)));
  z-index: 29;
  width: min(360px, calc(100vw - 372px));
  min-width: 320px;
  overflow-y: auto;
  background: #101b28;
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}

body.light-mode .side-panel {
  background: #f7fafc;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

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

.side-panel .panel-title h2 {
  display: none;
}

.switch {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #31475e;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9fb1c4;
  transition: transform 160ms ease, background 160ms ease;
}

.switch-row input:checked + .switch {
  background: #2f73a8;
}

.switch-row input:checked + .switch::after {
  transform: translateX(14px);
  background: #fff;
}

.drawer-panel {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin-bottom: 4px;
}

.panel-title h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 620;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-form input,
.inline-form button {
  height: 40px;
}

.list {
  display: grid;
  margin-top: 12px;
}

.drawer .list {
  gap: 8px;
}

.drawer .list-item {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 50px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b28;
}

.drawer .list-item::before {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.compact {
  max-height: 220px;
  overflow-y: auto;
}

.check-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(70px, auto);
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b28;
  color: var(--text);
  font-size: 13px;
}

.check-item input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.check-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.mini-check input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  accent-color: var(--accent);
}

.mini-check em {
  font-style: normal;
}

.group-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.group-settings-grid label,
.toggle-row {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.group-settings-grid select {
  appearance: none;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, #9eb4c9 50%) right 15px center / 6px 6px no-repeat,
    linear-gradient(135deg, #9eb4c9 50%, transparent 50%) right 11px center / 6px 6px no-repeat,
    #0f1a27;
  color: var(--text);
  padding: 0 32px 0 10px;
  font-size: 13px;
}

.group-settings-grid select:focus {
  border-color: rgba(78, 164, 232, 0.7);
  box-shadow: 0 0 0 3px rgba(78, 164, 232, 0.12);
}

.group-settings-grid option {
  background: #101b28;
  color: var(--text);
}

.toggle-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 0 2px;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

.toggle-row span {
  overflow: hidden;
  color: #a8bbce;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title.compact {
  margin-top: 10px;
}

.group-search-item {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.group-search-item button,
.group-member-actions button {
  border: 0;
  border-radius: 8px;
  background: rgba(74, 164, 231, 0.16);
  color: #a9d8ff;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.group-search-item button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.7;
}

.group-member-summary {
  display: grid;
  gap: 8px;
  text-align: left;
}

.group-member-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(126, 157, 188, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.group-member-row .avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.group-member-row strong,
.group-member-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-row span {
  color: var(--muted);
  font-size: 12px;
}

.group-member-actions {
  display: flex;
  gap: 6px;
}

.group-member-actions button.danger {
  background: rgba(255, 99, 118, 0.14);
  color: #ff8fa0;
}

#groupsPanel .section-action {
  min-height: 40px;
  justify-content: center;
}

#groupsPanel #createChat {
  border-color: rgba(78, 164, 232, 0.26);
  background: rgba(78, 164, 232, 0.18);
  color: #e4f3ff;
}

#groupsPanel #saveGroupSettings {
  margin-top: -4px;
}

#groupsPanel .inline-form {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.settings-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.settings-hub {
  display: grid;
  gap: 8px;
}

.settings-hub button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b28;
  color: var(--text);
  text-align: left;
}

.settings-hub button:hover,
.settings-hub button:focus-visible {
  border-color: rgba(86, 167, 232, 0.45);
  background: #142235;
}

.settings-hub-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(80, 159, 221, 0.14);
  color: #9ccaf0;
  font-size: 15px;
}

.settings-hub strong,
.settings-hub small {
  display: block;
}

.settings-hub strong {
  font-size: 14px;
  font-weight: 620;
}

.settings-hub small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #101b28;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row span {
  color: var(--muted);
}

.settings-row strong {
  font-size: 13px;
  font-weight: 560;
}

.settings-row strong.verified {
  color: var(--green);
}

.settings-row strong.unverified {
  color: #ffb3b8;
}

.empty-state {
  align-self: center;
  max-width: 360px;
  margin: auto;
  padding: 26px;
  border-radius: 10px;
  background: rgba(24, 40, 58, 0.92);
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  .chat-list-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-right: 0;
    min-height: 0;
  }

  .mobile-list-toolbar {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: max(6px, env(safe-area-inset-top, 0px)) 4px 4px;
  }

  .mobile-list-toolbar strong {
    overflow: hidden;
    color: var(--text);
    font-size: 18px;
    font-weight: 650;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-pill-button,
  .mobile-round-button,
  .mobile-tabbar button,
  .mobile-chat-back {
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-pill-button {
    min-width: 60px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 14px;
    font-weight: 560;
  }

  .mobile-toolbar-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }

  .mobile-round-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
  }

  .mobile-add-icon::before,
  .mobile-add-icon::after,
  .mobile-compose-icon::before,
  .mobile-compose-icon::after,
  .mobile-chat-back::before {
    content: "";
    position: absolute;
    background: currentColor;
  }

  .mobile-add-icon::before {
    width: 16px;
    height: 2px;
    border-radius: 2px;
  }

  .mobile-add-icon::after {
    width: 2px;
    height: 16px;
    border-radius: 2px;
  }

  .mobile-compose-icon::before {
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: transparent;
  }

  .mobile-compose-icon::after {
    width: 11px;
    height: 2px;
    transform: translate(4px, -6px) rotate(-42deg);
    border-radius: 2px;
  }

  .list-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-height: auto;
    padding: 8px 16px 12px;
    background: rgba(22, 36, 51, 0.96);
    backdrop-filter: blur(18px);
  }

  .list-menu-button {
    display: none;
  }

  .search-field {
    grid-column: 1 / -1;
    min-height: 42px;
    background: rgba(255, 255, 255, 0.08);
  }

  .connection-line {
    display: none;
  }

  .chat-list-content {
    height: auto;
    min-height: 0;
    padding-bottom: 8px;
  }

  .archive-row,
  .list-item {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 10px 16px;
  }

  .archive-icon,
  .avatar {
    width: 48px;
    height: 48px;
  }

  .chat {
    display: none;
    grid-column: 1;
    min-height: 0;
    height: calc(100dvh - env(safe-area-inset-bottom, 0px));
    max-height: none;
  }

  body.mobile-chat-open .app-shell {
    padding-bottom: 0;
  }

  body.mobile-chat-open .chat-list-pane {
    display: none;
  }

  body.mobile-chat-open .chat {
    display: grid;
  }

  body.mobile-chat-open .mobile-tabbar {
    display: none;
  }

  .mobile-chat-back {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    color: #9ec6e8;
  }

  .mobile-chat-back::before {
    width: 13px;
    height: 13px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    background: transparent;
    transform: rotate(45deg) translate(2px, -2px);
  }

  .chat-header {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    min-height: 58px;
    padding: max(8px, env(safe-area-inset-top, 0px)) 10px 8px;
  }

  .chat-identity {
    padding: 0;
  }

  .chat-identity h2 {
    font-size: 16px;
  }

  .chat-actions {
    gap: 2px;
  }

  .chat-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .messages {
    padding: 14px 12px 12px;
  }

  .mobile-tabbar {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    min-height: 62px;
    padding: 7px 8px;
    border: 1px solid rgba(151, 175, 202, 0.2);
    border-radius: 28px;
    background: rgba(15, 26, 38, 0.86);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(22px);
  }

  .mobile-tabbar button {
    display: grid;
    place-items: center;
    gap: 2px;
    min-width: 0;
    padding: 4px 2px;
    border-radius: 20px;
    background: transparent;
    color: #a7b8ca;
    font-size: 11px;
    font-weight: 520;
  }

  .mobile-tabbar button.active {
    color: var(--accent);
  }

  .mobile-tab-icon {
    position: relative;
    width: 23px;
    height: 23px;
    color: currentColor;
  }

  .mobile-tab-icon::before,
  .mobile-tab-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
  }

  .mobile-tab-icon.contacts::before {
    inset: 2px 7px 10px;
    border: 2px solid currentColor;
    border-radius: 50%;
  }

  .mobile-tab-icon.contacts::after {
    left: 3px;
    right: 3px;
    bottom: 2px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 999px 999px 4px 4px;
  }

  .mobile-tab-icon.calls::before {
    inset: 3px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-right-color: transparent;
    border-radius: 5px 0 7px 5px;
    transform: rotate(-45deg);
  }

  .mobile-tab-icon.chats::before {
    inset: 3px 2px 6px;
    border: 2px solid currentColor;
    border-radius: 8px;
  }

  .mobile-tab-icon.chats::after {
    left: 7px;
    bottom: 3px;
    width: 7px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: skew(-18deg);
  }

  .mobile-tab-icon.settings::before {
    inset: 3px;
    border: 2px solid currentColor;
    border-radius: 50%;
  }

  .mobile-tab-icon.settings::after {
    inset: 8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-shadow:
      0 -8px 0 -4px currentColor,
      0 8px 0 -4px currentColor,
      8px 0 0 -4px currentColor,
      -8px 0 0 -4px currentColor;
  }

  .mobile-tab-icon.search::before {
    inset: 2px 5px 6px 2px;
    border: 2px solid currentColor;
    border-radius: 50%;
  }

  .mobile-tab-icon.search::after {
    right: 2px;
    bottom: 3px;
    width: 9px;
    height: 2px;
    border-radius: 3px;
    background: currentColor;
    transform: rotate(45deg);
  }

  .voice-player {
    grid-template-columns: 30px 34px 30px minmax(0, 1fr) auto auto 30px;
    gap: 6px;
    padding: 6px 10px;
  }

  .voice-seek {
    grid-column: 1 / -1;
    width: 100%;
  }

  .voice-volume {
    display: none;
  }

  .drawer {
    left: 0;
    width: min(300px, 100vw);
    transform: translateX(-100%);
  }

  body.drawer-panel-mode .drawer {
    pointer-events: none;
    transform: translateX(-100%);
    visibility: hidden;
  }

  .side-panel {
    inset: auto 0 0 0;
    width: 100vw;
    min-width: 0;
    max-height: calc(100dvh - 74px - env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
  }

  body.drawer-panel-mode .side-panel {
    inset: 0 0 calc(74px + env(safe-area-inset-bottom, 0px)) 0;
    z-index: 32;
    width: 100vw;
    max-height: none;
    border-top: 0;
    border-right: 0;
  }

  body.drawer-panel-mode .side-panel-header {
    min-height: 58px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .drawer-backdrop {
    left: 0;
  }

  body.drawer-panel-mode .drawer-backdrop {
    display: none;
  }

  .composer {
    grid-template-columns: 42px minmax(0, 1fr) repeat(4, 38px);
    gap: 6px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom, 0px));
  }

  .composer textarea {
    grid-column: auto;
  }

  #sendMessage {
    grid-column: auto;
  }
}

.composer {
  grid-template-columns: 38px minmax(0, 1fr) repeat(4, 38px);
  align-items: center;
  gap: 10px;
}

.composer button.composer-icon,
.composer button.emoji-toggle,
.composer button.send-icon {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #9bbbd6;
  font-weight: 400;
}

.composer button.composer-icon:hover,
.composer button.emoji-toggle:hover,
.composer button.send-icon:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #d7ecff;
}

.composer button.send-icon {
  color: #72c4ff;
}

.composer button.send-icon::before {
  width: 22px;
  height: 22px;
}

.composer button#emojiToggle {
  font-size: 24px;
}

.composer textarea {
  align-self: center;
  min-height: 38px;
  padding: 8px 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  line-height: 1.35;
}

.composer textarea:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.video-note-preview {
  position: absolute;
  right: 18px;
  bottom: 82px;
  z-index: 24;
  width: 218px;
  padding: 10px;
  border: 1px solid rgba(126, 157, 188, 0.18);
  border-radius: 14px;
  background: rgba(13, 27, 41, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.video-note-preview.hidden {
  display: none;
}

.video-note-preview video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(167, 204, 232, 0.16);
  border-radius: 50%;
  background: #06111d;
  object-fit: cover;
  transform: scaleX(-1);
}

.video-note-preview.back-camera video {
  transform: none;
}

.video-note-preview-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px auto;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.video-note-preview.single-camera .video-note-preview-meta {
  grid-template-columns: minmax(0, 1fr) auto;
}

.video-note-preview-meta span {
  color: #cfe7fa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.video-note-preview-action,
.video-note-preview-stop {
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8ecfb;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.video-note-preview-action {
  position: relative;
  width: 34px;
  padding: 0;
}

.video-note-preview-action[hidden] {
  display: none;
}

.video-note-preview-action::before {
  content: "";
  position: absolute;
  inset: 8px;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M16%207h3a2%202%200%200%201%202%202v8a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V9a2%202%200%200%201%202-2h3'/%3E%3Cpath%20d='m8%207%204-4%204%204'/%3E%3Cpath%20d='M12%203v10'/%3E%3Cpath%20d='m8%2017%204%204%204-4'/%3E%3Cpath%20d='M12%2021V11'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='white'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M16%207h3a2%202%200%200%201%202%202v8a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V9a2%202%200%200%201%202-2h3'/%3E%3Cpath%20d='m8%207%204-4%204%204'/%3E%3Cpath%20d='M12%203v10'/%3E%3Cpath%20d='m8%2017%204%204%204-4'/%3E%3Cpath%20d='M12%2021V11'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.video-note-preview-stop {
  padding: 0 13px;
  background: rgba(74, 164, 231, 0.18);
  color: #7bc8ff;
}

.video-note-preview-action:hover,
.video-note-preview-stop:hover {
  background: rgba(74, 164, 231, 0.24);
  color: #ffffff;
}

@media (max-width: 900px) {
  .composer {
    grid-template-columns: 42px minmax(0, 1fr) repeat(4, 38px);
    gap: 6px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom, 0px));
  }

  .composer textarea,
  #sendMessage {
    grid-column: auto;
  }

  .video-note-preview {
    right: 12px;
    bottom: 72px;
    width: 180px;
  }
}

@media (max-width: 900px) {
  body.mobile-chat-open {
    background: #0b1521;
  }

  body.mobile-chat-open .chat {
    position: fixed;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    align-content: stretch;
    top: var(--mobile-vvtop, 0);
    right: 0;
    bottom: auto;
    left: 0;
    z-index: 20;
    width: var(--mobile-vvw, 100vw);
    max-width: var(--mobile-vvw, 100vw);
    box-sizing: border-box;
    height: var(--mobile-vvh, 100dvh);
    max-height: var(--mobile-vvh, 100dvh);
    overflow-x: hidden;
    background:
      linear-gradient(rgba(11, 21, 33, 0.8), rgba(11, 21, 33, 0.82)),
      repeating-linear-gradient(135deg, rgba(80, 125, 156, 0.1) 0, rgba(80, 125, 156, 0.1) 1px, transparent 1px, transparent 18px);
  }

  body.mobile-chat-open .chat-header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 66px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 9px max(10px, env(safe-area-inset-left, 0px));
    background: rgba(17, 29, 42, 0.9);
    backdrop-filter: blur(18px);
  }

  body.mobile-chat-open .chat-identity {
    min-width: 0;
    align-self: center;
  }

  body.mobile-chat-open .chat-identity h2 {
    font-size: 17px;
    font-weight: 680;
  }

  body.mobile-chat-open #activeUserLabel {
    margin-top: 2px;
    font-size: 12px;
  }

  body.mobile-chat-open .chat-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    max-width: 146px;
    overflow: hidden;
  }

  body.mobile-chat-open .chat-actions .icon-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #9db9d1;
  }

  body.mobile-chat-open .messages {
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    gap: 5px;
    padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(var(--mobile-composer-height, 54px) + 8px) max(10px, env(safe-area-inset-left, 0px));
    background: transparent;
    scroll-padding-bottom: calc(var(--mobile-composer-height, 54px) + 8px);
  }

  body.mobile-chat-open .date-divider {
    margin: 10px auto 8px;
    padding: 4px 10px;
    background: rgba(28, 48, 69, 0.88);
    font-size: 11px;
  }

  body.mobile-chat-open .message-row {
    grid-template-columns: 30px minmax(0, auto);
    gap: 6px;
    max-width: min(calc(var(--mobile-vvw, 100vw) - 22px), 420px);
    font-size: 14px;
    line-height: 1.3;
  }

  body.mobile-chat-open .message-row.mine {
    grid-template-columns: minmax(0, auto) 30px;
    align-self: flex-end;
  }

  body.mobile-chat-open .message-avatar {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    margin-bottom: 2px;
    font-size: 11px;
  }

  body.mobile-chat-open .message-row.mine .message-avatar {
    grid-column: 2;
    grid-row: 1;
  }

  body.mobile-chat-open .message-row.mine .message,
  body.mobile-chat-open .message-row.mine .video-note-body,
  body.mobile-chat-open .message-row.mine .media-message-body {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
  }

  body.mobile-chat-open .message,
  body.mobile-chat-open .video-note-row p {
    max-width: min(calc(var(--mobile-vvw, 100vw) - 92px), 320px);
    padding: 7px 10px;
    border-radius: 13px 13px 13px 5px;
    background: #17283a;
    box-shadow: none;
  }

  body.mobile-chat-open .message.mine,
  body.mobile-chat-open .video-note-row.mine p {
    border-radius: 13px 13px 5px 13px;
    background: #2c6793;
  }

  body.mobile-chat-open .message-meta {
    gap: 8px;
    margin-bottom: 2px;
    color: rgba(198, 221, 239, 0.72);
    font-size: 10px;
    line-height: 1.1;
  }

  body.mobile-chat-open .message.mine .message-meta {
    justify-content: flex-end;
  }

  body.mobile-chat-open .message.mine .message-meta span:first-child {
    display: none;
  }

  body.mobile-chat-open .message p {
    font-size: 14px;
  }

  body.mobile-chat-open .image-row,
  body.mobile-chat-open .video-note-row {
    max-width: min(calc(var(--mobile-vvw, 100vw) - 22px), 360px);
  }

  body.mobile-chat-open .media-message-body,
  body.mobile-chat-open .video-note-body {
    gap: 4px;
  }

  body.mobile-chat-open .message-attachment img,
  body.mobile-chat-open .message-attachment video {
    max-width: min(72vw, 260px);
    max-height: 340px;
    border-radius: 12px;
  }

  body.mobile-chat-open .photo-message-button,
  body.mobile-chat-open .photo-message-button img {
    border-radius: 13px;
  }

  body.mobile-chat-open .media-overlay-time {
    opacity: 1;
    transform: none;
    font-size: 11px;
  }

  body.mobile-chat-open .video-note-attachment {
    width: 224px;
  }

  body.mobile-chat-open .video-note-shell,
  body.mobile-chat-open .message-attachment video.video-note {
    width: 214px;
    height: 214px;
    max-width: 214px;
    max-height: 214px;
  }

  body.mobile-chat-open .video-note-duration,
  body.mobile-chat-open .video-note-time {
    min-width: 44px;
    padding: 3px 7px;
    font-size: 11px;
  }

  body.mobile-chat-open .voice-message {
    width: min(72vw, 282px);
    min-height: 48px;
  }

  body.mobile-chat-open .voice-play-button {
    width: 38px;
    height: 38px;
  }

  body.mobile-chat-open .forward-meta,
  body.mobile-chat-open .reply-meta {
    max-width: 100%;
    border-radius: 8px;
  }

  body.mobile-chat-open .composer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    grid-template-columns: 40px minmax(0, 1fr) 34px 40px;
    align-items: center;
    gap: 6px;
    min-height: 54px;
    padding: 6px max(12px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    border-top: 0;
    background: rgba(17, 29, 42, 0.6);
    backdrop-filter: blur(16px);
  }

  body.mobile-chat-open .reply-composer {
    grid-column: 1 / -1;
    margin: 0 42px 2px 48px;
    padding: 6px 30px 6px 9px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
  }

  body.mobile-chat-open .attach-wrap {
    align-self: center;
  }

  body.mobile-chat-open .composer button.composer-icon,
  body.mobile-chat-open .composer button.emoji-toggle,
  body.mobile-chat-open .composer button.send-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border: 1px solid rgba(151, 175, 202, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #b5cadd;
  }

  body.mobile-chat-open .composer button.send-icon {
    background: #2f8ed2;
    color: #ffffff;
  }

  body.mobile-chat-open .composer textarea {
    align-self: center;
    min-height: 40px;
    max-height: 104px;
    padding: 9px 38px 9px 14px;
    border: 0;
    border-radius: 20px;
    background: rgba(220, 235, 244, 0.12);
    color: var(--text);
    font-size: 15px;
    line-height: 1.28;
  }

  body.mobile-chat-open .composer textarea:focus {
    background: rgba(220, 235, 244, 0.16);
  }

  body.mobile-chat-open #emojiToggle {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    border-color: transparent;
    background: transparent;
    color: #d8c06a;
    font-size: 23px;
  }

  body.mobile-chat-open #recordAudio,
  body.mobile-chat-open #recordVideoNote,
  body.mobile-chat-open #sendMessage {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
  }

  body.mobile-chat-open .composer:focus-within {
    background: rgba(17, 29, 42, 0.5);
  }

  body.mobile-chat-open .composer:focus-within textarea {
    min-height: 40px;
  }

  body.mobile-chat-open .emoji-picker {
    right: 12px;
    bottom: calc(100% + 8px);
    grid-template-columns: repeat(6, 34px);
    border-radius: 14px;
    background: rgba(20, 34, 49, 0.98);
  }

  body.mobile-chat-open .attach-menu {
    bottom: calc(100% + 8px);
    border-radius: 14px;
  }
}
