:root {
  color-scheme: light;
  --admin-text: #2e2b26;
  --admin-text-muted: rgba(55, 53, 47, 0.72);
  --admin-bg: #f5f4f1;
  --admin-surface: #ffffff;
  --admin-border: rgba(56, 50, 42, 0.16);
  --admin-border-strong: rgba(56, 50, 42, 0.28);
  --admin-hover: rgba(56, 50, 42, 0.08);
  --admin-radius-sm: 3px;
  --admin-radius-md: 10px;
  --admin-font:
    "IBM Plex Sans", "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --admin-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 100% 0%, #faf9f6 0, #f5f4f1 52%, #f2f0ed 100%);
  color: var(--admin-text);
  font-family: var(--admin-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
p {
  margin: 0;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--admin-border);
  background: #f1efeb;
  padding: 24px 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.logo {
  color: inherit;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 8px;
  border-radius: var(--admin-radius-sm);
}

.logo:hover {
  background: var(--admin-hover);
}

.logo-label {
  display: block;
}

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

.menu-link {
  min-height: 34px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--admin-radius-sm);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menu-link-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(55, 53, 47, 0.78);
  flex: 0 0 auto;
}

.menu-link-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.menu-link-label {
  min-width: 0;
}

.menu-link:hover {
  background: var(--admin-hover);
}

.menu-link.is-active {
  background: rgba(55, 53, 47, 0.12);
  font-weight: 500;
}

.menu-link.is-active .menu-link-icon {
  color: rgba(46, 43, 38, 0.96);
}

.sidebar-footer {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-action-label {
  display: inline-block;
}

.sidebar-action-icon {
  width: 16px;
  height: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  color: rgba(55, 53, 47, 0.78);
  flex: 0 0 auto;
}

.sidebar-action-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.sidebar-user-meta {
  position: relative;
  flex: 0 0 auto;
}

.sidebar-user-trigger {
  min-height: 34px;
  min-width: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user-trigger-icon {
  width: 14px;
  height: 14px;
  color: rgba(55, 53, 47, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user-trigger-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.sidebar-user-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  max-width: 260px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  box-shadow:
    inset 0 0 0 1px rgba(55, 53, 47, 0.03),
    0 5px 12px rgba(35, 31, 25, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    visibility 120ms ease;
  z-index: 3;
}

.sidebar-user-meta:hover .sidebar-user-tooltip,
.sidebar-user-meta.is-open .sidebar-user-tooltip,
.sidebar-user-meta:focus-within .sidebar-user-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.content {
  padding: 30px 36px 36px;
  display: grid;
  width: 100%;
  max-width: 1480px;
  align-content: start;
  gap: 18px;
}

.admin-shell[data-active-nav="chats"] .shell:not(.shell-no-sidebar) {
  grid-template-columns: 74px minmax(0, 1fr);
}

.admin-shell[data-active-nav="chats"] .sidebar {
  padding: 14px 10px;
  gap: 12px;
}

.admin-shell[data-active-nav="chats"] .logo {
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  position: relative;
}

.admin-shell[data-active-nav="chats"] .logo-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.admin-shell[data-active-nav="chats"] .logo::before {
  content: "A";
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--admin-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.admin-shell[data-active-nav="chats"] .menu-link {
  width: 44px;
  min-height: 40px;
  padding: 0;
  justify-content: center;
  margin: 0 auto;
  border-radius: 10px;
  position: relative;
}

.admin-shell[data-active-nav="chats"] .menu-link-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.admin-shell[data-active-nav="chats"] .menu-link-icon {
  width: 18px;
  height: 18px;
}

.admin-shell[data-active-nav="chats"] .menu-link-icon svg {
  width: 18px;
  height: 18px;
}

.admin-shell[data-active-nav="chats"] .sidebar-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.admin-shell[data-active-nav="chats"] .sidebar-user-meta {
  width: 44px;
  display: grid;
  place-items: center;
}

.admin-shell[data-active-nav="chats"] .sidebar-user-trigger {
  width: 44px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
}

.admin-shell[data-active-nav="chats"] .sidebar-user-trigger-icon {
  width: 16px;
  height: 16px;
}

.admin-shell[data-active-nav="chats"] .sidebar-user-trigger-icon svg {
  width: 16px;
  height: 16px;
}

.admin-shell[data-active-nav="chats"] .sidebar-user-tooltip {
  right: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  min-width: 148px;
  max-width: min(280px, calc(100vw - 96px));
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  text-align: left;
  transform: translateY(4px) translateX(50%);
}

.admin-shell[data-active-nav="chats"] .sidebar-footer .btn {
  width: 44px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  position: relative;
}

.admin-shell[data-active-nav="chats"] .sidebar-action-icon {
  display: inline-flex;
}

.admin-shell[data-active-nav="chats"] .sidebar-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.admin-shell[data-active-nav="chats"] .sidebar-user-meta:hover .sidebar-user-tooltip,
.admin-shell[data-active-nav="chats"] .sidebar-user-meta.is-open .sidebar-user-tooltip,
.admin-shell[data-active-nav="chats"] .sidebar-user-meta:focus-within .sidebar-user-tooltip {
  transform: translateY(0) translateX(50%);
}

@media (min-width: 1025px) {
  .admin-shell[data-active-nav="chats"] {
    height: 100vh;
    overflow: hidden;
  }

  .admin-shell[data-active-nav="chats"] .shell {
    height: 100%;
    overflow: hidden;
  }

  .admin-shell[data-active-nav="chats"] .content {
    max-width: none;
    height: 100%;
    padding: 16px 20px 18px;
    gap: 10px;
    overflow: hidden;
  }

  .admin-shell[data-active-nav="chats"] .chats-shell,
  .admin-shell[data-active-nav="chats"] .chats-workspace,
  .admin-shell[data-active-nav="chats"] .chats-layout {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
}

.page-head {
  display: grid;
  gap: 4px;
}

.page-head-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-head p,
.text-muted {
  color: var(--admin-text-muted);
}

.surface {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-md);
  padding: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(56, 50, 42, 0.03),
    0 1px 0 rgba(56, 50, 42, 0.04);
  background: var(--admin-surface);
}

.stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius-sm) + 2px);
  background: #f4f2ee;
}

.tab-link {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--admin-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.tab-link:hover {
  background: var(--admin-hover);
}

.tab-link.is-active {
  border-color: var(--admin-border-strong);
  background: #fff;
  font-weight: 500;
}

.tab-link:focus-visible {
  outline: 2px solid rgba(36, 96, 255, 0.42);
  outline-offset: 2px;
}

.btn {
  min-height: 36px;
  border-radius: var(--admin-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  padding: 0 10px;
  cursor: pointer;
  transition: background-color 20ms linear;
  font: inherit;
}

.btn:hover {
  background: var(--admin-hover);
}

.btn.is-active {
  border-color: var(--admin-border-strong);
  background: rgba(56, 50, 42, 0.08);
}

.btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.btn[aria-disabled="true"] {
  cursor: default;
  opacity: 0.6;
}

.btn-quiet {
  border-color: transparent;
}

.btn-secondary {
  border-color: var(--admin-border-strong);
}

.btn-primary {
  border-color: rgba(56, 50, 42, 0.38);
  background: rgba(56, 50, 42, 0.09);
}

.ui-input,
.ui-textarea {
  width: 100%;
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  font: inherit;
  color: inherit;
  background: var(--admin-bg);
}

.ui-input {
  height: 30px;
  padding: 0 10px;
}

.ui-textarea {
  resize: vertical;
  min-height: 160px;
  padding: 10px 12px;
  line-height: 1.5;
}

.ui-input:focus-visible,
.ui-textarea:focus-visible {
  outline: none;
  border-color: rgba(55, 53, 47, 0.4);
}

.ui-input.is-error,
.ui-textarea.is-error {
  border-color: #a33a30;
}

.dashboard-panel {
  gap: 8px;
}

.dashboard-timezone strong {
  font-weight: 500;
}

.dashboard-metrics {
  border-radius: var(--admin-radius-md);
  padding: 6px 0;
  display: grid;
  gap: 0;
}

.dashboard-metrics.is-loading {
  opacity: 0.65;
}

.metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(55, 53, 47, 0.1);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  color: rgba(55, 53, 47, 0.68);
  font-family: var(--admin-mono);
  font-size: 13px;
}

.metric-value {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.preview-message {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 10px;
  background: rgba(55, 53, 47, 0.03);
  line-height: 1.5;
}

.preview-message p {
  margin: 0;
}

.preview-message p + p {
  margin-top: 10px;
}

.preview-message code {
  font-family: var(--admin-mono);
  font-size: 12px;
  background: rgba(55, 53, 47, 0.12);
  border-radius: 4px;
  padding: 1px 4px;
}

.preview-message a {
  color: inherit;
  text-decoration: underline;
}

.preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-actions .btn {
  height: auto;
  min-height: 30px;
  line-height: 1.2;
  padding: 6px 10px;
  text-align: center;
  white-space: normal;
}

.settings-form {
  max-width: 860px;
}

.logs-form {
  max-width: 640px;
}

.logs-audit {
  max-width: 100%;
  gap: 10px;
}

.logs-audit-head {
  gap: 4px;
}

.logs-audit-table-scroll {
  overflow: auto;
}

.logs-audit-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 940px;
}

.logs-audit-table th,
.logs-audit-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(55, 53, 47, 0.11);
  vertical-align: top;
}

.logs-audit-table th {
  font-size: 13px;
  font-weight: 500;
  color: rgba(55, 53, 47, 0.75);
}

.logs-audit-table tr:last-child td {
  border-bottom: none;
}

.logs-audit-type-cell {
  font-weight: 500;
}

.logs-audit-time-cell {
  font-family: var(--admin-mono);
  font-size: 13px;
  white-space: nowrap;
}

.quick-replies-panel {
  gap: 10px;
}

.quick-replies-create-button {
  white-space: nowrap;
}

.quick-replies-head-copy {
  gap: 4px;
}

.quick-replies-head {
  align-items: flex-start;
}

.quick-replies-table-surface {
  padding: 0;
}

.quick-replies-head {
  justify-content: flex-end;
}

.quick-replies-table-scroll {
  overflow: auto;
}

.quick-replies-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 940px;
}

.quick-replies-table th,
.quick-replies-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(55, 53, 47, 0.11);
  vertical-align: top;
}

.quick-replies-table th {
  font-size: 13px;
  color: rgba(55, 53, 47, 0.75);
  font-weight: 500;
}

.quick-replies-table tr:last-child td {
  border-bottom: none;
}

.quick-replies-command {
  font-family: var(--admin-mono);
  font-size: 13px;
}

.quick-replies-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.quick-replies-action-btn {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-replies-action-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.quick-replies-error {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-replies-delete-modal {
  width: min(560px, 100%);
}

.quick-replies-warning-box {
  margin: 0;
  border: 1px solid rgba(163, 58, 48, 0.35);
  border-radius: var(--admin-radius-sm);
  background: rgba(163, 58, 48, 0.08);
  color: #7e2a22;
  padding: 10px 12px;
}

.quick-replies-warning-box [data-quick-replies-delete-target] {
  font-weight: 600;
}

.quick-replies-form-surface {
  gap: 10px;
}

.quick-replies-form-head {
  align-items: flex-start;
}

.quick-replies-close-btn {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-replies-close-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-replies-close-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.quick-replies-form {
  gap: 8px;
}

.quick-replies-form-field {
  display: grid;
  gap: 6px;
}

.quick-replies-form-field > span {
  font-size: 14px;
  color: rgba(55, 53, 47, 0.85);
}

.quick-replies-command-input {
  font-family: var(--admin-mono);
  font-size: 13px;
}

.quick-replies-editor {
  border: 1px solid var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-bg);
  overflow: hidden;
}

.quick-replies-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid var(--admin-border);
  background: rgba(55, 53, 47, 0.05);
}

.quick-replies-toolbar-button {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: #fff;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.quick-replies-toolbar-button:hover {
  background: var(--admin-hover);
}

.quick-replies-toolbar-glyph {
  font-family: var(--admin-mono);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
}

.quick-replies-toolbar-glyph.is-italic {
  font-style: italic;
}

.quick-replies-toolbar-icon,
.quick-replies-toolbar-link-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-replies-toolbar-icon svg,
.quick-replies-toolbar-link-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.quick-replies-editor-textarea {
  border: none;
  background: transparent;
  min-height: 172px;
}

.quick-replies-editor-textarea:focus-visible {
  outline: none;
}

.quick-replies-gallery-field {
  gap: 6px;
}

.quick-replies-gallery-head {
  align-items: center;
}

.quick-replies-gallery-add {
  white-space: nowrap;
}

.quick-replies-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.quick-replies-gallery-item {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: rgba(55, 53, 47, 0.03);
  overflow: hidden;
  min-width: 0;
}

.quick-replies-gallery-preview {
  aspect-ratio: 1 / 1;
  background: rgba(55, 53, 47, 0.06);
}

.quick-replies-gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quick-replies-gallery-meta {
  border-top: 1px solid var(--admin-border);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.quick-replies-gallery-index {
  font-family: var(--admin-mono);
  font-size: 12px;
  color: rgba(55, 53, 47, 0.76);
}

.quick-replies-gallery-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quick-replies-gallery-action {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: var(--admin-radius-sm);
  border: 1px solid var(--admin-border);
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.quick-replies-gallery-action:hover {
  background: var(--admin-hover);
}

.quick-replies-gallery-empty {
  border: 1px dashed var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  padding: 14px 12px;
  font-size: 13px;
  color: rgba(55, 53, 47, 0.72);
  background: rgba(55, 53, 47, 0.02);
}

.quick-replies-file-input {
  display: none;
}

.quick-replies-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.refunds-create-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.refunds-button-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.refunds-button-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.refunds-screen {
  gap: 10px;
}

.refunds-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.refunds-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 14px;
  align-items: start;
}

.refunds-list-surface,
.refunds-detail-surface {
  min-height: 360px;
  min-width: 0;
}

.refunds-head-copy {
  gap: 2px;
}

.refunds-workspace-head {
  align-items: flex-start;
}

.refunds-admin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.refunds-action-chip,
.refunds-filter-pill {
  min-height: 28px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  color: rgba(55, 53, 47, 0.76);
  background: rgba(55, 53, 47, 0.035);
  font-size: 13px;
  line-height: 1.25;
}

.refunds-status-tabs {
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.refunds-status-tab {
  white-space: nowrap;
}

.refunds-list-tools {
  display: grid;
  gap: 8px;
}

.refunds-search-form,
.refunds-filter-grid {
  display: grid;
  gap: 10px;
  align-items: end;
}

.refunds-search-form {
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
}

.refunds-filter-grid {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 10px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  background: rgba(55, 53, 47, 0.025);
}

.refunds-active-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 28px;
}

.refunds-active-filter-chip {
  min-height: 26px;
  border: 1px solid rgba(55, 53, 47, 0.18);
  border-radius: var(--admin-radius-sm);
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: rgba(55, 53, 47, 0.72);
  background: rgba(55, 53, 47, 0.04);
  font-size: 12px;
  line-height: 1.25;
}

.refunds-active-filter-chip strong {
  margin-left: 4px;
  color: rgba(46, 43, 38, 0.92);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.refunds-form-field {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: rgba(55, 53, 47, 0.76);
}

.refunds-search-field {
  min-width: 0;
}

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

.refunds-create-panel {
  gap: 12px;
}

.refunds-create-context-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.refunds-create-result,
.refunds-create-submit-form {
  display: grid;
  gap: 12px;
}

.refunds-create-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.refunds-create-summary-item {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 8px;
  min-width: 0;
  display: grid;
  gap: 3px;
  background: rgba(55, 53, 47, 0.025);
}

.refunds-create-summary-label {
  color: rgba(55, 53, 47, 0.66);
  font-size: 12px;
}

.refunds-create-summary-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 500;
}

.refunds-create-eligibility {
  display: grid;
  gap: 8px;
}

.refunds-create-override-toggle {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(46, 43, 38, 0.9);
}

.refunds-create-warning {
  margin: 0;
  border: 1px solid rgba(172, 117, 22, 0.26);
  border-radius: var(--admin-radius-sm);
  padding: 8px;
  color: #7b4f08;
  background: rgba(172, 117, 22, 0.08);
  font-size: 13px;
}

.refunds-create-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.refunds-table-scroll {
  overflow: auto;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  background: var(--admin-surface);
}

.refunds-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.refunds-table th,
.refunds-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(55, 53, 47, 0.11);
  vertical-align: middle;
}

.refunds-table th {
  font-size: 13px;
  color: rgba(55, 53, 47, 0.75);
  font-weight: 500;
}

.refunds-table tr:last-child td {
  border-bottom: none;
}

.refunds-table tbody tr {
  cursor: pointer;
}

.refunds-table tbody tr:hover,
.refunds-table tbody tr.is-selected {
  background: rgba(55, 53, 47, 0.045);
}

.refunds-table th:nth-child(1),
.refunds-table td:nth-child(1) {
  width: 190px;
}

.refunds-table th:nth-child(3),
.refunds-table td:nth-child(3) {
  width: 250px;
}

.refunds-table th:nth-child(4),
.refunds-table td:nth-child(4) {
  width: 170px;
}

.refunds-table th:nth-child(5),
.refunds-table td:nth-child(5) {
  width: 118px;
}

.refunds-sort-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.refunds-sort-button::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(55, 53, 47, 0.35);
  vertical-align: middle;
}

.refunds-sort-button[aria-sort="ascending"]::after {
  border-top: 0;
  border-bottom: 5px solid rgba(55, 53, 47, 0.75);
}

.refunds-sort-button[aria-sort="descending"]::after {
  border-top-color: rgba(55, 53, 47, 0.75);
}

.refunds-user-cell,
.refunds-operation-cell,
.refunds-error-cell {
  max-width: 260px;
}

.refunds-user-main,
.refunds-user-sub,
.refunds-operation-cell,
.refunds-error-cell {
  overflow-wrap: anywhere;
}

.refunds-row-primary,
.refunds-row-secondary,
.refunds-row-meta {
  min-width: 0;
}

.refunds-row-primary {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.refunds-row-secondary,
.refunds-row-meta {
  margin-top: 4px;
  color: rgba(55, 53, 47, 0.66);
  font-size: 12px;
  line-height: 1.35;
}

.refunds-row-label {
  color: rgba(55, 53, 47, 0.56);
}

.refunds-row-amount {
  font-weight: 600;
  color: rgba(46, 43, 38, 0.94);
}

.refunds-user-main {
  font-weight: 500;
}

.refunds-user-sub,
.refunds-muted-cell {
  color: rgba(55, 53, 47, 0.68);
  font-size: 12px;
}

.refunds-mono-cell {
  font-family: var(--admin-mono);
  font-size: 12px;
}

.refunds-status-badge,
.refunds-override-badge {
  min-height: 24px;
  border-radius: var(--admin-radius-sm);
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--admin-border);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.refunds-status-badge[data-refunds-status="pending_approval"] {
  border-color: rgba(172, 117, 22, 0.35);
  background: rgba(172, 117, 22, 0.1);
  color: #7b4f08;
}

.refunds-status-badge[data-refunds-status="approved"],
.refunds-status-badge[data-refunds-status="processing"] {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.refunds-status-badge[data-refunds-status="succeeded"] {
  border-color: rgba(22, 101, 52, 0.3);
  background: rgba(22, 101, 52, 0.08);
  color: #166534;
}

.refunds-status-badge[data-refunds-status="failed"] {
  border-color: rgba(185, 28, 28, 0.3);
  background: rgba(185, 28, 28, 0.08);
  color: #991b1b;
}

.refunds-status-badge[data-refunds-status="rejected"],
.refunds-status-badge[data-refunds-status="cancelled"] {
  border-color: rgba(75, 85, 99, 0.3);
  background: rgba(75, 85, 99, 0.08);
  color: #4b5563;
}

.refunds-override-badge {
  border-color: rgba(126, 34, 206, 0.28);
  background: rgba(126, 34, 206, 0.08);
  color: #6b21a8;
}

.refunds-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.refunds-row-action {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.refunds-card-action {
  width: auto;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.refunds-row-action svg,
.refunds-card-action svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.refunds-action-label {
  font-size: 13px;
  line-height: 1;
}

.refunds-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: rgba(55, 53, 47, 0.72);
  font-size: 13px;
}

.refunds-pagination-status {
  min-width: 160px;
  text-align: center;
}

.refunds-detail-card {
  display: grid;
  gap: 14px;
}

.refunds-detail-block {
  display: grid;
  gap: 8px;
}

.refunds-detail-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  margin: 0;
  min-height: 20px;
  padding: 1px 2px;
  border-radius: var(--admin-radius-sm);
}

.refunds-detail-summary::-webkit-details-marker {
  display: none;
}

.refunds-detail-summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: rgba(55, 53, 47, 0.62);
  flex: 0 0 auto;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.14s ease;
}

.refunds-detail-block:not([open]) .refunds-detail-summary::before {
  transform: rotate(-45deg) translateY(1px);
}

.refunds-detail-summary:hover {
  background: rgba(55, 53, 47, 0.04);
}

.refunds-detail-summary:focus-visible {
  outline: 2px solid rgba(36, 96, 255, 0.42);
  outline-offset: 2px;
}

.refunds-detail-content {
  display: grid;
  gap: 8px;
  margin-left: 17px;
}

.refunds-detail-title {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.refunds-detail-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.44fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
}

.refunds-detail-label {
  color: rgba(55, 53, 47, 0.66);
}

.refunds-detail-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.refunds-eligibility-checks {
  display: grid;
  gap: 7px;
}

.refunds-eligibility-check {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr);
  gap: 4px 8px;
  align-items: start;
  font-size: 13px;
  background: rgba(55, 53, 47, 0.025);
}

.refunds-eligibility-check[data-refunds-eligibility-check-state="passed"] {
  border-color: rgba(22, 101, 52, 0.22);
  background: rgba(22, 101, 52, 0.05);
}

.refunds-eligibility-check[data-refunds-eligibility-check-state="failed"] {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(185, 28, 28, 0.05);
}

.refunds-eligibility-state {
  font-weight: 600;
  color: rgba(46, 43, 38, 0.88);
}

.refunds-eligibility-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.refunds-eligibility-override {
  grid-column: 2;
  width: fit-content;
  border: 1px solid rgba(126, 34, 206, 0.24);
  border-radius: var(--admin-radius-sm);
  padding: 2px 6px;
  color: #6b21a8;
  background: rgba(126, 34, 206, 0.06);
  font-size: 12px;
  line-height: 1.25;
}

.refunds-gateway-raw {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 8px;
  background: rgba(55, 53, 47, 0.025);
}

.refunds-gateway-raw summary {
  cursor: pointer;
  color: rgba(55, 53, 47, 0.72);
  font-size: 13px;
}

.refunds-gateway-raw pre {
  max-height: 180px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--admin-mono);
  font-size: 12px;
}

