@font-face {
  font-family: "Roboto Regular";
  src: url("RobotoRegular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans SC Regular";
  src: url("NotoSansSC-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-optical-sizing: auto;
  color: #1c1c1e;
  background: #f2f2f7;
  font-synthesis: none;
  --brand-purple: #754df4;
  --brand-purple-dark: #4e2bca;
  --brand-pink: #ef82d8;
  --brand-blue: #3b91ee;
  --brand-green: #00c98a;
  --brand-lime: #a5d900;
  --brand-yellow: #ffc22e;
  --material: rgba(250, 250, 252, 0.72);
  --material-edge: rgba(255, 255, 255, 0.78);
  --material-shadow: 0 10px 34px rgba(28, 32, 40, 0.1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --speaker-circle: 57px;
  --speaker-icon: 22px;
  --collapse-circle: 57px;
  --collapse-icon: 40px;
  --contact-name-size: 29px;
  --contact-name-weight: 900;
  --flag-top: 46px;
  --flag-left: -5px;
  --dot-gap: 3px;
  --dot-offset-x: 0px;
  --dot-offset-y: -1px;
  --english-font: "Roboto Regular";
  --chinese-font: "Noto Sans SC Regular";
  --name-offset-x: 5px;
  --name-offset-y: 9px;
  --header-offset-x: 9px;
  --header-offset-y: 0px;
  --back-offset-x: 0px;
  --back-offset-y: 0px;
  --status-offset-x: 4px;
  --status-offset-y: 0px;
  --foreign-font-size: 32px;
  --chinese-font-size: 31px;
  --foreign-line-height: 49px;
  --chinese-line-height: 40px;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  border-top: 4px solid var(--brand-purple);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 80ms ease-out;
}

:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  isolation: isolate;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) clamp(430px, 36vw, 680px);
  min-height: calc(100vh - 4px);
  overflow-x: clip;
}

.app-shell > * {
  position: relative;
  z-index: 1;
}

.editor-pane {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: 16px clamp(20px, 2.4vw, 36px) 34px;
  background: #f7f8fa;
  border-right: 1px solid #e5e5ea;
}

.editor-pane > * {
  position: relative;
  z-index: 1;
}

.app-header,
.message-toolbar,
.editor-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.app-header {
  position: relative;
  min-height: 78px;
  margin-bottom: 18px;
  padding: 2px 0 14px;
  overflow: hidden;
  border-bottom: 1px solid #dfe2e6;
}

.app-header::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--brand-pink);
  box-shadow:
    40px 0 0 var(--brand-purple),
    80px 0 0 var(--brand-blue),
    120px 0 0 var(--brand-lime);
  content: "";
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-copy {
  min-width: 0;
}

.brand-artwork {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  height: 88px;
  margin: 0;
  overflow: visible;
}

.brand-artwork img {
  display: block;
  width: 112px;
  height: 88px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 8px 10px rgba(58, 72, 110, 0.14));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-purple-dark);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.message-toolbar h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-toolbar h2::before {
  width: 15px;
  height: 12px;
  border-radius: 8px 8px 8px 3px;
  background: var(--brand-green);
  content: "";
}

.message-toolbar p {
  margin-bottom: 0;
  color: #747980;
  font-size: 13px;
}

.message-toolbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  margin: 0 -10px;
  padding: 11px 12px;
  border: 1px solid var(--material-edge);
  border-radius: 14px;
  background: var(--material);
  box-shadow: var(--material-shadow);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.message-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.toolbar-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d8dce2;
  border-radius: 10px;
  background: white;
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.toolbar-button:hover {
  border-color: var(--brand-purple);
  color: var(--brand-purple-dark);
}

.secondary-button,
.icon-button,
.row-actions button {
  border: 0;
  transition: transform 140ms ease, background 140ms ease;
}

.secondary-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--brand-purple);
  border-radius: 10px;
  background: var(--brand-purple);
  color: white;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.secondary-button:hover {
  background: var(--brand-purple-dark);
}

.secondary-button:hover,
.icon-button:hover,
.row-actions button:hover {
  transform: translateY(-1px);
}

.settings-band {
  display: grid;
  grid-template-columns:
    minmax(0, 1.12fr)
    minmax(0, 0.75fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 0.9fr);
  align-items: end;
  gap: 14px;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid #dfe2e6;
}

.translation-panel {
  margin: 0 0 16px;
  border: 1px solid #e5e5ea;
  border-left: 4px solid var(--brand-green);
  border-radius: 14px;
  background: white;
  box-shadow: 0 2px 10px rgba(28, 32, 40, 0.04);
}

.translation-summary {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
}

