:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d9e0e7;
  --text: #18212f;
  --muted: #6a7584;
  --primary: #177d72;
  --primary-strong: #0f625a;
  --accent: #d84e3f;
  --bubble-in: #ffffff;
  --bubble-out: #dff4ef;
  --rail: #202a33;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef6f3 0%, #f7f3ee 55%, #eef2f7 100%);
}

.login-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(30, 40, 50, 0.12);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 48px;
  margin-bottom: 28px;
}

.brand-mark,
.rail-avatar,
.conversation-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.image-avatar {
  -o-object-fit: cover;
     object-fit: cover;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  -o-object-fit: contain;
     object-fit: contain;
  background: #fff;
}

.brand-lockup h1,
.list-header h2,
.chat-header h2 {
  margin: 0;
  font-size: 20px;
}

.brand-lockup p,
.list-header p,
.chat-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.login-tabs,
.code-row,
.phone-row,
.captcha-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.login-tabs button,
.code-action {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.login-tabs button.active {
  border-color: var(--primary);
  background: #e8f4f2;
  color: var(--primary-strong);
  font-weight: 700;
}

.login-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.login-tabs button {
  min-width: 0;
  padding: 0 6px;
  overflow-wrap: anywhere;
}

.code-row {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.captcha-row {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.phone-row {
  grid-template-columns: 86px minmax(0, 1fr);
}

.country-code-field {
  height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  overflow: hidden;
}

.country-code-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 125, 114, 0.12);
}

.country-code-field span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.code-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.label-row {
  min-height: 18px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.field-error-badge {
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 4px 10px;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.login-form input,
.login-form select,
.modal-panel input,
.modal-panel textarea,
.search-box input,
.message-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.login-form input,
.login-form select,
.modal-panel input,
.search-box input {
  height: 42px;
  padding: 0 12px;
}

.modal-panel textarea {
  min-height: 92px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.5;
}

.login-form .country-code-field input {
  height: 40px;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 0;
}

.login-form .country-code-field input:focus {
  border-color: transparent;
  box-shadow: none;
}

.login-form input:focus,
.login-form select:focus,
.modal-panel input:focus,
.modal-panel textarea:focus,
.search-box input:focus,
.message-composer textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 125, 114, 0.12);
}

.login-form input.captcha-input-valid {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.login-form input.captcha-input-valid::-moz-placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.login-form input.captcha-input-valid::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.login-form input.captcha-input-invalid {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 78, 63, 0.12);
}

.login-form input.field-input-error {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 78, 63, 0.12);
}

.login-form input.field-input-error::-moz-placeholder {
  color: rgba(216, 78, 63, 0.78);
}

.login-form input.field-input-error::placeholder {
  color: rgba(216, 78, 63, 0.78);
}

.captcha-button {
  width: 112px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbfa;
  overflow: hidden;
}

.captcha-button img {
  display: block;
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}

.primary-action,
.primary-inline-action,
.send-button {
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.primary-action {
  height: 44px;
}

.primary-action:hover,
.primary-inline-action:hover,
.send-button:hover {
  background: var(--primary-strong);
}

.primary-action:disabled,
.primary-inline-action:disabled,
.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-action {
  width: 100%;
  height: 40px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.language-switcher {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 120;
}

.language-switch-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(217, 224, 231, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(24, 33, 47, 0.12);
  backdrop-filter: blur(10px);
}

.language-switch-button:hover,
.language-switch-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary-strong);
  outline: none;
}

.language-switch-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.language-menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 148px;
  display: grid;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(24, 33, 47, 0.18);
}

.language-option {
  min-height: 30px;
  display: grid;
  grid-template-columns: 18px 22px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 13px;
}

.language-option:hover,
.language-option.active {
  background: #e7f2f0;
  color: var(--primary-strong);
}

.language-check,
.language-flag,
.language-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-check {
  color: #2563eb;
  font-weight: 800;
  text-align: center;
}

.language-flag {
  width: 18px;
  aspect-ratio: 4 / 3;
  display: block;
  border-radius: 1px;
  -o-object-fit: cover;
     object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(24, 33, 47, 0.18);
}

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

.language-switcher--panel {
  position: absolute;
  top: 18px;
  right: 18px;
}

.language-switcher--panel .language-switch-button {
  width: 38px;
  height: 38px;
  box-shadow: none;
}

.language-switcher--panel .language-menu {
  top: 44px;
}

.ghost-inline-action,
.primary-inline-action,
.danger-inline-action {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1;
}

.ghost-inline-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost-inline-action:hover {
  background: #edf2f5;
}

.danger-inline-action {
  border: 1px solid #ef4444;
  background: #fff;
  color: #b91c1c;
}

.danger-inline-action:hover {
  background: #fee2e2;
}

