:root {
  --telegram-blue: #3390ec;
  --telegram-blue-hover: #2b80d8;
  --telegram-green: #4fae4e;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f1f3f4;
  --border: #dfe3e6;
  --text: #202b33;
  --text-soft: #707579;
  --text-faint: #a2acb4;
  --outgoing: #e4ffca;
  --wallpaper: #d8e7d3;
  --danger: #df3f40;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  --sidebar-width: 392px;
  --composer-height: 132px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body.is-resizing {
  user-select: none;
}

body.is-resizing-x,
body.is-resizing-x * {
  cursor: col-resize !important;
}

body.is-resizing-y,
body.is-resizing-y * {
  cursor: row-resize !important;
}

body.is-resizing iframe {
  pointer-events: none;
}

body {
  overflow: hidden;
  color: var(--text);
  background: #c8cdd0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 8px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

.inbox-panel {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
}

.workspace-resizer,
.composer-resizer {
  position: relative;
  z-index: 7;
  display: grid;
  padding: 0;
  place-items: center;
  border: 0;
  outline: 0;
  background: transparent;
  touch-action: none;
}

.workspace-resizer {
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

.workspace-resizer::before {
  position: absolute;
  inset: 0 3px;
  background: var(--border);
  content: "";
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.workspace-resizer span {
  position: relative;
  width: 4px;
  height: 42px;
  border-radius: 4px;
  background: #aebbc4;
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.workspace-resizer:hover::before,
.workspace-resizer:focus-visible::before,
.workspace-resizer.is-dragging::before {
  background: var(--telegram-blue);
  box-shadow: 0 0 0 1px rgba(51, 144, 236, 0.16);
}

.workspace-resizer:hover span,
.workspace-resizer:focus-visible span,
.workspace-resizer.is-dragging span {
  background: var(--telegram-blue);
  opacity: 1;
}

.sidebar-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 4px;
  min-height: 60px;
  padding: 8px 8px 6px;
  background: var(--sidebar);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  outline: 0;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

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

.icon-button:focus-visible {
  box-shadow: 0 0 0 2px var(--telegram-blue);
}

.icon-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 2px solid transparent;
  border-radius: 22px;
  color: var(--text-soft);
  background: #f1f3f4;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.search-box:focus-within {
  border-color: var(--telegram-blue);
  color: var(--telegram-blue);
  background: var(--surface);
}

.search-box svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder {
  color: #8c979f;
}

kbd {
  padding: 1px 4px;
  border: 1px solid #cbd1d5;
  border-radius: 4px;
  color: #8a949b;
  background: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 9px;
}

.inbox-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 2px 17px 6px 22px;
}

.inbox-heading h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.inbox-heading-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.next-lead-button {
  display: inline-flex;
  min-height: 40px;
  padding: 0 8px 0 12px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background: var(--telegram-blue);
  box-shadow: 0 2px 9px rgba(51, 144, 236, 0.24);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
  transition-property: background-color, box-shadow, transform, opacity;
  transition-duration: 120ms;
}

.next-lead-button span {
  display: grid;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  place-items: center;
  border-radius: 12px;
  color: var(--telegram-blue);
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.next-lead-button:hover:not(:disabled) {
  background: var(--telegram-blue-hover);
  box-shadow: 0 4px 13px rgba(51, 144, 236, 0.3);
}

.next-lead-button:active:not(:disabled) {
  transform: scale(0.96);
}

.next-lead-button:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: default;
}

.archive-shortcut,
.favorites-shortcut {
  display: flex;
  width: calc(100% - 14px);
  min-height: 50px;
  margin: 0 7px 4px;
  padding: 6px 12px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  transition: background-color 120ms ease;
}

.archive-shortcut:hover,
.archive-shortcut.is-active,
.favorites-shortcut:hover {
  background: var(--surface-hover);
}

.archive-shortcut-icon,
.favorites-shortcut-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--telegram-blue);
  font-size: 17px;
}

.archive-count,
.favorites-count {
  min-width: 20px;
  margin-left: auto;
  color: var(--text-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.favorites-shortcut-icon {
  color: #8a6512;
  background: #ffe7a3;
}

.favorites-panel {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  padding: 20px 16px;
  overflow-y: auto;
  border-left: 1px solid #dce4e9;
  background: #fff;
  box-shadow: -12px 0 34px rgba(34, 51, 63, 0.18);
}

.favorites-panel-header,
.forward-dialog-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.favorites-panel-kicker,
.forward-dialog-card > header span {
  color: var(--telegram-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.favorites-panel h2,
.forward-dialog-card h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 23px;
}

.panel-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #657786;
  background: #edf2f5;
  cursor: pointer;
  font-size: 23px;
}

.favorites-panel-hint {
  margin: 12px 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.favorites-upload {
  margin-bottom: 16px;
}

.favorites-upload > button {
  display: flex;
  width: 100%;
  min-height: 64px;
  padding: 11px 13px;
  align-items: center;
  gap: 11px;
  border: 1px dashed #8dc5ed;
  border-radius: 13px;
  color: #236e9f;
  background: #eef8ff;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.favorites-upload > button:hover {
  border-color: var(--telegram-blue);
  background: #e4f4ff;
  transform: translateY(-1px);
}

.favorites-upload > button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.favorites-upload svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.favorites-upload span {
  display: grid;
  gap: 3px;
}

.favorites-upload strong {
  font-size: 13px;
}

.favorites-upload small {
  color: var(--text-soft);
  font-size: 10px;
}

.favorites-list {
  display: grid;
  gap: 9px;
}

.favorites-empty,
.forward-empty {
  padding: 28px 20px;
  border: 1px dashed #cbd8df;
  border-radius: 12px;
  color: var(--text-soft);
  background: #f7fafb;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.favorite-card {
  display: grid;
  padding: 11px;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 9px;
  border: 1px solid #dce6ec;
  border-radius: 12px;
  background: #fbfdfe;
}

.favorite-card-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--telegram-blue);
  font-size: 10px;
  font-weight: 800;
}

.favorite-card-preview {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #dceaf2;
  object-fit: cover;
}

.favorite-card-body {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 3px;
}

.favorite-card-body strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-card-body span {
  color: var(--text-soft);
  font-size: 10px;
}

.favorite-card-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 5px;
}

.favorite-card-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: #257ab5;
  background: #e8f4fd;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.favorite-card-actions button:first-child {
  flex: 1;
  color: #fff;
  background: var(--telegram-blue);
}