.translation-heading,
.translation-actions,
.translation-field-actions,
.translation-config-actions {
  display: flex;
  align-items: center;
}

.translation-heading {
  min-width: 0;
  gap: 9px;
}

.translation-heading strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.translation-heading p {
  margin: 0;
  color: #747980;
  font-size: 12px;
}

.translation-mark {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: #eafaf4;
  color: #087b58;
  font-size: 15px;
  font-weight: 600;
}

.translation-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.translation-language-field {
  display: grid;
  grid-template-columns: auto 94px;
  align-items: center;
  gap: 7px;
  color: #555c65;
  font-size: 12px;
  font-weight: 500;
}

.translation-language-field select {
  height: 34px;
  padding: 0 26px 0 9px;
  border: 1px solid #d8dce2;
  border-radius: 5px;
  background-color: #fff;
  color: #343941;
  font: inherit;
}

.translation-model-field {
  grid-template-columns: auto minmax(142px, auto);
}

.translation-model-name {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #91dcc2;
  border-radius: 5px;
  background: #e9faf4;
  color: #087b58;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.translation-master-toggle {
  white-space: nowrap;
}

.translation-settings-button,
.text-button,
.translate-message-button {
  min-height: 30px;
  border: 1px solid #d8dce1;
  border-radius: 5px;
  background: white;
  color: #474d55;
  font-size: 12px;
  font-weight: 600;
}

.translation-settings-button {
  padding: 0 10px;
}

.translation-settings-button:hover,
.text-button:hover,
.translate-message-button:hover {
  border-color: var(--brand-purple);
  color: var(--brand-purple-dark);
}

.translation-config-note {
  margin: 0;
  padding: 0 12px 9px 51px;
  color: #747980;
  font-size: 11px;
}

.language-profile-confirmation {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin: 0 12px 8px;
  padding: 6px 8px 6px 12px;
  border: 1px solid #e0d9ff;
  border-radius: 5px;
  background: #f7f5ff;
  color: #55506c;
  font-size: 12px;
  font-weight: 500;
}

.language-profile-confirmation[hidden] {
  display: none;
}

.language-profile-confirmation button {
  min-width: 50px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--brand-purple);
  border-radius: 5px;
  background: #fff;
  color: var(--brand-purple-dark);
  font-size: 12px;
  font-weight: 600;
}

.language-profile-confirmation button:hover {
  background: #eeeaff;
}

.translation-config-note[data-state="success"] {
  color: #087b58;
}

.translation-config-note[data-state="error"] {
  color: #b42333;
}

.name-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
}

.name-control input {
  min-width: 0;
  border-radius: 5px 0 0 5px;
}

.name-control button {
  border: 1px solid #d8dce1;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: #f0edff;
  color: var(--brand-purple-dark);
  font-size: 12px;
  font-weight: 600;
}

.name-control button:hover {
  background: #e5dfff;
}

.name-control:focus-within input,
.name-control:focus-within button {
  border-color: var(--brand-purple);
}

.name-control:focus-within {
  border-radius: 5px;
  box-shadow: 0 0 0 3px rgba(117, 77, 244, 0.12);
}

.name-control input:focus {
  box-shadow: none;
}

label {
  display: grid;
  gap: 7px;
  color: #5f646c;
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d8dce1;
  border-radius: 5px;
  background: white;
  color: #181b20;
  outline: none;
}

input,
select {
  height: 36px;
  padding: 0 11px;
}

textarea {
  min-height: 58px;
  padding: 8px 10px;
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(117, 77, 244, 0.12);
}

.file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-field > span {
  display: flex;
  align-items: center;
  border: 1px dashed #bfc5cc;
  border-radius: 5px;
  background: #f8f9fa;
  color: #4d535b;
  cursor: pointer;
}

.file-field > span:hover {
  border-color: var(--brand-blue);
  background: #f1f7ff;
  color: #145ba5;
}

.file-field .avatar-picker {
  position: relative;
  width: 100%;
  height: 36px;
  padding: 0;
  overflow: hidden;
  border-style: solid;
  background: #eef0f3;
}

.avatar-picker img {
  display: block;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: 3px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.avatar-picker-action {
  position: static;
  display: flex;
  flex: 1;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  background: transparent;
  color: #4d535b;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.avatar-crop-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 80px rgba(16, 20, 28, 0.3);
}

.avatar-crop-dialog::backdrop {
  background: rgba(22, 26, 34, 0.58);
}

.avatar-crop-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.avatar-crop-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
}

.avatar-crop-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0f1f3;
  color: #42464d;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.avatar-crop-viewport {
  position: relative;
  width: min(300px, calc(100vw - 72px));
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  background: #dfe2e7;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-viewport.is-dragging {
  cursor: grabbing;
}