.form-error {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
}

.form-info {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: 64px minmax(260px, 340px) minmax(0, 1fr);
  overflow: hidden;
  background: var(--panel);
}

.navigation-rail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 10px;
  background: var(--rail);
}

.rail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e9f7f4;
  color: var(--primary-strong);
  font-weight: 800;
  overflow: hidden;
}

.rail-avatar-button {
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.rail-avatar-button::after {
  content: "+";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rail);
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.rail-avatar-button:hover,
.rail-avatar-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 196, 178, 0.28);
}

.rail-avatar img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

.rail-button,
.icon-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.rail-button {
  width: 40px;
  height: 40px;
  color: #dbe5ea;
  font-size: 18px;
}

.rail-contact-button {
  position: relative;
}

.rail-notification-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--rail);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.rail-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-button.active,
.rail-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.rail-logout-button:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.rail-spacer {
  flex: 1;
}

.conversation-list {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: 72px auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: start center;
  padding: 88px 16px 16px;
  background: rgba(24, 33, 47, 0.28);
}

.modal-panel {
  width: min(100%, 308px);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.18);
}

.modal-panel header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-panel header strong {
  font-size: 16px;
}

.modal-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.settings-backdrop {
  z-index: 24;
  place-items: center;
  padding: 24px 16px;
}

.settings-panel {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.18);
}

.settings-panel header,
.settings-password-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-panel header strong {
  font-size: 16px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
}

.settings-menu {
  display: grid;
  align-content: start;
  gap: 8px;
}

.settings-menu button {
  min-height: 46px;
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.settings-menu button.active,
.settings-menu button:hover {
  border-color: var(--primary);
  background: #e8f4f2;
  color: var(--primary-strong);
}

.settings-menu button span {
  font-weight: 700;
}

.settings-menu button small {
  color: var(--muted);
  font-size: 11px;
}

.settings-password-form,
.settings-placeholder {
  min-height: 250px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.settings-password-form h3,
.settings-placeholder h3 {
  margin: 0;
  font-size: 16px;
}

.settings-password-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.settings-password-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.settings-password-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 125, 114, 0.12);
}

.settings-password-form footer {
  margin-top: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.settings-password-form footer .inline-save-status {
  margin-right: auto;
}

.settings-placeholder {
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.settings-placeholder p {
  margin: 0;
}

.profile-edit-panel {
  width: min(100%, 360px);
}

.profile-avatar-field {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.profile-avatar-field input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-avatar-preview {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #dce8f2;
  color: #24435c;
  cursor: default;
  font-size: 30px;
  font-weight: 800;
}

.profile-avatar-preview.clickable {
  cursor: zoom-in;
}

.profile-avatar-preview.clickable:hover {
  box-shadow: 0 0 0 3px rgba(23, 125, 114, 0.16);
}

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

.profile-avatar-change-button {
  min-width: 96px;
}

.avatar-preview-backdrop {
  z-index: 32;
  place-items: center;
  padding: 24px 16px;
}

.avatar-preview-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.18);
}

.avatar-preview-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avatar-preview-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.avatar-preview-actions button {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.avatar-preview-actions .icon-button {
  border: 0;
  color: var(--muted);
}

.avatar-preview-stage {
  height: min(430px, calc(100dvh - 160px));
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #101820;
  cursor: zoom-in;
  touch-action: none;
}

.avatar-preview-stage.dragging {
  cursor: grabbing;
}

.avatar-preview-stage img {
  max-width: min(100%, 430px);
  max-height: 100%;
  border-radius: 8px;
  -o-object-fit: contain;
     object-fit: contain;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: none;
}

.avatar-preview-stage.dragging img {
  transition: none;
}

.avatar-cropper-backdrop {
  z-index: 30;
  place-items: center;
  padding: 24px 16px;
}

.avatar-cropper-panel {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
}

.avatar-cropper-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-cropper-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 14px;
}

.avatar-cropper-stage {
  position: relative;
  height: 360px;
  min-height: 360px;
  overflow: hidden;
  border: 1px dashed #b8ccd7;
  border-radius: 8px;
  background: #0f1b24;
  touch-action: none;
  cursor: grab;
}

.avatar-cropper-stage.dragging {
  cursor: grabbing;
}

.avatar-cropper-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-cropper-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74%;
  aspect-ratio: 1;
  max-width: calc(100% - 44px);
  max-height: calc(100% - 44px);
  transform: translate(-50%, -50%);
  border: 2px dashed var(--primary);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.avatar-cropper-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.avatar-cropper-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #d9e8ee;
  font-size: 13px;
  pointer-events: none;
}