.refunds-action-slots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.refunds-action-slot {
  min-height: 30px;
}

.refunds-card-action[data-refunds-action="reject"] {
  color: #991b1b;
}

.refunds-card-action[data-refunds-action="approve"] {
  color: #166534;
}

.refunds-action-slots-empty {
  color: rgba(55, 53, 47, 0.64);
  font-size: 13px;
}

.refunds-detail-timeline {
  display: grid;
  gap: 8px;
}

.refunds-detail-event {
  border-left: 2px solid rgba(55, 53, 47, 0.16);
  padding-left: 9px;
  display: grid;
  gap: 2px;
  font-size: 13px;
}

.refunds-detail-event-time {
  color: rgba(55, 53, 47, 0.64);
  font-size: 12px;
}

.refunds-detail-event-diagnostics {
  display: grid;
  gap: 3px;
  margin: 4px 0 0;
  color: rgba(55, 53, 47, 0.72);
  font-size: 12px;
}

.refunds-detail-event-diagnostics div {
  display: grid;
  grid-template-columns: minmax(116px, auto) minmax(0, 1fr);
  gap: 7px;
}

.refunds-detail-event-diagnostics dt,
.refunds-detail-event-diagnostics dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.refunds-detail-event-diagnostics dt {
  font-family: var(--admin-mono);
  color: rgba(55, 53, 47, 0.58);
}

