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

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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: 392px 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;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
}

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

.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 18px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

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

.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: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: 8px;
}

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

.thread-card.is-active .thread-preview,
.thread-card.is-active .thread-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: grid;
  height: 100%;
  grid-template-rows: 60px minmax(0, 1fr) auto;
}

.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;
  min-width: 0;
  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: block;
  min-width: 0;
}

.client-name {
  display: block;
  overflow: hidden;
  margin: 0 0 3px;
  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;
  color: var(--telegram-blue);
  text-overflow: ellipsis;
}

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

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

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

.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-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.has-media p {
  padding: 6px 6px 1px;
}

.message-meta {
  min-width: 48px;
  margin: 2px 0 0 12px;
  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-kind {
  margin-bottom: 4px;
  color: var(--telegram-blue);
  font-size: 11px;
  font-weight: 600;
}

.reply-form {
  position: relative;
  z-index: 2;
  padding: 8px 4.5% max(10px, env(safe-area-inset-bottom));
  background: rgba(216, 231, 211, 0.82);
  backdrop-filter: blur(8px);
}

.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 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="waiting_customer"] {
  color: #7d6a2e;
  background: #fff2c8;
}

.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 {
  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 {
  height: 1px;
  flex: 1;
  background: rgba(79, 105, 89, 0.24);
  content: "";
}

.message-date-divider span,
.unread-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);
}

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

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

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

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

  .message {
    max-width: 86%;
  }

  .reply-form {
    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;
  }
}