.avatar-cropper-controls {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.avatar-cropper-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.avatar-cropper-tools button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.avatar-cropper-tools button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.avatar-cropper-preview {
  width: 108px;
  height: 108px;
  justify-self: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f7;
}

.avatar-cropper-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-cropper-controls footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-cropper-controls footer .inline-save-status {
  flex: 1 1 100%;
}

.modal-actions {
  justify-content: flex-end;
}

.list-header,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 34px;
  height: 34px;
  color: var(--muted);
  font-size: 20px;
}

.icon-button:hover {
  background: #edf2f5;
  color: var(--text);
}

.search-box {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.friend-notice-entry {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.friend-notice-entry:hover,
.friend-notice-entry:focus-visible {
  border-color: #9fd4cc;
  background: #f2faf8;
}

.friend-notice-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8f5f2;
  color: var(--primary-strong);
  font-size: 20px;
}

.friend-notice-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.friend-notice-copy strong,
.friend-notice-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-notice-copy strong {
  font-size: 14px;
}

.friend-notice-copy small {
  color: var(--muted);
  font-size: 12px;
}

.friend-notice-count {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.friend-notice-arrow {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.sidebar-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.conversation-item {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid rgba(217, 224, 231, 0.7);
  background: transparent;
  color: inherit;
  text-align: left;
}

.conversation-item.active,
.conversation-item:hover {
  background: #eaf3f1;
}

.favorite-item {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid rgba(217, 224, 231, 0.7);
  background: transparent;
  color: inherit;
  text-align: left;
}

.favorite-item.active,
.favorite-item:hover {
  background: #eaf3f1;
}

.favorite-item-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff7df;
  color: #c79520;
  font-size: 16px;
}

.favorite-item-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.favorite-item-main strong,
.favorite-item-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-item-main strong {
  font-size: 14px;
}

.favorite-item-main small,
.favorite-item time {
  color: var(--muted);
  font-size: 12px;
}

.favorite-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #eef3f6;
}

.favorite-detail {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 28px;
  overflow: auto;
}

.favorite-detail-message {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(24, 33, 47, 0.08);
}

.favorite-detail-message.recalled {
  border-color: #f1c7c1;
  background: #fff7f6;
}

.favorite-detail-star {
  color: #c79520;
  font-size: 18px;
  line-height: 1.4;
}

.favorite-detail-body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.favorite-detail-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.favorite-detail-message time {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.favorite-detail-image {
  width: min(420px, 100%);
  display: block;
  overflow: hidden;
  border: 1px solid #b9ded8;
  border-radius: 8px;
  background: #fff;
}

.favorite-detail-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  -o-object-fit: contain;
     object-fit: contain;
  background: #f8fbfc;
}

.favorite-detail-file {
  width: min(360px, 100%);
}

.favorite-detail-actions {
  width: min(680px, 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.favorite-detail-actions .inline-save-status {
  margin-right: auto;
}

.empty-list,
.empty-chat {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-list {
  min-height: 180px;
  padding: 24px;
}

.empty-chat {
  min-height: 0;
  padding: 24px;
}

.empty-list strong,
.empty-chat strong {
  color: var(--text);
}

.conversation-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #dce8f2;
  color: #24435c;
  font-weight: 700;
}

.conversation-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.conversation-copy strong,
.conversation-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy small {
  color: var(--muted);
}

.unread-badge {
  justify-self: end;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px #f7fafc;
}

.chat-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) auto auto;
  overflow: hidden;
  background: #eef2f5;
}

.contact-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: auto;
  background: #eef2f5;
}

.contact-profile {
  align-self: start;
  width: min(520px, calc(100% - 48px));
  margin: 48px auto;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dce8f2;
  color: #24435c;
  font-size: 28px;
  font-weight: 800;
}

.profile-main {
  text-align: center;
}

.remark-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-main h3 {
  margin: 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.remark-edit-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  font-size: 16px;
}

.profile-main p {
  margin: 6px 0 0;
  color: var(--muted);
}

.profile-fields {
  width: 100%;
  display: grid;
  gap: 12px;
  margin: 0;
}

.profile-fields div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.profile-fields dt {
  color: var(--muted);
}

.profile-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-action {
  width: 160px;
}

.contact-panel .contact-modal-backdrop {
  position: fixed;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.contact-request-button {
  position: relative;
}

.contact-request-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--panel-soft);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.friend-request-panel {
  width: min(100%, 360px);
  max-height: calc(100dvh - 112px);
  overflow: auto;
}