.avatar-crop-viewport img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  pointer-events: none;
  transform-origin: center;
}

.avatar-crop-guide {
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.avatar-crop-zoom {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #555b65;
  font-weight: 500;
}

.avatar-crop-zoom input {
  width: 100%;
}

.avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.message-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.message-editor {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  padding: 12px 66px 12px 12px;
  border: 1px solid #e5e5ea;
  border-left: 4px solid var(--brand-blue);
  border-radius: 14px;
  background: white;
  box-shadow: 0 2px 10px rgba(28, 32, 40, 0.04);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.message-editor:hover {
  box-shadow: 0 6px 20px rgba(28, 32, 40, 0.08);
}

.message-editor:nth-child(4n + 2) {
  border-left-color: var(--brand-purple);
}

.message-editor:nth-child(4n + 3) {
  border-left-color: var(--brand-green);
}

.message-editor:nth-child(4n + 4) {
  border-left-color: var(--brand-pink);
}

.editor-topline {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px) 104px;
  align-content: center;
  align-items: center;
  justify-content: start;
  gap: 10px;
  padding-right: 0;
}

.editor-topline .side-field,
.editor-topline .type-field {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr);
  align-items: center;
  gap: 7px;
}

.editor-topline .side-field > span,
.editor-topline .type-field > span {
  white-space: nowrap;
}

.side-field {
  gap: 5px;
}

.side-field select {
  height: 34px;
  min-width: 0;
  padding-left: 9px;
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.row-actions button,
.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  background: #edf0f3;
  color: #343941;
  font-weight: 600;
}

.row-actions button {
  width: 100%;
  height: 34px;
}

.row-actions button:disabled {
  cursor: default;
  opacity: 0.35;
  transform: none;
}

.row-actions button[data-action="delete"] {
  color: #d03645;
}

.type-field {
  gap: 5px;
}

.type-field select {
  height: 34px;
}

.text-message-field {
  display: grid;
  grid-template-rows: 22px auto;
  align-content: start;
  gap: 8px;
  color: #5f646c;
  font-size: 12px;
  font-weight: 500;
}

.text-message-field > textarea {
  height: 40px;
  min-height: 40px;
  max-height: 160px;
  overflow-y: auto;
  resize: none;
}

.records-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: white;
  box-shadow: 0 24px 70px rgba(24, 28, 36, 0.28);
}

.records-dialog::backdrop {
  background: rgba(30, 34, 42, 0.38);
}

.records-panel {
  display: grid;
  max-height: inherit;
  grid-template-rows: auto auto minmax(120px, 1fr) auto;
}

.records-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid #e3e6ea;
}

.records-heading > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.records-heading strong {
  font-size: 18px;
}

.records-heading span,
.records-note,
.records-storage-status {
  color: #747980;
  font-size: 12px;
}

.records-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 5px;
  background: #edf0f3;
  color: #343941;
  font-size: 20px;
}

.records-note {
  margin: 0;
  padding: 10px 18px;
}

.records-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 0 18px 16px;
  overflow-y: auto;
}

.record-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #dfe2e6;
  border-radius: 7px;
  background: #fafbfc;
}

.record-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.record-name {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #282c33;
  font-weight: 600;
}

.record-name:focus {
  border-color: var(--brand-purple);
  outline: none;
  background: white;
}

.record-meta {
  overflow: hidden;
  color: #747980;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-actions {
  display: flex;
  gap: 6px;
}

.record-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d8dce2;
  border-radius: 5px;
  background: white;
  color: #474d55;
  font-size: 12px;
  font-weight: 600;
}

.record-actions button[data-action="restore"] {
  border-color: #cfc5ff;
  color: var(--brand-purple-dark);
}

.record-actions button[data-action="delete"] {
  color: #c72f3d;
}

.records-empty {
  padding: 30px 12px;
  color: #7a8088;
  text-align: center;
}

.records-storage-status {
  min-height: 34px;
  margin: 0;
  padding: 8px 18px 12px;
  border-top: 1px solid #e3e6ea;
}

.records-storage-status[data-state="success"] {
  color: #087b58;
}

.records-storage-status[data-state="error"] {
  color: #b42333;
}

.field-heading {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.translation-field-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 7px;
}

.translate-message-button {
  min-height: 24px;
  padding: 0 8px;
  border-color: #d8d2fb;
  background: #f5f2ff;
  color: var(--brand-purple-dark);
}

.translate-message-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.message-translation-status {
  max-width: 190px;
  overflow: hidden;
  color: #7a8088;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-translation-status[data-state="success"] {
  color: #087b58;
}

.message-translation-status[data-state="error"] {
  color: #b42333;
}