.refunds-empty-list,
.refunds-detail-empty {
  min-height: 180px;
  border: 1px dashed var(--admin-border-strong);
  border-radius: var(--admin-radius-sm);
  padding: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  text-align: center;
  color: rgba(55, 53, 47, 0.72);
  background: rgba(55, 53, 47, 0.02);
}

.refunds-empty-list strong,
.refunds-detail-empty strong {
  color: rgba(46, 43, 38, 0.94);
  font-weight: 600;
}

.refunds-decision-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.refunds-decision-message {
  margin: 0;
}

.refunds-decision-meta {
  margin: 0;
  display: grid;
  gap: 8px;
}

.refunds-decision-meta > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
}

.refunds-decision-meta dt {
  color: rgba(55, 53, 47, 0.66);
}

.refunds-decision-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.refunds-decision-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.personnel-panel {
  gap: 10px;
}

.personnel-head {
  align-items: flex-start;
}

.personnel-head-copy {
  gap: 4px;
}

.personnel-table-surface {
  padding: 0;
}

.personnel-table-scroll {
  overflow: auto;
}

.personnel-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.personnel-table th,
.personnel-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(55, 53, 47, 0.11);
  vertical-align: top;
}

.personnel-table th {
  font-size: 13px;
  color: rgba(55, 53, 47, 0.75);
  font-weight: 500;
}

.personnel-table tr:last-child td {
  border-bottom: none;
}

.personnel-cell-login {
  font-family: var(--admin-mono);
  font-size: 13px;
}

.personnel-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.personnel-action-btn {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.personnel-action-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.personnel-modal {
  width: min(860px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  gap: 14px;
}

.personnel-password-modal,
.personnel-confirm-modal {
  width: min(560px, 100%);
}

.personnel-warning-box {
  margin: 0;
  border: 1px solid rgba(163, 58, 48, 0.35);
  border-radius: var(--admin-radius-sm);
  background: rgba(163, 58, 48, 0.08);
  color: #7e2a22;
  padding: 10px 12px;
}

.personnel-form {
  gap: 10px;
}

.personnel-form-field {
  display: grid;
  gap: 6px;
}

.personnel-form-field > span {
  font-size: 14px;
  color: rgba(55, 53, 47, 0.85);
}

.personnel-password-field {
  gap: 6px;
}

.personnel-schedule-editor {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--admin-border);
}

.personnel-schedule-grid {
  display: grid;
  gap: 8px;
}

.personnel-schedule-row {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 10px;
  background: rgba(55, 53, 47, 0.03);
  display: grid;
  gap: 8px;
}

.personnel-schedule-day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.personnel-schedule-mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.personnel-schedule-mode-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.personnel-schedule-time-range {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.personnel-schedule-time-range label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(55, 53, 47, 0.9);
}

.personnel-time-input {
  width: 110px;
  height: 30px;
  padding: 0 8px;
}

.personnel-schedule-row.is-closed .personnel-schedule-mode-group,
.personnel-schedule-row.is-closed .personnel-schedule-time-range {
  opacity: 0.55;
}

.personnel-schedule-row.is-closed .personnel-schedule-time-range,
.personnel-schedule-row:not(.is-custom) .personnel-schedule-time-range {
  display: none;
}

.personnel-form-actions {
  padding-top: 4px;
}

.settings-recipients {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--admin-border);
}

.settings-recipient-list {
  gap: 8px;
}

.settings-recipient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 8px;
  align-items: center;
}

.template-tabs {
  padding: 12px;
  gap: 10px;
}

.template-filter-group {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.template-filter-label {
  padding-top: 10px;
  color: var(--admin-text-muted);
  font-size: 12px;
  font-weight: 500;
}

.template-tabs .tabs {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}

.template-product-switcher .tab-link {
  min-height: 44px;
  padding-inline: 16px;
}

.template-status-switcher .tab-link {
  min-height: 44px;
}

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

.template-editor {
  padding: 18px;
  gap: 14px;
}

.template-textarea {
  min-height: 360px;
  font-size: 16px;
}

.template-actions-row {
  padding-top: 4px;
}

.template-assist {
  position: sticky;
  top: 18px;
  gap: 14px;
}

.template-vars-list code {
  font-family: var(--admin-mono);
  font-size: 13px;
}

.template-preview-user {
  gap: 6px;
}

.template-preview-data {
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--admin-border);
}