.friend-request-state {
  min-height: 136px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.friend-request-state strong {
  color: var(--text);
}

.friend-request-list {
  display: grid;
  gap: 10px;
  max-height: min(420px, calc(100dvh - 250px));
  overflow: auto;
  padding-right: 2px;
}

.friend-request-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.friend-request-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.friend-request-copy strong,
.friend-request-copy small,
.friend-request-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-request-copy small,
.friend-request-copy span {
  color: var(--muted);
  font-size: 12px;
}

.friend-request-actions {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.friend-request-actions .ghost-inline-action,
.friend-request-actions .primary-inline-action {
  min-width: 68px;
  height: 34px;
  padding: 0 12px;
}

.chat-header-actions {
  position: relative;
  margin-right: 48px;
}

.chat-title-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  max-width: min(460px, 52vw);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.chat-title-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #dce8f2;
  color: #24435c;
  font-size: 16px;
  font-weight: 800;
}

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

.chat-title-button h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-button:hover h2 {
  color: var(--primary-strong);
}

.chat-more-menu {
  top: 38px;
  width: 150px;
}

.action-menu-anchor {
  position: relative;
}

.quick-action-menu {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 7;
  width: 168px;
  display: grid;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(24, 33, 47, 0.16);
}

.quick-action-menu button {
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.quick-action-menu button:hover {
  background: #edf2f5;
}

.quick-action-menu.chat-more-menu {
  top: 38px;
  width: 150px;
}

.chat-header-actions .icon-button.active {
  background: #e4efed;
  color: var(--primary-strong);
}

.chat-panel.side-panel-open > .chat-header,
.chat-panel.side-panel-open > .message-list,
.chat-panel.side-panel-open > .message-composer,
.chat-panel.side-panel-open > .empty-chat,
.chat-panel.side-panel-open > .selection-toolbar,
.chat-panel.side-panel-open > .chat-action-feedback {
  margin-right: 360px;
}

.conversation-side-panel {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 12;
  width: 360px;
  min-width: 0;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -16px 0 34px rgba(24, 33, 47, 0.08);
}

.conversation-side-header {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.conversation-side-header h3 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-search-panel,
.conversation-tools-panel,
.conversation-info-panel {
  min-height: 0;
  overflow: auto;
  background: var(--panel);
}

.conversation-search-panel {
  display: flex;
  flex-direction: column;
}

.conversation-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.conversation-search-form input,
.conversation-destruct-form select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.conversation-search-form button,
.conversation-destruct-form button,
.conversation-info-actions button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
}

.conversation-search-summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.conversation-search-results {
  display: grid;
}

.conversation-search-results > button {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.conversation-search-results > button:hover,
.conversation-search-results > button.active {
  background: #e8f3f1;
}

.conversation-search-results > button.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.conversation-search-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.conversation-search-meta strong {
  overflow: hidden;
  color: var(--primary-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-search-meta time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.conversation-search-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.conversation-side-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.conversation-side-empty strong {
  color: var(--text);
}

.conversation-info-summary {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 28px 20px 22px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.conversation-info-summary.compact {
  padding-top: 22px;
}

.conversation-info-summary strong,
.conversation-info-summary small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-info-summary small {
  color: var(--muted);
}

.conversation-info-avatar {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #dce8f2;
  color: #24435c;
  font-size: 24px;
  font-weight: 800;
  -o-object-fit: cover;
     object-fit: cover;
}

.conversation-info-fields {
  margin: 0;
  padding: 8px 18px;
}

.conversation-info-fields div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.conversation-info-fields dt {
  color: var(--muted);
}

.conversation-info-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.conversation-info-actions {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
}

.conversation-tool-list {
  display: grid;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.conversation-tool-list button {
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.conversation-tool-list button:hover {
  background: #edf3f5;
}

.conversation-tool-list button > span {
  color: var(--primary-strong);
  font-size: 20px;
  text-align: center;
}

.conversation-tool-list button > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-tool-list button > small {
  color: var(--muted);
  white-space: nowrap;
}

.conversation-tool-list.danger-list button > span,
.conversation-tool-list.danger-list button > strong {
  color: #b83b33;
}

.conversation-destruct-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.conversation-destruct-form label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.conversation-side-feedback {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 14px;
  padding: 10px 12px;
  border: 1px solid #a9ddd2;
  border-radius: 8px;
  background: #e5f6f2;
  color: #0b6f60;
  line-height: 1.45;
}

.conversation-side-feedback.error {
  border-color: #efb0a8;
  background: #fff1ef;
  color: #a92f24;
}

.conversation-side-feedback button {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 18px;
}

.conversation-action-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  width: min(100%, 340px);
  max-height: calc(100dvh - 116px);
  overflow: auto;
}

.conversation-action-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  z-index: 30;
  display: block !important;
  margin: 0 !important;
  transform: none !important;
  padding: 24px;
}

.conversation-action-panel.group-create-panel {
  width: min(620px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  padding: 22px 24px;
  gap: 16px;
}

.group-create-panel .contact-picker-list {
  max-height: 260px;
}

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

.contact-picker > input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.contact-picker-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.contact-picker-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.contact-picker-row:hover,
.contact-picker-row.selected {
  border-color: #9fd4cc;
  background: #edf8f5;
}

.contact-picker-row .conversation-avatar {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 13px;
}

.contact-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
}

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

.contact-picker-copy strong,
.contact-picker-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-picker-copy small {
  color: var(--muted);
  font-size: 12px;
}

.contact-picker-empty {
  min-height: 64px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.group-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 116px);
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.18);
}

.group-dialog header,
.group-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-dialog h3 {
  margin: 0;
  font-size: 18px;
}

.confirm-dialog {
  width: min(360px, calc(100% - 32px));
}

.confirm-dialog p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.single-profile-dialog {
  width: min(420px, calc(100% - 32px));
}

.single-profile-summary {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.single-profile-summary strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.single-profile-name-row { max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; }
.single-profile-name-row input { width: min(240px, 70vw); height: 38px; padding: 0 10px; border: 1px solid var(--primary); border-radius: 6px; outline: none; }
.single-profile-edit { width: 28px; height: 28px; border: 0; border-radius: 6px; background: #eaf3f1; color: var(--primary); font-size: 17px; }
.single-delete-options { display: grid; gap: 8px; padding: 12px; border: 1px solid rgba(216, 78, 63, 0.3); border-radius: 8px; background: rgba(216, 78, 63, 0.05); }
.single-delete-options button { min-height: 38px; padding: 0 12px; border: 1px solid rgba(216, 78, 63, 0.3); border-radius: 6px; background: #fff; color: #a52e23; text-align: left; }
.single-delete-options button:hover { background: #fff1ef; }
.danger-inline-action { min-height: 38px; padding: 0 16px; border: 0; border-radius: 6px; background: #d84e3f; color: #fff; font-weight: 700; }

.single-profile-footer {
  align-items: center;
  justify-content: flex-end;
}

.single-profile-footer .inline-save-status {
  margin-right: auto;
}

.message-detail-dialog {
  width: min(560px, calc(100% - 32px));
}

.message-detail-meta div {
  grid-template-columns: 88px minmax(0, 1fr);
}

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

.message-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-detail-summary span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfb;
  color: var(--muted);
  font-size: 13px;
}

.message-detail-summary strong {
  color: var(--text);
}

.message-detail-groups {
  display: grid;
  gap: 14px;
}

.message-detail-section {
  display: grid;
  gap: 8px;
}

.message-detail-section header {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.message-detail-section header strong {
  font-size: 14px;
}

.message-detail-section header span {
  color: var(--muted);
  font-size: 12px;
}

.message-detail-member-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.message-detail-member-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 8px;
  border-top: 1px solid var(--line);
}

.message-detail-member-row:first-child {
  border-top: 0;
}

.message-detail-member-row .conversation-avatar {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 13px;
}

.message-detail-member-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.message-detail-member-main strong,
.message-detail-member-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-detail-member-main strong {
  font-size: 13px;
}

.message-detail-member-main small,
.message-detail-member-time {
  color: var(--muted);
  font-size: 12px;
}

.message-detail-member-time {
  white-space: nowrap;
}

.message-detail-role {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #c7d9e5;
  border-radius: 6px;
  color: #416272;
  font-size: 12px;
  white-space: nowrap;
}

.group-dialog label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.group-dialog input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.group-dialog textarea,
.group-dialog select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.group-dialog textarea {
  min-height: 86px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.5;
}

.group-dialog select {
  height: 42px;
  padding: 0 10px;
}

.group-dialog input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 125, 114, 0.12);
}

.group-dialog textarea:focus,
.group-dialog select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 125, 114, 0.12);
}

.group-profile {
  display: grid;
  gap: 10px;
  margin: 0;
}

.group-profile div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.group-profile dt {
  color: var(--muted);
}

.group-profile dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.group-loading {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.group-member-list {
  display: grid;
  gap: 8px;
}

.group-member-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.group-member-row.selectable {
  cursor: pointer;
}

.group-member-row.with-check {
  grid-template-columns: 24px 42px minmax(0, 1fr);
}

.group-member-row.selectable:hover,
.group-member-row.selectable.selected {
  border-color: #9fd4cc;
  background: #edf8f5;
}

.group-member-row input[type="checkbox"] {
  justify-self: center;
  width: 16px;
  height: 16px;
}

.group-member-row span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

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

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

.group-management-dialog {
  width: min(520px, calc(100% - 32px));
}

.group-management-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-management-tabs button {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.group-management-tabs button.active,
.group-management-tabs button:hover {
  border-color: var(--primary);
  background: #e8f4f2;
  color: var(--primary-strong);
  font-weight: 700;
}

.group-manage-section {
  display: grid;
  gap: 14px;
}

.group-setting-hint {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.group-message-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.group-message-action-grid input {
  background: var(--panel);
  color: var(--text);
}

.message-action-save-footer {
  align-items: center;
  gap: 10px;
}

.message-action-save-footer .inline-save-status {
  margin-right: auto;
}

.single-member-mute { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfb; }
.single-member-mute select { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.group-manage-section footer {
  justify-content: flex-end;
}

.mute-save-footer {
  align-items: center;
  gap: 10px;
}

.inline-save-status {
  color: var(--primary-strong);
  font-size: 13px;
}

.inline-save-status.error {
  color: var(--accent);
}

.mute-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.message-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

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

.message-sender-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #dce8f2;
  color: #24435c;
  font-size: 14px;
  font-weight: 800;
}

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

.message-stack {
  max-width: min(68%, 720px);
  display: grid;
  justify-items: start;
  gap: 4px;
}

.message-row.out .message-stack {
  justify-items: end;
}

.message-sender-name {
  min-height: 18px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-sender-name:hover {
  color: var(--primary-strong);
}

.message-sender-role {
  margin-left: 4px;
  color: var(--primary-strong);
  font-size: 11px;
}

.message-row.selected .message-bubble {
  box-shadow: 0 0 0 2px rgba(24, 138, 121, 0.26);
}

.message-row.attention .message-bubble {
  animation: message-attention 1.4s ease-in-out 2;
  box-shadow: 0 0 0 3px rgba(24, 138, 121, 0.3);
}

.message-row.search-focused .message-bubble {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 125, 114, 0.22);
}

@keyframes message-attention {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(24, 138, 121, 0.16);
  }

  45% {
    box-shadow: 0 0 0 5px rgba(24, 138, 121, 0.36);
  }
}

.message-select {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.message-select input {
  width: 16px;
  height: 16px;
}

.message-bubble {
  position: relative;
  max-width: min(68%, 720px);
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bubble-in);
  box-shadow: 0 2px 8px rgba(30, 40, 50, 0.05);
}

.message-stack .message-bubble {
  max-width: 100%;
}

.message-row.out .message-bubble {
  background: var(--bubble-out);
  border-color: #bfe4dc;
}

.message-row.system {
  justify-content: center;
}

.message-row.system .message-stack {
  width: auto;
  max-width: min(520px, 86%);
  align-items: center;
}

.message-row.system .message-bubble {
  padding: 7px 12px;
  border-color: rgba(100, 116, 139, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
  color: var(--muted);
  text-align: center;
}

.message-row.system .message-bubble p {
  font-size: 12px;
}

.message-row.system .message-bubble time,
.message-row.system .delivery-mark {
  display: none;
}

.message-bubble:hover {
  border-color: #9fd4cc;
}

.message-bubble.role-bubble-owner,
.message-bubble.role-bubble-admin {
  overflow: hidden;
}

.message-bubble.role-bubble-owner::after,
.message-bubble.role-bubble-admin::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 16px solid #d79d22;
  border-left: 16px solid transparent;
}

.message-bubble.role-bubble-admin::after {
  border-top-color: #178a79;
}

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

.message-image {
  padding: 0;
  border: 0;
  display: block;
  max-width: min(280px, 62vw);
  overflow: hidden;
  border-radius: 6px;
  background: #edf2f5;
  cursor: zoom-in;
}

.message-image + p,
.message-file + p {
  margin-top: 8px;
}

.message-image img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  -o-object-fit: contain;
     object-fit: contain;
}

.image-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 26, 0.58);
}

.image-viewer-dialog {
  width: min(880px, calc(100vw - 48px));
  height: min(640px, calc(100vh - 48px));
  min-width: 360px;
  min-height: 280px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  overflow: hidden;
  resize: both;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #101820;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.image-viewer-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 33, 47, 0.94);
}

.image-viewer-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-toolbar button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.image-viewer-toolbar button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.image-viewer-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0c121a;
  cursor: default;
  touch-action: none;
}

.image-viewer-stage.zoomed {
  cursor: grab;
}

.image-viewer-stage.dragging {
  cursor: grabbing;
}

.image-viewer-img {
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  -o-object-fit: contain;
     object-fit: contain;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: none;
}

.image-viewer-stage.dragging .image-viewer-img {
  transition: none;
}

.sender-profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 33, 47, 0.32);
}