.message-translation-status[data-state="loading"] {
  color: var(--brand-purple-dark);
}

.message-editor.translation-disabled .translate-message-button,
.message-editor.translation-disabled .message-translation-status {
  display: none;
}

.translation-toggle {
  display: inline-flex;
  grid-auto-flow: initial;
  align-items: center;
  gap: 6px;
  color: #555c65;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.translation-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.translation-toggle .toggle-track {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 20px;
  border: 1px solid #c7ccd3;
  border-radius: 10px;
  background: #dfe2e6;
  transition: border-color 140ms ease, background 140ms ease;
}

.translation-toggle .toggle-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(27, 31, 38, 0.24);
  transition: transform 140ms ease;
  content: "";
}

.translation-toggle input:checked + .toggle-track {
  border-color: var(--brand-purple);
  background: var(--brand-purple);
}

.translation-toggle input:checked + .toggle-track::after {
  transform: translateX(14px);
}

.translation-toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(117, 77, 244, 0.18);
  outline-offset: 2px;
}

.image-message-field {
  display: none;
  grid-column: 1 / -1;
  gap: 6px;
}

.message-editor.is-image-message .text-message-field {
  display: none;
}

.message-editor.is-image-message .image-message-field {
  display: grid;
}

.image-message-heading {
  color: #666d76;
  font-size: 13px;
  font-weight: 500;
}

.image-message-tools {
  position: relative;
}

.message-image-picker {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 112px;
  overflow: hidden;
  border: 1px dashed #bdc3cb;
  border-radius: 5px;
  background: #f8f9fa;
  color: #555c65;
  cursor: pointer;
}

.message-image-picker:hover {
  border-color: var(--brand-purple);
  background: #f6f3ff;
}

.message-image-picker:focus-within {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(117, 77, 244, 0.12);
}

.message-image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.message-image-empty {
  font-size: 13px;
  font-weight: 500;
}