.template-preview-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-text-muted);
}

.template-preview-card {
  padding: 12px;
}

.template-preview-card[aria-busy="true"] {
  opacity: 0.65;
}

.template-preview-actions .btn {
  min-height: 34px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 18, 0.38);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 20px;
}

.send-test-modal {
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.send-test-modal-actions {
  display: flex;
  gap: 8px;
}

.send-test-modal-list {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-sm);
  padding: 8px;
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  background: rgba(55, 53, 47, 0.03);
}

.send-test-modal-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px;
  border-radius: var(--admin-radius-sm);
}

.send-test-modal-item:hover {
  background: var(--admin-hover);
}

.send-test-modal-item input {
  margin-top: 3px;
}

.send-test-modal-item-text {
  overflow-wrap: anywhere;
}

.field-hint {
  margin-top: -4px;
}

.field-error {
  min-height: 18px;
  color: #a33a30;
  margin-top: -6px;
}

.inline-status {
  min-height: 20px;
  color: rgba(55, 53, 47, 0.72);
}

.inline-status.is-error {
  color: #a33a30;
}

.is-hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-md);
  padding: 20px;
  display: grid;
  gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(55, 53, 47, 0.02);
}

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

.shell-no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.content-no-sidebar {
  max-width: 1680px;
}

.chats-shell {
  --chats-column-left: 320px;
  --chats-column-right: 288px;
  --chats-accent: #4f46e5;
  --chats-accent-strong: #4338ca;
  --chats-accent-soft: rgba(79, 70, 229, 0.14);
  --chats-safe-top: env(safe-area-inset-top, 0px);
  --chats-safe-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.chats-workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chats-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--admin-border-strong);
  background: rgba(55, 53, 47, 0.04);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chats-state-pill[data-chats-status="open"] {
  border-color: rgba(79, 70, 229, 0.25);
  background: var(--chats-accent-soft);
  color: rgba(54, 67, 214, 0.98);
  font-weight: 600;
}

.chats-state-pill[data-chats-status="reopened"] {
  border-color: rgba(88, 55, 38, 0.3);
  background: rgba(88, 55, 38, 0.12);
}

.chats-state-pill[data-chats-status="closed"] {
  border-color: rgba(55, 53, 47, 0.2);
  background: rgba(55, 53, 47, 0.06);
}

.chats-error {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chats-layout {
  display: grid;
  grid-template-columns:
    minmax(296px, var(--chats-column-left))
    minmax(0, 1fr)
    minmax(256px, var(--chats-column-right));
  gap: 12px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.chats-layout.is-list-only {
  grid-template-columns:
    minmax(296px, var(--chats-column-left))
    minmax(0, 1fr)
    minmax(256px, var(--chats-column-right));
}

.chats-layout.is-list-only .chats-column-list {
  max-width: none;
}

.chats-column-list,
.chats-column-timeline,
.chats-column-profile {
  min-width: 0;
}

.chats-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  border-radius: 16px;
}

.chats-column.surface {
  padding: 0;
  box-shadow:
    inset 0 0 0 1px rgba(56, 50, 42, 0.03),
    0 1px 0 rgba(56, 50, 42, 0.04);
}

.chats-column-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(56, 50, 42, 0.11);
  background: rgba(255, 255, 255, 0.9);
  flex: 0 0 auto;
  align-items: center;
}

.chats-column h2,
.chats-empty-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.chats-column-head-copy {
  gap: 0;
}

.chats-view-options,
.chats-filters {
  display: grid;
  gap: 8px;
}