.sender-profile-dialog {
  width: min(380px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.18);
}

.sender-profile-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sender-profile-main {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.sender-profile-main strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.sender-profile-main span {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.sender-profile-fields {
  display: grid;
  gap: 8px;
  margin: 0;
}

.sender-profile-fields div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.sender-profile-fields dt {
  color: var(--muted);
}

.sender-profile-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.sender-profile-alias {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sender-profile-alias input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.sender-profile-alias input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 125, 114, 0.12);
}

.sender-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.sender-profile-actions .inline-save-status {
  margin-right: auto;
}

@media (max-width: 480px) {
  .group-message-action-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-viewer-backdrop {
    padding: 12px;
  }

  .image-viewer-dialog {
    width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 24px));
    min-width: 280px;
    min-height: 240px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .image-viewer-toolbar {
    gap: 4px;
    padding: 6px;
  }

  .image-viewer-toolbar button {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .message-detail-member-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .message-detail-member-time,
  .message-detail-role {
    grid-column: 2;
    justify-self: start;
  }

  .avatar-cropper-panel {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .avatar-cropper-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .avatar-cropper-stage {
    height: 300px;
    min-height: 300px;
  }

  .avatar-cropper-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .avatar-cropper-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .avatar-cropper-preview {
    width: 82px;
    height: 82px;
  }

  .avatar-cropper-controls footer {
    grid-column: 1 / -1;
  }

  .settings-panel {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-menu {
    grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr);
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .settings-password-form footer .inline-save-status {
    flex: 1 1 100%;
  }
}

.message-file {
  width: min(280px, 62vw);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d6e2e7;
  border-radius: 6px;
  background: #f8fbfc;
  color: var(--text);
  text-decoration: none;
}

.message-file:hover {
  border-color: #9fd4cc;
  background: #edf8f5;
}

.message-file-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e3eff2;
  color: var(--primary-strong);
  font-size: 18px;
  font-weight: 800;
}

.message-file-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.message-file-main strong,
.message-file-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-file-main strong {
  font-size: 13px;
}

.message-file-main small {
  color: var(--muted);
  font-size: 11px;
}

.message-bubble time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.recall-mark {
  margin-right: auto;
  color: #d93025;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.edit-mark {
  color: #7a8792;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.delivery-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
}

.delivery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8f9aa3;
}

.delivery-mark-delivered .delivery-dot {
  background: #d84e3f;
}

.delivery-mark-read .delivery-dot {
  background: #1aa66a;
}

.favorite-mark {
  color: #c79520;
  font-size: 12px;
  line-height: 1;
}

.delivery-error {
  color: #c0392b;
}

.message-context-menu {
  position: fixed;
  z-index: 30;
  width: 136px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(24, 33, 47, 0.18);
}

.message-context-menu button {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.message-context-menu button:hover {
  background: #eaf3f1;
}

.selection-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: #f7fafc;
}

.selection-toolbar span {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}

.selection-toolbar button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
}