.message-image-thumbnail {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.message-image-picker.has-image .message-image-empty {
  display: none;
}

.message-image-picker.has-image .message-image-thumbnail {
  display: block;
}

.remove-message-image {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: auto;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #ead3d6;
  border-radius: 5px;
  background: #fff7f8;
  color: #c43040;
  font-size: 12px;
  font-weight: 500;
}

.remove-message-image[hidden] {
  display: none;
}

.preview-pane {
  position: relative;
  top: 0;
  align-self: stretch;
  min-height: 100vh;
  padding: 14px 18px 18px;
  overflow: visible;
  background: rgba(236, 238, 242, 0.52);
  isolation: isolate;
}

.preview-pane > * {
  position: relative;
  z-index: 1;
}

body[data-capture="true"] .preview-pane::before {
  display: none;
}

.preview-toolbar,
.page-switcher {
  display: flex;
  align-items: center;
}

.preview-toolbar {
  position: sticky;
  top: 2px;
  z-index: 40;
  justify-content: space-between;
  width: fit-content;
  margin: 0 auto 10px;
  padding: 3px;
  border: 1px solid #d4d8de;
  border-top: 3px solid var(--brand-purple);
  border-radius: 7px;
  background: rgba(248, 249, 251, 0.96);
  box-shadow: 0 4px 14px rgba(32, 37, 45, 0.08);
  backdrop-filter: blur(10px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .brand-artwork {
    display: none;
  }
}

.page-switcher {
  gap: 5px;
}

.page-switcher span {
  min-width: 96px;
  color: #343941;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.page-switcher .icon-button {
  width: 40px;
  height: 34px;
  background: transparent;
  font-size: 23px;
  line-height: 1;
  touch-action: manipulation;
  user-select: none;
}

.page-switcher .icon-button:not(:disabled):hover {
  background: #e7eaee;
}

.page-switcher .icon-button:not(:disabled):active {
  background: #dfe2e7;
  transform: scale(0.94);
}

.page-switcher .icon-button:disabled {
  cursor: default;
  opacity: 0.3;
  transform: none;
}

.phone-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: calc(100vh - 58px);
  padding-top: 10px;
  box-sizing: border-box;
  overflow: hidden;
}

.phone-frame {
  position: relative;
  flex: 0 0 auto;
}

.phone-raster {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.phone-raster.is-ready {
  display: block;
}

.phone-stack {
  display: block;
  width: 728px;
  transform-origin: top left;
}

.phone {
  position: relative;
  width: 728px;
  height: 1457px;
  overflow: hidden;
  background: white;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: normal;
  box-shadow: 0 18px 60px rgba(28, 32, 40, 0.18);
}

.editable-preview {
  display: none;
  grid-template-rows: 87px 1fr 155px;
  width: 728px;
  height: 1457px;
}

body[data-preview-mode="editable"] .editable-preview,
.phone.export-editable .editable-preview {
  display: grid;
}

body[data-preview-mode="editable"] .phone-page.is-hidden {
  display: none;
}

body[data-capture="true"] {
  width: 728px;
  height: 1457px;
  overflow: hidden;
}

body[data-capture="true"] .app-shell {
  display: block;
  width: 728px;
  min-height: 1457px;
}

body[data-capture="true"] .editor-pane,
body[data-capture="true"] .preview-toolbar {
  display: none;
}

body[data-capture="true"] .editor-pane::before {
  display: none;
}

body[data-capture="true"] .app-shell::before {
  display: none;
}

body[data-capture="true"] .preview-pane {
  position: static;
  width: 728px;
  height: 1457px;
  padding: 0;
}

body[data-capture="true"] .phone-stage {
  width: 728px;
  height: 1457px;
  padding-top: 0;
}

body[data-capture="true"] .phone {
  box-shadow: none;
}

body[data-capture="true"] .phone-page:not(:first-child) {
  display: none;
}

body[data-capture="true"] .phone-raster {
  display: none;
}

.chat-header {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  padding: 10px 158px 5px 35px;
  background: white;
}

.header-movable {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  transform: translate(var(--header-offset-x), var(--header-offset-y));
}

.header-template {
  position: absolute;
  inset: 0;
  display: none;
  width: 728px;
  height: 87px;
}

.chat-header.uses-template .header-template {
  display: block;
}

.chat-header.uses-template .header-movable,
.chat-header.uses-template .header-reference {
  visibility: hidden;
}

.back-icon {
  position: relative;
  transform: translate(var(--back-offset-x), var(--back-offset-y));
  width: 25px;
  height: 25px;
  border-bottom: 5px solid #17191d;
  border-left: 5px solid #17191d;
  font-size: 0;
  transform: translate(var(--back-offset-x), var(--back-offset-y)) rotate(45deg);
}

.contact-copy {
  display: grid;
  gap: 1px;
}

.contact-copy strong {
  overflow: hidden;
  padding-bottom: 4px;
  font-size: var(--contact-name-size);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-copy span {
  position: relative;
  display: inline-block;
  transform: translate(var(--status-offset-x), var(--status-offset-y));
  color: #a6a6aa;
  font-size: 22px;
}

.header-reference {
  position: absolute;
  top: 0;
  right: 0;
  width: 158px;
  height: 87px;
  overflow: hidden;
  background: white;
}

.header-reference img {
  display: block;
  width: 158px;
  height: 87px;
  max-width: none;
}

.conversation {
  position: relative;
  padding: 0 22px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: white;
  scrollbar-width: none;
}

.conversation::-webkit-scrollbar {
  display: none;
}

.continuation-page .conversation::after {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 24px;
  background: white;
  content: "";
  pointer-events: none;
}

.conversation-content {
  display: flow-root;
  will-change: transform;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 21px;
}

.message-row:first-child {
  margin-top: 24px;
}

.message-row.me {
  flex-direction: row-reverse;
}

.avatar-wrap {
  position: relative;
  flex: 0 0 72px;
  height: 72px;
  margin-top: 0;
}

.avatar-image {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.flag-badge {
  position: absolute;
  top: var(--flag-top);
  left: var(--flag-left);
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: block;
  border: 3px solid white;
  background: white;
  box-shadow: 0 1px 4px rgba(20, 24, 32, 0.22);
  object-fit: cover;
  object-position: center;
}

.message-group {
  position: relative;
  display: flex;
  align-items: flex-start;
  column-gap: 9px;
  max-width: calc(100% - 96px);
}

.message-group .bubble {
  flex: 0 1 auto;
}

.message-group .message-menu-wrap {
  flex-shrink: 0;
}

.me .message-group {
  flex-direction: row-reverse;
  max-width: 100%;
}

.bubble {
  min-width: 0;
  width: fit-content;
  max-width: 470px;
  padding: 17px 20px 16px;
  border-radius: 32px;
  background: #f2f2f2;
  color: #2b2b2f;
}

.continued-bubble-shell {
  position: absolute;
  z-index: 1;
  top: 24px;
  overflow: hidden;
  border-radius: 32px;
}

.continued-bubble {
  margin: 0;
}

.me .bubble {
  background: #f0ecff;
}

.message-row.them:not(:first-child) .bubble {
  padding-bottom: 17px;
}

.bubble p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-wrap: wrap;
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 28px;
  line-height: 40px;
}

.dotted-word {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.word-dots {
  position: absolute;
  bottom: var(--dot-offset-y);
  left: calc(50% + var(--dot-offset-x));
  display: flex;
  gap: var(--dot-gap);
  transform: translateX(-50%);
}

.word-dots i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b6b6b6;
}

.bubble-image {
  display: block;
  width: auto;
  max-width: 460px;
  max-height: 360px;
  margin: 0;
  border-radius: 22px;
  object-fit: contain;
  background: white;
}

.bubble.image-bubble {
  max-width: 460px;
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  background: transparent;
}

.bubble-image-placeholder {
  display: grid;
  place-items: center;
  width: 320px;
  height: 190px;
  border: 2px dashed #cdd1d7;
  border-radius: 22px;
  background: #f5f6f7;
  color: #858b94;
  font-size: 22px;
  font-weight: 700;
}

.bubble .translation {
  font-size: 28px;
}

.bubble-part {
  position: relative;
}

.bubble-part.original-part p {
  font-size: var(--foreign-font-size);
  line-height: var(--foreign-line-height);
}

.bubble-part.translation-part p {
  font-size: var(--chinese-font-size);
  line-height: var(--chinese-line-height);
}

.bubble-part.translation-part {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #e3e3e3;
}

.bubble-part.translation-part.translation-only {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.me .bubble-part.translation-part {
  border-top-color: #e1ddf0;
}

.message-menu-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border-radius: 50%;
}

.message-menu {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f1f1f1;
}

.message-menu.me {
  background: #eeecf7;
}

.message-menu::after {
  content: "";
  position: absolute;
  top: 55%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-right: 4px solid #111;
  border-bottom: 4px solid #111;
  transform: translate(-50%, -50%) rotate(225deg);
}

.composer-reference {
  position: relative;
  z-index: 2;
  width: 728px;
  height: 155px;
  overflow: hidden;
  background: white;
}

.composer-reference::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 3px;
  background: white;
}

.composer-reference img {
  display: block;
  width: 728px;
  height: 155px;
  max-width: none;
}

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .preview-pane {
    position: relative;
    height: auto;
    min-height: 860px;
  }

  .settings-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .translation-summary {
    align-items: flex-start;
  }

  .translation-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .phone-stage {
    height: auto;
  }

  .phone {
    width: 728px;
  }
}

@media (max-width: 720px) {
  .editor-pane {
    padding: 22px 16px 36px;
  }

  .app-header {
    min-height: 82px;
  }

  h1 {
    font-size: 25px;
  }

  .settings-band {
    grid-template-columns: 1fr;
  }

  .translation-summary {
    display: grid;
  }

  .translation-actions {
    justify-content: flex-start;
  }

  .translation-config-note {
    padding-left: 15px;
  }

  .message-editor {
    grid-template-columns: 1fr;
  }

  .editor-topline {
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-content: start;
  }

  .message-editor.is-collapsed .editor-topline {
    grid-template-columns: 1fr;
  }

  .message-toolbar {
    align-items: flex-start;
  }

  .message-toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .image-message-field {
    grid-column: 1;
  }

  .field-heading {
    align-items: flex-start;
  }

  .translation-field-actions {
    flex-wrap: wrap;
  }

  .preview-pane {
    min-height: 780px;
    padding: 20px 12px 36px;
  }
}

/* ---- local studio additions ---- */
.download-button {
  border-color: var(--brand-purple);
  color: var(--brand-purple-dark);
}

.app-toast {
  position: fixed;
  z-index: 9999;
  left: 50%;
  bottom: 28px;
  max-width: min(520px, calc(100vw - 40px));
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(28, 28, 30, 0.88);
  color: #fff;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.batch-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: #17191d;
  box-shadow: 0 28px 90px rgba(23, 25, 29, 0.28);
}

.batch-dialog::backdrop {
  background: rgba(30, 34, 42, 0.38);
}

.batch-panel {
  display: grid;
  gap: 14px;
  padding: 22px 24px 24px;
}

.batch-textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px 14px;
  border: 1px solid #d7dae0;
  border-radius: 12px;
  font: 13px/1.7 "SFMono-Regular", Consolas, "PingFang SC", monospace;
  resize: vertical;
  outline: none;
}