.favorite-card-actions button:disabled {
  opacity: 0.52;
  cursor: default;
}

.favorite-card-actions .is-remove {
  color: #b65353;
  background: #fff0f0;
}

.forward-dialog {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(17, 27, 34, 0.48);
  backdrop-filter: blur(3px);
}

.scheduled-messages-button {
  position: relative;
}

.scheduled-messages-button > span {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 9px;
  color: #fff;
  background: var(--telegram-blue);
  font-size: 9px;
  font-weight: 750;
  line-height: 12px;
}

.scheduled-messages-button.has-scheduled {
  color: var(--telegram-blue);
  background: #e9f5fd;
}

.send-context-menu {
  position: fixed;
  z-index: 55;
  min-width: 182px;
  padding: 5px;
  border: 1px solid rgba(20, 42, 55, 0.08);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(21, 38, 49, 0.22);
}

.send-context-menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  color: #263c48;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.send-context-menu button:hover {
  background: #edf6fd;
}

.schedule-dialog {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(17, 27, 34, 0.5);
  backdrop-filter: blur(3px);
}

.schedule-dialog-card {
  display: grid;
  width: min(440px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  padding: 18px;
  gap: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(21, 38, 49, 0.3);
}

.schedule-dialog-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.schedule-dialog-card h2 {
  margin: 0;
  color: #223947;
  font-size: 18px;
}

.schedule-dialog-card > header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #627580;
  background: transparent;
  cursor: pointer;
  font-size: 23px;
}

.schedule-dialog-card label {
  display: grid;
  gap: 6px;
  color: #5b6f7b;
  font-size: 12px;
  font-weight: 650;
}

.schedule-dialog-card textarea,
.schedule-dialog-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cedce4;
  border-radius: 10px;
  outline: 0;
  color: #1f3542;
  background: #f8fafb;
  font: inherit;
  font-size: 14px;
}

.schedule-dialog-card textarea {
  min-height: 116px;
  resize: vertical;
}

.schedule-dialog-card textarea:focus,
.schedule-dialog-card input:focus {
  border-color: var(--telegram-blue);
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.schedule-message-media {
  display: grid;
  padding: 10px;
  gap: 8px;
  border: 1px solid #cae2f5;
  border-radius: 11px;
  background: #f2f8fd;
}

.schedule-message-media[hidden] {
  display: none;
}

.schedule-message-media-grid,
.scheduled-message-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}

.schedule-message-media-grid img,
.scheduled-message-media img {
  width: 100%;
  height: 86px;
  border-radius: 8px;
  object-fit: cover;
  background: #dce8ee;
}

.schedule-message-media small {
  color: #527082;
  font-size: 11px;
}