.forward-dialog,
.edit-dialog {
  width: min(100%, 340px);
  max-height: min(520px, calc(100vh - 130px));
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.18);
  overflow: auto;
}

.forward-dialog header,
.edit-dialog header,
.forward-target {
  display: flex;
  align-items: center;
  gap: 10px;
}

.forward-dialog header,
.edit-dialog header {
  justify-content: space-between;
  margin-bottom: 6px;
}

.forward-dialog h3,
.edit-dialog h3 {
  margin: 0;
  font-size: 16px;
}

.edit-dialog {
  width: min(100%, 420px);
  gap: 12px;
}

.edit-dialog textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px;
  background: #f9fbfc;
  color: var(--text);
  line-height: 1.5;
}

.edit-dialog textarea:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(24, 138, 121, 0.14);
}

.edit-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.edit-dialog footer button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
}

.edit-feedback {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(24, 138, 121, 0.32);
  border-radius: 7px;
  background: rgba(24, 138, 121, 0.08);
  color: var(--primary-strong);
  font-size: 13px;
  line-height: 1.45;
}

.edit-feedback.error {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.08);
  color: var(--accent);
}

.forward-target {
  min-height: 52px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.forward-target:hover {
  background: #eaf3f1;
}

.chat-action-feedback {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border-top: 1px solid rgba(24, 138, 121, 0.3);
  background: rgba(24, 138, 121, 0.08);
  color: var(--primary-strong);
  font-size: 13px;
}

.chat-action-feedback.error {
  border-top-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.08);
  color: var(--accent);
}