.batch-textarea:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(117, 77, 244, 0.14);
}

.batch-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555b66;
}

.toggle-mode {
  cursor: pointer;
}

.toggle-mode input {
  display: none;
}

.toggle-track {
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 44px;
  height: 24px;
  border: 1px solid #c9cdd4;
  border-radius: 999px;
  background: #f2f3f5;
  transition: border-color 180ms ease, background 180ms ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border: 1px solid #b9bec7;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.toggle-mode input:checked + .toggle-track {
  border-color: #754df4;
  background: #eee8ff;
}

.toggle-mode input:checked + .toggle-track .toggle-thumb {
  border-color: #754df4;
  background: #754df4;
  transform: translateX(20px);
}

.batch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- Apple-style chrome: grouped actions, sheets, adaptive motion ---- */
.more-menu-wrap {
  position: relative;
}

.more-button[aria-expanded="true"] {
  border-color: var(--brand-purple);
  background: #f4f1ff;
  color: var(--brand-purple-dark);
}

.more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 198px;
  padding: 6px;
  border: 1px solid var(--material-edge);
  border-radius: 14px;
  background: rgba(252, 252, 254, 0.88);
  box-shadow: 0 16px 44px rgba(28, 32, 40, 0.16);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  transform-origin: top right;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.more-menu[hidden] {
  display: none;
}

