: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;
}

html[data-build-target="h5"] body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html[data-build-target="h5"] .app-shell {
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
}

html[data-build-target="h5"] input,
html[data-build-target="h5"] textarea,
html[data-build-target="h5"] select {
  font-size: max(16px, 1em);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-update-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(680px, calc(100% - 32px));
  padding: 10px 12px 10px 16px;
  border: 1px solid #d5a72e;
  border-radius: 8px;
  background: #fff7d6;
  color: #624b0e;
  box-shadow: 0 12px 32px rgba(24, 33, 47, 0.2);
  transform: translateX(-50%);
  font-size: 14px;
}

.app-update-banner span {
  flex: 1 1 auto;
}

.app-update-banner button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: #7a5c0b;
  color: #fff;
  font-weight: 700;
}

.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;
}

.delivery-retry {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c0392b;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.delivery-retry:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

.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-update-banner {
    top: 8px;
    align-items: stretch;
    width: calc(100% - 16px);
    flex-direction: column;
    gap: 8px;
  }

  .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;
  }

  html[data-build-target="h5"] .app-shell {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  html[data-build-target="h5"] .conversation-list {
    grid-column: 2;
    display: grid;
  }

  html[data-build-target="h5"] .chat-panel,
  html[data-build-target="h5"] .contact-panel,
  html[data-build-target="h5"] .favorite-panel {
    grid-column: 2;
    display: none;
  }

  html[data-build-target="h5"] .app-shell.h5-detail-open .conversation-list {
    display: none;
  }

  html[data-build-target="h5"] .app-shell.h5-detail-open .chat-panel,
  html[data-build-target="h5"] .app-shell.h5-detail-open .contact-panel,
  html[data-build-target="h5"] .app-shell.h5-detail-open .favorite-panel {
    display: grid;
  }

  html[data-build-target="h5"] .h5-detail-back {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 17px);
    left: calc(env(safe-area-inset-left, 0px) + 58px);
    z-index: 32;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    box-shadow: 0 2px 10px rgba(24, 33, 47, 0.12);
    font-size: 30px;
    line-height: 1;
  }

  html[data-build-target="h5"] .app-shell.h5-detail-open .chat-header,
  html[data-build-target="h5"] .app-shell.h5-detail-open .contact-panel > header,
  html[data-build-target="h5"] .app-shell.h5-detail-open .favorite-panel > header {
    padding-left: 50px;
  }

  html[data-build-target="h5"] .navigation-rail {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  html[data-build-target="h5"] .message-list {
    overscroll-behavior-y: contain;
  }

html[data-build-target="h5"] .message-composer {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.botmother-launch-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(23, 125, 114, 0.3);
  border-radius: 8px;
  background: #e5f3f0;
  color: var(--primary-strong);
  font-weight: 800;
}

.botmother-launch-button span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

.botmother-launch-button:hover { background: #d8ede8; }
.botmother-backdrop{position:fixed;inset:0;z-index:140;display:grid;place-items:center;padding:16px;background:rgba(13,23,31,.66);backdrop-filter:blur(3px)}
.botmother-panel{width:min(520px,calc(100vw - 32px));height:min(720px,calc(100dvh - 32px));display:grid;grid-template-rows:62px minmax(0,1fr);overflow:hidden;border:1px solid #30404a;border-radius:13px;background:#172129;color:#f3f7f8;box-shadow:0 30px 90px rgba(0,0,0,.42);outline:none}
.botmother-topbar{display:grid;grid-template-columns:38px minmax(0,1fr) 38px;align-items:center;gap:10px;padding:0 15px;border-bottom:1px solid #283640;background:#1b252e}.botmother-topbar strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px}.botmother-icon-button{width:36px;height:36px;display:grid;place-items:center;padding:0;border:0;border-radius:8px;background:transparent;color:#c8d3d9;font-size:27px;line-height:1}.botmother-icon-button:hover{background:#283640;color:#fff}.botmother-icon-button:disabled{opacity:.45}.botmother-topbar-spacer{width:36px}
.botmother-content{min-height:0;overflow:auto;padding:24px}.botmother-feedback{margin:0 0 16px;padding:11px 12px;display:flex;align-items:center;gap:12px;border:1px solid #327e72;border-radius:9px;background:#163b37;color:#8ce2d4;font-size:13px;line-height:1.45}.botmother-feedback.error{border-color:#8f4947;background:#402627;color:#ffaaa3}.botmother-feedback span{flex:1}.botmother-feedback button{width:28px;height:28px;padding:0;border:0;background:transparent;color:inherit;font-size:20px}
.botmother-hero{display:grid;justify-items:center;text-align:center}.botmother-avatar{width:86px;height:86px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,#32c2aa,#12786c);box-shadow:0 14px 30px rgba(17,132,117,.28);color:#fff;font-size:38px;font-weight:900}.botmother-hero h2{margin:14px 0 5px;font-size:25px}.botmother-hero p{max-width:380px;margin:0;color:#aebbc3;line-height:1.55}.botmother-hero small{margin-top:8px;color:#62cbbb}
.botmother-search{height:46px;margin:22px 0;display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;padding:0 13px;border:1px solid #2a3a45;border-radius:10px;background:#202d37;color:#8fa2ad}.botmother-search input{min-width:0;height:42px;border:0;outline:0;background:transparent;color:#f4f7f8;font-size:15px}.botmother-search input::-moz-placeholder{color:#8fa2ad}.botmother-search input::placeholder{color:#8fa2ad}.botmother-section-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 10px}.botmother-section-heading h3{margin:0;font-size:18px}.botmother-section-heading span{color:#8fa2ad;font-size:12px}
.botmother-list{overflow:hidden;border:1px solid #2a3943;border-radius:10px}.botmother-row{width:100%;min-height:66px;display:grid;grid-template-columns:44px minmax(0,1fr) auto 20px;align-items:center;gap:11px;padding:9px 13px;border:0;border-bottom:1px solid #2a3943;background:#202c35;color:#eef3f5;text-align:left}.botmother-row:last-of-type{border-bottom:0}.botmother-row:hover{background:#25343e}.botmother-row:disabled{cursor:not-allowed;opacity:.52}.botmother-row-avatar,.botmother-detail-avatar{display:grid;place-items:center;border-radius:50%;background:#e9625d;color:#fff;font-weight:900}.botmother-row-avatar{width:42px;height:42px}.botmother-row-avatar.create{border:2px solid #45a8df;background:transparent;color:#45a8df;font-size:25px;font-weight:400}.botmother-row-avatar.revoked,.botmother-detail-avatar.revoked{background:#687782}.botmother-row-copy{min-width:0;display:grid;gap:3px}.botmother-row-copy strong,.botmother-row-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.botmother-row-copy small{color:#91a2ac}.botmother-chevron{color:#6f828d;font-size:26px}.botmother-status-dot{width:9px;height:9px;border-radius:50%;background:#788892}.botmother-status-dot.active{background:#39c69f;box-shadow:0 0 0 3px rgba(57,198,159,.12)}.botmother-empty{min-height:100px;display:grid;place-items:center;align-content:center;gap:6px;padding:22px;color:#8fa1ab;text-align:center}.botmother-empty strong{color:#d9e3e7}
.botmother-form{display:grid;gap:20px}.botmother-form-intro{display:flex;align-items:center;gap:14px}.botmother-form-intro h2,.botmother-form-intro p{margin:0}.botmother-form-intro p{margin-top:5px;color:#9babb4;line-height:1.45}.botmother-form label,.botmother-form-field>label{display:grid;gap:8px;color:#dbe4e8;font-size:14px;font-weight:700}.botmother-form label>small,.botmother-form-field>small{color:#8fa1ab;font-weight:400;line-height:1.45}.botmother-form input{width:100%;height:46px;padding:0 12px;border:1px solid #354651;border-radius:9px;outline:0;background:#10191f;color:#f5f8f9}.botmother-form input:focus{border-color:#39b9a6;box-shadow:0 0 0 3px rgba(57,185,166,.14)}.botmother-form-field{display:grid;gap:8px}.botmother-username-check-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.botmother-username-field{min-width:0;display:grid;grid-template-columns:34px minmax(0,1fr) 66px;align-items:center;border:1px solid #354651;border-radius:9px;background:#10191f;color:#79cfc1;overflow:hidden}.botmother-username-field:focus-within{border-color:#39b9a6;box-shadow:0 0 0 3px rgba(57,185,166,.14)}.botmother-username-field.error{border-color:#b95c59}.botmother-username-field.success{border-color:#32b69e}.botmother-username-field>span{display:grid;place-items:center;font-weight:800}.botmother-username-field input{min-width:0;border:0;border-radius:0;box-shadow:none!important}.botmother-username-field .botmother-username-suffix{padding:0 10px;border-left:1px solid #354651;background:#1e2b34;color:#79cfc1;font-weight:800;cursor:default}.botmother-check-button{min-width:74px;padding:0 15px;border:1px solid #3aa795;border-radius:8px;background:#193b38;color:#79dfcf;font-weight:800}.botmother-check-button:hover{background:#214b46}.botmother-check-button:disabled{cursor:not-allowed;opacity:.5}.botmother-field-feedback{margin:0;font-size:13px;line-height:1.45}.botmother-field-feedback.idle,.botmother-field-feedback.checking{color:#9cabb4}.botmother-field-feedback.available{color:#6dd8c1}.botmother-field-feedback.error{color:#ff938d}
.botmother-form footer,.botmother-detail-actions,.botmother-confirm>div{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.botmother-primary,.botmother-secondary,.botmother-danger{min-height:40px;padding:0 17px;border-radius:8px;font-weight:800}.botmother-primary{border:0;background:#2aa990;color:#fff}.botmother-primary:hover{background:#36bda3}.botmother-secondary{border:1px solid #40515c;background:transparent;color:#d7e0e4}.botmother-secondary:hover{background:#26343d}.botmother-danger{border:1px solid #cb5f59;background:#4b2828;color:#ffb0aa}.botmother-danger:hover{background:#61302f}.botmother-primary:disabled,.botmother-secondary:disabled,.botmother-danger:disabled{cursor:not-allowed;opacity:.48}
.botmother-detail{display:grid;gap:18px}.botmother-detail-hero{display:grid;justify-items:center;text-align:center}.botmother-detail-avatar{width:78px;height:78px;font-size:30px}.botmother-detail-hero h2{margin:12px 0 3px}.botmother-detail-hero p{margin:0;color:#8fa1ab}.botmother-status-pill{margin-top:9px;padding:4px 9px;border-radius:999px;background:#34434d;color:#c0cbd1;font-size:12px}.botmother-status-pill.active{background:#163e36;color:#74dfc7}.botmother-detail-fields{margin:0;display:grid;border:1px solid #2c3a44;border-radius:10px;overflow:hidden}.botmother-detail-fields div{display:grid;grid-template-columns:112px minmax(0,1fr);gap:12px;padding:12px;border-bottom:1px solid #2c3a44;background:#1d2831}.botmother-detail-fields div:last-child{border-bottom:0}.botmother-detail-fields dt{color:#8fa1ab}.botmother-detail-fields dd{margin:0;overflow-wrap:anywhere}.botmother-token-card{display:grid;gap:11px;padding:15px;border:1px solid #b7892f;border-radius:10px;background:#362e1f}.botmother-token-card>div{display:grid;gap:3px}.botmother-token-card span{color:#d5bd8b;font-size:13px;line-height:1.45}.botmother-token-card code{padding:11px;border-radius:7px;background:#11191e;color:#ffe6af;overflow-wrap:anywhere;word-break:break-all;line-height:1.55}.botmother-token-card button{justify-self:end}.botmother-confirm{padding:15px;border:1px solid #485963;border-radius:10px;background:#202c35}.botmother-confirm p{margin:7px 0;color:#aebbc2;line-height:1.55}.botmother-detail-actions{flex-wrap:wrap}.botmother-detail-actions .botmother-primary{margin-right:auto}
@media(max-width:760px){.botmother-launch-button{width:38px;padding:0;justify-content:center}.botmother-launch-button strong{display:none}}
@media(max-width:560px){.botmother-backdrop{padding:0}.botmother-panel{width:100vw;height:100dvh;border:0;border-radius:0}.botmother-content{padding:18px 14px}.botmother-detail-fields div{grid-template-columns:92px minmax(0,1fr)}.botmother-detail-actions{display:grid}.botmother-detail-actions .botmother-primary{margin:0}}
@media(max-width:380px){.botmother-username-check-row{grid-template-columns:1fr}.botmother-check-button{min-height:42px}}

.bot-settings-backdrop{position:fixed;inset:0;z-index:145;display:grid;place-items:center;padding:16px;background:rgba(13,23,31,.66);backdrop-filter:blur(3px)}
.bot-settings-panel{width:min(540px,calc(100vw - 32px));height:min(740px,calc(100dvh - 32px));display:grid;grid-template-rows:62px minmax(0,1fr);overflow:hidden;border:1px solid #30404a;border-radius:13px;background:#172129;color:#f3f7f8;box-shadow:0 30px 90px rgba(0,0,0,.42);outline:none}
.bot-settings-topbar{display:grid;grid-template-columns:38px minmax(0,1fr) 38px;align-items:center;gap:10px;padding:0 15px;border-bottom:1px solid #283640;background:#1b252e}.bot-settings-topbar strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px}.bot-settings-icon{width:36px;height:36px;display:grid;place-items:center;padding:0;border:0;border-radius:8px;background:transparent;color:#c8d3d9;font-size:27px;line-height:1}.bot-settings-icon:hover{background:#283640;color:#fff}.bot-settings-icon:disabled{opacity:.45}.bot-settings-topbar-spacer{width:36px}
.bot-settings-content{min-height:0;overflow:auto;padding:24px}.bot-settings-feedback{margin:0 0 16px;padding:11px 12px;display:flex;align-items:center;gap:12px;border:1px solid #327e72;border-radius:9px;background:#163b37;color:#8ce2d4;font-size:13px;line-height:1.45}.bot-settings-feedback.error{border-color:#8f4947;background:#402627;color:#ffaaa3}.bot-settings-feedback span{flex:1}.bot-settings-feedback button{width:28px;height:28px;padding:0;border:0;background:transparent;color:inherit;font-size:20px}
.bot-settings-hero{display:flex;align-items:center;gap:15px;padding:4px 0 18px}.bot-settings-avatar{width:66px;height:66px;display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,#32c2aa,#12786c);color:#fff;font-size:27px;font-weight:900}.bot-settings-hero h2,.bot-settings-hero p{margin:0}.bot-settings-hero h2{font-size:22px}.bot-settings-hero p{margin-top:4px;color:#76d2c3}.bot-settings-intro{margin:0 0 18px;color:#9dabb3;line-height:1.55}
.bot-settings-menu{overflow:hidden;border:1px solid #2a3943;border-radius:11px}.bot-settings-menu button,.bot-settings-group-list button,.bot-settings-rule-list button{width:100%;min-height:72px;display:grid;grid-template-columns:46px minmax(0,1fr) auto 20px;align-items:center;gap:11px;padding:10px 13px;border:0;border-bottom:1px solid #2a3943;background:#202c35;color:#eef3f5;text-align:left}.bot-settings-menu button:last-child,.bot-settings-group-list button:last-child,.bot-settings-rule-list button:last-child{border-bottom:0}.bot-settings-menu button:hover,.bot-settings-group-list button:hover,.bot-settings-rule-list button:hover{background:#25343e}.bot-settings-menu button>span:nth-child(2),.bot-settings-group-list button>span:nth-child(2),.bot-settings-rule-list button>span:first-child{min-width:0;display:grid;gap:4px}.bot-settings-menu strong,.bot-settings-menu small,.bot-settings-group-list strong,.bot-settings-group-list small,.bot-settings-rule-list strong,.bot-settings-rule-list small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bot-settings-menu small,.bot-settings-group-list small,.bot-settings-rule-list small{color:#91a2ac}.bot-settings-menu b,.bot-settings-group-list b,.bot-settings-rule-list b{color:#6f828d;font-size:25px}.bot-settings-menu em{min-width:22px;height:22px;display:grid;place-items:center;border-radius:999px;background:#dc5d58;color:#fff;font-size:12px;font-style:normal}.bot-settings-menu-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:#193c38;color:#70d3c1;font-size:22px}
.bot-settings-section{display:grid;gap:18px}.bot-settings-section-copy h2,.bot-settings-section-copy p{margin:0}.bot-settings-section-copy h2{font-size:22px}.bot-settings-section-copy p{margin-top:7px;color:#9eacb4;line-height:1.55}.bot-settings-empty{min-height:130px;display:grid;place-items:center;align-content:center;gap:9px;padding:22px;color:#8fa1ab;text-align:center}.bot-settings-empty strong{color:#d9e3e7}.bot-settings-group-list,.bot-settings-rule-list{overflow:hidden;border:1px solid #2a3943;border-radius:10px}.bot-settings-group-list button{grid-template-columns:44px minmax(0,1fr) auto 18px}.bot-settings-group-avatar{width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:#30566b;color:#cceafa;font-weight:900}.bot-settings-group-avatar.large{width:72px;height:72px;font-size:28px}.bot-settings-group-list em,.bot-settings-rule-list em{padding:4px 8px;border-radius:999px;background:#17413a;color:#73ddc7;font-size:11px;font-style:normal;white-space:nowrap}.bot-settings-group-list em.off,.bot-settings-rule-list em.off{background:#35434c;color:#aab7be}
.bot-settings-pending{display:grid;gap:9px}.bot-settings-pending h3{margin:0;font-size:15px;color:#f2cf91}.bot-settings-pending article{display:grid;gap:12px;padding:14px;border:1px solid #7b6335;border-radius:10px;background:#322c20}.bot-settings-pending article>div{display:grid;gap:4px}.bot-settings-pending small{color:#c3ad82}.bot-settings-pending footer{display:flex;justify-content:flex-end;gap:9px}.bot-settings-group-profile{display:grid;justify-items:center;text-align:center}.bot-settings-group-profile h2{margin:12px 0 4px}.bot-settings-group-profile p{margin:0;color:#90a2ac;font-size:13px;overflow-wrap:anywhere}
.bot-settings-switch-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 48px;align-items:center;gap:14px;padding:15px;border:1px solid #2f3f49;border-radius:10px;background:#1e2a32}.bot-settings-switch-row>span{display:grid;gap:5px}.bot-settings-switch-row small{color:#91a2ac;font-weight:400;line-height:1.45}.bot-settings-switch-row input{position:absolute;right:15px;width:48px;height:26px;opacity:0;cursor:pointer}.bot-settings-switch-row i{width:48px;height:26px;position:relative;border-radius:999px;background:#4b5961;transition:.18s}.bot-settings-switch-row i:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:.18s}.bot-settings-switch-row input:checked+i{background:#2aa990}.bot-settings-switch-row input:checked+i:after{transform:translateX(22px)}.bot-settings-switch-row.compact{min-height:62px}.bot-settings-note,.bot-settings-warning{margin:0;padding:12px 14px;border-radius:9px;color:#aebdc4;line-height:1.55}.bot-settings-note{border:1px solid #31534f;background:#182f2d}.bot-settings-warning{border:1px solid #8e623a;background:#392d20;color:#efc181}
.bot-settings-actions{display:flex;justify-content:flex-end;gap:10px}.bot-settings-actions.split{justify-content:space-between;align-items:center}.bot-settings-primary,.bot-settings-secondary,.bot-settings-danger{min-height:40px;padding:0 17px;border-radius:8px;font-weight:800}.bot-settings-primary{border:0;background:#2aa990;color:#fff}.bot-settings-primary:hover{background:#36bda3}.bot-settings-secondary{border:1px solid #40515c;background:transparent;color:#d7e0e4}.bot-settings-secondary:hover{background:#26343d}.bot-settings-danger{border:1px solid #cb5f59;background:#4b2828;color:#ffb0aa}.bot-settings-primary:disabled,.bot-settings-secondary:disabled,.bot-settings-danger:disabled{cursor:not-allowed;opacity:.48}.bot-settings-danger-link{padding:9px 0;border:0;background:transparent;color:#ff8f88;font-weight:700}
.bot-settings-add-rule{min-height:48px;display:flex;align-items:center;justify-content:center;gap:8px;border:1px dashed #418d82;border-radius:10px;background:#18332f;color:#77dac9;font-weight:800}.bot-settings-add-rule span{font-size:22px}.bot-settings-add-rule:disabled{opacity:.5}.bot-settings-rule-list button{grid-template-columns:minmax(0,1fr) auto 18px}.bot-settings-ai-card{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:start;gap:12px;padding:15px;border:1px solid #354750;border-radius:10px;background:#202c35}.bot-settings-ai-card>span{width:44px;height:44px;display:grid;place-items:center;border-radius:11px;background:#303b63;color:#b9c5ff;font-weight:900}.bot-settings-ai-card div{min-width:0}.bot-settings-ai-card p{margin:5px 0 0;color:#96a5ad;line-height:1.45}.bot-settings-ai-card em{padding:4px 8px;border-radius:999px;background:#343e47;color:#b5c0c6;font-size:11px;font-style:normal}
.bot-settings-rule-form>label:not(.bot-settings-switch-row){display:grid;gap:8px;color:#dbe4e8;font-size:14px;font-weight:700}.bot-settings-rule-form label small{color:#8fa1ab;font-weight:400;line-height:1.45}.bot-settings-rule-form input[type=text],.bot-settings-rule-form input:not([type]),.bot-settings-rule-form textarea{width:100%;padding:11px 12px;border:1px solid #354651;border-radius:9px;outline:0;background:#10191f;color:#f5f8f9;font:inherit;resize:vertical}.bot-settings-rule-form input:focus,.bot-settings-rule-form textarea:focus{border-color:#39b9a6;box-shadow:0 0 0 3px rgba(57,185,166,.14)}.bot-settings-delete-confirm{padding:15px;border:1px solid #8d4a47;border-radius:10px;background:#3d2727}.bot-settings-delete-confirm p{margin:0 0 12px;color:#ffc2bd}.bot-settings-delete-confirm footer{display:flex;justify-content:flex-end;gap:9px}
@media(max-width:560px){.bot-settings-backdrop{padding:0}.bot-settings-panel{width:100vw;height:100dvh;border:0;border-radius:0}.bot-settings-content{padding:18px 14px}.bot-settings-ai-card{grid-template-columns:44px minmax(0,1fr)}.bot-settings-ai-card em{grid-column:2;justify-self:start}}
@media(max-width:380px){.bot-settings-menu button{grid-template-columns:42px minmax(0,1fr) auto 16px}.bot-settings-group-list button{grid-template-columns:42px minmax(0,1fr) 16px}.bot-settings-group-list em{display:none}.bot-settings-actions.split{align-items:stretch;display:grid}.bot-settings-actions.split .bot-settings-primary{grid-row:1}.bot-settings-actions.split .bot-settings-danger-link{grid-row:2}}