.chats-list-top {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.chats-list-title-wrap {
  gap: 0;
}

.chats-list-title {
  font-size: 19px;
  line-height: 1.2;
}

.chats-list-controls {
  display: grid;
  gap: 10px;
}

.chats-shell-blocks {
  display: grid;
  gap: 0;
}

.chats-shell-block,
.chats-empty-card {
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.chats-empty-card {
  border: 1px solid rgba(55, 53, 47, 0.11);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.chats-view-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(56, 50, 42, 0.14);
  border-radius: 12px;
  background: rgba(245, 243, 239, 0.92);
}

.chats-view-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  padding: 0;
  position: relative;
  text-align: center;
  font: inherit;
  color: rgba(55, 53, 47, 0.72);
  cursor: pointer;
  transition:
    color 120ms linear,
    background-color 120ms linear,
    box-shadow 120ms linear;
}

.chats-view-option:hover {
  background: rgba(56, 50, 42, 0.08);
  color: rgba(40, 37, 33, 0.9);
}

.chats-view-option.is-active {
  background: #fff;
  color: rgba(40, 37, 33, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(56, 50, 42, 0.1),
    0 1px 2px rgba(56, 50, 42, 0.12);
}

.chats-view-option[data-chats-view-option="favorite_messages"].is-active {
  color: rgba(139, 93, 20, 0.98);
}

.chats-view-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 0;
}

.chats-view-option-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.chats-view-option-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.chats-filters-compact {
  grid-template-columns: minmax(0, 1fr);
}

.chats-shell-block {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: none;
  background: transparent;
}

.chats-shell-block[data-chats-shell-block="empty"] {
  margin: 10px 14px;
  border: 1px solid rgba(55, 53, 47, 0.11);
  border-radius: 12px;
  background: #fff;
}

.chats-shell-block .section-title {
  margin: 0;
  font-size: 13px;
}

.chats-shell-block .text-muted {
  font-size: 12px;
  line-height: 1.4;
}

[data-chats-list-placeholder] {
  padding: 10px 14px;
}

.chats-filter-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.chats-filter-label {
  color: rgba(55, 53, 47, 0.68);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.chats-filter-select {
  background: rgba(248, 246, 242, 0.92);
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
  border-color: rgba(56, 50, 42, 0.2);
  font-size: 13px;
  font-weight: 500;
  padding-left: 10px;
  padding-right: 28px;
}

.chats-list-scroll {
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.chats-list-pagination {
  justify-content: center;
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid rgba(56, 50, 42, 0.08);
  color: rgba(55, 53, 47, 0.62);
  font-size: 12px;
}

.chats-list-block {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(56, 50, 42, 0.08);
}

.chats-list-block:first-child {
  border-top: none;
}

.chats-list-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 14px;
  background: rgba(247, 245, 241, 0.95);
  border-bottom: 1px solid rgba(56, 50, 42, 0.08);
}

.chats-block-title {
  margin: 0;
  color: rgba(55, 53, 47, 0.68);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chats-block-count {
  color: rgba(55, 53, 47, 0.72);
  font-family: var(--admin-mono);
  font-size: 11px;
}

.chats-case-list {
  display: grid;
  gap: 0;
}

.chats-case-row {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(56, 50, 42, 0.09);
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 10px 14px;
  display: grid;
  gap: 5px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    background-color 120ms linear,
    box-shadow 120ms linear;
}

.chats-case-row:hover {
  background: rgba(56, 50, 42, 0.05);
}

.chats-case-row.is-active {
  background: rgba(70, 95, 158, 0.1);
  box-shadow:
    inset 3px 0 0 rgba(70, 95, 158, 0.74),
    inset 0 -1px 0 rgba(56, 50, 42, 0.12);
}

.chats-favorite-list {
  display: grid;
  gap: 8px;
}

.chats-favorite-row {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(55, 53, 47, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.chats-favorite-row:hover {
  border-color: rgba(56, 108, 187, 0.24);
  background: rgba(247, 250, 255, 0.96);
}

.chats-favorite-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chats-favorite-title {
  min-width: 0;
  color: rgba(39, 47, 67, 0.96);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chats-favorite-time {
  flex: 0 0 auto;
  color: rgba(55, 53, 47, 0.62);
  font-family: var(--admin-mono);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

.chats-favorite-preview {
  margin: 0;
  color: rgba(44, 41, 36, 0.86);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chats-favorite-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chats-case-row-top,
.chats-case-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chats-case-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chats-case-user {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.chats-case-user-meta,
.chats-case-time {
  color: rgba(55, 53, 47, 0.68);
  font-size: 11px;
}

.chats-case-time {
  flex: 0 0 auto;
  font-family: var(--admin-mono);
}

.chats-case-preview {
  color: rgba(46, 43, 38, 0.88);
  font-size: 12px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.chats-case-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.chats-case-pill,
.chats-case-status,
.chats-unread-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.chats-case-status {
  border: 1px solid rgba(55, 53, 47, 0.14);
  background: rgba(55, 53, 47, 0.06);
}

.chats-case-status[data-chats-case-status="open"] {
  border-color: rgba(56, 108, 187, 0.26);
  background: rgba(56, 108, 187, 0.1);
  color: rgba(43, 84, 146, 0.92);
}

.chats-case-status[data-chats-case-status="reopened"] {
  border-color: rgba(183, 121, 32, 0.28);
  background: rgba(183, 121, 32, 0.12);
  color: rgba(133, 87, 22, 0.94);
}

.chats-case-status[data-chats-case-status="closed"] {
  border-color: rgba(42, 132, 91, 0.3);
  background: rgba(42, 132, 91, 0.12);
  color: rgba(28, 92, 64, 0.94);
}

.chats-case-assignee {
  color: rgba(55, 53, 47, 0.74);
  border: 1px solid rgba(55, 53, 47, 0.14);
  background: rgba(55, 53, 47, 0.06);
}

.chats-case-assignee[data-chats-case-assignee-state="queue"] {
  color: rgba(135, 86, 12, 0.96);
  border-color: rgba(196, 134, 36, 0.3);
  background: rgba(196, 134, 36, 0.14);
}

.chats-unread-badge {
  margin-left: auto;
  color: #fff;
  background: rgba(57, 86, 150, 0.92);
  font-family: var(--admin-mono);
}

.chats-empty-card {
  min-height: 220px;
  align-content: center;
}

.chats-empty-card-chat {
  margin: 14px 16px 0;
  min-height: 280px;
}

.chats-empty-card-profile {
  margin: 0;
  min-height: 200px;
}

.chats-main-head {
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.chats-main-head-copy {
  min-width: 0;
  flex: 1 1 320px;
  width: auto;
  gap: 0;
}

.chats-main-head-row {
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.chats-main-head-controls {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 0;
  flex: 0 0 auto;
  order: 1;
}

.chats-main-head-title-group {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  order: 2;
  margin-left: auto;
  justify-content: flex-end;
}

.chats-main-head-title-group .section-title {
  font-size: 17px;
  line-height: 1.2;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.chats-main-head-title-group .chats-state-pill {
  flex: 0 0 auto;
}

.chats-main-head-subline {
  display: none;
}

.chats-main-head-meta-group {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.chats-main-head-meta,
.chats-main-head-assignee {
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chats-mobile-nav-button,
.chats-mobile-back-button,
.chats-mobile-profile-back {
  display: none;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.chats-mobile-nav-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  justify-content: center;
  align-items: center;
}

.chats-profile-open-button {
  display: inline-flex;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
  padding: 0;
  justify-content: center;
  align-items: center;
}

.chats-mobile-close-button {
  display: none;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
  padding: 0;
  justify-content: center;
  align-items: center;
  border-color: rgba(55, 53, 47, 0.24);
  background: rgba(55, 53, 47, 0.08);
  color: rgba(55, 53, 47, 0.9);
}

.chats-mobile-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.chats-mobile-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.chats-mobile-button-label {
  display: inline;
}

.chats-profile-open-button .chats-mobile-button-label,
.chats-mobile-close-button .chats-mobile-button-label,
.chats-mobile-nav-button .chats-mobile-button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.chats-case-actions {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  flex: 0 0 auto;
}

.chats-case-actions.is-pending {
  opacity: 0.76;
}

.chats-case-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 4px;
}

.chats-case-actions-status {
  margin: 0;
  font-size: 12px;
  text-align: right;
}

.chats-icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 8px;
  font-size: 12px;
}

.chats-icon-button svg {
  width: 14px;
  height: 14px;
  display: block;
  flex: 0 0 auto;
}

.chats-action-icon {
  display: inline-flex;
  line-height: 0;
}

.chats-action-label {
  display: none;
}

.chats-icon-button[data-chats-case-action-variant="take"] {
  border-color: rgba(56, 108, 187, 0.36);
  background: rgba(56, 108, 187, 0.11);
  color: rgba(37, 78, 142, 0.96);
}

.chats-icon-button[data-chats-case-action-variant="close"] {
  border-color: rgba(55, 53, 47, 0.24);
  background: rgba(55, 53, 47, 0.08);
}

.chats-icon-button[data-chats-case-action-variant="reopen"] {
  border-color: rgba(176, 114, 29, 0.3);
  background: rgba(176, 114, 29, 0.11);
  color: rgba(122, 80, 21, 0.96);
}

.chats-icon-button[data-chats-case-action-variant="apply"] {
  border-color: rgba(55, 53, 47, 0.24);
  background: rgba(55, 53, 47, 0.08);
}

.chats-icon-button[data-chats-case-action-variant="info"] {
  border-color: rgba(56, 108, 187, 0.26);
  background: rgba(56, 108, 187, 0.1);
  color: rgba(43, 84, 146, 0.96);
}

.chats-assign-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: 100%;
}

.chats-assign-select-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.chats-assign-select-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  pointer-events: none;
}

.chats-assign-select-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.chats-assign-select {
  min-width: 148px;
  max-width: min(100%, 192px);
  background: rgba(248, 246, 242, 0.96);
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
  border-color: rgba(55, 53, 47, 0.22);
  font-size: 12px;
  padding-left: 8px;
  padding-right: 22px;
}

.chats-assign-select.is-compact-mobile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  min-height: 0;
  padding: 0;
  border: none;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.chats-polling-note {
  color: rgba(55, 53, 47, 0.68);
  font-family: var(--admin-mono);
  font-size: 12px;
}

.chats-timeline-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 0;
  flex: 1;
  min-height: 0;
}

.chats-composer {
  display: grid;
  gap: 8px;
  margin: 10px 16px 16px;
  padding: 10px 12px 11px;
  border: 1px solid rgba(55, 53, 47, 0.16);
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(55, 53, 47, 0.04),
    inset 0 0 0 1px rgba(55, 53, 47, 0.02);
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.chats-composer.is-disabled {
  opacity: 0.72;
}

.chats-composer-closed-warning {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(176, 114, 29, 0.24);
  background: rgba(176, 114, 29, 0.09);
  color: rgba(122, 80, 21, 0.96);
  font-size: 12px;
  line-height: 1.35;
}

.chats-composer-closed-warning strong {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid rgba(122, 80, 21, 0.42);
  font-size: 10px;
  font-family: var(--admin-mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.chats-composer-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(56, 50, 42, 0.15);
  border-radius: 10px;
  background: #fff;
}

.chats-toolbar-button {
  min-width: 34px;
  min-height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: rgba(46, 43, 38, 0.88);
  font: inherit;
  cursor: pointer;
}

.chats-toolbar-button:hover {
  background: rgba(56, 50, 42, 0.08);
}

.chats-toolbar-button:disabled {
  cursor: default;
  opacity: 0.56;
}

.chats-toolbar-glyph {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  font-family: "Arial", sans-serif;
}

.chats-toolbar-glyph.is-italic {
  font-style: italic;
}

.chats-button-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.chats-button-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.chats-button-label {
  line-height: 1;
}

.chats-composer-field {
  display: block;
  min-width: 0;
}

.chats-composer-textarea {
  min-height: 82px;
  max-height: 240px;
  border-radius: 10px;
  background: #fff;
  border-color: rgba(56, 50, 42, 0.15);
  padding: 10px 11px;
  line-height: 1.45;
  resize: vertical;
}

.chats-composer-footer {
  align-items: center;
  gap: 8px;
}

.chats-composer-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.chats-composer-submit {
  min-height: 34px;
  border-radius: 9px;
  padding: 0 12px;
}

.chats-composer-submit:disabled {
  opacity: 0.54;
}

.chats-slash-hook {
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  width: min(440px, calc(100% - 24px));
  max-height: min(var(--chats-quick-replies-max-height, 58vh), 360px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(88, 55, 38, 0.2);
  background: rgba(255, 255, 255, 0.985);
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 14px 34px rgba(42, 36, 28, 0.16);
  z-index: 35;
  overflow: hidden;
}

.chats-slash-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: rgba(46, 43, 38, 0.82);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chats-slash-menu-head-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chats-slash-menu-head strong {
  font-family: var(--admin-mono);
  font-size: 12px;
  font-weight: 600;
}

.chats-slash-close {
  display: none;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(56, 50, 42, 0.14);
  background: rgba(251, 252, 254, 0.98);
  color: rgba(62, 58, 52, 0.88);
  flex: 0 0 auto;
}

.chats-slash-close .chats-button-label {
  display: none;
}

.chats-slash-backdrop {
  display: none;
}

.chats-mobile-nav-backdrop {
  display: none;
}

.chats-slash-menu-state {
  margin: 0;
  color: rgba(46, 43, 38, 0.76);
}

.chats-slash-menu-state.is-error {
  color: rgba(149, 29, 54, 0.92);
}

.chats-slash-menu-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 4px;
  min-height: 0;
  max-height: min(var(--chats-quick-replies-list-max-height, 42vh), 244px);
  overflow-y: auto;
  padding-right: 1px;
}

.chats-slash-menu-item {
  width: 100%;
  border: 1px solid rgba(56, 50, 42, 0.12);
  border-radius: 8px;
  background: rgba(248, 246, 242, 0.64);
  color: rgba(44, 40, 34, 0.95);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chats-slash-menu-item:hover,
.chats-slash-menu-item.is-active {
  border-color: rgba(88, 55, 38, 0.35);
  background: rgba(88, 55, 38, 0.12);
}

.chats-slash-menu-command {
  font-family: var(--admin-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.chats-slash-menu-title {
  font-size: 12px;
  color: rgba(52, 48, 41, 0.86);
  line-height: 1.25;
}

.chats-composer-attachment {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(55, 53, 47, 0.14);
  border-radius: 10px;
  background: #fff;
}

.chats-composer-attachment-preview {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(55, 53, 47, 0.14);
  background: rgba(55, 53, 47, 0.05);
}

.chats-composer-attachment-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chats-composer-attachment-copy {
  gap: 1px;
  min-width: 0;
}

.chats-composer-attachment-copy strong,
.chats-composer-attachment-copy .text-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chats-composer-attachment-copy strong {
  font-size: 13px;
}

.chats-composer-attachment-copy .text-muted {
  font-size: 11px;
}

.chats-composer-clear-image {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
}

.chats-composer-attach-button {
  position: relative;
  overflow: hidden;
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chats-composer-quick-replies {
  min-width: 30px;
  min-height: 30px;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.chats-composer-quick-replies.is-active {
  border-color: rgba(56, 108, 187, 0.34);
  background: rgba(56, 108, 187, 0.1);
  color: rgba(43, 84, 146, 0.96);
}

.chats-composer-attach-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.chats-timeline-toolbar {
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 0 0 auto;
}

.chats-history-state {
  margin-left: auto;
  color: rgba(55, 53, 47, 0.68);
  font-family: var(--admin-mono);
  font-size: 11px;
}

.chats-load-older {
  min-height: 30px;
  border-radius: 8px;
}

.chats-timeline-viewport {
  border: 1px solid rgba(55, 53, 47, 0.11);
  border-radius: 14px;
  background: rgba(247, 246, 243, 0.9);
  padding: 12px;
  max-height: none;
  min-height: 260px;
  flex: 1;
  height: 100%;
  overflow: auto;
}

.chats-timeline-viewport::-webkit-scrollbar {
  width: 8px;
}

.chats-timeline-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.chats-timeline-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(84, 92, 110, 0.45);
}

.chats-timeline {
  display: grid;
  gap: 12px;
  align-content: start;
}

.chats-timeline-item {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.chats-timeline-item.is-outbound {
  justify-items: end;
}

.chats-timeline-item.is-center {
  justify-items: center;
}

.chats-timeline-item.is-date {
  margin: 2px 0 0;
}

.chats-timeline-date {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 53, 47, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: rgba(55, 53, 47, 0.72);
  font-size: 11px;
  font-weight: 500;
}

.chats-boundary-core {
  width: min(100%, 460px);
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  padding: 9px 12px;
  border: 1px solid rgba(55, 53, 47, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.chats-boundary-core.is-focus-case {
  border-color: rgba(88, 55, 38, 0.34);
  background: rgba(248, 243, 236, 0.98);
  box-shadow: inset 0 0 0 1px rgba(88, 55, 38, 0.08);
}

.chats-boundary-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.chats-boundary-meta-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chats-boundary-meta {
  color: rgba(55, 53, 47, 0.64);
  font-family: var(--admin-font);
  font-size: 12px;
}

.chats-boundary-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(55, 53, 47, 0.12);
  background: rgba(55, 53, 47, 0.045);
  font-size: 11px;
  font-weight: 500;
}

.chats-boundary-status[data-chats-boundary-status="open"] {
  border-color: rgba(56, 108, 187, 0.26);
  background: rgba(56, 108, 187, 0.1);
  color: rgba(43, 84, 146, 0.94);
}

.chats-boundary-status[data-chats-boundary-status="reopened"] {
  border-color: rgba(183, 121, 32, 0.26);
  background: rgba(183, 121, 32, 0.12);
  color: rgba(133, 87, 22, 0.94);
}

.chats-boundary-status[data-chats-boundary-status="closed"] {
  border-color: rgba(42, 132, 91, 0.26);
  background: rgba(42, 132, 91, 0.11);
  color: rgba(28, 92, 64, 0.94);
}

.chats-event-card {
  width: fit-content;
  max-width: min(100%, 480px);
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
  padding: 7px 14px;
  border: 1px solid rgba(117, 126, 144, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 1px 2px rgba(61, 71, 95, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.chats-event-card.has-description {
  width: min(100%, 520px);
  gap: 4px;
  border-radius: 10px;
  padding: 8px 12px;
}

.chats-event-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.22;
  color: rgba(84, 93, 112, 0.96);
}

.chats-event-description {
  margin: 0;
  color: rgba(55, 53, 47, 0.72);
  font-size: 11px;
  line-height: 1.24;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.chats-event-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(55, 53, 47, 0.68);
  font-family: var(--admin-mono);
  font-size: 11px;
  line-height: 1.2;
}

.chats-message {
  width: min(100%, 76%);
  display: grid;
  gap: 4px;
}

.chats-timeline-item.is-outbound .chats-message {
  justify-items: end;
}

.chats-message-card {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 11px 14px;
  border: 1px solid rgba(132, 142, 162, 0.18);
  border-radius: 18px 18px 18px 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(48, 57, 79, 0.08);
}

.chats-message-card.is-user {
  background: #fff;
  border-color: rgba(136, 147, 168, 0.2);
}

.chats-message-card.is-operator {
  background: linear-gradient(
    135deg,
    rgba(86, 77, 255, 0.99) 0%,
    rgba(74, 54, 232, 0.99) 100%
  );
  border-color: rgba(68, 55, 214, 0.96);
  color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 14px rgba(62, 52, 189, 0.3);
}

.chats-message-card.is-bot-auto {
  background: rgba(183, 121, 32, 0.13);
  border-color: rgba(183, 121, 32, 0.28);
  color: rgba(95, 61, 15, 0.94);
}

.chats-message-card.is-bot-auto-close {
  background: rgba(55, 53, 47, 0.12);
  border-color: rgba(55, 53, 47, 0.2);
}

.chats-message-card.is-unsupported {
  border-style: dashed;
}

.chats-timeline-item.is-outbound .chats-message-card {
  border-radius: 18px 18px 10px 18px;
}

.chats-message-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.chats-timeline-item.is-outbound .chats-message-head {
  justify-content: flex-end;
}

.chats-timeline-item.is-outbound .chats-message-time {
  order: 0;
}

.chats-message-actor {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(64, 74, 93, 0.92);
  text-transform: none;
}

.chats-message-time {
  color: rgba(122, 131, 149, 0.9);
  font-family: var(--admin-mono);
  font-size: 12px;
  white-space: nowrap;
}

.chats-message-favorite {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid rgba(122, 131, 149, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(122, 131, 149, 0.94);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.chats-message-favorite:hover {
  border-color: rgba(183, 121, 32, 0.36);
  color: rgba(138, 91, 24, 0.96);
  background: rgba(255, 248, 235, 0.96);
}

.chats-message-favorite[data-chats-message-favorite-state="active"] {
  border-color: rgba(183, 121, 32, 0.38);
  background: rgba(183, 121, 32, 0.13);
  color: rgba(138, 91, 24, 0.98);
}

.chats-message-favorite svg {
  width: 13px;
  height: 13px;
  display: block;
}

.chats-timeline-item.is-focus-message .chats-message-card {
  outline: 2px solid rgba(56, 108, 187, 0.34);
  outline-offset: 2px;
}

.chats-message-body {
  display: grid;
  gap: 8px;
}

.chats-message-text {
  margin: 0;
  color: rgba(39, 47, 67, 0.96);
  font-size: 14px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chats-message-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chats-message-card.is-operator .chats-message-text,
.chats-message-card.is-operator .chats-message-fallback {
  color: rgba(255, 255, 255, 0.98);
}

.chats-message-media {
  display: grid;
  gap: 8px;
  contain: paint;
}

.chats-message-media img {
  width: min(100%, 320px);
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(55, 53, 47, 0.12);
  background: #fff;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: pan-y;
}

.chats-message-pdf {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(55, 53, 47, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.chats-message-pdf.is-unavailable {
  grid-template-columns: 42px minmax(0, 1fr);
  background: rgba(250, 250, 250, 0.86);
}

.chats-message-pdf-badge {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: #f04f3f;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.chats-message-pdf-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chats-message-pdf-title,
.chats-message-pdf-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chats-message-pdf-title {
  color: rgba(39, 47, 67, 0.96);
  font-size: 13px;
  line-height: 1.25;
}

.chats-message-pdf-meta {
  color: rgba(55, 53, 47, 0.62);
  font-size: 12px;
  line-height: 1.25;
}

.chats-message-pdf-open {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 7px;
  background: #2f6fed;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.chats-message-pdf-open:hover {
  background: #285ec9;
  color: #fff;
  text-decoration: none;
}

.chats-message-fallback {
  margin: 0;
  color: rgba(55, 53, 47, 0.76);
  font-size: 12px;
  line-height: 1.4;
}

.chats-profile-head {
  gap: 8px;
  align-items: center;
}

.chats-profile-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.chats-profile-block {
  border: 1px solid rgba(55, 53, 47, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  padding: 11px 12px;
  display: grid;
  gap: 9px;
}

.chats-profile-block.is-user {
  border-color: rgba(56, 50, 42, 0.16);
  background:
    linear-gradient(
      180deg,
      rgba(249, 247, 243, 0.95) 0%,
      rgba(255, 255, 255, 0.98) 100%
    );
}

.chats-column-profile.is-attention {
  box-shadow:
    inset 0 0 0 2px rgba(79, 70, 229, 0.22),
    inset 0 0 0 1px rgba(56, 50, 42, 0.03),
    0 1px 0 rgba(56, 50, 42, 0.04);
}

.chats-profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.chats-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(56, 50, 42, 0.24);
  background: rgba(56, 50, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--admin-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(46, 43, 38, 0.88);
}

.chats-profile-identity-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chats-profile-identity-title {
  margin: 0;
  color: rgba(44, 41, 36, 0.94);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chats-profile-identity-meta {
  margin: 0;
  color: rgba(55, 53, 47, 0.68);
  font-family: var(--admin-mono);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chats-profile-block-head {
  display: grid;
  gap: 2px;
}

.chats-profile-block-title {
  margin: 0;
  color: rgba(55, 53, 47, 0.66);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chats-profile-block-subtitle {
  margin: 0;
  color: rgba(55, 53, 47, 0.74);
  font-family: var(--admin-mono);
  font-size: 11px;
  line-height: 1.35;
}

.chats-profile-list {
  margin: 0;
  display: grid;
  gap: 7px;
}

.chats-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 8px;
  align-items: start;
  padding-top: 5px;
  border-top: 1px solid rgba(56, 50, 42, 0.08);
}

.chats-profile-row:first-child {
  border-top: none;
  padding-top: 0;
}

.chats-profile-label {
  margin: 0;
  color: rgba(55, 53, 47, 0.66);
  font-family: var(--admin-mono);
  font-size: 11px;
  line-height: 1.4;
}

.chats-profile-value {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(46, 43, 38, 0.94);
  overflow-wrap: anywhere;
  text-align: right;
}

.chats-profile-value.is-fallback {
  color: rgba(55, 53, 47, 0.64);
  font-weight: 400;
}

.chats-profile-block.is-transaction,
.chats-profile-block.is-refund {
  border-color: rgba(56, 108, 187, 0.18);
}

.chats-profile-block.is-refund {
  border-color: transparent;
  background: transparent;
  padding: 0;
}

.chats-profile-value[data-chats-profile-value="last_transaction_operation_id"] {
  font-family: var(--admin-mono);
  font-size: 11px;
}

.chats-refund-footer,
.chats-refund-action-form,
.chats-refund-disabled {
  display: grid;
  gap: 8px;
}

.chats-refund-footer {
  padding-top: 0;
  border-top: 0;
}

.chats-refund-submit {
  width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.chats-refund-current-status {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(56, 108, 187, 0.18);
  border-radius: 9px;
  background: rgba(249, 251, 255, 0.96);
}

.chats-refund-current-label {
  color: rgba(55, 53, 47, 0.66);
  font-family: var(--admin-mono);
  font-size: 11px;
  line-height: 1.35;
}

.chats-refund-current-value {
  min-width: 0;
  color: rgba(46, 43, 38, 0.94);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.chats-refund-submit .chats-action-icon {
  width: 16px;
  height: 16px;
}

.chats-refund-submit .chats-action-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.chats-refund-action-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.operator-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.operator-card {
  width: min(560px, 100%);
  padding: 22px;
  gap: 14px;
}

.operator-meta {
  margin: 0;
  display: grid;
  gap: 8px;
}

.operator-meta-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.operator-meta-row dt {
  color: rgba(55, 53, 47, 0.68);
  font-family: var(--admin-mono);
  font-size: 13px;
}

.operator-meta-row dd {
  margin: 0;
  font-size: 15px;
}

.toast-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  display: grid;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
}

.toast {
  border: 1px solid var(--admin-border);
  background: var(--admin-bg);
  border-radius: var(--admin-radius-sm);
  padding: 8px 10px;
  box-shadow: inset 0 0 0 1px rgba(55, 53, 47, 0.02);
}

@media (max-width: 1360px) {
  .chats-shell {
    --chats-column-left: 304px;
    --chats-column-right: 272px;
  }
}

@media (max-width: 1024px) {
  .admin-shell[data-active-nav="chats"] {
    min-height: var(--chats-mobile-vh, 100dvh);
    height: var(--chats-mobile-vh, 100dvh);
    overflow: hidden;
  }

  .admin-shell[data-active-nav="chats"] .shell:not(.shell-no-sidebar) {
    grid-template-columns: minmax(0, 1fr);
    height: var(--chats-mobile-vh, 100dvh);
    overflow: hidden;
  }

  .admin-shell[data-active-nav="chats"] .shell {
    height: var(--chats-mobile-vh, 100dvh);
    min-height: var(--chats-mobile-vh, 100dvh);
    overflow: hidden;
  }

  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .content {
    padding: 24px;
  }

  .split-grid {
    grid-template-columns: 1fr;
  }

  .template-layout {
    grid-template-columns: 1fr;
  }

  .template-assist {
    position: static;
  }

  .settings-recipient-row {
    grid-template-columns: 1fr;
  }

  .dashboard-panel .row-between {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-shell[data-active-nav="chats"] .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-shell[data-active-nav="chats"] .sidebar {
    display: none;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .sidebar {
    display: grid;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 312px);
    border-right: 1px solid var(--admin-border);
    background: #f1efeb;
    padding: 20px 14px calc(20px + var(--chats-safe-bottom));
    gap: 12px;
    z-index: 62;
    box-shadow: 12px 0 32px rgba(25, 34, 49, 0.24);
    overflow: auto;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .logo {
    min-height: 42px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    border-radius: 8px;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .logo::before {
    flex: 0 0 auto;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .logo-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    font-size: 14px;
    line-height: 1.25;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .menu {
    gap: 4px;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .menu-link {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 0 10px;
    justify-content: flex-start;
    gap: 10px;
    border-radius: 8px;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .menu-link-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .sidebar-footer {
    width: 100%;
    margin-top: auto;
    display: grid;
    justify-items: stretch;
    gap: 8px;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .sidebar-user-meta {
    width: 100%;
    display: block;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open
    .sidebar-user-trigger {
    display: none;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open
    .sidebar-user-tooltip {
    position: static;
    display: block;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: rgba(55, 53, 47, 0.68);
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open
    .sidebar-footer
    .btn {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    border-radius: 8px;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open
    .sidebar-action-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .sidebar-footer {
    padding-bottom: max(var(--chats-safe-bottom), 0px);
  }

  .admin-shell[data-active-nav="chats"].chats-mobile-nav-open .chats-mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: none;
    margin: 0;
    padding: 0;
    background: rgba(16, 24, 38, 0.24);
    z-index: 61;
    cursor: pointer;
  }

  .admin-shell[data-active-nav="chats"] .content {
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: var(--chats-mobile-vh, 100dvh);
    min-height: var(--chats-mobile-vh, 100dvh);
    overflow: hidden;
    background: rgba(239, 242, 248, 0.98);
  }

  @supports (-webkit-touch-callout: none) {
    .admin-shell[data-active-nav="chats"],
    .admin-shell[data-active-nav="chats"] .shell,
    .admin-shell[data-active-nav="chats"] .content {
      min-height: -webkit-fill-available;
    }
  }

  .admin-shell[data-active-nav="chats"] .chats-shell,
  .admin-shell[data-active-nav="chats"] .chats-workspace,
  .admin-shell[data-active-nav="chats"] .chats-layout {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

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

  .chats-layout.is-list-only .chats-column-list {
    max-width: none;
  }

  .chats-layout .chats-column.surface {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .chats-layout .chats-column {
    display: none;
    width: 100%;
    min-height: 0;
    height: 100%;
  }

  .chats-layout[data-chats-mobile-panel="list"] .chats-column-list,
  .chats-layout[data-chats-mobile-panel="timeline"] .chats-column-timeline,
  .chats-layout[data-chats-mobile-panel="profile"] .chats-column-profile {
    display: flex;
  }

  .chats-shell,
  .chats-workspace {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .chats-shell {
    display: flex;
    flex-direction: column;
  }

  .chats-workspace {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .chats-layout {
    flex: 1 1 auto;
    min-height: 0;
  }

  .chats-column-head {
    padding: 4px 12px;
    border-bottom-color: rgba(123, 133, 152, 0.24);
    background: rgba(255, 255, 255, 0.98);
  }

  .chats-list-top {
    gap: 8px;
  }

  .chats-list-scroll {
    max-height: none;
    min-height: 0;
    flex: 1;
  }

  .chats-main-head {
    gap: 2px;
    align-items: center;
    flex-wrap: nowrap;
  }

  .chats-main-head-copy {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0;
  }

  .chats-main-head-row {
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .chats-main-head-controls {
    order: 1;
    width: auto;
    margin-left: 0;
    justify-content: flex-start;
    flex: 0 0 auto;
  }

  .chats-main-head-title-group {
    order: 2;
    width: auto;
    max-width: none;
    margin-left: auto;
    justify-content: flex-end;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .chats-main-head-title-group .section-title {
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
  }

  .chats-main-head-title-group .chats-state-pill {
    margin-left: 0;
    min-height: 16px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.03em;
    flex: 0 0 auto;
  }

  .chats-main-head-subline {
    display: none;
  }

  .chats-mobile-nav-button,
  .chats-mobile-back-button,
  .chats-mobile-close-button,
  .chats-profile-open-button,
  .chats-mobile-profile-back {
    display: inline-flex;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 8px;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-color: rgba(131, 142, 161, 0.24);
    background: rgba(240, 243, 248, 0.9);
    color: rgba(73, 85, 106, 0.95);
  }

  .chats-mobile-back-button,
  .chats-mobile-profile-back {
    border-color: transparent;
    background: transparent;
  }

  .chats-mobile-button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .chats-profile-head {
    justify-content: flex-start;
  }

  .chats-case-actions {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
  }

  .chats-case-actions-row {
    width: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .chats-case-actions-status {
    width: 100%;
    text-align: left;
  }

  .chats-assign-control {
    flex: 0 0 auto;
    min-width: 0;
    gap: 4px;
    max-width: none;
  }

  .chats-assign-select {
    min-width: 0;
    max-width: none;
    width: auto;
    flex: 1 1 auto;
  }

  .chats-empty-card-chat {
    margin: 10px 12px 0;
    min-height: 220px;
  }

  .chats-empty-card-profile {
    margin: 10px 12px;
    min-height: 220px;
  }

  .chats-timeline-panel {
    padding: 6px 0 0;
  }

  .chats-composer {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(128, 139, 159, 0.3);
    background: rgba(247, 249, 252, 0.98);
    box-shadow: none;
    padding: 10px 12px calc(12px + var(--chats-safe-bottom));
  }

  .chats-list-controls {
    gap: 8px;
  }

  .chats-shell-block[data-chats-shell-block="empty"] {
    margin: 8px 12px;
  }

  .chats-profile-panel {
    padding: 10px 12px calc(12px + var(--chats-safe-bottom));
  }

  .chats-timeline-toolbar {
    padding: 0 14px;
  }

  .chats-history-state {
    font-size: 12px;
  }

  .chats-timeline-viewport {
    border: none;
    border-top: 1px solid rgba(128, 139, 159, 0.22);
    border-radius: 0;
    background: rgba(242, 245, 250, 0.98);
    padding: 16px 14px 18px;
  }

  .chats-message {
    width: min(100%, 86%);
    gap: 6px;
  }

  .chats-case-actions-row {
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .chats-case-actions {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    min-width: 0;
  }

  .chats-icon-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 8px;
    padding: 0;
  }

  .chats-icon-button .chats-action-label {
    display: none;
  }

  .chats-icon-button svg {
    width: 15px;
    height: 15px;
  }

  .chats-assign-select-trigger {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(126, 136, 155, 0.26);
    background: rgba(250, 251, 254, 0.98);
    color: rgba(73, 85, 106, 0.95);
  }

  .chats-assign-select-trigger[data-chats-assign-selected="true"] {
    border-color: rgba(56, 108, 187, 0.26);
    background: rgba(56, 108, 187, 0.1);
    color: rgba(43, 84, 146, 0.96);
  }

  .chats-assign-select-icon svg {
    width: 15px;
    height: 15px;
  }

  .chats-composer-textarea {
    min-height: 74px;
    border-radius: 14px;
    border-color: rgba(126, 136, 155, 0.22);
    background: rgba(255, 255, 255, 0.99);
    font-size: 16px;
    padding: 10px 11px;
    resize: none;
  }

  .chats-composer-toolbar,
  .chats-composer-attach-button,
  .chats-composer-quick-replies {
    min-height: 34px;
    border-radius: 10px;
  }

  .chats-composer-submit {
    min-height: 36px;
    border-radius: 10px;
    border-color: rgba(126, 136, 155, 0.24);
    background: rgba(237, 241, 247, 0.98);
    color: rgba(87, 96, 114, 0.95);
    font-weight: 600;
    font-size: 13px;
  }

  .chats-slash-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 28;
    border: none;
    margin: 0;
    padding: 0;
    background: rgba(20, 27, 38, 0.16);
    cursor: pointer;
  }

  .chats-slash-hook {
    left: 10px;
    right: 10px;
    width: auto;
    max-height: min(var(--chats-quick-replies-max-height, 46vh), 320px);
    border-radius: 12px;
    border-color: rgba(106, 84, 68, 0.26);
    box-shadow: 0 18px 36px rgba(27, 35, 49, 0.24);
    z-index: 30;
  }

  .chats-slash-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
  }

  .chats-slash-menu-list {
    max-height: min(var(--chats-quick-replies-list-max-height, 36vh), 248px);
  }

  .chats-case-actions-status {
    display: none;
  }

  .chats-list-title {
    font-size: 16px;
  }

  .chats-view-option-label {
    font-size: 12px;
  }

  .chats-filter-label {
    font-size: 11px;
  }

  .chats-filter-select {
    height: 30px;
    min-height: 30px;
    font-size: 12px;
  }

  .chats-case-user {
    font-size: 13px;
  }

  .chats-case-user-meta,
  .chats-case-time {
    font-size: 10px;
  }

  .chats-case-preview {
    font-size: 11px;
  }

  .chats-case-pill {
    min-height: 16px;
    font-size: 9px;
    padding: 0 6px;
  }

  .chats-history-state {
    font-size: 10px;
  }

  .chats-timeline-date {
    min-height: 22px;
    font-size: 10px;
  }

  .chats-boundary-title {
    font-size: 13px;
  }

  .chats-boundary-status,
  .chats-boundary-meta {
    font-size: 10px;
  }

  .chats-event-label {
    font-size: 12px;
  }

  .chats-event-description,
  .chats-event-meta {
    font-size: 10px;
  }

  .chats-message-actor {
    font-size: 11px;
  }

  .chats-message-time {
    font-size: 10px;
  }

  .chats-message-text {
    font-size: 13px;
  }

  .chats-message-fallback {
    font-size: 11px;
  }

  .chats-profile-block-title {
    font-size: 10px;
  }

  .chats-profile-identity-title {
    font-size: 13px;
  }

  .chats-profile-identity-meta,
  .chats-profile-label {
    font-size: 10px;
  }

  .chats-profile-value {
    font-size: 12px;
  }

  .personnel-table {
    min-width: 760px;
  }

  .quick-replies-table {
    min-width: 760px;
  }

  .logs-audit-table {
    min-width: 760px;
  }

  .personnel-time-input {
    width: 100px;
  }
}

@media (max-width: 640px) {
  .admin-shell:not([data-active-nav="chats"]) .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-shell:not([data-active-nav="chats"]) .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
    overflow: hidden;
  }

  .admin-shell:not([data-active-nav="chats"]) .logo {
    display: none;
  }

  .admin-shell:not([data-active-nav="chats"]) .menu {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .admin-shell:not([data-active-nav="chats"]) .menu::-webkit-scrollbar {
    display: none;
  }

  .admin-shell:not([data-active-nav="chats"]) .menu-link {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 9px;
    white-space: nowrap;
  }

  .admin-shell:not([data-active-nav="chats"]) .sidebar-footer {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .admin-shell:not([data-active-nav="chats"]) .content {
    padding: 14px;
  }

  .preview-actions {
    grid-template-columns: 1fr;
  }

  .template-filter-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .template-filter-label {
    padding-top: 0;
  }

  .template-tabs .tabs {
    width: 100%;
  }

  .template-product-switcher .tab-link {
    flex: 1 1 120px;
    justify-content: center;
  }

  .template-status-switcher .tab-link {
    flex: 1 1 128px;
    justify-content: center;
  }

  .chats-view-segmented {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chats-filter-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .chats-case-actions-row,
  .chats-assign-control {
    align-items: center;
  }

  .chats-assign-control {
    flex-wrap: nowrap;
    max-width: 100%;
  }

  .chats-main-head {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .chats-main-head-copy {
    flex: 1 1 auto;
    min-width: 0;
  }

  .chats-main-head-controls {
    width: auto;
    margin-left: 0;
    flex: 0 0 auto;
  }

  .chats-main-head-title-group {
    width: auto;
    max-width: none;
    margin-left: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .chats-case-actions-row {
    justify-content: flex-start;
  }

  .chats-case-actions-status {
    width: 100%;
    text-align: left;
  }

  .chats-main-head-row {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .chats-profile-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .chats-profile-value {
    text-align: left;
  }

  .chats-refund-submit {
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }

  .chats-message {
    width: min(100%, 90%);
  }

  .chats-timeline-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .chats-composer-attachment {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
  }

  .chats-composer-footer {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .chats-composer-controls {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
    padding-bottom: 0;
    gap: 6px;
  }

  .chats-composer-submit {
    width: auto;
    min-width: 108px;
    margin-left: auto;
    flex: 0 0 auto;
  }

  .chats-main-head-title-group .section-title {
    font-size: 13px;
  }

  .chats-mobile-nav-button,
  .chats-profile-open-button,
  .chats-mobile-back-button,
  .chats-mobile-close-button,
  .chats-mobile-profile-back,
  .chats-icon-button,
  .chats-assign-select-trigger {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .chats-main-head-title-group .chats-state-pill {
    min-height: 16px;
    padding: 0 5px;
    font-size: 9px;
  }

  .chats-assign-select-icon svg,
  .chats-icon-button svg {
    width: 14px;
    height: 14px;
  }

  .chats-error {
    align-items: flex-start;
  }

  .personnel-head {
    flex-direction: column;
  }

  .quick-replies-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .refunds-workspace-head {
    flex-direction: column;
  }

  .refunds-admin-actions,
  .refunds-status-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .refunds-search-form,
  .refunds-create-context-form,
  .refunds-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .refunds-create-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .refunds-filter-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .refunds-status-tab {
    flex: 1 1 140px;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .refunds-list-surface,
  .refunds-detail-surface {
    min-height: auto;
  }

  .refunds-eligibility-check {
    grid-template-columns: minmax(0, 1fr);
  }

  .refunds-eligibility-override {
    grid-column: 1;
  }

  .refunds-table-scroll {
    max-width: calc(100vw - 48px);
  }

  .refunds-pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .quick-replies-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-replies-gallery-head {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-replies-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-replies-table-scroll {
    overflow: visible;
  }

  .quick-replies-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-collapse: separate;
  }

  .quick-replies-table thead {
    display: none;
  }

  .quick-replies-table tbody {
    display: grid;
    gap: 10px;
  }

  .quick-replies-table tr[data-quick-replies-row] {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius-sm);
    background: var(--admin-surface);
  }

  .quick-replies-table th,
  .quick-replies-table td {
    border-bottom: none;
  }

  .quick-replies-table td {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 8px;
    padding: 0;
    min-width: 0;
    align-items: start;
    overflow-wrap: anywhere;
  }

  .quick-replies-table td::before {
    color: rgba(55, 53, 47, 0.68);
    font-size: 12px;
    line-height: 1.35;
  }

  .quick-replies-table td:nth-child(1)::before {
    content: "Создан";
  }

  .quick-replies-table td:nth-child(2)::before {
    content: "Автор";
  }

  .quick-replies-table td:nth-child(3)::before {
    content: "Название";
  }

  .quick-replies-table td:nth-child(4)::before {
    content: "Команда";
  }

  .quick-replies-table td:nth-child(5)::before {
    content: "Действия";
  }

  .quick-replies-row-actions {
    justify-content: flex-start;
  }

  .personnel-table {
    min-width: 640px;
  }

  .quick-replies-table {
    min-width: 0;
  }

  .logs-audit-table {
    min-width: 640px;
  }

  .personnel-schedule-time-range {
    flex-direction: column;
    align-items: flex-start;
  }

  .personnel-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