.schedule-dialog-actions,
.scheduled-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.schedule-dialog-actions button,
.scheduled-message-actions button {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: #46606f;
  background: #edf2f5;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.schedule-dialog-actions .is-primary,
.scheduled-message-actions button:nth-child(2) {
  color: #fff;
  background: var(--telegram-blue);
}

.scheduled-list-card {
  grid-template-rows: auto minmax(0, 1fr);
}

.scheduled-messages-list {
  display: grid;
  min-height: 120px;
  overflow-y: auto;
  gap: 10px;
}

.scheduled-message-card {
  display: grid;
  padding: 12px;
  gap: 8px;
  border: 1px solid #dce6eb;
  border-radius: 12px;
  background: #f8fafb;
}

.scheduled-message-card time {
  color: var(--telegram-blue);
  font-size: 11px;
  font-weight: 750;
}

.scheduled-message-card p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #243b48;
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.scheduled-message-media img {
  height: 112px;
}

.scheduled-message-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.scheduled-message-actions .is-danger {
  color: #b14f4f;
  background: #fff0f0;
}

.scheduled-empty {
  margin: auto;
  color: #78909c;
  font-size: 13px;
}

.scheduled-error {
  color: #b06045;
  font-size: 10px;
}

.forward-dialog-card {
  display: grid;
  width: min(420px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  padding: 18px;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(21, 38, 49, 0.3);
}

.forward-search {
  display: flex;
  min-height: 42px;
  padding: 0 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8e3e9;
  border-radius: 11px;
  background: #f5f8fa;
}

.forward-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.forward-recipient-list {
  min-height: 0;
  overflow-y: auto;
}

.forward-recipient {
  display: grid;
  width: 100%;
  padding: 7px 5px;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.forward-recipient:hover {
  background: #edf6fd;
}

.forward-recipient > span:first-child {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #3ba39c;
  font-size: 12px;
  font-weight: 700;
}

.forward-recipient > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.forward-recipient strong {
  color: var(--text);
  font-size: 12px;
}

.forward-recipient small {
  color: var(--text-soft);
  font-size: 10px;
}

.count-badge,
.unread-badge {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--telegram-blue);
  font-size: 11px;
  font-weight: 600;
}

.thread-list {
  height: 0;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 7px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #b9c1c7 transparent;
  scrollbar-width: thin;
  touch-action: pan-y;
}

.thread-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 72px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 100ms ease;
}

.thread-card.is-entering {
  animation: thread-in 180ms ease-out both;
}

.thread-card:hover {
  background: var(--surface-hover);
}

.thread-card.has-unread:not(.is-active),
.thread-card.awaiting-reply:not(.is-active) {
  background: #e8f4fd;
  box-shadow: inset 0 0 0 2px #70b9f4;
}

.thread-card.has-unread:not(.is-active):hover,
.thread-card.awaiting-reply:not(.is-active):hover {
  background: #dceefd;
}

.thread-card.has-unread .thread-name,
.thread-card.awaiting-reply .thread-name {
  font-weight: 700;
}

.thread-card.has-unread:not(.is-active) .thread-preview,
.thread-card.awaiting-reply:not(.is-active) .thread-preview {
  color: #3d6785;
  font-weight: 500;
}

.thread-card.is-active {
  color: #fff;
  background: var(--telegram-blue);
}

.thread-card.awaiting-reply.is-active {
  box-shadow: inset 0 0 0 2px #b9ddfb;
}

.thread-card.is-priority-lead:not(.is-active) {
  background: #fff8dc;
  box-shadow: inset 3px 0 0 #e4ad2f, inset 0 0 0 1px #f2d887;
}

.thread-card.is-priority-lead:not(.is-active):hover {
  background: #fff2c7;
}

.thread-card:focus-visible {
  box-shadow: inset 0 0 0 2px var(--telegram-blue);
}

.thread-avatar,
.client-avatar,
.client-card-avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #57b4aa, #2c817a);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.thread-avatar img,
.client-avatar img,
.client-card-avatar img {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: 0;
  transition: opacity 140ms ease;
}

.thread-avatar.has-photo img,
.client-avatar.has-photo img,
.client-card-avatar.has-photo img {
  opacity: 1;
}

.thread-avatar {
  width: 54px;
  height: 54px;
}

.thread-copy {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.thread-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.thread-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-mini {
  flex: 0 0 auto;
  max-width: 88px;
  overflow: hidden;
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--telegram-blue);
  background: #e8f3fd;
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.thread-preview {
  overflow: hidden;
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-side {
  display: flex;
  min-width: 35px;
  align-self: stretch;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.thread-time {
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.thread-wait-time {
  max-width: 78px;
  overflow: hidden;
  color: #ad7418;
  font-size: 9px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-wait-time.is-overdue {
  color: #d45a25;
}

.thread-wait-time.is-critical {
  color: #c52d35;
}

.thread-card.is-active .thread-preview,
.thread-card.is-active .thread-time,
.thread-card.is-active .thread-wait-time {
  color: rgba(255, 255, 255, 0.78);
}

.thread-card.is-active .source-mini,
.thread-card.is-active .unread-badge {
  color: var(--telegram-blue);
  background: #fff;
}

.inbox-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 11px;
}

.secure-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--telegram-green);
}

.chat-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background-color: var(--wallpaper);
  background-image:
    linear-gradient(rgba(216, 231, 211, 0.82), rgba(216, 231, 211, 0.82)),
    url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%236f8f70' stroke-width='1.2' opacity='.25'%3E%3Cpath d='M18 28c8-8 19 3 11 11s-19-3-11-11Zm86 6 12-12 12 12-12 12-12-12ZM57 89c14-13 33 6 19 19s-32-6-19-19Zm69 38c5-7 16-4 17 5s-10 13-16 7-6-8-1-12ZM13 130l25-10 7 18-25 10-7-18ZM87 17l8 7-7 8-8-7 7-8Z'/%3E%3Cpath d='m137 72 12 5-5 12-12-5 5-12ZM24 69c9-5 20 3 17 13s-16 13-22 5-4-13 5-18Z'/%3E%3C/g%3E%3C/svg%3E");
}

.empty-chat {
  display: grid;
  height: 100%;
  place-content: center;
  color: #fff;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(63, 88, 76, 0.42);
  backdrop-filter: blur(8px);
}

.empty-icon svg {
  width: 46px;
  height: 46px;
  fill: #fff;
}

.empty-chat h2 {
  width: max-content;
  margin: 0 auto;
  padding: 7px 14px;
  border-radius: 16px;
  background: rgba(63, 88, 76, 0.48);
  font-size: 15px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.empty-chat p {
  margin: 8px 0 0;
  padding: 7px 12px;
  border-radius: 14px;
  background: rgba(63, 88, 76, 0.38);
  font-size: 12px;
  line-height: 1.45;
  backdrop-filter: blur(8px);
}

.active-chat {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.lead-action-bar {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  padding: 7px 10px;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(31, 55, 69, 0.09);
  background: linear-gradient(180deg, #fbfdff, #f3f7f9);
  box-shadow: 0 2px 8px rgba(31, 55, 69, 0.04);
  scrollbar-width: none;
}

.lead-action-bar::-webkit-scrollbar {
  display: none;
}

.lead-action-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.lead-action-group + .lead-action-group {
  padding-left: 10px;
  border-left: 1px solid #dce5ea;
}

.lead-action-label {
  padding: 0 3px;
  color: #778791;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lead-action-group button {
  min-height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: 20px;
  color: #4e6574;
  background: #e8eef2;
  cursor: pointer;
  font-size: 10px;
  font-weight: 680;
  white-space: nowrap;
  transition-property: color, background-color, box-shadow, transform, opacity;
  transition-duration: 120ms;
}

.lead-action-group button:hover:not(:disabled) {
  color: #1f6f9f;
  background: #dfeef9;
}

.lead-action-group button:active:not(:disabled) {
  transform: scale(0.96);
}

.lead-action-group button.is-active {
  color: #fff;
  background: var(--telegram-blue);
  box-shadow: 0 2px 8px rgba(51, 144, 236, 0.24);
}

.lead-outcomes button[data-lead-outcome="paid"].is-active {
  background: #3f9b62;
  box-shadow: 0 2px 8px rgba(63, 155, 98, 0.24);
}

.lead-outcomes button[data-lead-outcome="deposited"].is-active {
  background: #268b5d;
  box-shadow: 0 2px 8px rgba(38, 139, 93, 0.24);
}

.lead-outcomes button[data-lead-outcome="waiting_deposit"].is-active,
.lead-outcomes button[data-lead-outcome="waiting_commission"].is-active {
  color: #4d3907;
  background: #f0c34c;
  box-shadow: 0 2px 8px rgba(202, 151, 24, 0.24);
}

.lead-outcomes button[data-lead-outcome="refused"].is-active {
  background: #c65c61;
  box-shadow: 0 2px 8px rgba(198, 92, 97, 0.22);
}

.lead-action-group button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.lead-reminders .reminder-clear {
  color: #9b5558;
  background: #f8e8e9;
}

.chat-header {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 7px 12px 7px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.client-identity {
  display: flex;
  flex: 1 1 280px;
  min-width: 0;
  max-width: 460px;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  outline: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.client-identity:hover .client-heading {
  opacity: 0.78;
}

.client-identity:focus-visible {
  box-shadow: 0 0 0 2px var(--telegram-blue);
}

.client-avatar {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.client-heading {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 1px;
}

.client-name {
  display: block;
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

.source-chip {
  overflow: hidden;
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--telegram-blue);
  background: #e8f3fd;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
}

.client-presence {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: #71828d;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-presence::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a6b1b8;
  content: "";
}

.client-presence[data-state="online"] {
  color: #258455;
  font-weight: 680;
}

.client-presence[data-state="online"]::before {
  background: #35a86b;
  box-shadow: 0 0 0 3px rgba(53, 168, 107, 0.12);
}

.peru-clock {
  display: inline-flex;
  flex: 0 1 300px;
  min-width: 190px;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid rgba(30, 136, 229, 0.16);
  border-radius: 10px;
  color: #496571;
  background: linear-gradient(180deg, #f8fcff 0%, #eef7fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.055em;
  line-height: 1;
  white-space: nowrap;
}

.peru-clock::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d94343;
  box-shadow: 0 0 0 3px rgba(217, 67, 67, 0.1);
  content: "";
}

.peru-clock-label {
  font-weight: 720;
}

.peru-clock-time {
  color: #173f52;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: 0.025em;
}

.chat-actions {
  display: flex;
  margin-left: 0;
}

.chat-favorites-button {
  color: #9a7115;
}

.chat-favorites-button:hover {
  color: #76540a;
  background: #fff4cf;
}

.refresh-button.is-spinning svg {
  animation: refresh-spin 650ms linear infinite;
}

.action-menu,
.client-card {
  position: absolute;
  z-index: 8;
  padding: 7px;
  border: 1px solid rgba(30, 46, 57, 0.08);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 28px rgba(31, 45, 54, 0.2);
  backdrop-filter: blur(12px);
  animation: popover-in 120ms ease-out both;
}

.main-menu {
  top: 58px;
  left: 8px;
  width: 260px;
}

.more-menu {
  top: 54px;
  right: 8px;
  width: 230px;
}

.menu-title {
  padding: 8px 11px 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover,
.menu-item.is-selected {
  background: var(--surface-hover);
}

.menu-item.is-selected {
  color: var(--telegram-blue);
  font-weight: 600;
}

.menu-item:disabled {
  color: var(--text-faint);
  cursor: default;
}

.danger-item:not(:disabled) {
  color: var(--danger);
}

.permanent-block-item {
  margin-top: 5px;
  border-top: 1px solid rgba(190, 53, 53, 0.13);
  border-radius: 0 0 7px 7px;
  font-weight: 750;
  letter-spacing: 0.035em;
}

.permanent-block-item:not(:disabled):hover {
  color: #fff;
  background: #c93838;
}

.block-user-dialog {
  position: fixed;
  z-index: 18;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(20, 28, 33, 0.58);
  backdrop-filter: blur(5px);
}

.block-user-card {
  width: min(470px, 100%);
  overflow: hidden;
  border: 1px solid rgba(166, 36, 36, 0.18);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 22px 64px rgba(17, 26, 31, 0.28);
  animation: popover-in 140ms ease-out both;
}

.block-user-card header {
  display: flex;
  padding: 20px 22px 15px;
  align-items: center;
  gap: 13px;
  background: linear-gradient(105deg, #fff6f5, #fff);
}

.block-user-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #c93838;
  font-size: 20px;
  font-weight: 800;
}

.block-user-kicker {
  color: #b03434;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.block-user-card h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.block-user-card > p {
  margin: 0;
  padding: 5px 22px 12px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.block-user-card > p strong {
  color: var(--text);
}

.block-user-card ul {
  margin: 0 22px;
  padding: 14px 16px 14px 34px;
  border: 1px solid rgba(30, 46, 57, 0.08);
  border-radius: 10px;
  color: #37454d;
  background: #f7f9fa;
  font-size: 12px;
  line-height: 1.55;
}

.block-user-card li + li {
  margin-top: 5px;
}

.block-user-warning {
  margin: 13px 22px 0;
  padding: 9px 11px;
  border-radius: 8px;
  color: #922929;
  background: #fff1f0;
  font-size: 11px;
  font-weight: 650;
}

.block-user-actions {
  display: flex;
  padding: 18px 22px 22px;
  justify-content: flex-end;
  gap: 9px;
}

.block-user-actions button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

#block-user-cancel {
  color: var(--text);
  background: #edf1f3;
}

#block-user-confirm {
  color: #fff;
  background: #c93838;
  box-shadow: 0 5px 14px rgba(201, 56, 56, 0.23);
}

#block-user-confirm:hover {
  background: #ad2e2e;
}

.block-user-actions button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.menu-icon {
  display: grid;
  width: 21px;
  color: currentColor;
  place-items: center;
  font-size: 15px;
}

.client-card {
  top: 54px;
  left: 70px;
  width: min(340px, calc(100vw - 90px));
  padding: 14px;
}

.client-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.client-card-avatar {
  width: 48px;
  height: 48px;
}

.client-card-head strong,
.client-card-head small {
  display: block;
}

.client-card-head strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.client-card-head small {
  color: var(--text-soft);
  font-size: 11px;
}

.client-facts {
  margin: 13px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.client-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 2px;
}

.client-facts dt,
.client-facts dd {
  margin: 0;
  font-size: 11px;
}

.client-facts dt {
  color: var(--text-soft);
}

.client-facts dd {
  overflow: hidden;
  font-weight: 600;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.client-card-actions button {
  min-height: 35px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--telegram-blue);
  background: #e8f3fd;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.back-button {
  display: none;
}

.message-stage {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 5.5% 10px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(83, 104, 91, 0.42) transparent;
  scrollbar-width: thin;
}

.composer-resizer {
  width: 100%;
  height: 8px;
  flex: 0 0 8px;
  cursor: row-resize;
  background: rgba(216, 231, 211, 0.82);
}

.composer-resizer::before {
  position: absolute;
  inset: 3px 0;
  background: rgba(83, 104, 91, 0.28);
  content: "";
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.composer-resizer span {
  position: relative;
  width: 44px;
  height: 4px;
  border-radius: 4px;
  background: rgba(83, 104, 91, 0.55);
  opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.composer-resizer:hover::before,
.composer-resizer:focus-visible::before,
.composer-resizer.is-dragging::before {
  background: var(--telegram-blue);
  box-shadow: 0 0 0 1px rgba(51, 144, 236, 0.16);
}

.composer-resizer:hover span,
.composer-resizer:focus-visible span,
.composer-resizer.is-dragging span {
  background: var(--telegram-blue);
  opacity: 1;
}

.date-pill {
  width: max-content;
  margin: 0 auto 12px;
  padding: 5px 11px;
  border-radius: 13px;
  color: #fff;
  background: rgba(72, 91, 80, 0.48);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(5px);
}

.message-list {
  display: flex;
  max-width: 860px;
  margin: 0 auto;
  flex-direction: column;
  gap: 4px;
}

.empty-messages {
  width: max-content;
  max-width: min(90%, 420px);
  margin: 22px auto;
  padding: 7px 12px;
  border-radius: 14px;
  color: #fff;
  background: rgba(72, 91, 80, 0.48);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(5px);
}

.message {
  position: relative;
  align-self: flex-start;
  max-width: min(72%, 620px);
  padding: 7px 9px 5px;
  border-radius: 11px 11px 11px 3px;
  background: #fff;
  box-shadow: var(--shadow);
  animation: message-in 120ms ease-out both;
}

.message.is-translatable > p {
  cursor: help;
}

.message.is-translatable > p::after {
  display: inline-block;
  margin-left: 5px;
  color: rgba(51, 144, 236, 0.68);
  content: "文";
  font-size: 9px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-1px);
  transition: opacity 120ms ease;
}

.message.is-translatable:hover > p::after,
.message.is-translatable:focus-within > p::after,
.message.is-translation-pending > p::after {
  opacity: 1;
}

.message.is-translation-pending {
  box-shadow:
    0 0 0 2px rgba(51, 144, 236, 0.16),
    var(--shadow);
}

.translation-popover {
  position: fixed;
  z-index: 140;
  width: min(380px, calc(100vw - 20px));
  padding: 11px 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: #f5f8fa;
  background: rgba(24, 37, 49, 0.96);
  box-shadow:
    0 14px 36px rgba(15, 25, 35, 0.24),
    0 2px 7px rgba(15, 25, 35, 0.18);
  backdrop-filter: blur(14px);
  animation: translation-popover-in 130ms ease-out both;
}

.translation-popover[hidden] {
  display: none;
}

.translation-popover header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.translation-popover header > span {
  color: #78c5ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.translation-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.translation-popover button {
  padding: 2px 0;
  border: 0;
  color: #85ccff;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

.translation-popover button:disabled {
  cursor: default;
  opacity: 0.42;
}

.translation-popover > p {
  max-height: min(42vh, 280px);
  margin: 7px 0 6px;
  overflow: auto;
  color: #fff;
  font-size: 13.5px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.translation-popover > small {
  display: block;
  color: rgba(226, 235, 241, 0.58);
  font-size: 9.5px;
  line-height: 1.3;
}

@keyframes translation-popover-in {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message.is-out {
  align-self: flex-end;
  border-radius: 11px 11px 3px;
  background: var(--outgoing);
}

.message.has-media {
  width: min(72%, 520px);
  padding: 3px 3px 5px;
}

.message-album {
  display: grid;
  overflow: hidden;
  min-width: 260px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  border-radius: 9px;
  background: #cad7c9;
}

.message-album.count-1 {
  grid-template-columns: 1fr;
}

.message-album.count-3,
.message-album.count-5 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.message-album.count-3 > :first-child,
.message-album.count-5 > :first-child {
  grid-row: span 2;
}

.message-photo,
.message-photo-placeholder {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #d5dfd3;
}

.message-photo {
  cursor: zoom-in;
  transition: filter 120ms ease;
}

.message-photo:hover {
  filter: brightness(0.96);
}

.message-album.count-1 .message-photo,
.message-album.count-1 .message-photo-placeholder {
  height: auto;
  max-height: 440px;
  aspect-ratio: 4 / 3;
}

.message-photo-placeholder {
  display: grid;
  place-items: center;
  color: #728078;
  font-size: 12px;
  font-weight: 600;
}

.message-document {
  display: grid;
  width: min(320px, 72vw);
  padding: 9px 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(86, 118, 139, 0.2);
  border-radius: 10px;
  color: #182533;
  background: rgba(255, 255, 255, 0.56);
  text-align: left;
}

.message-document.is-previewable {
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 100ms ease;
}

.message-document.is-previewable:hover {
  border-color: rgba(51, 144, 236, 0.54);
  background: rgba(255, 255, 255, 0.82);
}

.message-document.is-previewable:active {
  transform: scale(0.992);
}

.message-document-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #3390ec;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.message-document-details {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
}

.message-document-details strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-document-details > span {
  color: #617586;
  font-size: 11px;
}

.message-document-details .message-document-safety {
  color: #2587cb;
  font-weight: 600;
}

.message-document:not(.is-previewable) .message-document-icon {
  background: #8999a5;
}

.message-document:not(.is-previewable) .message-document-safety {
  color: #74828c;
}

.message p {
  margin: 0;
  color: #182533;
  font-size: 13.5px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-text-link {
  color: #168acd;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 2px;
}

.message-text-link:hover,
.message-text-link:focus-visible {
  text-decoration: underline;
}

.message-text-link:focus-visible {
  border-radius: 2px;
  outline: 2px solid rgba(51, 144, 236, 0.35);
  outline-offset: 2px;
}

.message-emoji {
  display: inline-block;
  width: 1.12em;
  height: 1.12em;
  margin: 0 0.02em;
  vertical-align: -0.2em;
  object-fit: contain;
}

.message.has-media p {
  padding: 6px 6px 1px;
}

.message-meta {
  display: flex;
  min-width: 48px;
  margin: 2px 0 0 12px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: #8b989f;
  font-size: 10px;
  line-height: 1;
  text-align: right;
}

.message.has-media .message-meta {
  padding-right: 5px;
}

.message.is-out .message-meta {
  color: #5f9c59;
}

.message-read-receipt {
  display: inline-block;
  min-width: 9px;
  color: #5f9c59;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.message-read-receipt.is-read {
  min-width: 13px;
  color: #168acd;
  letter-spacing: -3px;
}

.message-kind {
  margin-bottom: 4px;
  color: var(--telegram-blue);
  font-size: 11px;
  font-weight: 600;
}

.message.has-sticker {
  width: 192px;
  min-height: 96px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.message-sticker {
  position: relative;
  display: grid;
  width: 192px;
  height: 192px;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
}

.message-sticker > img,
.message-sticker > svg,
.message-sticker-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.message-sticker.is-loading {
  background:
    radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.92), transparent 34%),
    rgba(255, 255, 255, 0.48);
}

.message-sticker.is-loading::after {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(51, 144, 236, 0.22);
  border-top-color: #3390ec;
  border-radius: 50%;
  animation: sticker-loading 700ms linear infinite;
  content: "";
}

.message.has-sticker .message-meta {
  width: max-content;
  margin: -23px 5px 3px auto;
  padding: 4px 6px;
  border-radius: 10px;
  color: #596b76;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 4px rgba(43, 70, 88, 0.14);
  backdrop-filter: blur(6px);
}

.message.has-video {
  width: min(72%, 520px);
  padding: 3px 3px 5px;
}

.message-video-wrap {
  overflow: hidden;
  min-width: 250px;
  border-radius: 9px;
  background: #18222b;
}

.message-video {
  display: block;
  width: 100%;
  max-height: min(58vh, 520px);
  object-fit: contain;
}

.message.has-voice {
  padding: 6px 8px 5px;
}

.message-voice {
  display: flex;
  width: min(330px, 70vw);
  min-height: 44px;
  align-items: center;
  gap: 8px;
}

.message-voice-marker {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #3390ec;
  font-size: 12px;
  text-indent: 2px;
}

.message.is-out .message-voice-marker {
  background: #5caf52;
}

.message-voice audio {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.message-media-fallback {
  min-height: 62px;
  padding: 12px;
  color: #617586;
  border: 1px dashed rgba(97, 117, 134, 0.38);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

@keyframes sticker-loading {
  to {
    transform: rotate(360deg);
  }
}

.reply-form {
  position: relative;
  z-index: 2;
  height: var(--composer-height);
  min-height: 104px;
  max-height: min(420px, 52vh);
  padding: 8px 4.5% max(10px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(216, 231, 211, 0.82);
  backdrop-filter: blur(8px);
}

.reply-form.has-open-popover {
  z-index: 20;
  overflow: visible;
}

.attachment-preview {
  display: grid;
  width: min(900px, 100%);
  min-height: 74px;
  margin: 0 auto 8px;
  padding: 7px 42px 7px 7px;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.attachment-preview img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
}

.attachment-preview-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

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

.attachment-preview-copy strong {
  color: var(--text);
  font-size: 13px;
}

.attachment-preview-copy small {
  color: #7b888f;
  font-size: 11px;
}

.attachment-remove {
  position: absolute;
  top: 14px;
  right: max(5%, calc((100% - 900px) / 2 + 8px));
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #6d7a82;
  background: #edf1f3;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.reply-row {
  display: grid;
  max-width: 900px;
  margin: auto;
  grid-template-columns: 44px minmax(0, 1fr) 46px;
  align-items: end;
  gap: 8px;
}

.attachment-button {
  margin-bottom: 1px;
  color: #7b888f;
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 1;
}

.attachment-button:disabled {
  cursor: default;
}

.attachment-button:not(:disabled) {
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}

.attachment-button:not(:disabled):hover {
  color: var(--telegram-blue);
}

.attachment-button:not(:disabled):active {
  transform: scale(0.94);
}

.media-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 56px 24px 24px;
  place-items: center;
  background: rgba(13, 18, 22, 0.92);
  backdrop-filter: blur(5px);
}

.media-lightbox img {
  display: block;
  max-width: min(96vw, 1600px);
  max-height: calc(100vh - 80px);
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.media-lightbox iframe {
  display: block;
  width: min(94vw, 1100px);
  height: calc(100vh - 88px);
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.media-lightbox video {
  display: block;
  max-width: min(94vw, 1100px);
  max-height: calc(100vh - 88px);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.media-lightbox-close {
  position: fixed;
  z-index: 1;
  top: 14px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  transition: background-color 120ms ease, transform 120ms ease;
}

.media-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.media-lightbox-close:active {
  transform: scale(0.94);
}

.reply-box {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 10px 15px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.reply-box textarea {
  display: block;
  width: 100%;
  max-height: 150px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  line-height: 1.45;
}

.reply-box textarea::placeholder {
  color: #8c979f;
}

.send-button {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--telegram-blue);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.send-button:hover {
  background: var(--telegram-blue-hover);
}

.send-button:active {
  transform: scale(0.94);
}

.send-button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.send-button svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.reply-hint {
  max-width: 800px;
  margin: 5px auto 0;
  color: rgba(56, 72, 63, 0.68);
  font-size: 9px;
  text-align: center;
}

.access-screen {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: #eef2f5;
}

.access-card {
  width: min(390px, 100%);
  padding: 36px 30px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.14);
  text-align: center;
}

.lock-mark {
  display: grid;
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--telegram-blue);
  font-size: 25px;
  font-weight: 600;
}

.access-card h1 {
  margin: 0 0 9px;
  font-size: 22px;
}

.access-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: rgba(35, 45, 53, 0.93);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty-list {
  padding: 45px 24px;
  color: var(--text-soft);
  line-height: 1.5;
  text-align: center;
}

.folder-strip {
  display: flex;
  min-height: 39px;
  padding: 0 9px 6px;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.folder-strip::-webkit-scrollbar {
  display: none;
}

.folder-chip {
  display: inline-flex;
  min-height: 31px;
  padding: 5px 10px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 16px;
  color: var(--text-soft);
  background: #f1f3f4;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  transition: color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.folder-chip:hover {
  color: var(--telegram-blue);
  background: #e7f2fc;
}

.folder-chip:active {
  transform: scale(0.97);
}

.folder-chip.is-active {
  color: #fff;
  background: var(--telegram-blue);
}

.folder-chip.priority-folder {
  color: #755716;
  background: #fff1bf;
}

.folder-chip.priority-folder:hover {
  color: #5e430a;
  background: #ffe89a;
}

.folder-chip.priority-folder.is-active {
  color: #fff;
  background: #c98b18;
}

.folder-chip span {
  font-variant-numeric: tabular-nums;
}

.folder-chip.needs-attention {
  color: #1676b8;
  background: #e5f3ff;
  transform-origin: center;
  transition:
    color 800ms ease,
    background-color 800ms ease,
    box-shadow 800ms ease,
    transform 800ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: box-shadow, transform;
}

.folder-chip.needs-attention.is-active {
  color: #fff;
  background: var(--telegram-blue);
}

.folder-chip.needs-attention.is-breathing {
  color: #075f9d;
  background: #d5ecff;
  transform: scale(1.016);
  box-shadow: 0 0 0 4px rgba(51, 144, 236, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .folder-chip.needs-attention {
    transition:
      color 900ms ease,
      background-color 900ms ease,
      box-shadow 900ms ease;
  }

  .folder-chip.needs-attention.is-breathing {
    color: #075f9d;
    background: #d5ecff;
    transform: none;
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.15);
  }
}

.thread-status {
  display: inline-flex;
  max-width: 92px;
  min-height: 17px;
  padding: 2px 6px;
  align-items: center;
  border-radius: 9px;
  color: #4b7190;
  background: #e5f2fc;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.thread-status[data-state="needs_reply"] {
  color: #1475b9;
  background: #dff0ff;
}

.thread-status[data-state="deposited"] {
  color: #22734d;
  background: #dcf3e7;
}

.thread-status[data-state="waiting_deposit"],
.thread-status[data-state="waiting_commission"] {
  color: #755716;
  background: #fff0ba;
}

.thread-status[data-state="waiting_customer"] {
  color: #7d6a2e;
  background: #fff2c8;
}

.thread-status[data-state="snoozed"] {
  color: #7b5b9e;
  background: #efe7f8;
}

.thread-status[data-state="blocked"] {
  color: #b12f35;
  background: #ffe4e5;
}

.thread-status[data-state="done"] {
  color: #3b7c51;
  background: #def3e5;
}

.message-search-bar {
  position: absolute;
  z-index: 7;
  top: 60px;
  right: 12px;
  left: 12px;
  display: grid;
  min-height: 46px;
  padding: 6px 8px 6px 13px;
  grid-template-columns: 20px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 24px rgba(24, 40, 52, 0.16);
}

.message-search-bar svg {
  width: 18px;
  fill: none;
  stroke: var(--text-soft);
  stroke-width: 1.8;
}

.message-search-bar input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.message-search-bar span {
  color: var(--text-soft);
  font-size: 11px;
}

.message-search-bar button,
.client-drawer-header button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  font-size: 22px;
}

.scroll-bottom {
  position: sticky;
  bottom: 8px;
  display: grid;
  width: 42px;
  height: 42px;
  margin: -48px 4px 6px auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 14px rgba(27, 46, 57, 0.22);
  cursor: pointer;
}

.scroll-bottom svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.message-date-divider,
.unread-divider,
.transport-divider {
  display: flex;
  width: 100%;
  margin: 8px 0;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  text-align: center;
}

.message-date-divider::before,
.message-date-divider::after,
.unread-divider::before,
.unread-divider::after,
.transport-divider::before,
.transport-divider::after {
  height: 1px;
  flex: 1;
  background: rgba(79, 105, 89, 0.24);
  content: "";
}

.message-date-divider span,
.unread-divider span,
.transport-divider span {
  padding: 4px 9px;
  border-radius: 11px;
  background: rgba(72, 91, 80, 0.48);
  backdrop-filter: blur(4px);
}

.unread-divider {
  color: var(--telegram-blue);
}

.unread-divider span {
  background: rgba(255, 255, 255, 0.92);
}

.transport-divider {
  margin: 12px 0;
  color: #25796e;
}

.transport-divider span {
  padding: 6px 11px;
  border: 1px solid rgba(63, 142, 130, 0.18);
  background: rgba(239, 251, 248, 0.94);
  font-weight: 750;
}

.transport-divider.is-bot {
  color: #2374a8;
}

.transport-divider.is-bot span {
  border-color: rgba(51, 144, 236, 0.18);
  background: rgba(238, 247, 254, 0.94);
}

.message-actions {
  position: absolute;
  top: -14px;
  right: 4px;
  display: flex;
  padding: 2px;
  gap: 2px;
  border-radius: 12px;
  opacity: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  pointer-events: none;
  transition: opacity 100ms ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
}

.message-actions button {
  min-width: 25px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.message-actions button:hover {
  color: var(--telegram-blue);
  background: #e8f3fd;
}

.message-actions .is-danger {
  color: #b54a4a;
}

.message-actions .is-danger:hover {
  color: #a12626;
  background: #fff0ef;
}

.message-reply-quote {
  margin: 0 0 5px;
  padding: 4px 7px;
  overflow: hidden;
  border-left: 3px solid var(--telegram-blue);
  border-radius: 4px;
  color: #4c646f;
  background: rgba(51, 144, 236, 0.08);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-send-state.is-sending {
  color: #78909c;
}

.message-send-state.is-failed {
  color: var(--danger);
}

.message-retry {
  margin-left: 5px;
  padding: 1px 4px;
  border: 0;
  border-radius: 5px;
  color: var(--danger);
  background: rgba(223, 63, 64, 0.1);
  cursor: pointer;
  font-size: 9px;
}

.reply-preview {
  display: flex;
  width: min(900px, 100%);
  min-height: 48px;
  margin: 0 auto 7px;
  padding: 7px 9px 7px 12px;
  align-items: center;
  gap: 10px;
  border-left: 3px solid var(--telegram-blue);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.reply-preview strong {
  color: var(--telegram-blue);
  font-size: 11px;
}

.reply-preview small {
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview button {
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  color: var(--text-soft);
  background: #eef1f3;
  cursor: pointer;
  font-size: 18px;
}

.reply-row {
  grid-template-columns: 40px 40px minmax(0, 1fr) 46px;
}

.quick-replies-button {
  color: #d89513;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 17px;
}

.quick-replies-panel {
  position: absolute;
  z-index: 12;
  right: max(4.5%, calc((100% - 900px) / 2));
  bottom: calc(100% - 4px);
  width: min(390px, calc(100vw - 24px));
  max-height: min(430px, 60vh);
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(30, 46, 57, 0.08);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 36px rgba(27, 42, 52, 0.22);
  backdrop-filter: blur(12px);
}

.quick-replies-panel label {
  display: grid;
  gap: 7px;
  padding: 3px 3px 9px;
}

.quick-replies-panel label span {
  font-size: 12px;
  font-weight: 750;
}

.quick-replies-panel input {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: #f4f6f7;
}

.quick-replies-panel > div {
  display: grid;
  max-height: 330px;
  gap: 5px;
  overflow-y: auto;
}

.quick-reply-item {
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  line-height: 1.35;
  text-align: left;
}

.quick-reply-item:hover {
  background: #eaf4fd;
}

.quick-reply-item strong,
.quick-reply-item small {
  display: block;
}

.quick-reply-item strong {
  margin-bottom: 3px;
  color: var(--telegram-blue);
  font-size: 11px;
}

.quick-reply-item small {
  font-size: 11px;
}

.quick-replies-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-replies-title #quick-reply-add {
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--telegram-blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.quick-replies-panel > .quick-reply-editor {
  display: grid;
  max-height: none;
  margin: 0 3px 9px;
  padding: 9px;
  gap: 7px;
  overflow: visible;
  border: 1px solid #c9dff2;
  border-radius: 11px;
  background: #f5faff;
}

.quick-reply-editor textarea {
  min-height: 92px;
  padding: 9px 11px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  font: inherit;
  line-height: 1.35;
}

.quick-reply-editor > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.quick-reply-editor button {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

#quick-reply-save {
  color: #fff;
  background: var(--telegram-blue);
}

#quick-replies-list {
  display: grid;
  max-height: 310px;
  padding: 0 2px 2px;
  gap: 5px;
  overflow-y: auto;
}

.quick-reply-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid transparent;
  cursor: default;
}

.quick-reply-item:hover {
  border-color: #c9dff2;
}

.quick-reply-item > [data-quick-reply] {
  display: grid;
  min-width: 0;
  padding: 9px 10px;
  gap: 3px;
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  line-height: 1.35;
  text-align: left;
}

.quick-reply-item > [data-quick-reply] strong {
  color: var(--telegram-blue);
  font-size: 11px;
}

.quick-reply-item > [data-quick-reply] span {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.quick-reply-actions {
  display: flex;
  padding: 6px;
  align-items: flex-start;
  gap: 3px;
}

.quick-reply-actions button {
  padding: 4px 6px;
  border: 0;
  border-radius: 7px;
  color: var(--text-soft);
  background: #edf1f3;
  cursor: pointer;
  font-size: 9px;
}

.quick-reply-actions [data-quick-reply-delete] {
  color: var(--danger);
}

.attachment-preview-grid {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.attachment-preview {
  grid-template-columns: minmax(60px, auto) minmax(0, 1fr);
}

.attachment-preview-grid img {
  flex: 0 0 60px;
}

.drop-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(31, 47, 57, 0.5);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.drop-overlay div {
  display: grid;
  width: min(430px, 90vw);
  min-height: 180px;
  place-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  color: #fff;
  text-align: center;
}

.drop-overlay strong {
  font-size: 21px;
}

.drop-overlay span {
  margin-top: 6px;
  opacity: 0.86;
}

.client-drawer {
  position: absolute;
  z-index: 15;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(350px, 92vw);
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -10px 0 30px rgba(28, 44, 54, 0.15);
  backdrop-filter: blur(14px);
  animation: drawer-in 180ms cubic-bezier(.2, .8, .2, 1) both;
}

.client-drawer-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  min-height: 58px;
  padding: 10px 12px 10px 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.client-drawer .client-card {
  position: static;
  width: auto;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.client-field {
  display: grid;
  margin-top: 14px;
  gap: 6px;
}

.client-field > span {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-field select,
.client-field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: #f7f8f9;
}

.client-field textarea {
  resize: vertical;
  line-height: 1.45;
}

.client-field select:focus,
.client-field textarea:focus {
  border-color: var(--telegram-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.1);
}

.client-save {
  width: 100%;
  min-height: 39px;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--telegram-blue);
  cursor: pointer;
  font-weight: 650;
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes thread-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .inbox-panel,
  .chat-panel {
    width: 100%;
    height: 100%;
  }

  .workspace-resizer,
  .composer-resizer {
    display: none;
  }

  .chat-panel {
    position: absolute;
    z-index: 3;
    inset: 0;
    transform: translateX(100%);
    transition: transform 210ms cubic-bezier(.2, .8, .2, 1);
  }

  .app-shell.chat-open .chat-panel {
    transform: translateX(0);
  }

  .sidebar-header {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .inbox-heading {
    padding-top: 5px;
  }

  .back-button {
    display: grid;
  }

  .chat-header {
    min-height: 58px;
    padding: max(6px, env(safe-area-inset-top)) 6px 6px;
  }

  .peru-clock {
    flex-basis: auto;
    min-width: 0;
    gap: 5px;
    padding: 6px 8px;
  }

  .peru-clock-label {
    display: none;
  }

  .peru-clock-time::before {
    content: "ПЕРУ ";
    font-size: 9px;
    font-weight: 720;
    letter-spacing: 0.045em;
  }

  .client-card {
    left: 52px;
    width: calc(100vw - 64px);
  }

  .message-stage {
    padding: 12px 9px 8px;
  }

  .message {
    max-width: 86%;
  }

  .reply-form {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 7px 7px max(8px, env(safe-area-inset-bottom));
  }

  .reply-row {
    grid-template-columns: 38px 38px minmax(0, 1fr) 44px;
    gap: 5px;
  }

  .reply-hint {
    display: none;
  }

  .attachment-preview {
    min-height: 66px;
    padding-right: 38px;
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .attachment-preview img {
    width: 52px;
    height: 52px;
  }

  .attachment-remove {
    top: 12px;
    right: 12px;
  }

  .folder-strip {
    padding-right: 7px;
    padding-left: 7px;
  }

  .client-drawer {
    width: min(350px, 100vw);
  }

  .quick-replies-panel {
    right: 7px;
    bottom: calc(100% + 2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