.chat-action-feedback span {
  flex: 1;
}

.chat-action-feedback button {
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
}

.message-composer {
  position: relative;
  min-height: 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.message-composer::after {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 4;
  border: 2px dashed transparent;
  border-radius: 8px;
  pointer-events: none;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.message-composer.drop-active::after {
  border-color: var(--primary);
  background: rgba(23, 125, 114, 0.08);
}

.image-send-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 20, 24, 0.88);
  backdrop-filter: blur(3px);
}

.image-send-preview {
  width: min(920px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #111718;
  color: #f5f8f7;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.image-send-preview > header,
.image-send-preview > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.image-send-preview > footer {
  min-height: 88px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
}

.image-preview-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d8dfdd;
  font-size: 28px;
}

.image-preview-close:hover { background: rgba(255, 255, 255, 0.1); }

.image-preview-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
}

.image-send-preview-backdrop.drop-active .image-preview-stage::after {
  content: "放开以添加图片";
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  border: 2px dashed #20c77a;
  border-radius: 12px;
  background: rgba(16, 45, 35, 0.9);
  color: #d9ffed;
  font-size: 18px;
  font-weight: 700;
  pointer-events: none;
}

.image-preview-stage img { max-width: 100%; max-height: 100%; -o-object-fit: contain; object-fit: contain; }
.image-preview-caption-row { padding: 12px 22px 14px; }