.more-menu.is-opening {
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
}

.more-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #3a3a3c;
  font-size: 13px;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}

.more-menu button:hover {
  background: rgba(117, 77, 244, 0.09);
  color: var(--brand-purple-dark);
}

.more-menu button.destructive {
  color: #b3322a;
}

.more-menu-divider {
  display: block;
  height: 1px;
  margin: 5px 6px;
  background: #e5e5ea;
}

.avatar-crop-dialog[open],
.records-dialog[open],
.batch-dialog[open] {
  animation: sheet-in 260ms var(--ease-out) both;
  transform-origin: 50% 100%;
}

.avatar-crop-dialog.is-closing,
.records-dialog.is-closing,
.batch-dialog.is-closing {
  animation: sheet-out 190ms var(--ease-in) both !important;
}

.avatar-crop-dialog[open]::backdrop,
.records-dialog[open]::backdrop,
.batch-dialog[open]::backdrop {
  animation: scrim-in 260ms ease both;
}

.avatar-crop-dialog.is-closing::backdrop,
.records-dialog.is-closing::backdrop,
.batch-dialog.is-closing::backdrop {
  animation: scrim-out 190ms ease both;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(14px) scale(0.98); }
}

@keyframes scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scrim-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  button:active:not(:disabled) { transform: none; }
  .message-editor:hover { box-shadow: 0 2px 10px rgba(28, 32, 40, 0.04); }
}

@media (prefers-reduced-transparency: reduce) {
  .message-toolbar,
  .more-menu,
  .app-toast,
  .avatar-crop-panel,
  .records-panel,
  .batch-panel {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .editor-pane,
  .message-toolbar,
  .more-menu,
  .translation-panel,
  .message-editor,
  .avatar-crop-panel,
  .records-panel,
  .batch-panel {
    border-color: #6b6b70;
  }
  .message-toolbar p,
  .translation-heading p,
  .records-note,
  .more-menu button {
    color: #3a3a3c;
  }
}
/* ---- simplified message editor + DeepSeek key field ---- */
.api-key-field {
  grid-template-columns: auto minmax(140px, 220px);
}

.api-key-field input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d8dce2;
  border-radius: 10px;
  background: #fff;
  color: #3a3a3c;
  font-size: 12px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.api-key-field input:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(117, 77, 244, 0.14);
}

.side-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 10px;
  background: #eceef2;
}

.side-toggle button {
  min-width: 46px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.side-toggle button.is-active {
  background: #fff;
  color: var(--brand-purple-dark);
  box-shadow: 0 1px 4px rgba(28, 32, 40, 0.12);
}

.message-editor .editor-topline {
  gap: 10px;
  grid-column: 1 / -1;
}

.message-editor .row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.translate-message-button.translate-chip {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--brand-purple);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-purple-dark);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.message-translation-status {
  min-width: 44px;
  max-width: none;
  flex: 0 0 auto;
  overflow: visible;
  color: #8a8f98;
  font-size: 11px;
  text-overflow: clip;
  white-space: nowrap;
}

.message-translation-status[data-state="success"] { color: #0b7a58; }
.message-translation-status[data-state="error"] { color: #b3322a; }

.type-toggle {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d8dce2;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
}

.message-editor .translation-field { order: 1; }
.message-editor .original-field { order: 2; }
.message-editor .image-message-field { order: 3; }

.message-editor .translation-toggle {
  gap: 5px;
  color: #6b7280;
  font-size: 11px;
  white-space: nowrap;
}

.message-editor .translation-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand-purple);
}

@media (prefers-reduced-motion: reduce) {
  .side-toggle button,
  .type-toggle,
  .translate-chip {
    transition: none;
  }
}

.preview-hint {
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---- editor card tones + global translate ---- */
.message-editor:not(.side-me) {
  background: #f2f2f2;
}

.message-editor.side-me {
  background: #f0ecff;
}

.translate-all-button {
  align-self: end;
  min-height: 34px;
  white-space: nowrap;
}

/* ---- preview bubble actions ---- */
.bubble-actions {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}

.bubble-actions.them {
  top: 0;
  left: 100%;
  margin-left: 10px;
}

.bubble-actions.me {
  top: 50%;
  right: 100%;
  margin-right: 10px;
  transform: translateY(-50%);
}

.bubble-action {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--collapse-circle);
  height: var(--collapse-circle);
  border-radius: 50%;
  background: #f1f1f1;
}

.bubble-action.me {
  background: #eeecf7;
}

.bubble-action img {
  width: var(--collapse-icon);
  height: var(--collapse-icon);
}

.bubble-action .chevron {
  width: 10px;
  height: 10px;
  margin-top: -3px;
  border-right: 3px solid #111;
  border-bottom: 3px solid #111;
  transform: rotate(225deg);
}

.bubble-inline-action {
  position: absolute;
  top: 50%;
  left: 100%;
  display: grid;
  place-items: center;
  width: var(--collapse-circle);
  height: var(--collapse-circle);
  margin-left: 28px;
  border-radius: 50%;
  background: #f1f1f1;
  transform: translateY(-50%);
}

.bubble-inline-action img {
  width: var(--collapse-icon);
  height: var(--collapse-icon);
  object-fit: contain;
}

.preview-name {
  font-weight: var(--contact-name-weight);
}

.preview-name,
.bubble p {
  font-family: var(--english-font), var(--chinese-font), -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.bubble-inline-action.speaker {
  width: var(--speaker-circle);
  height: var(--speaker-circle);
}

.bubble-inline-action.speaker img {
  width: var(--speaker-icon);
  height: var(--speaker-icon);
}

.copy-preview-button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 9px;
  background: rgba(28, 32, 40, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[data-capture="true"] .copy-preview-button {
  display: none;
}

.phone-stage {
  user-select: none;
  -webkit-user-select: none;
}

.preview-name {
  position: relative;
  transform: translate(var(--name-offset-x), var(--name-offset-y));
}

.preview-scale-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 12px;
}

.preview-scale-control input {
  width: 110px;
  accent-color: #754df4;
}

.preview-scale-control span {
  min-width: 34px;
  color: #3a3a3c;
  font-variant-numeric: tabular-nums;
}

.translation-dialog .records-panel {
  grid-template-rows: auto auto auto;
}

.translation-dialog .translation-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.message-editor.side-them {
  background: #f2f2f2;
}

.message-editor.side-me {
  background: #f0ecff;
}

.dialog-more-section {
  display: grid;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid #e3e6ea;
}

.dialog-more-section strong {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.dialog-more-section .toolbar-button {
  width: 100%;
  min-height: 36px;
}

.translation-language-hidden {
  display: none;
}


.batch-actions .secondary-button,
.batch-actions .primary-button {
  border-radius: 8px;
}

.batch-actions .secondary-button {
  border-color: #d8dce1;
  background: #fff;
  color: #5f646c;
}

.batch-actions .primary-button {
  border-color: #754df4;
  background: #754df4;
  color: #fff;
}

.overwrite-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 18px 0;
}

.overwrite-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  background: #fafbfc;
}

.overwrite-item input {
  margin-top: 3px;
}

.overwrite-item strong {
  display: block;
  margin-bottom: 4px;
  color: #3a3a3c;
  font-size: 12px;
}

.overwrite-item p {
  margin: 2px 0;
  color: #5f646c;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.overwrite-item .existing {
  color: #754df4;
}

#overwriteTranslateDialog {
  width: min(920px, calc(100vw - 40px));
  max-height: min(88vh, 980px);
}

#overwriteTranslateDialog .records-panel {
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
}

#overwriteTranslateDialog .overwrite-list {
  max-height: none;
  padding-bottom: 14px;
}

#overwriteTranslateDialog .batch-actions {
  padding: 12px 18px 20px;
  border-top: 1px solid #e3e6ea;
}

.overwrite-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
}

.overwrite-select-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.overwrite-select-actions .toolbar-button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 8px;
}

.avatar-filename-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #5f646c;
  font-size: 12px;
  white-space: nowrap;
}

.avatar-crop-actions .primary-button,
.avatar-crop-actions .secondary-button {
  border-radius: 10px;
}

.avatar-crop-actions .primary-button {
  border: 1px solid #754df4;
  background: #754df4;
  color: #fff;
}

.avatar-crop-actions .secondary-button {
  border: 1px solid #d8dce1;
  background: #f5f6f8;
  color: #5f646c;
}

.copy-preview-button.is-copied {
  border-color: #754df4;
  background: #754df4;
  color: #fff;
}