.image-preview-caption-row textarea {
  width: 100%;
  min-height: 48px;
  max-height: 110px;
  resize: vertical;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  outline: none;
  background: #242b2c;
  color: #fff;
  font: inherit;
}

.image-preview-thumbnails { min-width: 0; display: flex; gap: 10px; overflow-x: auto; }

.image-preview-thumbnail,
.image-preview-add {
  position: relative;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #283031;
  color: #fff;
}

.image-preview-thumbnail.active { border-color: #20c77a; }
.image-preview-thumbnail img { width: 100%; height: 100%; border-radius: 4px; -o-object-fit: cover; object-fit: cover; }

.image-preview-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d84e3f;
  color: #fff;
  line-height: 18px;
}

.image-preview-add { font-size: 32px; }

.image-preview-send {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #20c77a;
  color: #062b1c;
  font-size: 30px;
  font-weight: 800;
}

.image-preview-send:disabled { opacity: 0.5; }

.quote-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 0;
  color: var(--muted);
  font-size: 13px;
}

.quote-preview span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.quote-preview strong {
  margin-right: 6px;
  color: var(--text);
}

.quote-preview button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.quote-preview button:hover {
  background: #edf2f5;
}

.composer-tools {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
}

.composer-tools input[type="file"] {
  display: none;
}

.composer-tools button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.composer-tools button:hover {
  background: #edf2f5;
}

.composer-tools button:disabled {
  cursor: default;
  opacity: 0.45;
}

.composer-tool-button {
  border-color: rgba(23, 125, 114, 0.28);
  background: rgba(23, 125, 114, 0.1);
  color: var(--primary);
}

.composer-tool-button.file-tool {
  border-color: rgba(216, 78, 63, 0.28);
  background: rgba(216, 78, 63, 0.1);
  color: var(--accent);
}

.composer-tool-button:hover {
  border-color: currentColor;
  background: rgba(23, 125, 114, 0.16);
}

.composer-tool-button.file-tool:hover {
  background: rgba(216, 78, 63, 0.16);
}

.composer-tool-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emoji-picker {
  position: absolute;
  left: 16px;
  bottom: 38px;
  z-index: 12;
  width: 256px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(24, 33, 47, 0.16);
}

.emoji-picker button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 17px;
}

.message-composer textarea {
  display: block;
  min-height: 86px;
  max-height: 180px;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  resize: none;
  box-shadow: none;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 12px;
}

.send-button {
  min-width: 72px;
  height: 34px;
}

body:has(.chat-panel.side-panel-open) .language-switcher {
  right: 378px;
}

@media (max-width: 1100px) {
  .chat-panel.side-panel-open > .chat-header,
  .chat-panel.side-panel-open > .message-list,
  .chat-panel.side-panel-open > .message-composer,
  .chat-panel.side-panel-open > .empty-chat,
  .chat-panel.side-panel-open > .selection-toolbar,
  .chat-panel.side-panel-open > .chat-action-feedback {
    margin-right: 320px;
  }

  .conversation-side-panel {
    width: 320px;
  }

  body:has(.chat-panel.side-panel-open) .language-switcher {
    right: 338px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .conversation-list {
    display: none;
  }

  .message-bubble {
    max-width: 86%;
  }

  .language-switcher {
    top: 10px;
    right: 10px;
  }

  .language-switch-button {
    width: 38px;
    height: 38px;
  }

  .chat-header-actions {
    margin-right: 42px;
  }

  .chat-panel.side-panel-open > .chat-header,
  .chat-panel.side-panel-open > .message-list,
  .chat-panel.side-panel-open > .message-composer,
  .chat-panel.side-panel-open > .empty-chat,
  .chat-panel.side-panel-open > .selection-toolbar,
  .chat-panel.side-panel-open > .chat-action-feedback {
    margin-right: 0;
  }

  .conversation-side-panel {
    width: 100%;
  }

  body:has(.chat-panel.side-panel-open) .language-switcher {
    display: none;
  }
}

