* {
  box-sizing: border-box;
  scrollbar-color: var(--border-3) transparent;
}

*::-webkit-scrollbar,
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

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

body {
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-ui);
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

:where(
  .chat-context-menu,
  .msg-actions-menu,
  .template-menu-popover,
  .attachment-menu-popover,
  .composer-channel-popover,
  .app-sidebar-account-menu,
  .admin-actions-menu-popover
) {
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid var(--menu-border);
  border-radius: var(--menu-radius);
  background: var(--menu-surface);
  box-shadow: var(--menu-shadow);
}

:where(
  .chat-context-menu-item,
  .msg-actions-item,
  .template-menu-item,
  .attachment-menu-item,
  .composer-channel-option,
  .app-sidebar-account-action,
  .admin-actions-menu-popover button
) {
  border-radius: 0;
  transition:
    background-color var(--menu-item-transition),
    color var(--menu-item-transition);
}

:where(
    .chat-context-menu-item,
    .msg-actions-item,
    .template-menu-item,
    .attachment-menu-item,
    .composer-channel-option,
    .app-sidebar-account-action,
    .admin-actions-menu-popover button
  ):not(:disabled):hover,
:where(
  .chat-context-menu-item,
  .msg-actions-item,
  .template-menu-item,
  .attachment-menu-item,
  .composer-channel-option,
  .app-sidebar-account-action,
  .admin-actions-menu-popover button
):focus-visible {
  background: var(--menu-item-hover);
  outline: none;
}

input,
textarea {
  border: 0;
  background: none;
  color: inherit;
  outline: none;
}

.app {
  --app-rail-width: 316px;
  --surface-toolbar-height: 54px;
  display: grid;
  grid-template-columns: var(--app-rail-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "rail main";
  height: 100dvh;
  padding: 0;
  gap: 0;
  background: var(--bg-0);
  transition: grid-template-columns 180ms ease;
}

.app[data-rail-collapsed="true"] {
  --app-rail-width: 96px;
}

.app-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  display: grid;
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-1);
}

.app-main > .shell {
  min-height: 0;
  height: 100%;
}

.app-header-notification-popover {
  top: calc(100% + 6px);
  right: 8px;
  width: min(372px, calc(100vw - 16px));
  padding: 0;
  border: 1px solid var(--menu-border);
  border-radius: var(--menu-radius);
  background: var(--menu-surface);
  box-shadow: var(--menu-shadow);
  overflow: hidden;
}

.notification-toolbar {
  min-height: 40px;
  padding: 0 4px 6px;
  border-bottom: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.notification-toolbar-main {
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.notification-toolbar-icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-right: 0;
  border-radius: 6px;
  background: rgb(0 0 0 / 0.04);
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-toolbar-icon svg {
  width: 20px;
  height: 20px;
}

.notification-summary {
  padding: 0 8px;
  color: #000000;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.notification-toolbar-actions {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 4px;
}

.notification-toolbar-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgb(0 0 0 / 0.68);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-toolbar-btn:hover {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}

.notification-toolbar-btn svg {
  width: 18px;
  height: 18px;
}

.notification-list {
  max-height: min(440px, calc(100vh - 96px));
  padding: 2px 0 0;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(0 0 0 / 0.18) transparent;
}

.notification-item {
  padding: 9px 8px;
  border-bottom: 0;
  border-radius: 6px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
}

.notification-item:hover {
  background: rgb(0 0 0 / 0.04);
}

.notification-marker {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: none;
}

.notification-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notification-content strong {
  color: #000000;
  font-size: 13px;
  font-weight: 650;
  line-height: 18px;
}

.notification-text {
  color: rgb(0 0 0 / 0.68);
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.notification-time {
  color: rgb(0 0 0 / 0.5);
  font-size: 11px;
  line-height: 16px;
}

.notification-empty {
  min-height: 132px;
  padding: 24px 20px;
  color: rgb(0 0 0 / 0.68);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  text-align: center;
}

.notification-empty svg {
  width: 28px;
  height: 28px;
  color: rgb(0 0 0 / 0.5);
}

.app-body {
  display: contents;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-1);
  background: #ffffff;
  color: var(--fg-1);
}

.btn-primary,
.btn-secondary,
.btn-subtle,
.btn-danger {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.btn-primary {
  background: var(--accent-gradient);
  border: 0;
  color: #ffffff;
  box-shadow: var(--accent-shadow);
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-1);
  color: var(--fg-1);
}

.btn-subtle {
  background: var(--bg-2);
  border: 1px solid transparent;
  color: var(--fg-1);
}

.btn-danger {
  background: #ffffff;
  border: 1px solid rgb(220 38 38 / 0.18);
  color: var(--err);
}

.btn-primary.wide,
.btn-secondary.wide,
.btn-subtle.wide,
.btn-danger.wide {
  width: 100%;
  min-width: 0;
}

.me-name {
  font-size: var(--text-sm);
  font-weight: 600;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width, 340px) 1px minmax(0, 1fr);
  min-height: 0;
  gap: 0;
  position: relative;
}

.shell:not(.admin-shell) {
  overflow: hidden;
}

.sidebar,
.right-panel,
.admin-content,
.chat-area {
  min-height: 0;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg-1);
  box-shadow: none;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.sidebar-resizer {
  position: relative;
  width: 1px;
  min-width: 1px;
  max-width: 1px;
  cursor: col-resize;
  background: var(--border-2);
  touch-action: none;
  z-index: 4;
}

.sidebar-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5px;
  right: -5px;
  background: transparent;
}

.sidebar-resizer:hover,
.app[data-sidebar-resizing="true"] .sidebar-resizer {
  background: var(--border-2);
}

.app[data-sidebar-resizing="true"] {
  cursor: col-resize;
  user-select: none;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
  padding: 20px;
  gap: 8px;
}

.sidebar-top-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.search-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-filter-anchor {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}

.sidebar-settings-popover {
  position: relative;
  z-index: 24;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  gap: 8px;
}

.sidebar-settings-popover .remote-list-tools {
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  align-items: center;
}

.sidebar-settings-popover .remote-list-tools button {
  white-space: nowrap;
}

.sidebar-settings-popover .chat-filter-panel {
  padding: 0;
}

.sidebar-switch .filter-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: #000000;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  justify-content: space-between;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.sidebar-switch .filter-chip:hover {
  background: transparent !important;
  color: #000000;
  box-shadow: none;
}

.sidebar-switch .filter-chip[data-active="true"] {
  background: transparent !important;
  color: #000000;
  box-shadow: none;
}

.sidebar-switch .filter-chip[data-active="true"]::after {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: #000000;
  content: "";
}

.sidebar-switch {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 0;
  margin-top: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border-1);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.sidebar-filter-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 0 !important;
  background: var(--bg-0) !important;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-1);
}

.sidebar-filter-toggle:hover {
  background: var(--bg-0) !important;
  color: var(--fg-1);
}

.sidebar-filter-toggle[data-active="true"] {
  background: var(--bg-0) !important;
  color: var(--fg-1);
}

.sidebar-filter-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 16px;
}

.sidebar-filter-toggle:hover svg,
.sidebar-filter-toggle[data-active="true"] svg {
  transform: translateY(0);
}

.ui-counter {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: #ff5c4d;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.chat-filter-toggle-count {
  position: absolute;
  right: -2px;
  top: -2px;
}

.chat-filter-panel {
  display: grid;
  gap: 10px;
  padding: 2px 0 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-filter-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-0);
}

.chat-filter-panel-title span:last-child {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgb(80 169 248 / 0.12);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.chat-filter-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.chat-filter-text-btn {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  transition: color 140ms ease;
}

.chat-filter-head-actions .chat-filter-text-btn:first-child {
  color: var(--fg-3);
}

.chat-filter-head-actions .chat-filter-text-btn:first-child:hover {
  color: var(--fg-1);
}

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

.chat-filter-field {
  display: grid;
  gap: 5px;
}

.chat-filter-field span {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-2);
  text-transform: none;
  letter-spacing: 0;
}

.chat-filter-field input,
.chat-filter-field select {
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: var(--bg-2);
  color: var(--fg-0);
  outline: none;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px transparent;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.chat-filter-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m4.5 7.5 5.5 5 5.5-5' stroke='%2364758B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
}

.chat-filter-field input:focus,
.chat-filter-field select:focus {
  background-color: #ffffff;
  box-shadow: inset 0 0 0 1px rgb(59 132 236 / 0.18);
}

.chat-filter-field input::placeholder {
  color: var(--fg-3);
}

@media (max-width: 860px) {
  .chat-filter-grid {
    grid-template-columns: 1fr;
  }
}

.search-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-2);
  border: 0;
  border-radius: var(--r-full);
  padding: 0 34px 0 14px;
  color: var(--fg-0);
  height: 32px;
  font-size: var(--text-sm);
}

.search-input:focus {
  border-color: transparent;
  background: var(--bg-2);
  box-shadow: none;
}

.field input:focus,
.composer-textarea:focus {
  border-color: rgb(59 132 236 / 0.28);
  box-shadow: none;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-2);
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.search-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  background: var(--bg-1);
  color: var(--fg-0);
}

.search-clear-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.plus-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--accent-shadow);
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sidebar-top-row > .plus-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.sidebar-top-row > .plus-btn svg {
  width: 16px;
  height: 16px;
}

.search-field .search-input {
  height: 32px;
  padding: 0 34px 0 34px;
  font-size: 12px;
}

.search-field .search-icon {
  left: 50px;
}

.settings-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
}

.plus-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.settings-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.filter-chip {
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 600;
}

.filter-chip[data-active="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgb(59 132 236 / 0.18);
}

.filter-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgb(59 132 236 / 0.18);
}

.count {
  color: var(--fg-3);
}

.right-panel,
.admin-content {
  overflow: auto;
  scrollbar-width: thin;
}

.chat-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  gap: 0;
}

.chat-list-more {
  min-height: 30px;
  margin: 4px 10px 8px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
  line-height: 1;
}

.chat-list-more:hover {
  background: transparent;
  color: var(--fg-0);
}

.chat-list-more:disabled {
  cursor: default;
  opacity: 0.6;
}

.chat-list-more-label {
  min-width: 0;
  font-weight: 500;
}

.chat-list-more-count {
  flex: 0 0 auto;
  color: var(--fg-3);
  font-size: var(--text-xs);
  font-weight: 400;
}

.chat-list-more-static {
  justify-content: center;
}

.chat-list-wrap {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-width: thin;
}

.chat-list-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--fg-2);
}

.chat-list-loader-centered {
  min-height: 180px;
  flex-direction: column;
}

.chat-list-loader-inline {
  margin-top: 16px;
}

.chat-list-loader-overlay {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  pointer-events: none;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-0) 86%, transparent);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.08);
  backdrop-filter: blur(6px);
}

.chat-list-loader-ring {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid rgb(59 132 236 / 0.16);
  border-top-color: var(--accent);
  border-right-color: color-mix(in srgb, var(--accent) 72%, white);
  animation: chat-loader-spin 0.72s linear infinite;
}

.chat-list-loader-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-2);
}

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

.section-label {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.chat-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 8px 18px;
  border-radius: 0;
  text-align: left;
  border: 0;
  position: relative;
}

.chat-item[data-active="true"] {
  background: var(--bg-2);
}

.chat-item:hover {
  background: var(--bg-2);
}

.chat-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 156px;
  overflow: hidden;
}

.chat-context-menu-item {
  min-height: var(--menu-item-height);
  padding: var(--menu-item-padding);
  text-align: left;
  font-size: 13px;
  color: var(--fg-1);
}

.chat-context-menu-item-danger {
  color: var(--err);
}

.chat-context-menu-item-danger:hover,
.chat-context-menu-item-danger:focus-visible {
  background: var(--menu-item-danger-hover);
  color: var(--err);
}

.chat-context-menu-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--accent);
}

.meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dialog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.name {
  color: var(--fg-0);
  font-size: var(--text-md);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.time,
.subtle,
.a-time {
  color: var(--fg-3);
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: 0;
}

.chat-item .time {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
  line-height: 1.2;
}

.chat-time-group {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.chat-channel-strip {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  max-width: 76px;
  overflow: hidden;
  pointer-events: none;
}

.chat-channel-strip .messenger-dot,
.chat-channel-extra {
  width: 17px;
  height: 17px;
  min-width: 17px;
  margin-left: -5px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border-1);
  font-size: 9px;
}

.chat-channel-strip .messenger-dot:first-child {
  margin-left: 0;
}

.chat-channel-extra {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  color: var(--fg-2);
  font-weight: 700;
  line-height: 1;
}

.preview {
  display: inline-block;
  color: var(--fg-2);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remote-list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  color: var(--fg-1);
  font-size: 12px;
}

.remote-list-tools strong {
  color: var(--accent);
  font-weight: 500;
}

.remote-list-tools button {
  min-height: 24px;
  padding: 0;
  border: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.show-profile-chats-link {
  min-height: 24px;
  padding: 0;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  line-height: inherit;
  vertical-align: baseline;
}

.all-profiles-dot {
  background: var(--accent-soft);
  color: var(--accent);
}

.all-profiles-dot svg {
  width: 12px;
  height: 12px;
  display: block;
}

.profile-channel-picker {
  overflow: auto;
  padding: 10px 10px 14px;
  scrollbar-width: thin;
}

.profile-channel-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
}

.profile-channel-picker-head span {
  color: var(--fg-0);
  font-size: 13px;
  font-weight: 650;
}

.profile-channel-picker-head button {
  min-height: 24px;
  padding: 0;
  border: 0;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
}

.profile-channel-picker-head button:hover {
  color: var(--fg-0);
}

.profile-channel-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-channel-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-1);
  text-align: left;
}

.profile-channel-row span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 550;
}

.profile-channel-row strong {
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 550;
}

.profile-channel-row:hover {
  background: var(--bg-2);
}

.profile-channel-row[data-active="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.profile-channel-apply {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.profile-channel-apply:hover {
  background: var(--accent-gradient-hover);
}

.remote-list-tools button:disabled {
  color: var(--fg-3);
  opacity: 0.65;
}

.dialog-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dialog-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 22px;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-item-menu-trigger {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  cursor: pointer;
}

.chat-item-menu-trigger:hover,
.chat-item-menu-trigger:focus-visible {
  color: var(--fg-2);
  outline: none;
}

.chat-item-menu-trigger svg {
  width: 18px;
  height: 18px;
}

.chat-header-menu-trigger {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-header-menu-trigger:hover,
.chat-header-menu-trigger:focus-visible {
  background: transparent;
  color: #000000;
}

.chat-header-menu-trigger svg {
  width: 18px;
  height: 18px;
  transform: rotate(90deg);
}

.chat-restore-trigger {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--fg-1);
  font-size: 12px;
  line-height: 24px;
  white-space: nowrap;
  cursor: pointer;
}

.chat-restore-trigger:hover,
.chat-restore-trigger:focus-visible {
  background: var(--bg-2);
  outline: none;
}

.preview-wrap {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.preview-line {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.preview-checks {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 1px;
  flex-shrink: 0;
}

.messenger-dot {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.messenger-dot.no-channel-dot {
  background: var(--bg-2);
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 600;
}

.badge-pill {
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: fit-content;
  display: inline-flex;
  flex-shrink: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: none;
  overflow: hidden;
  position: relative;
}

.avatar-fallback {
  position: relative;
  z-index: 0;
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: var(--text-xs);
}

.avatar.lg {
  width: 52px;
  height: 52px;
  font-size: 16px;
}

.avatar.xl {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.avatar-channel {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 3;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid #ffffff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.14),
    0 2px 5px rgba(0, 0, 0, 0.16);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
}

.avatar-wrap.lg .avatar-channel {
  width: 20px;
  height: 20px;
  min-width: 20px;
  font-size: 11px;
}

.avatar-wrap.xl .avatar-channel {
  width: 24px;
  height: 24px;
  min-width: 24px;
  font-size: 12px;
}

.chat-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg-2);
}

.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-1);
}

.who {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.who .meta,
.chat-header .meta {
  min-width: 0;
  overflow: hidden;
}

.who .name {
  font-size: 15px;
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who .sub {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  overflow: hidden;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--fg-3);
}

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

.action-pill {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: #ffffff;
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.action-pill-ghost {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.manual-phone-bind {
  height: 32px;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 10px;
  border-radius: 20px;
  border: 1px solid rgb(0 0 0 / 0.08);
  background: rgb(255 255 255 / 0.62);
  color: var(--fg-1);
}

.manual-phone-bind:focus-within {
  border-color: rgb(59 132 236 / 0.26);
  background: rgb(255 255 255 / 0.88);
}

.manual-phone-bind input {
  width: 138px;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 600;
}

.manual-phone-bind input::placeholder {
  color: rgb(0 0 0 / 0.72);
  font-weight: 500;
}

.manual-phone-bind button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(80 169 248 / 0.1);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.manual-phone-bind button:hover {
  background: rgb(80 169 248 / 0.16);
}

.manual-phone-bind-panel {
  width: 100%;
  max-width: 210px;
  justify-content: space-between;
}

.manual-phone-bind-panel input {
  flex: 1;
}

.manual-phone-bind-suggested {
  border-color: rgb(59 132 236 / 0.38);
  background: #ffffff;
  box-shadow: none;
}

.manual-phone-bind-suggested .manual-phone-input {
  width: 146px;
}

.manual-phone-bind-dismiss,
.manual-phone-bind-accept {
  flex: 0 0 auto;
}

.manual-phone-bind .manual-phone-bind-dismiss {
  background: rgb(0 0 0 / 0.08);
  color: rgb(0 0 0 / 0.68);
}

.manual-phone-bind .manual-phone-bind-dismiss:hover {
  background: rgb(0 0 0 / 0.14);
}

.manual-phone-bind .manual-phone-bind-accept {
  background: var(--accent-gradient);
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
}

.manual-phone-bind .manual-phone-bind-accept:hover {
  background: var(--accent-gradient-hover);
  color: #ffffff;
}

.channel-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.messages {
  flex: 1;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 14px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  overscroll-behavior: contain;
  overflow-anchor: none;
}

.chat-history-loader {
  position: sticky;
  top: 8px;
  z-index: 4;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgb(0 0 0 / 0.9);
  background: rgb(255 255 255 / 0.96);
  color: var(--fg-2);
  font-size: 12px;
  box-shadow: 0 8px 18px rgb(0 0 0 / 0.08);
  backdrop-filter: blur(8px);
}

.chat-history-loader .chat-list-loader-ring {
  width: 14px;
  height: 14px;
}

.chat-history-expand {
  position: static;
  margin: 0 auto 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.chat-history-expand-btn {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-1);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.94);
  color: var(--fg-2);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease;
}

.chat-history-expand-btn:hover {
  color: var(--fg);
  border-color: var(--accent);
  background: #fff;
}

.day-divider {
  position: sticky;
  top: 8px;
  z-index: 3;
  align-self: center;
  min-width: 90px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-1);
  background: rgb(255 255 255 / 0.94);
  box-shadow: none;
  backdrop-filter: blur(8px);
  display: inline-flex;
  justify-content: center;
  font-size: var(--text-xs);
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-3);
  margin: var(--space-1) 0;
}

.channel-zone-divider {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 4px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: var(--channel-zone-bg);
  color: var(--channel-zone-color);
  font-size: 12px;
  font-weight: 600;
}

.channel-zone-divider[data-active="true"] {
  box-shadow: none;
}

.channel-zone-divider > span:nth-last-child(2) {
  color: var(--fg-2);
}

.channel-zone-divider .messenger-dot {
  width: 20px;
  height: 20px;
  background: #ffffff !important;
}

.channel-zone-count {
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 500;
}

.channel-zone-empty {
  align-self: center;
  max-width: min(520px, 92%);
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--channel-zone-bg);
  color: var(--fg-2);
  font-size: var(--text-xs);
  line-height: 1.35;
}

.new-messages-divider {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 6px;
  text-align: center;
}

.new-messages-divider::before,
.new-messages-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgb(59 132 236 / 0.24);
}

.new-messages-divider span {
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.msg-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  max-width: min(72%, 760px);
  min-width: 0;
  width: auto;
}

.msg-row[data-channel-zone="true"] {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.msg-row[data-mine="true"] {
  grid-template-columns: 1fr;
  align-self: end;
  justify-items: end;
}

.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
  position: relative;
  width: auto;
}

.msg-row[data-mine="true"] .msg-bubble-wrap {
  align-items: flex-end;
}

.msg-bubble {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  width: auto;
  min-width: 72px;
  max-width: min(100%, 720px);
  padding: 8px 10px;
  border-radius: 2px 8px 8px 8px;
  background: #ffffff;
  border: 0;
  color: var(--fg-0);
  line-height: 1.5;
  box-shadow: none;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-row[data-mine="true"] .msg-bubble {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  border-radius: 8px 2px 8px 8px;
}

.msg-row[data-mine="false"] > .avatar.sm {
  display: none;
}

.msg-bubble-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 3px;
  font-size: var(--text-xs);
  line-height: 1.2;
  color: var(--fg-2);
}

.msg-bubble-author {
  font-weight: 400;
  color: inherit;
}

.msg-reply {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-left: 3px solid rgb(59 132 236 / 0.6);
  border-radius: 8px;
  background: var(--bg-2);
  min-width: 0;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.msg-row[data-mine="false"] .msg-reply {
  background: var(--bg-2);
}

.msg-row[data-mine="true"] .msg-reply {
  background: rgb(255 255 255 / 0.16);
  border-left-color: rgb(255 255 255 / 0.72);
}

.msg-reply:hover {
  background: rgb(255 255 255 / 0.72);
}

.msg-row[data-mine="false"] .msg-reply:hover {
  background: rgb(0 0 0 / 0.08);
}

.msg-reply-author {
  font-size: 12px;
  font-weight: 600;
  color: rgb(45 116 232 / 0.88);
}

.msg-row[data-mine="true"] .msg-reply-author {
  color: rgb(255 255 255 / 0.88);
}

.msg-reply-text {
  font-size: 12px;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-row[data-mine="true"] .msg-reply-text {
  color: rgb(255 255 255 / 0.76);
}

.msg-text {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.unsupported-message-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--fg-1);
}

.unsupported-message-title {
  font-weight: 650;
}

.unsupported-message-copy {
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.35;
}

.unsupported-message-link {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.unsupported-message-link:hover {
  text-decoration: underline;
}

.msg-row-highlight .msg-bubble {
  box-shadow: 0 0 0 2px rgb(59 132 236 / 0.16);
}

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  max-width: 100%;
}

.msg-row[data-mine="true"] .msg-reactions {
  justify-content: flex-end;
}

.msg-reaction {
  min-height: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-1);
  background: rgb(255 255 255 / 0.96);
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  line-height: 1;
  box-shadow: none;
}

.msg-reaction-count {
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 600;
}

.msg-meta {
  display: flex;
  align-items: center;
  align-self: flex-end;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--fg-3);
  line-height: 1;
  white-space: nowrap;
}

.msg-row[data-mine="true"] .msg-meta {
  width: 100%;
  justify-content: flex-end;
  color: rgb(255 255 255 / 0.8);
}

.msg-row[data-mine="false"] .msg-meta {
  margin-left: auto;
}

.msg-send-error {
  max-width: min(100%, 420px);
  margin-top: 6px;
  color: var(--err);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-row[data-mine="true"] .msg-send-error {
  text-align: right;
  justify-content: flex-end;
}

.msg-retry-icon-btn {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  border: 1px solid rgb(220 38 38 / 0.24);
  background: #fff;
  color: var(--err);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msg-retry-icon-btn:hover {
  background: var(--err-soft);
  border-color: rgb(220 38 38 / 0.36);
}

.msg-retry-icon-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.msg-meta-time {
  font-size: 11px;
  line-height: 1;
}

.msg-meta-author {
  flex: 0 0 auto;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
  color: inherit;
}

.msg-meta-status {
  font-size: 11px;
  line-height: 1;
}

.msg-meta-status-failed {
  color: var(--err);
}

.msg-meta-clock {
  width: 14px;
  height: 14px;
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.82;
  flex: 0 0 auto;
}

.msg-meta-clock svg {
  width: 14px;
  height: 14px;
  display: block;
}

.msg-meta-clock path {
  transform-origin: 8px 8px;
  animation: msg-clock-tick 1.1s steps(12, end) infinite;
}

@keyframes msg-clock-tick {
  to {
    transform: rotate(360deg);
  }
}

.msg-meta-checks {
  position: relative;
  display: inline-flex;
  width: 14px;
  height: 10px;
  color: var(--fg-3);
  flex-shrink: 0;
}

.msg-meta-checks[data-tone="accent"] {
  color: currentColor;
}

.msg-meta-check {
  position: absolute;
  width: 5px;
  height: 9px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(38deg);
  top: -1px;
}

.msg-meta-check-first {
  left: 1px;
}

.msg-meta-check-second {
  left: 6px;
}

.msg-meta-checks[data-count="1"] .msg-meta-check-first {
  left: 5px;
}

.msg-actions {
  position: absolute;
  top: 0;
  right: -28px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  padding: 0 0 0 6px;
}

.msg-row[data-mine="true"] .msg-actions {
  top: 2px;
  right: auto;
  left: -28px;
  padding: 0 14px 0 0;
}

.msg-bubble-wrap:hover .msg-actions,
.msg-bubble:hover .msg-actions,
.msg-actions:hover,
.msg-actions[open] {
  opacity: 1;
  pointer-events: auto;
}

.msg-actions-toggle {
  list-style: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  color: rgb(0 0 0 / 0.58);
}

.msg-row[data-mine="true"] .msg-actions-toggle {
  background: var(--accent-gradient);
  color: rgb(255 255 255 / 0.58);
}

.msg-actions-toggle:hover {
  background: #ffffff;
  color: rgb(0 0 0 / 0.72);
}

.msg-row[data-mine="true"] .msg-actions-toggle:hover {
  background: var(--accent-gradient);
  color: rgb(255 255 255 / 0.78);
}

.msg-actions-toggle::-webkit-details-marker {
  display: none;
}

.msg-actions-toggle-icon {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}

.msg-actions-menu {
  position: absolute;
  top: 26px;
  right: 0;
  left: auto;
  min-width: 156px;
  overflow: hidden;
}

.msg-row[data-mine="true"] .msg-actions-menu {
  left: 0;
  right: auto;
}

.msg-actions-item {
  min-height: var(--menu-item-height);
  padding: var(--menu-item-padding);
  text-align: left;
  font-size: 13px;
  color: var(--fg-1);
}

.msg-actions-item-danger {
  color: var(--err);
}

.msg-actions-item-danger:hover,
.msg-actions-item-danger:focus-visible {
  background: var(--menu-item-danger-hover);
  color: var(--err);
}

.message-attachments {
  display: grid;
  gap: 8px;
  width: 100%;
}

.message-file-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  width: min(360px, 62vw);
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 10px;
  overflow: clip;
  background: rgb(255 255 255 / 0.56);
  border: 1px solid rgb(0 0 0 / 0.06);
  text-align: left;
}

.msg-row[data-mine="false"] .message-file-card {
  background: var(--bg-2);
}

.message-attachment-icon {
  width: 38px;
  min-width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.message-attachment-icon .message-attachment-kind,
.message-attachment-icon svg {
  width: 20px;
  height: 20px;
}

.message-attachment-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.message-attachment-kind[data-tone="red"] {
  color: #dc2626;
}

.message-attachment-kind[data-tone="green"] {
  color: #16a34a;
}

.message-attachment-kind[data-tone="violet"] {
  color: var(--accent);
}

.message-attachment-kind[data-tone="yellow"] {
  color: #ca8a04;
}

.message-attachment-kind[data-tone="gray"] {
  color: rgb(0 0 0 / 0.68);
}

.message-attachment-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 0;
}

.message-attachment-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment-meta {
  font-size: 11px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment-open {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.78);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-attachment-open svg {
  width: 15px;
  height: 15px;
}

.msg-row[data-mine="true"] .message-file-card {
  background: rgb(255 255 255 / 0.16);
  border-color: rgb(255 255 255 / 0.18);
}

.msg-row[data-mine="true"] .message-attachment-title {
  color: #ffffff;
}

.msg-row[data-mine="true"] .message-attachment-meta {
  color: rgb(255 255 255 / 0.72);
}

.msg-row[data-mine="true"] .message-attachment-icon {
  border-color: transparent;
}

.msg-row[data-mine="true"] .message-attachment-open {
  background: rgb(255 255 255 / 0.18);
  color: #ffffff;
}

.read-action-wrap {
  display: flex;
  justify-content: flex-start;
  margin-top: 2px;
}

.read-action {
  min-height: 32px;
  padding: 0 8px 0 10px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.read-action-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.composer-wrap {
  border-top: 0;
  padding: 10px;
}

.template-menu {
  position: relative;
  flex: 0 0 auto;
}

.template-menu > summary {
  list-style: none;
}

.template-menu > summary::-webkit-details-marker {
  display: none;
}

.template-menu-trigger svg,
.attachment-menu-trigger svg {
  width: 18px;
  height: 18px;
  display: block;
}

.template-menu-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 45;
  width: min(420px, calc(100vw - 32px));
  max-height: 360px;
  overflow: auto;
  display: none;
}

.template-menu[open] .template-menu-popover {
  display: block;
}

.template-menu-section + .template-menu-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid var(--border-1);
}

.template-menu-title {
  padding: 5px 14px 6px;
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.template-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 8px 14px;
  color: var(--fg-0);
  display: block;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.template-strip {
  display: flex;
  gap: var(--space-1);
  margin-top: 0;
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  padding-bottom: 2px;
  scrollbar-width: none;
}

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

.template-group-switch {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 22px;
  min-height: 36px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-1);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.template-group-switch::-webkit-scrollbar {
  display: none;
}

.template-strip .filter-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.template-strip .filter-chip:hover,
.template-strip .filter-chip[data-active="true"] {
  background: var(--bg-2);
  border-color: transparent;
  box-shadow: none;
  color: var(--accent);
}

.template-strip .filter-chip[data-active="true"] {
  background: var(--accent-soft);
}

.composer-reply {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-1);
  border-radius: 10px;
  background: var(--bg-2);
}

.composer-reply-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-reply-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.composer-reply-text {
  font-size: 12px;
  color: var(--fg-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-reply-close {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--fg-2);
}

.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.composer-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-1);
  background: var(--bg-2);
  max-width: 280px;
}

.composer-attachment-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.composer-attachment-icon svg {
  width: 16px;
  height: 16px;
}

.composer-attachment-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-attachment-kind svg {
  width: 16px;
  height: 16px;
}

.composer-attachment-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.composer-attachment-copy span:first-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-attachment-copy span:last-child {
  font-size: 11px;
  color: var(--fg-3);
}

.composer-attachment-remove {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.composer-file-input {
  display: none !important;
}

.composer-textarea {
  flex: 1;
  min-height: var(--composer-textarea-min-height);
  height: var(--composer-textarea-min-height);
  max-height: calc((16px * 20) + 24px);
  resize: none;
  background: #ffffff;
  color: var(--fg-0);
  line-height: 20px;
  padding: 10px 16px;
  border: 0 !important;
  border-radius: 20px !important;
  font-size: var(--text-sm);
  overflow: hidden;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border-3) transparent;
}

.composer-textarea::-webkit-scrollbar {
  width: 4px;
}

.composer-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.composer-textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border-3);
}

.composer-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--border-2);
}

.composer-btn,
.composer-send,
.composer-channel-btn {
  border-radius: 50%;
}

.attachment-menu {
  position: relative;
  flex: 0 0 auto;
}

.composer-channel-menu {
  position: relative;
  flex: 0 0 auto;
}

.attachment-menu summary {
  list-style: none;
}

.attachment-menu summary::-webkit-details-marker {
  display: none;
}

.attachment-menu-trigger {
  user-select: none;
}

.attachment-menu-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 25;
  min-width: 180px;
  overflow: hidden;
}

.composer-channel-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 26;
  min-width: 220px;
  overflow: hidden;
}

.composer-channel-menu[data-open="true"] .composer-channel-btn {
  background: var(--bg-2);
  color: var(--fg-0);
}

.attachment-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: var(--menu-item-padding);
  color: var(--fg-1);
  font-size: var(--text-sm);
  text-align: left;
  white-space: nowrap;
}

.composer-channel-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 42px;
  width: 100%;
  padding: var(--menu-item-padding);
  border: 0;
  background: transparent;
  color: var(--fg-1);
  font-size: var(--text-sm);
  text-align: left;
}

.composer-channel-group {
  display: grid;
  gap: 0;
}

.composer-channel-group + .composer-channel-group {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid var(--border-1);
}

.composer-channel-group-title {
  padding: 3px 10px 4px;
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.composer-channel-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.composer-channel-option-copy span:first-child {
  font-weight: 600;
}

.composer-channel-option-copy span:last-child {
  color: var(--fg-3);
  font-size: var(--text-xs);
}

.composer-channel-option span:last-child,
.composer-channel-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-channel-option:hover,
.composer-channel-option:focus-visible,
.composer-channel-option[data-active="true"] {
  color: var(--fg-0);
}

.composer-channel-option[data-active="true"] {
  background: var(--menu-item-active);
  font-weight: 650;
}

.attachment-menu-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
}

.attachment-menu-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.composer-btn,
.composer-channel-btn {
  width: var(--composer-control-size);
  height: var(--composer-control-size);
  background: #ffffff;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.composer-channel-btn {
  width: auto;
  min-width: 98px;
  max-width: 150px;
  padding: 0 10px;
  gap: 7px;
  border-radius: 20px;
  color: var(--fg-1);
  font-size: var(--text-sm);
  font-weight: 650;
  justify-content: flex-start;
}

.composer .composer-send {
  width: var(--composer-control-size);
  min-width: var(--composer-control-size);
  height: var(--composer-control-size);
  padding: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--accent-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-btn:disabled,
.composer .composer-send:disabled,
.composer-textarea:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.composer .composer-send svg {
  width: 18px;
  height: 18px;
}

.composer-send.wide {
  width: 100%;
  min-width: 0;
  height: var(--composer-control-size);
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent-gradient);
  font-size: var(--text-sm);
  position: static;
  justify-content: center;
}

.composer-channel {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
  font-size: var(--text-xs);
  color: var(--fg-2);
}

.right-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(360px, 100%);
  border-left: 1px solid var(--border-2);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 180ms ease;
  will-change: transform;
}

.right-panel[data-open="true"] {
  transform: translateX(0);
  box-shadow: -18px 0 40px rgb(0 0 0 / 0.12);
}

.right-panel-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 18px;
  line-height: 1;
}

.right-panel-close:hover {
  background: var(--bg-3);
  color: var(--fg-0);
}

.empty-state {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  color: var(--fg-0);
  font-size: 20px;
}

.empty-state p {
  margin: 0;
  color: var(--fg-2);
  font-size: 14px;
}

.empty-chat-state {
  place-content: center;
  width: 100%;
  min-height: 100%;
  padding: 0;
}

.patient-channel-start {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(560px, 100%);
  margin: 18px auto 0;
}

.patient-channel-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.patient-channel-choice {
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 72px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg-1);
  cursor: pointer;
}

.patient-channel-choice-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.patient-channel-choice-icon .messenger-dot {
  width: 34px;
  height: 34px;
  min-width: 34px;
}

.patient-channel-choice-label {
  max-width: 72px;
  overflow: hidden;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-channel-choice:hover .patient-channel-choice-icon {
  background: var(--bg-2);
}

.patient-channel-choice:hover .patient-channel-choice-label {
  color: var(--fg-0);
}

.remote-modal h2 {
  margin: 0 0 14px;
  color: var(--fg-0);
}

.auth-card.remote-modal {
  width: min(1000px, calc(100vw - 32px));
  position: relative;
}

.auth-card.conversation-modal {
  width: min(500px, calc(100vw - 32px));
}

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

.modal-actions > * {
  width: 100%;
  min-width: 0;
}

.modal-actions .btn-primary.wide,
.modal-actions .btn-secondary.wide,
.modal-actions .btn-subtle.wide,
.modal-actions .btn-danger.wide {
  width: 100%;
  min-width: 0;
}

.modal-actions :where(.btn-secondary, .btn-subtle) {
  order: 1;
}

.modal-actions :where(.btn-primary, .btn-danger) {
  order: 2;
}

.admin-collection {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 5px;
}

.admin-content > .settings-card,
.admin-content > .admin-grid,
.admin-content > .admin-collection {
  margin: 0;
}

.admin-content > .settings-card + .settings-card {
  margin-top: 0;
}

.admin-plus-btn {
  flex: 0 0 36px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 5px;
}

.admin-content .field input,
.admin-content .field textarea,
.admin-content .field select,
.admin-create-modal .field input,
.admin-create-modal .field textarea,
.admin-create-modal .field select {
  min-height: 36px;
  border-color: rgb(0 0 0 / 0.13);
  font-size: 13px;
}

.admin-content .btn-primary,
.admin-content .btn-secondary,
.admin-content .btn-subtle,
.admin-content .btn-danger,
.admin-create-modal .btn-primary,
.admin-create-modal .btn-secondary,
.admin-create-modal .btn-subtle,
.admin-create-modal .btn-danger {
  min-height: 36px;
  font-size: 13px;
  font-weight: 500;
}

.admin-content .btn-secondary:hover,
.admin-create-modal .btn-secondary:hover {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}

.sms-automation-rules {
  align-items: start;
}

.sms-automation-rule {
  display: grid;
  gap: 12px;
}

.sms-automation-rule-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.auth-card.sms-automation-rule-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
}

.sms-automation-rule-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.sms-automation-rule-title-field {
  grid-column: 1 / -1;
}

.sms-automation-template {
  display: grid;
  gap: 6px;
}

.sms-automation-template small {
  color: var(--fg-3);
  font-size: 11px;
}

.sms-automation-log {
  overflow: hidden;
}

.sms-automation-log .admin-table {
  min-width: 760px;
}

.sms-automation-log-toolbar {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sms-automation-log-search {
  width: min(480px, 100%);
}

.sms-automation-log-search .search-icon {
  left: 12px;
}

.sms-automation-log-search .search-input {
  width: 100%;
}

.sms-automation-log-count {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.admin-content table th,
.admin-content table td {
  padding: 10px 8px;
  border-bottom-color: rgb(0 0 0 / 0.13);
  font-size: 13px;
}

.admin-content table th {
  background: rgb(0 0 0 / 0.04);
  color: rgb(0 0 0 / 0.68);
  font-weight: 500;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  font-size: 12px;
  color: var(--fg-3);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-1);
  border-radius: var(--input-radius);
  padding: 0 12px;
  color: var(--fg-0);
  min-height: 40px;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m4.5 7.5 5.5 5 5.5-5' stroke='%2364758B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
}

.field textarea {
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

.template-placeholder-tools {
  display: grid;
  gap: 8px;
  margin: -2px 0 12px;
}

.template-placeholder-title {
  color: #000000;
  font-size: 12px;
  font-weight: 400;
}

.template-placeholder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-placeholder-chip {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgb(0 0 0 / 0.13);
  border-radius: 5px;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.template-placeholder-chip:hover {
  border-color: rgb(0 0 0 / 0.5);
  background: rgb(0 0 0 / 0.04);
}

.broadcast-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
}

.broadcast-meta span {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Channel console: the profile workspace is deliberately operational, not a generic admin form. */
.channel-console-page {
  --console-accent: var(--accent);
  --console-ink: var(--fg-0);
  --console-muted: var(--fg-2);
  --console-line: var(--border-2);
  padding: 0;
}
.channel-console-layout {
  margin: 18px 24px 24px;
}
.channel-console-connected {
  min-width: 0;
}
.channel-console-connected-groups {
  display: grid;
  gap: 16px;
  padding: 0;
}
.channel-console-connected-group {
  border: 1px solid var(--console-line);
  border-radius: 4px;
  overflow: hidden;
}
.channel-console-connected-group-head {
  min-height: 38px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--console-line);
  background: #ffffff;
  color: var(--console-ink);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-radius: 3px 3px 0 0;
}
.channel-console-connected-group-head h4 {
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}
.channel-console-connected-group-head > span {
  color: var(--console-muted);
  font-size: 11px;
  font-weight: 500;
}
.channel-console-connected-group-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.channel-console-connected-group-icon {
  width: 24px;
  height: 24px;
  color: var(--channel-group-color, var(--accent));
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.channel-console-connected-group-icon svg {
  width: 17px;
  height: 17px;
}
.channel-console-connected-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.channel-console-connected-item {
  min-width: 0;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--console-line);
  background: #ffffff;
  color: var(--console-ink);
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-radius: 0;
}
.channel-console-connected-item:hover {
  background: rgb(0 0 0 / 0.04);
}
.channel-console-connected-list > .channel-console-connected-item:last-child {
  border-bottom: 0;
}
.channel-console-connected-status-cell {
  width: 18px;
  display: grid;
  place-items: center;
}
.channel-console-connected-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.channel-console-connected-copy strong,
.channel-console-connected-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-console-connected-copy strong {
  font-size: 13px;
  font-weight: 600;
}
.channel-console-connected-copy small {
  color: var(--console-muted);
  font-size: 11px;
}
.channel-console-connected-state {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.5);
  box-shadow: none;
  display: inline-block;
  flex: 0 0 auto;
}
.channel-console-connected-state[data-tone="success"] {
  background: #16a34a;
}
.channel-console-connected-state[data-tone="warning"] {
  background: #ca8a04;
}
.channel-console-connected-state[data-tone="danger"] {
  background: var(--err);
}
.channel-console-connected-chevron {
  width: 22px;
  height: 22px;
  color: rgb(0 0 0 / 0.68);
  display: grid;
  place-items: center;
  transition: transform 140ms ease;
}
.channel-console-connected-chevron svg {
  width: 15px;
  height: 15px;
  display: block;
}
.channel-console-connected-item:hover .channel-console-connected-chevron {
  color: var(--console-ink);
}
.channel-console-empty {
  min-height: 96px;
  padding: 18px;
  color: var(--console-muted);
  display: flex;
  align-items: center;
  font-size: 13px;
}
.channel-console-profile,
.channel-console-widget {
  border: 1px solid var(--console-line);
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
}
.channel-console-profile {
  overflow: hidden;
}
.channel-console-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.channel-console-section-heading h3,
.channel-console-section-heading p {
  margin: 0;
}
.channel-console-section-heading h3 {
  margin-top: 3px;
  color: var(--console-ink);
  font-size: 18px;
  font-weight: 600;
}
.channel-console-section-heading p {
  margin-top: 5px;
  color: var(--console-muted);
  font-size: 12px;
  line-height: 1.4;
}
.channel-console-eyebrow {
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
}
.channel-console-color-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px auto;
  gap: 8px;
  align-items: end;
}
.channel-console-color-field span {
  grid-column: 1 / -1;
}
.channel-console-color-field input[type="color"] {
  width: 38px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--console-line);
  border-radius: var(--input-radius);
  background: #fff;
  cursor: pointer;
}
.channel-console-color-field output {
  min-height: 38px;
  display: flex;
  align-items: center;
  color: var(--console-muted);
  font-size: 12px;
}
.channel-console-page-nav {
  margin: 10px 0 0;
  display: flex;
  align-items: center;
}
.channel-console-back-button {
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--console-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.channel-console-back-button:hover {
  color: var(--console-ink);
}
.channel-console-back-button svg {
  width: 15px;
  height: 15px;
  display: block;
  transform: rotate(180deg);
}
.channel-console-connection,
.channel-console-site-chat-detail {
  padding: 18px;
}
.channel-console-connection {
  display: grid;
  gap: 10px;
}
.channel-console-connection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.channel-console-connection-head h3 {
  margin: 0;
  color: var(--console-ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  font-weight: 650;
}
.channel-console-head-action {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}
.channel-console-head-action svg {
  width: 14px;
  height: 14px;
  color: currentColor;
  flex: 0 0 auto;
}
.channel-console-head-action.btn-primary {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}
.channel-console-head-action.btn-primary:hover {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}
.channel-console-head-action.btn-secondary {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}
.channel-console-head-action.btn-secondary:hover {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}
.channel-console-connection-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.channel-console-runtime-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.channel-console-auth-state {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgb(0 0 0 / 0.68);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.channel-console-auth-warning-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}
.channel-console-auth-state[data-tone="success"] {
  color: #16a34a;
}
.channel-console-auth-state[data-tone="warning"] {
  color: #ca8a04;
}
.channel-console-auth-state[data-tone="danger"] {
  color: #dc2626;
}
.channel-console-auth-qr {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.channel-console-auth-qr img {
  width: 164px;
  aspect-ratio: 1;
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}
.channel-console-auth-qr ligamed-qr {
  width: 164px;
  height: 164px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  display: block;
}
.channel-console-auth-qr ligamed-qr canvas,
.channel-console-auth-qr ligamed-qr img,
.channel-console-auth-qr ligamed-qr svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.channel-console-auth-qr strong {
  display: block;
  color: var(--console-ink);
  font-size: 13px;
}
.channel-console-auth-qr p,
.channel-console-auth-note {
  margin: 8px 0 0;
  color: var(--console-muted);
  font-size: 12px;
  line-height: 1.45;
}
.channel-console-auth-qr .btn-secondary {
  margin-top: 12px;
}
.channel-console-auth-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.channel-console-auth-fields > .field:only-child {
  grid-column: 1 / -1;
}
.channel-auth-modal {
  width: min(560px, calc(100vw - 32px));
  padding: 18px;
  display: grid;
  gap: 14px;
}
.channel-auth-modal-waha {
  width: min(560px, calc(100vw - 32px));
  min-height: 280px;
  place-content: center;
}
.channel-auth-modal-waha .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}
.channel-auth-modal-waha .channel-auth-modal-body {
  place-items: center;
}
.channel-auth-modal-waha .channel-console-auth-qr {
  display: grid;
  grid-template-columns: minmax(0, 230px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}
.channel-auth-modal-waha .channel-console-auth-qr img {
  width: min(230px, calc(100vw - 86px));
  border-radius: 6px;
}
.channel-auth-qr-hint {
  color: var(--console-ink);
}
.channel-auth-qr-hint strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.channel-auth-qr-hint p {
  margin: 7px 0 0;
  color: var(--console-muted);
  font-size: 12px;
  line-height: 1.5;
}
.channel-auth-loader {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
.channel-auth-loader span {
  width: 24px;
  height: 24px;
  border: 2px solid rgb(0 0 0 / 0.13);
  border-top-color: var(--nav-bg);
  border-radius: 50%;
  animation: channel-auth-spin 0.72s linear infinite;
}
@keyframes channel-auth-spin {
  to {
    transform: rotate(360deg);
  }
}
.channel-auth-modal-body {
  display: grid;
  gap: 14px;
}
.telegram-auth-methods-head strong,
.telegram-auth-unavailable strong {
  color: var(--console-ink);
  font-size: 16px;
}
.telegram-auth-methods-head p,
.telegram-auth-unavailable p {
  margin: 6px 0 0;
  color: var(--console-muted);
  font-size: 13px;
  line-height: 1.5;
}
.telegram-auth-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.telegram-auth-method {
  min-height: 142px;
  padding: 16px;
  border: 1px solid var(--console-line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--console-ink);
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.telegram-auth-method:hover {
  border-color: #009bde;
  box-shadow: 0 8px 24px rgb(0 155 222 / 0.12);
  transform: translateY(-1px);
}
.telegram-auth-method:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}
.telegram-auth-method-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f6fc;
  color: #0088cc;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.telegram-auth-method-icon-qr {
  font-size: 25px;
  line-height: 1;
}
.telegram-auth-method strong {
  font-size: 13px;
}
.telegram-auth-method small {
  color: var(--console-muted);
  font-size: 11px;
  line-height: 1.4;
}
.telegram-qr-auth .channel-auth-loader {
  min-height: 164px;
  margin: 0 auto;
}
.telegram-auth-unavailable code {
  font-size: 12px;
}
.channel-auth-modal .modal-actions {
  margin: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.channel-create-modal {
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
  display: grid;
  gap: 14px;
}

.channel-create-select-form {
  display: grid;
  gap: 14px;
}

.channel-create-select-form .modal-actions {
  margin: 0;
}
.channel-create-modal-head {
  padding-right: 34px;
  display: grid;
  gap: 4px;
}
.channel-create-modal-head h2,
.channel-create-modal-head p {
  margin: 0;
}
.channel-create-modal-head h2 {
  color: var(--fg-0);
  font-size: 18px;
  font-weight: 650;
}
.channel-create-modal-head p {
  color: var(--console-muted);
  font-size: 12px;
}
.channel-console-meta {
  margin: 0;
  padding: 0;
  border-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 18px;
}
.channel-console-meta div,
.channel-console-meta dt,
.channel-console-meta dd {
  min-width: 0;
}
.channel-console-meta dt {
  margin: 0 0 4px;
  color: var(--console-muted);
  font-size: 11px;
  font-weight: 500;
}
.channel-console-meta dd {
  margin: 0;
  color: var(--console-ink);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.channel-console-meta dd .admin-actions-menu {
  margin-left: auto;
}

.channel-console-profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--console-line);
}

.channel-console-profile-actions {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 9px;
}

.channel-console-profile-actions > span {
  color: var(--console-muted);
  font-size: 11px;
  font-weight: 500;
}

.channel-console-text-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg-0);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.channel-console-text-action-danger {
  color: var(--err);
}

.channel-console-instructions {
  padding: 18px;
}

.channel-console-instructions-head {
  display: flex;
  align-items: center;
}

.channel-console-instructions h3 {
  margin: 0;
  color: var(--fg-0);
  font-size: 14px;
  font-weight: 650;
}

.channel-console-instructions ol {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.55;
}
.channel-console-meta dd > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-console-name-editor {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.channel-console-name-editor input {
  width: min(220px, 100%);
  min-width: 120px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--console-line);
  border-radius: 6px;
  background: #fff;
  color: var(--console-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}
.channel-console-name-editor input:focus {
  border-color: rgb(59 132 236 / 0.28);
  box-shadow: 0 0 0 2px rgb(59 132 236 / 0.08);
}
.channel-console-name-action {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--console-muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.channel-console-name-action:hover {
  background: rgb(0 0 0 / 0.04);
  color: var(--console-ink);
}
.channel-console-name-action svg {
  width: 15px;
  height: 15px;
  display: block;
}
.channel-console-widget {
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
}
.channel-console-widget-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
}
.channel-console-widget-form {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--console-line);
}
.channel-console-widget-section + .channel-console-widget-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 0;
}
.channel-console-widget-section h4,
.channel-console-widget-install h4 {
  margin: 0;
  color: var(--console-ink);
  font-size: 13px;
  font-weight: 700;
}
.channel-console-widget-section > h4 {
  margin: 0 0 12px;
}
.channel-console-widget-channel-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--console-line);
}
.channel-console-widget-channel {
  min-height: 40px;
  padding: 0 2px;
  border-bottom: 1px solid var(--console-line);
  display: flex;
  align-items: center;
  color: var(--console-muted);
  font-size: 12px;
}
.channel-console-widget-channel[data-active="true"] {
  color: var(--console-ink);
}
.channel-console-widget-channel > label {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.channel-console-widget-channel input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--console-accent);
}
.channel-console-widget-channel-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  color: var(--widget-channel-color);
}
.channel-console-widget-channel-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.channel-console-widget-channel-order {
  display: flex;
  align-items: center;
  gap: 2px;
}
.channel-console-widget-channel-order button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--console-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.channel-console-widget-channel-order button:hover:not(:disabled) {
  color: var(--console-ink);
}
.channel-console-widget-channel-order button:disabled {
  opacity: .28;
  cursor: default;
}
.channel-console-widget-channel-order svg {
  width: 16px;
  height: 16px;
}
.channel-console-widget-install p {
  margin: 4px 0 0;
  color: var(--console-muted);
  font-size: 12px;
  line-height: 1.45;
}
.channel-console-widget-form .field {
  margin: 0 0 14px;
}
.channel-console-widget-form .field input,
.channel-console-widget-form .field select,
.channel-console-widget-form .field textarea {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
}
.channel-console-widget-form .field textarea {
  min-height: 78px;
  padding-top: 9px;
  resize: vertical;
}
.channel-console-position {
  margin: 0;
  padding: 0;
  border: 0;
}
.channel-console-position legend {
  margin-bottom: 8px;
  color: var(--console-muted);
  font-size: 12px;
}
.channel-console-position-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.channel-console-position-options label {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--console-line);
  color: var(--console-muted);
  font-size: 12px;
  cursor: pointer;
}
.channel-console-position-options label + label {
  margin-left: -1px;
}
.channel-console-position-options label:first-child {
  border-radius: 7px 0 0 7px;
}
.channel-console-position-options label:last-child {
  border-radius: 0 7px 7px 0;
}
.channel-console-position-options label[data-active="true"] {
  position: relative;
  z-index: 1;
  border-color: var(--console-accent);
  background: #ffffff;
  color: var(--console-ink);
  font-weight: 700;
}
.channel-console-position-options input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--console-accent);
}
.channel-console-widget-actions {
  display: flex;
  width: 100%;
  padding: 0;
}
.channel-console-widget-actions .channel-console-widget-save {
  width: 100%;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--accent-gradient);
  border-color: var(--accent);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}
.channel-console-widget-actions .channel-console-widget-save:hover {
  background: var(--accent-gradient-hover);
  border-color: var(--accent);
  opacity: 1;
}
.channel-console-widget-side {
  min-width: 0;
  padding: 20px;
  background: #ffffff;
}
.channel-console-widget-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.channel-console-widget-preview-head h4 {
  margin: 0;
  color: var(--console-ink);
  font-size: 13px;
  font-weight: 700;
}
.channel-console-widget-preview-head span {
  color: var(--console-muted);
  font-size: 11px;
}
.channel-console-widget-preview {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--console-line);
  background: rgb(0 0 0 / 0.04);
}
.channel-console-widget-preview-page {
  position: absolute;
  inset: 24px 22px auto;
  height: 8px;
  background: rgb(0 0 0 / 0.13);
  box-shadow: 0 22px 0 rgb(0 0 0 / 0.04), 0 44px 0 rgb(0 0 0 / 0.04), 0 66px 0 rgb(0 0 0 / 0.04);
}
.channel-console-widget-preview-card {
  position: absolute;
  right: 18px;
  bottom: 54px;
  width: min(250px, calc(100% - 36px));
  border: 1px solid var(--console-line);
  background: #ffffff;
}
.channel-console-widget-preview[data-widget-preview-position="left"] .channel-console-widget-preview-card {
  right: auto;
  left: 18px;
}
.channel-console-widget-preview-bar {
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--widget-color);
  color: #ffffff;
  font-size: 12px;
}
.channel-console-widget-preview-card p {
  min-height: 48px;
  margin: 0;
  padding: 12px;
  color: var(--console-ink);
  font-size: 12px;
  line-height: 1.4;
}
.channel-console-widget-preview-input {
  margin: 0 12px 12px;
  padding: 9px 10px;
  border: 1px solid var(--console-line);
  color: var(--console-muted);
  font-size: 11px;
}
.channel-console-widget-preview-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 12px 10px;
}
.channel-console-widget-preview-channels span {
  padding: 3px 6px;
  border: 1px solid var(--console-line);
  color: var(--console-muted);
  font-size: 10px;
}
.channel-console-widget-preview-launcher {
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--widget-color);
  color: #fff;
}
.channel-console-widget-preview-launcher svg {
  width: 30px;
  height: 30px;
  display: block;
}
.channel-console-widget-preview-launcher[data-widget-preview-position="left"] {
  right: auto;
  left: 18px;
}
.channel-console-widget-install {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 0;
}
.channel-console-widget-install-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.copy-icon-button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-2);
  display: inline-grid;
  place-items: center;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.copy-icon-button svg {
  width: 17px;
  height: 17px;
  display: block;
}

.copy-icon-button:hover,
.copy-icon-button:focus-visible {
  border: 0;
  outline: none;
  background: rgb(0 0 0 / 0.055);
  color: var(--fg-0);
}

.channel-console-copy-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.channel-console-copy-button:hover {
  border: 0;
}
.channel-console-code {
  width: 100%;
  min-height: 156px;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--console-line);
  border-radius: 0;
  background: #ffffff;
  color: #000000;
  font-size: 11px;
  line-height: 1.45;
  resize: vertical;
}
@media (max-width: 1100px) {
  .channel-console-layout {
    margin-inline: 16px;
  }
}
@media (max-width: 820px) {
  .channel-console-layout {
    margin: 12px;
  }
}
@media (max-width: 640px) {
  .channel-console-connection-head {
    align-items: flex-start;
  }
  .channel-console-head-action {
    padding-inline: 11px;
  }
  .channel-console-auth-qr {
    grid-template-columns: minmax(0, 1fr);
  }
  .channel-console-auth-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .telegram-auth-method-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .channel-console-auth-qr img {
    width: min(180px, 100%);
  }
  .channel-console-auth-qr ligamed-qr {
    width: min(180px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
  .channel-auth-modal-waha .channel-console-auth-qr {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 14px;
    text-align: center;
  }
  .channel-console-meta {
    grid-template-columns: minmax(0, 1fr);
  }
  .channel-console-profile-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .channel-console-connected-item {
    grid-template-columns: 18px minmax(0, 1fr) 20px;
  }
  .channel-console-connected-state {
    grid-column: 2;
    justify-self: start;
  }
  .channel-console-connected-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
  .channel-console-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .channel-console-widget-layout {
    grid-template-columns: 1fr;
  }
  .channel-console-widget-form {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--console-line);
  }
  .channel-console-widget-side {
    padding: 18px;
  }
}

/* Administration pages share one compact business-console layout. */
.admin-shell {
  grid-template-columns: minmax(0, 640px) minmax(248px, 304px);
  grid-auto-rows: min-content;
  height: 100%;
  align-content: start;
  justify-content: start;
  gap: 20px;
  overflow: auto;
  background: var(--bg-0);
}

.admin-shell[data-admin-tab="remote"] {
  grid-template-columns: minmax(0, 720px);
}

.admin-shell[data-admin-tab="remote"][data-channel-view="detail"] {
  grid-template-columns: minmax(0, 640px) minmax(248px, 304px);
}

.admin-shell[data-admin-tab="smsAutomationLog"] {
  grid-template-columns: minmax(0, 960px);
}

.admin-shell > .admin-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 16px;
  overflow: visible;
  background: transparent;
}

.admin-shell > .admin-context {
  min-width: 0;
}

.admin-shell .channel-console-instructions-context {
  padding-top: 0;
}

.admin-shell .channel-console-widget-context .channel-console-widget-side {
  padding: 16px;
}

.admin-shell .channel-console-widget-context .channel-console-widget-preview {
  min-height: 300px;
}

.admin-shell .admin-header,
.admin-shell .admin-content > .admin-header {
  min-height: 0;
  margin: 0;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-shell .admin-header-copy {
  min-width: 0;
  display: grid;
}

.admin-shell .admin-header h2 {
  margin: 0;
  color: var(--fg-0);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.admin-shell .admin-header-description {
  margin: 0;
  max-width: 540px;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.4;
}

.admin-shell .channel-console-detail-header {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  column-gap: 10px;
  text-align: left;
}

.admin-shell .admin-content > .channel-console-detail-header {
  display: grid;
  justify-content: normal;
  justify-items: start;
  padding-left: 5px;
}

.admin-shell .channel-console-detail-header .admin-header-copy {
  justify-self: start;
  text-align: left;
}

.channel-console-detail-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-console-detail-title .channel-console-name-editor input {
  width: min(300px, 42vw);
  min-width: 180px;
  height: 32px;
  font-size: 16px;
  font-weight: 650;
}

.channel-console-detail-title .channel-console-name-action {
  width: 28px;
  min-width: 28px;
  height: 28px;
}

.channel-console-detail-title .channel-console-name-action svg {
  width: 17px;
  height: 17px;
}

.channel-console-detail-edit {
  width: 24px;
  height: 24px;
  padding: 3px;
  flex: 0 0 24px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  display: grid;
  place-items: center;
}

.channel-console-detail-edit:hover,
.channel-console-detail-edit:focus-visible {
  background: transparent;
  color: var(--fg-0);
  outline: none;
}

.channel-console-detail-edit svg {
  width: 17px;
  height: 17px;
  display: block;
}

.channel-console-detail-icon {
  width: 40px;
  height: 44px;
  flex: 0 0 40px;
  color: var(--channel-detail-color, var(--accent));
  display: grid;
  place-items: center;
}

.channel-console-detail-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

.admin-shell .settings-card,
.admin-shell .stat-card,
.admin-shell .template-card,
.admin-shell .channel-console-connected-group,
.admin-shell .channel-console-profile,
.admin-shell .channel-console-widget,
.admin-shell .auth-card,
.admin-context-card {
  border: 1px solid rgb(0 0 0 / 0.08);
  border-radius: 14px;
  background: var(--bg-1);
  box-shadow: none;
}

.admin-shell .settings-card,
.admin-shell .stat-card {
  padding: 18px;
}

.admin-shell .admin-collection {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.admin-shell .admin-grid,
.admin-shell .analytics-grid,
.admin-shell .stats-grid {
  gap: 14px;
}

.admin-shell .field {
  gap: 5px;
  margin-bottom: 10px;
}

.admin-shell .field > span,
.admin-shell .field > label,
.admin-shell .field legend {
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 500;
}

.admin-shell .field input,
.admin-shell .field textarea,
.admin-shell .field select {
  min-height: 34px;
  border: 1px solid rgb(0 0 0 / 0.13);
  border-radius: 7px;
  background: #ffffff;
  color: var(--fg-0);
  font-size: 12px;
}

.admin-shell .field textarea {
  min-height: 88px;
}

.admin-shell :where(.btn-primary, .btn-secondary, .btn-subtle, .btn-danger) {
  min-height: 32px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

.admin-shell .channel-console-head-action {
  min-height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.admin-shell .admin-plus-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  flex-basis: 32px;
  border-radius: 50%;
}

.admin-shell .admin-table-wrap {
  overflow-x: auto;
}

.admin-shell .admin-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.admin-shell .admin-table th,
.admin-shell .admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgb(0 0 0 / 0.08);
  background: transparent;
  color: var(--fg-1);
  font-size: 12px;
  text-align: left;
}

.admin-shell .admin-table th {
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 600;
}

.admin-shell .admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-section-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-section-title h3,
.admin-empty-state h3,
.admin-context-card h3,
.admin-note-card h3 {
  margin: 0;
  color: var(--fg-0);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.admin-section-title p,
.admin-empty-state p,
.admin-context-card p,
.admin-note-card p {
  margin: 5px 0 0;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.45;
}

.admin-section-title > span {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.admin-empty-state,
.admin-note-card {
  min-height: 124px;
  display: grid;
  align-content: center;
}

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

.admin-readonly-grid > div {
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgb(0 0 0 / 0.08);
  border-radius: 7px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.admin-readonly-grid span {
  color: var(--fg-2);
  font-size: 11px;
}

.admin-readonly-grid strong {
  color: var(--fg-0);
  font-size: 12px;
  font-weight: 600;
}

.admin-context-card {
  padding: 16px;
}

.sms-automation-context {
  display: grid;
  align-content: start;
  gap: 12px;
}

.admin-context-link-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  color: var(--fg-0);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.admin-context-link-card:hover {
  background: var(--system-surface-hover, #f7f7f7);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.055);
}

.admin-context-link-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.admin-context-link-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.admin-context-link-copy small {
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.45;
}

.admin-context-link-card > svg {
  width: 18px;
  height: 18px;
  color: var(--fg-3);
  transition: transform 140ms ease, color 140ms ease;
}

.admin-context-link-card:hover > svg {
  color: var(--fg-0);
  transform: translateX(2px);
}

.sms-automation-log-nav {
  min-height: 24px;
}

.admin-shell .channel-console-page {
  padding: 0;
}

.admin-shell .channel-console-layout {
  margin: 0;
}

.admin-shell .channel-console-widget-form,
.admin-shell .channel-console-widget-side {
  padding: 18px;
}

.admin-shell .channel-console-widget-layout {
  grid-template-columns: minmax(0, 1fr);
}

.admin-shell .channel-console-widget {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.admin-shell .channel-console-widget-form {
  border-right: 0;
  border-bottom: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.admin-shell .channel-console-widget-section,
.admin-shell .channel-console-widget-install {
  margin: 0;
  padding: 16px;
  border: 1px solid rgb(0 0 0 / 0.08);
  border-radius: 14px;
  background: var(--bg-1);
}

.admin-shell .channel-console-widget-section + .channel-console-widget-section {
  margin: 0;
  padding-top: 16px;
}

.admin-shell .channel-console-widget-preview {
  min-height: 220px;
}

.admin-shell .channel-console-widget-install {
  display: none;
}

.admin-shell .channel-console-widget-page .channel-console-widget-install {
  display: block;
}

@media (max-width: 1120px) {
  .admin-shell {
    grid-template-columns: minmax(0, 640px);
    padding: 18px;
  }

  .admin-shell > .admin-context {
    display: none;
  }
}

@media (max-width: 640px) {
  .admin-shell {
    gap: 14px;
    padding: 14px 12px 24px;
  }

  .admin-shell .admin-header h2 {
    font-size: 18px;
  }

  .admin-shell .admin-readonly-grid {
    grid-template-columns: 1fr;
  }
}

.admin-runtime-btn {
  min-height: 32px;
  min-width: 0;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
}

.template-card {
  display: grid;
  gap: 10px;
}

.template-group-stack {
  display: grid;
  gap: 16px;
}

.template-group-section {
  display: grid;
  gap: 10px;
}

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

.template-group-header h3 {
  margin: 0;
  color: var(--fg-0);
  font-size: 14px;
}

.template-group-header span {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 0;
  background: rgb(0 0 0 / 0.04);
  color: var(--fg-3);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

.admin-item-card {
  align-content: start;
}

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

.admin-card-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.admin-actions-menu {
  position: relative;
  flex: 0 0 auto;
}

.admin-actions-menu > summary::-webkit-details-marker {
  display: none;
}

.admin-actions-menu-trigger {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  cursor: pointer;
}

.admin-actions-menu-trigger:hover,
.admin-actions-menu[open] > .admin-actions-menu-trigger {
  background: transparent;
  color: #000000;
}

.admin-actions-menu-trigger svg {
  width: 17px;
  height: 17px;
  display: block;
  transform: rotate(90deg);
}

.admin-actions-menu-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  min-width: 150px;
  overflow: hidden;
}

.admin-actions-menu-popover button {
  width: 100%;
  min-height: var(--menu-item-height);
  padding: var(--menu-item-padding);
  border: 0;
  background: transparent;
  color: var(--fg-0);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.admin-actions-menu-popover .admin-actions-menu-danger {
  color: var(--err);
}

.admin-actions-menu-popover .admin-actions-menu-danger:hover,
.admin-actions-menu-popover .admin-actions-menu-danger:focus-visible {
  background: var(--menu-item-danger-hover);
  color: var(--err);
}

.admin-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-card-meta span {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgb(0 0 0 / 0.04);
  color: var(--fg-1);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-table {
  table-layout: fixed;
}

.admin-table-actions-col {
  width: 72px;
}

.admin-table-tools {
  justify-content: flex-end;
}

.manager-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.manager-avatar {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--fg-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.manager-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.manager-copy strong {
  color: var(--fg-0);
  font-size: 13px;
}

.manager-copy span {
  color: var(--fg-3);
  font-size: 12px;
}

.admin-inline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-inline-chips span,
.admin-table-status {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgb(0 0 0 / 0.04);
  color: var(--fg-1);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

.admin-table-status[data-tone="success"] {
  background: var(--ok-soft);
  color: #16a34a;
}

.admin-table-status[data-tone="muted"] {
  color: var(--fg-3);
}

.manager-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.manager-channel-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.manager-channel-option {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid rgb(0 0 0 / 0.13);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-1);
  font-size: 13px;
}

.manager-channel-option input {
  flex: 0 0 14px;
}

.auth-card.admin-create-modal {
  width: min(560px, calc(100vw - 32px));
  position: relative;
}

.admin-shell .auth-card.remote-modal {
  background: #ffffff;
}

.admin-shell .modal-close {
  border-radius: 7px;
}

.auto-reply-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 0 12px;
}

.auth-role {
  justify-content: center;
  min-height: 40px;
  border-radius: 7px;
}

.admin-content
  > :where(
    .admin-header,
    .settings-card,
    .admin-grid,
    .admin-collection,
    .stats-grid
  ) {
  margin: 0;
}

.template-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-0);
}

.template-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-2);
}

.panel-hero {
  padding: var(--space-4) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-1);
}

.h-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--fg-0);
  margin-top: 14px;
  letter-spacing: -0.02em;
}

.h-sub {
  color: var(--fg-3);
  font-size: var(--text-sm);
  margin-top: 4px;
}

.quick-actions {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-2);
}

.panel-section {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-1);
}

.panel-section h4,
.settings-card h3 {
  margin: 0 0 12px;
  color: var(--fg-0);
}

.panel-label {
  color: var(--fg-3);
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--text-xs);
  margin-bottom: 6px;
}

.info-row,
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-1);
}

.info-row:last-child,
.activity-item:last-child {
  border-bottom: 0;
}

.k {
  color: var(--fg-3);
  font-size: var(--text-sm);
}

.v {
  color: var(--fg-1);
  font-size: var(--text-sm);
  text-align: right;
}

.phone-display {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 12px;
  background: rgb(0 0 0 / 0.03);
  border-radius: var(--r-sm);
  letter-spacing: 0.5px;
}

.copy-phone-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.copy-phone-btn:hover {
  background: rgb(0 0 0 / 0.055);
}

.a-text {
  font-size: var(--text-sm);
  line-height: 1.5;
}

.stat-card {
  padding: var(--space-3);
  border-radius: 10px;
  border: 1px solid var(--border-1);
  background: #ffffff;
  box-shadow: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.stat-card strong {
  display: block;
  margin-top: var(--space-1);
  font-size: 28px;
  color: var(--fg-0);
}

.analytics-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.admin-empty-cell {
  display: block;
  padding: 10px 0;
  color: var(--fg-3);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: var(--space-2) 6px;
  border-bottom: 1px solid var(--border-1);
  font-size: var(--text-sm);
}

th {
  color: var(--fg-3);
  font-weight: 500;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.18);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 40;
}

.auth-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: rgb(255 255 255 / 0.98);
  box-shadow: var(--shadow-md);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 24px;
  min-width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #000000;
  font-size: 0;
  line-height: 1;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 1px;
  border-radius: 999px;
  background: currentColor;
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.modal-close:hover {
  background: transparent;
  color: #000000;
}

.auth-card,
.auth-card.conversation-modal {
  border: 0;
  border-radius: 5px;
}

.auth-card
  :where(.btn-primary, .btn-secondary, .btn-subtle, .btn-danger, .auth-role),
.admin-create-modal
  :where(.btn-primary, .btn-secondary, .btn-subtle, .btn-danger) {
  border-radius: 999px;
}

@media (max-width: 900px) {
  .auth-card.remote-modal {
    width: min(640px, calc(100vw - 24px));
  }

  .auth-card.conversation-modal {
    width: min(500px, calc(100vw - 24px));
  }

  .admin-runtime-btn {
    flex: 0 0 auto;
  }

  .auto-reply-rule-grid,
  .sms-automation-rule-modal-grid,
  .manager-modal-grid,
  .manager-channel-list {
    grid-template-columns: 1fr;
  }
}

.auth-card h1 {
  margin: 0 0 10px;
  color: var(--fg-0);
  font-size: 26px;
}

.auth-card p {
  color: var(--fg-2);
  line-height: 1.6;
}

.auth-actions {
  display: grid;
  gap: var(--space-2);
  margin-top: 22px;
}

.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #f2f2f2;
}

.auth-page-form-pane {
  width: min(380px, 100%);
  padding: 30px;
  border: 0;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.025);
}

.auth-page-form-wrap {
  width: 100%;
  display: grid;
  gap: 20px;
}

.auth-page-heading {
  display: grid;
  gap: 5px;
}

.auth-page-heading h1 {
  margin: 0;
  color: #171717;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-page-heading p {
  margin: 0;
  color: rgb(0 0 0 / 0.68);
  font-size: 13px;
  line-height: 1.4;
}

.auth-page-form {
  display: grid;
  gap: 14px;
}

.auth-page-form .field {
  gap: 7px;
}

.auth-page-form .field > span {
  color: #777777;
  font-size: 12px;
  font-weight: 500;
}

.auth-page-form input {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f5f5f5;
  color: #171717;
  font-size: 13px;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.auth-page-form input::placeholder {
  color: #8a8a8a;
}

.auth-page-form input:hover {
  background: #ededed;
}

.auth-page-form input:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgb(59 132 236 / 0.12);
}

.auth-page-submit {
  min-height: 42px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: var(--accent-shadow);
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.auth-page-submit:hover {
  background: var(--accent-gradient-hover);
  box-shadow: 0 6px 16px rgb(67 163 251 / 0.22);
  transform: translateY(-1px);
}

.auth-page-submit:active {
  box-shadow: var(--accent-shadow);
  transform: translateY(0);
}

.auth-page-signup {
  margin: 0;
  color: #8a8a8a;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 560px) {
  .auth-page {
    padding: 16px;
  }

  .auth-page-form-pane {
    padding: 26px 22px;
    border-radius: 24px;
  }
}

.toast-stack {
  position: fixed;
  right: 18px;
  top: 18px;
  display: grid;
  gap: 8px;
  z-index: 50;
}

.toast {
  position: relative;
  width: min(352px, calc(100vw - 24px));
  padding: 12px 38px 12px 28px;
  border: 1px solid rgb(0 0 0 / 0.08);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.14);
  overflow: hidden;
  animation: toast-enter-right 180ms ease-out both;
}

.toast::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
}

.toast[data-tone="incoming"]::before {
  background: var(--accent-gradient);
}

.toast[data-tone="new-request"]::before {
  background: var(--accent-gradient);
}

@keyframes toast-enter-right {
  from {
    opacity: 0;
    transform: translateX(calc(100% + 24px));
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast[data-tone="warn"]::before {
  background: #ca8a04;
}

.toast[data-tone="err"]::before {
  background: #dc2626;
}

.toast strong {
  display: block;
  color: var(--fg-0);
  margin-bottom: 3px;
  padding-right: 8px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 650;
}

.toast span {
  color: var(--fg-2);
  font-size: 12px;
  line-height: 17px;
  display: block;
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.toast-close:hover {
  background: var(--bg-2);
  color: var(--fg-0);
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
}

.media-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: rgb(0 0 0 / 0.76);
}

.media-viewer-card {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: min(92vw, 980px);
  max-height: 92vh;
  display: grid;
  gap: 10px;
}

.media-viewer-head {
  height: 36px;
  padding: 0 4px 0 12px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.96);
  color: var(--fg-0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
}

.media-viewer-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--fg-2);
  font-size: 20px;
  line-height: 1;
}

.media-viewer-image,
.media-viewer-video {
  display: block;
  max-width: min(92vw, 980px);
  max-height: calc(92vh - 46px);
  border-radius: 10px;
  background: #000000;
  object-fit: contain;
}

.popover {
  position: absolute;
  top: 46px;
  right: 0;
  width: 340px;
  background: var(--menu-surface);
  border: 0;
  border-radius: var(--menu-radius);
  box-shadow: var(--menu-shadow);
  padding: 0;
}

.popover .activity-item {
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid rgb(0 0 0 / 0.06);
}

.popover .activity-item:last-child {
  border-bottom: 0;
}

.popover .a-text strong {
  color: var(--fg-0);
}

.popover .a-time {
  color: var(--fg-3);
  white-space: nowrap;
}

.icon-btn:hover,
.settings-btn:hover,
.filter-chip:hover,
.btn-secondary:hover,
.btn-subtle:hover {
  background: var(--bg-2);
  border-color: var(--border-2);
  color: var(--fg-0);
}

.plus-btn:hover,
.composer-send:hover,
.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--accent-shadow);
  transform: none;
  opacity: 1;
}

.btn-danger:hover {
  background: var(--err-soft);
  border-color: rgb(220 38 38 / 0.24);
  color: var(--err);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.leads-main {
  --lead-control-height: 32px;
  --lead-control-radius: 999px;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--bg-1);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

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

.lead-detail-head h2 {
  margin: 2px 0 0;
  color: var(--fg-0);
  font-size: 18px;
  line-height: 1.15;
}

.lead-muted {
  color: var(--fg-2);
  font-size: 12px;
}

.lead-filter-panel {
  display: grid;
  gap: 6px;
}

.lead-funnel-controls {
  padding: 20px;
  border-bottom: 1px solid var(--border-1);
  background: #ffffff;
  display: grid;
  gap: 6px;
}

.lead-funnel-search-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.lead-funnel-search {
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.lead-create-btn {
  width: var(--lead-control-height);
  height: var(--lead-control-height);
  flex: 0 0 var(--lead-control-height);
  min-height: var(--lead-control-height);
  margin-right: 2px;
  padding: 0;
  border-radius: 50%;
}

.lead-create-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.lead-funnel-search .search-input {
  height: var(--lead-control-height);
  padding: 0 34px 0 34px;
  font-size: 12px;
  background: var(--bg-2);
}

.lead-funnel-search .search-icon {
  left: 50px;
}

.lead-filter-dropdown {
  position: relative;
}

.lead-filter-dropdown summary {
  list-style: none;
}

.lead-filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.lead-filter-trigger {
  width: var(--lead-control-height);
  min-width: var(--lead-control-height);
  height: var(--lead-control-height);
  min-height: var(--lead-control-height);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.lead-filter-trigger svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.lead-filter-trigger:hover,
.lead-filter-dropdown[open] .lead-filter-trigger {
  background: var(--bg-2) !important;
}

.lead-filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 9;
  width: min(720px, calc(100vw - 360px));
  min-width: 560px;
  padding: 10px;
  border-radius: var(--menu-radius);
  border: 1px solid var(--menu-border);
  background: var(--menu-surface);
  box-shadow: var(--menu-shadow);
}

.lead-funnel-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.lead-found-count {
  height: var(--lead-control-height);
  min-height: var(--lead-control-height);
  padding: 0 9px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.lead-quick-filters,
.lead-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead-chip,
.lead-view-btn,
.lead-tag {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border-1);
  background: #ffffff;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.lead-view-switch .lead-view-btn {
  border-color: transparent;
  background: transparent;
  width: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 12px;
}

.lead-view-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.lead-chip[data-active="true"],
.lead-view-btn[data-active="true"] {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
}

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

.lead-funnel-controls .lead-filter-grid {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
}

.lead-funnel-controls .chat-filter-field {
  gap: 3px;
}

.lead-funnel-controls .chat-filter-field span {
  font-size: 9px;
}

.lead-funnel-controls .chat-filter-field input,
.lead-funnel-controls .chat-filter-field select {
  min-height: 30px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 11px;
}

.lead-empty-state {
  align-self: center;
  justify-self: center;
  width: min(360px, calc(100% - 28px));
  min-height: 240px;
  padding: 26px 24px;
  border: 1px solid var(--border-1);
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 10%, rgb(80 169 248 / 0.12), transparent 34%),
    #ffffff;
  color: var(--fg-1);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.lead-empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lead-empty-icon svg {
  width: 24px;
  height: 24px;
}

.lead-empty-state strong {
  color: var(--fg-0);
  font-size: 16px;
  line-height: 1.2;
}

.lead-empty-state span {
  max-width: 260px;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 1.45;
}

.lead-empty-action {
  min-height: 32px;
  margin-top: 4px;
  padding: 0 14px;
  border-radius: 999px;
}

.lead-card-head,
.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.lead-card-head strong {
  min-width: 0;
  color: var(--fg-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-subject,
.lead-card-text,
.lead-card-footer {
  color: var(--fg-2);
  font-size: 12px;
}

.lead-type {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.lead-type[data-type="повторная"] {
  background: transparent;
  color: #16a34a;
}

.lead-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.lead-detail-head {
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lead-detail-head {
  min-height: var(--surface-toolbar-height);
  padding: 0 0 0 20px;
  border-bottom: 1px solid rgb(0 0 0 / 0.13);
  background: #ffffff;
  flex: 0 0 auto;
}

.lead-detail-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.lead-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-2);
  align-items: center;
  height: var(--lead-control-height);
}

.lead-export-icon {
  width: var(--lead-control-height);
  height: var(--lead-control-height);
  flex: 0 0 var(--lead-control-height);
  border-radius: 999px;
  border: 1px solid var(--border-1);
  background: #ffffff;
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lead-export-icon svg {
  width: 16px;
  height: 16px;
}

.lead-export-icon:hover {
  background: var(--bg-2);
  border-color: var(--border-2);
}

.lead-kanban {
  min-height: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  justify-content: start;
  gap: 8px;
  overflow: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(0 0 0 / 0.42) transparent;
}

.lead-column {
  width: 220px;
  min-width: 0;
  min-height: 0;
  border-radius: 7px;
  background: var(--bg-2);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: visible;
}

.lead-column:has(.admin-actions-menu[open]) {
  position: relative;
  z-index: 20;
}

.lead-column-head {
  padding: 8px;
  border-bottom: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.lead-column-title-row {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
}

.lead-column-head strong {
  min-width: 0;
  color: var(--fg-0);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-column-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.lead-column-head span {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.lead-column-icon-btn {
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 5px;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lead-column-icon-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.lead-column-icon-btn:hover {
  background: #ffffff;
  color: var(--fg-0);
}

.lead-column-save-btn {
  color: var(--ok);
}

.lead-column-title-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  color: var(--fg-0);
  font-size: 11px;
  font-weight: 500;
}

.lead-column-list {
  min-height: 0;
  padding: 7px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  scrollbar-width: thin;
  scrollbar-color: rgb(0 0 0 / 0.38) transparent;
}

.lead-kanban-card {
  min-width: 0;
  width: 100%;
  padding: 7px;
  border-radius: 7px;
  border: 1px solid var(--border-1);
  background: #ffffff;
  display: grid;
  gap: 4px;
  text-align: left;
}

.lead-column-create {
  width: 80px;
  grid-template-rows: 1fr;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}

.lead-column-create-btn {
  width: 100%;
  min-width: 0;
  height: 100%;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lead-column-create-btn svg {
  width: 22px;
  height: 22px;
}

.lead-column-create-btn:hover {
  background: rgb(0 0 0 / 0.04);
}

.lead-kanban-card .lead-card-head,
.lead-kanban-card .lead-card-footer {
  gap: 6px;
}

.lead-kanban-card .lead-card-head {
  min-height: 14px;
  margin-bottom: 2px;
}

.lead-kanban-card .lead-card-name,
.lead-kanban-card .lead-card-footer span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-kanban-card .lead-card-name {
  display: block;
  color: var(--fg-0);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.lead-kanban-card .lead-card-head span {
  flex: 0 0 auto;
  font-size: 9.5px;
}

.lead-kanban-card .lead-type {
  min-height: 0;
  padding: 0;
  color: var(--fg-0);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
}

.lead-kanban-card .lead-type[data-type="повторная"] {
  color: var(--fg-0);
}

.lead-tags-preview {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  overflow: hidden;
}

.lead-tag-mini {
  max-width: 100%;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgb(0 0 0 / 0.06);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.lead-tag-more {
  color: var(--accent);
  background: rgb(80 169 248 / 0.1);
}

.lead-assignee {
  min-width: 0;
  max-width: 190px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--fg-0);
  vertical-align: middle;
}

.lead-assignee-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.lead-assignee[data-empty="true"] .lead-assignee-avatar {
  background: rgb(0 0 0 / 0.08);
  color: var(--fg-3);
}

.lead-assignee-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.lead-assignee-compact {
  max-width: 100%;
  gap: 5px;
}

.lead-assignee-compact .lead-assignee-avatar {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  font-size: 8px;
}

.lead-assignee-compact .lead-assignee-name {
  color: var(--fg-2);
  font-size: 10px;
  font-weight: 600;
}

.lead-kanban-card:hover,
.lead-kanban-card[data-active="true"] {
  border-color: rgb(59 132 236 / 0.24);
  box-shadow: var(--shadow-sm);
}

.lead-card-subject {
  color: var(--fg-0);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-text {
  max-height: 28px;
  color: var(--fg-2);
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
}

.lead-kanban-card .lead-card-footer {
  font-size: 10px;
}

.lead-column-empty,
.lead-empty-small {
  padding: 14px;
  border-radius: 10px;
  color: var(--fg-3);
  background: rgb(255 255 255 / 0.72);
  font-size: 12px;
  text-align: center;
}

.lead-table-wrap {
  min-height: 0;
  overflow: auto;
  padding: 0 10px 10px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: rgb(0 0 0 / 0.42) transparent;
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 12px;
}

.lead-table th {
  padding: 8px 9px;
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-1);
  background: #ffffff;
}

.lead-table td {
  padding: 9px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-1);
  vertical-align: middle;
}

.lead-table td:first-child {
  border-left: 0;
  border-radius: 0;
}

.lead-table td:last-child {
  border-right: 0;
  border-radius: 0;
}

.lead-table tr {
  cursor: pointer;
}

.lead-table tr:hover td,
.lead-table tr[data-active="true"] td {
  background: var(--bg-2);
}

.lead-table td span {
  display: block;
  margin-top: 4px;
  color: var(--fg-2);
  font-size: 12px;
}

.lead-table td .lead-tags-preview {
  display: flex;
  margin-top: 5px;
}

.lead-table td .lead-tag-mini {
  font-size: 10px;
}

.lead-table td .lead-assignee,
.lead-table td .lead-assignee-avatar {
  display: inline-flex;
  margin-top: 0;
}

.lead-table td .lead-type {
  display: inline-flex;
  margin-top: 0;
  min-height: 0;
  line-height: 1;
  vertical-align: middle;
}

.lead-kanban::-webkit-scrollbar,
.lead-column-list::-webkit-scrollbar,
.lead-table-wrap::-webkit-scrollbar,
.lead-detail-panel::-webkit-scrollbar,
.lead-email-body::-webkit-scrollbar,
.lead-email-textarea::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.lead-kanban::-webkit-scrollbar-track,
.lead-column-list::-webkit-scrollbar-track,
.lead-table-wrap::-webkit-scrollbar-track,
.lead-detail-panel::-webkit-scrollbar-track,
.lead-email-body::-webkit-scrollbar-track,
.lead-email-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.lead-kanban::-webkit-scrollbar-thumb,
.lead-column-list::-webkit-scrollbar-thumb,
.lead-table-wrap::-webkit-scrollbar-thumb,
.lead-detail-panel::-webkit-scrollbar-thumb,
.lead-email-body::-webkit-scrollbar-thumb,
.lead-email-textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(0 0 0 / 0.38);
}

.lead-kanban::-webkit-scrollbar-thumb:hover,
.lead-column-list::-webkit-scrollbar-thumb:hover,
.lead-table-wrap::-webkit-scrollbar-thumb:hover,
.lead-detail-panel::-webkit-scrollbar-thumb:hover,
.lead-email-body::-webkit-scrollbar-thumb:hover,
.lead-email-textarea::-webkit-scrollbar-thumb:hover {
  background: rgb(0 0 0 / 0.56);
}

.lead-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;
  overflow: hidden;
}

.lead-detail-layer[data-open="true"] {
  pointer-events: auto;
}

.lead-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.16);
  opacity: 0;
  animation: leadBackdropIn 160ms ease forwards;
}

.lead-detail-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 32px));
  min-width: 0;
  height: auto;
  max-height: min(640px, calc(100dvh - 40px));
  min-height: 0;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.18);
  display: flex;
  flex-direction: column;
  overflow: auto;
  transform: translateY(10px) scale(0.98);
  animation: leadPanelIn 180ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  scrollbar-width: thin;
  scrollbar-color: rgb(0 0 0 / 0.42) transparent;
}

.lead-detail-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(360px, 1fr);
  gap: 0;
  overflow: auto;
}

.lead-detail-contact,
.lead-detail-workflow {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px 16px;
}

.lead-detail-contact {
  border-right: 1px solid rgb(0 0 0 / 0.13);
  background: #ffffff;
}

.lead-detail-workflow {
  background: #ffffff;
}

.lead-detail-panel .field {
  gap: 5px;
  margin-bottom: 0;
}

.lead-detail-panel .field input,
.lead-detail-panel .field textarea,
.lead-detail-panel .field select,
.lead-detail-panel .lead-inline-input,
.lead-detail-panel .lead-add-tag input {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

html[data-performance-mode="low"] button,
html[data-performance-mode="low"] input,
html[data-performance-mode="low"] textarea,
html[data-performance-mode="low"] select {
  transition: none;
}

html[data-performance-mode="low"] .overlay,
html[data-performance-mode="low"] .chat-list-loader-overlay {
  backdrop-filter: none;
}

html[data-performance-mode="low"] .lead-detail-backdrop,
html[data-performance-mode="low"] .lead-detail-panel {
  animation: none;
  opacity: 1;
  transform: none;
}

.lead-detail-head-actions {
  align-self: stretch;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
}

.lead-detail-title {
  min-width: 0;
  display: grid;
  align-items: center;
}

.lead-detail-title-line {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1.2;
}

.lead-detail-title-line h2,
.lead-detail-title-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-detail-title-line span {
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
}

.lead-copy-id-btn {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-2);
}

.lead-copy-id-btn svg {
  width: 14px;
  height: 14px;
}

.lead-copy-id-btn:hover {
  color: var(--fg-0);
  background: rgb(0 0 0 / 0.055);
}

.lead-top-actions {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
}

.lead-top-icon-action {
  width: 52px;
  min-width: 52px;
  padding: 0;
}

.lead-top-icon-action svg {
  width: 22px;
  height: 22px;
}

.lead-edit-text-action {
  min-height: calc(var(--surface-toolbar-height) - 1px);
  padding: 0 14px;
  border-left: 0;
  background: #ffffff;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.lead-edit-text-action svg {
  width: 22px;
  height: 22px;
}

.lead-edit-text-action:hover {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}

.lead-edit-text-action.lead-top-icon-action {
  width: 52px;
  min-width: 52px;
  padding: 0;
}

.lead-detail-close {
  width: 52px;
  min-width: 52px;
  min-height: calc(var(--surface-toolbar-height) - 1px);
  border-radius: 0;
  border: 0;
  border-left: 0;
  background: #ffffff;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.lead-detail-close:hover {
  background: rgb(0 0 0 / 0.04);
  color: #000000;
}

:where(
  .modal-close,
  .toast-close,
  .media-viewer-close,
  .right-panel-close,
  .lead-detail-close,
  .composer-reply-close,
  .search-clear-btn,
  .manual-phone-bind-dismiss,
  .notification-toolbar-btn[data-action="close-notifications"]
) {
  color: #000000;
  font-size: 0;
  line-height: 1;
}

:where(
  .media-viewer-close,
  .lead-detail-close,
  .composer-reply-close,
  .manual-phone-bind-dismiss,
  .notification-toolbar-btn[data-action="close-notifications"]
) {
  position: relative;
}

:where(.notification-toolbar-btn[data-action="close-notifications"]) svg {
  display: none;
}

:where(
  .modal-close,
  .toast-close,
  .media-viewer-close,
  .right-panel-close,
  .lead-detail-close,
  .composer-reply-close,
  .search-clear-btn,
  .manual-phone-bind-dismiss,
  .notification-toolbar-btn[data-action="close-notifications"]
)::before,
:where(
  .modal-close,
  .toast-close,
  .media-viewer-close,
  .right-panel-close,
  .lead-detail-close,
  .composer-reply-close,
  .search-clear-btn,
  .manual-phone-bind-dismiss,
  .notification-toolbar-btn[data-action="close-notifications"]
)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1px;
  border-radius: 999px;
  background: currentColor;
}

:where(
  .modal-close,
  .toast-close,
  .media-viewer-close,
  .right-panel-close,
  .lead-detail-close,
  .composer-reply-close,
  .search-clear-btn,
  .manual-phone-bind-dismiss,
  .notification-toolbar-btn[data-action="close-notifications"]
)::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

:where(
  .modal-close,
  .toast-close,
  .media-viewer-close,
  .right-panel-close,
  .lead-detail-close,
  .composer-reply-close,
  .search-clear-btn,
  .manual-phone-bind-dismiss,
  .notification-toolbar-btn[data-action="close-notifications"]
)::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes leadPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes leadBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lead-edit-grid,
.lead-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
}

.lead-edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-date-card {
  min-height: 52px;
  padding: 9px 10px;
  border-radius: 5px;
  background: var(--bg-2);
  display: grid;
  align-content: center;
  gap: 4px;
}

.lead-date-card span {
  color: var(--fg-2);
  font-size: 11px;
  font-weight: 700;
}

.lead-date-card strong {
  min-width: 0;
  color: var(--fg-0);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-inline-input {
  min-height: 34px;
  padding: 0 10px;
  background: var(--bg-2);
  color: var(--fg-0);
  font-weight: 600;
}

.lead-control-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-detail-section {
  padding: 0;
  display: grid;
  gap: 6px;
}

.lead-email-body {
  max-height: 130px;
  padding: 9px 10px;
  border-radius: 5px;
  background: var(--bg-2);
  color: var(--fg-1);
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: rgb(0 0 0 / 0.42) transparent;
}

.lead-email-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 0;
  outline: none;
  font: inherit;
}

.lead-source-box {
  padding: 9px 10px;
  border-radius: 5px;
  background: var(--bg-2);
  display: grid;
  gap: 6px;
  color: var(--fg-2);
  font-size: 12px;
}

.lead-source-box strong {
  color: var(--fg-0);
}

.lead-tag-removable {
  cursor: pointer;
}

.lead-add-tag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.lead-add-tag input {
  min-height: 34px;
  padding: 0 10px;
  background: var(--bg-2);
}

.lead-actions {
  margin-top: 2px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.lead-actions :where(.btn-primary, .btn-secondary, .btn-subtle) {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.lead-processed {
  margin: 0;
  padding: 8px 10px;
  border-radius: 5px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.lead-empty {
  margin: auto;
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 38vh) 1fr;
  }

  .sidebar-resizer {
    display: none;
  }

  .admin-grid,
  .admin-collection,
  .analytics-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    border-right: 0;
    border-bottom: 1px solid var(--border-2);
  }

  .chat-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .right-panel {
    width: min(360px, 92vw);
  }

  .messages {
    padding: var(--space-3);
  }

  .msg-row {
    max-width: 88%;
  }

  .leads-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  .lead-workspace {
    border-right: 0;
  }

  .lead-detail-panel {
    width: min(1080px, calc(100vw - 16px));
  }

  .lead-detail-body {
    grid-template-columns: 1fr;
  }

  .lead-detail-contact {
    border-right: 0;
    border-bottom: 1px solid rgb(0 0 0 / 0.13);
  }

  .lead-detail-head {
    min-height: auto;
    padding: 10px 48px 10px 14px;
    align-items: flex-start;
  }

  .lead-detail-title {
    padding: 0;
  }

  .lead-detail-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .lead-top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .lead-funnel-search-row {
    grid-template-columns: 1fr;
  }

  .lead-filter-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 128px;
    width: auto;
    min-width: 0;
    max-height: calc(100vh - 150px);
    overflow: auto;
  }

  .lead-funnel-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .lead-funnel-controls .lead-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-kanban {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: auto;
  }

  .lead-column {
    width: 220px;
  }

  .lead-column-create {
    width: 80px;
  }
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
    [type="color"]
  ):not([type="hidden"]):not([type="search"]):not(.search-input),
textarea:not(.search-input):not(.composer-textarea),
select:not(.search-input) {
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--input-radius) !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m4.5 7.5 5.5 5 5.5-5' stroke='%2364758B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  padding-right: 34px;
  cursor: pointer;
  transition:
    background-color var(--menu-item-transition),
    border-color var(--menu-item-transition),
    box-shadow var(--menu-item-transition);
}

select:not(.search-input):not(:disabled):hover {
  border-color: var(--border-2) !important;
  background-color: var(--select-hover-surface) !important;
}

select:not(.search-input):focus-visible {
  border-color: var(--border-3) !important;
  background-color: #ffffff !important;
  outline: 3px solid rgb(59 132 236 / 0.08);
  outline-offset: 0;
}

select:not(.search-input):disabled {
  cursor: not-allowed;
}

/* Compact native controls keep selection familiar while using the app accent. */
input[type="checkbox"],
input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid rgb(59 132 236 / 0.28);
  outline-offset: 2px;
}

.field > span,
.field > label,
.chat-filter-field > span,
.chat-filter-field > label,
.lead-date-card > span {
  color: #000000 !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.lead-funnel-controls .lead-filter-popover .lead-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.lead-funnel-controls .lead-filter-popover .chat-filter-field input,
.lead-funnel-controls .lead-filter-popover .chat-filter-field select {
  border-radius: 5px !important;
}

.scripts-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 5px;
  height: 100%;
  min-height: 0;
  padding: 5px;
  background: var(--bg-0);
}

.scripts-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 5px;
  min-height: 0;
}

.scripts-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.scripts-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.scripts-panel-head,
.script-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 15px;
  border-bottom: 1px solid rgb(0 0 0 / 0.13);
  color: #000000;
  font-size: 13px;
  font-weight: 600;
}

.script-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-3);
  font-weight: 400;
}

.script-panel-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  cursor: pointer;
}

.script-panel-plus svg {
  width: 18px;
  height: 18px;
}

.script-small-btn,
.script-reset-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
}

.script-list {
  min-height: 0;
  overflow: auto;
}

.script-list-row {
  width: 100%;
  min-height: 58px;
  padding: 10px 15px;
  border: 0;
  border-bottom: 1px solid #e4e4e4;
  border-radius: 0;
  background: #ffffff;
  color: #000000;
  text-align: left;
  cursor: pointer;
}

.script-list-row[data-active="true"] {
  background: rgb(0 0 0 / 0.04);
  box-shadow: inset 3px 0 0 var(--accent);
}

.script-list-title,
.script-list-meta {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-list-title {
  font-size: 13px;
  font-weight: 700;
}

.script-list-meta {
  margin-top: 4px;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 400;
}

.scripts-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.script-stage-head {
  align-items: center;
  min-height: 64px;
}

.script-stage-head h3 {
  margin: 3px 0 2px;
  color: #000000;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.script-stage-head p {
  margin: 0;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 400;
}

.script-flow {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 15px;
  min-height: 0;
  padding: 20px;
}

.script-flow-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-width: 960px;
  overflow: auto;
  padding-right: 6px;
}

.script-text-block {
  display: grid;
  gap: 6px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e4e4e4;
}

.script-text-block[data-current="true"] {
  border-bottom-color: rgb(0 0 0 / 0.13);
}

.script-flow-kicker {
  display: block;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 500;
}

.script-flow-text p {
  margin: 0;
  color: #000000;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-line;
}

.script-saved-answer {
  align-self: flex-start;
  max-width: min(720px, 100%);
  padding: 8px 12px;
  border-radius: 3px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.script-saved-answer[data-color="blue"] {
  background: var(--accent-gradient);
}
.script-saved-answer[data-color="green"] {
  background: #16a34a;
}
.script-saved-answer[data-color="amber"] {
  background: #ca8a04;
}
.script-saved-answer[data-color="red"] {
  background: #dc2626;
}
.script-saved-answer[data-color="violet"] {
  background: var(--accent-gradient);
}
.script-saved-answer[data-color="gray"] {
  background: rgb(0 0 0 / 0.68);
}

.script-answer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.script-answer {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.script-answer[data-color="blue"] {
  background: var(--accent-gradient);
}
.script-answer[data-color="green"] {
  background: #16a34a;
}
.script-answer[data-color="amber"] {
  background: #ca8a04;
}
.script-answer[data-color="red"] {
  background: #dc2626;
}
.script-answer[data-color="violet"] {
  background: var(--accent-gradient);
}
.script-answer[data-color="gray"] {
  background: rgb(0 0 0 / 0.68);
}

.script-answer-yesno,
.script-answer-input-card {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 38px;
  padding: 4px;
  border-radius: 3px;
  background: rgb(0 0 0 / 0.04);
}

.script-answer-yesno > span,
.script-answer-input-card label span {
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
}

.script-answer-yesno > span {
  align-self: center;
  padding: 0 4px;
}

.script-answer-input-card label {
  display: grid;
  gap: 3px;
}

.script-answer-input-card input {
  width: 190px;
  min-height: 30px;
  border: 1px solid rgb(0 0 0 / 0.13) !important;
  border-radius: var(--input-radius) !important;
  background: #ffffff !important;
  color: #000000;
  font-size: 13px;
}

.script-answer-input-submit {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: #000000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.script-answer-input-card[data-color="blue"] {
  box-shadow: inset 3px 0 0 var(--accent);
}
.script-answer-input-card[data-color="green"] {
  box-shadow: inset 3px 0 0 #16a34a;
}
.script-answer-input-card[data-color="amber"] {
  box-shadow: inset 3px 0 0 #ca8a04;
}
.script-answer-input-card[data-color="red"] {
  box-shadow: inset 3px 0 0 #dc2626;
}
.script-answer-input-card[data-color="violet"] {
  box-shadow: inset 3px 0 0 var(--accent);
}
.script-answer-input-card[data-color="gray"] {
  box-shadow: inset 3px 0 0 rgb(0 0 0 / 0.68);
}

.script-finish {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--fg-3);
  font-size: 13px;
}

.script-editor-wrap {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(0 0 0 / 0.35);
}

.script-editor {
  display: grid;
  gap: 12px;
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 0 15px 15px;
  border-radius: 5px;
  background: #ffffff;
}

.script-editor-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--surface-toolbar-height);
  margin: 0 -15px;
  padding: 0 0 0 15px;
  border-bottom: 1px solid rgb(0 0 0 / 0.13);
  background: #ffffff;
}

.script-editor-head h3 {
  margin: 0;
  color: #000000;
  font-size: 15px;
}

.script-editor-head p {
  margin: 3px 0 0;
  color: var(--fg-3);
  font-size: 12px;
}

.script-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.script-flow-field textarea {
  min-height: 300px;
  line-height: 1.45;
  resize: vertical;
}

.script-editor-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.script-color-help {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 3px;
  background: rgb(0 0 0 / 0.04);
  color: var(--fg-2);
  font-size: 12px;
}

.script-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1120px) {
  .scripts-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .scripts-layout {
    grid-template-columns: 1fr;
  }

  .scripts-list-panel {
    max-height: 220px;
  }

  .script-flow {
    padding: 15px;
  }

  .script-flow-text p {
    font-size: 16px;
  }

  .script-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* One shape language for actionable controls: text actions are pills, icons are circles. */
button:is(
  .btn-primary,
  .btn-secondary,
  .btn-subtle,
  .btn-danger,
  .filter-chip,
  .profile-channel-apply,
  .auth-page-submit,
  .admin-runtime-btn,
  .script-small-btn,
  .script-reset-btn,
  .composer-send.wide,
  .composer-channel-btn,
  .chat-history-expand-btn,
  .read-action,
  .channel-console-back-button,
  .channel-console-text-action,
  .channel-console-name-action,
  .channel-console-detail-edit,
  .lead-top-action,
  .lead-column-create-btn,
  .show-profile-chats-link,
  .sidebar-filter-toggle
) {
  border-radius: 999px;
}

button:is(
  .notification-toolbar-btn,
  .plus-btn,
  .settings-btn,
  .search-clear-btn,
  .composer-btn,
  .composer-send:not(.wide),
  .copy-icon-button,
  .modal-close,
  .right-panel-close,
  .lead-detail-close,
  .media-viewer-close,
  .lead-column-icon-btn,
  .lead-top-icon-action,
  .lead-export-icon,
  .msg-retry-icon-btn,
  .composer-reply-close,
  .composer-attachment-remove,
  .app-sidebar-collapse,
  .app-sidebar-utility,
  .script-panel-plus,
  .manual-phone-bind-accept,
  .manual-phone-bind-dismiss
) {
  border-radius: 50%;
}

/* Keep the Metricon gradient as one clean layer without native/button edge seams. */
:is(
  .btn-primary,
  .plus-btn,
  .profile-channel-apply,
  .manual-phone-bind-accept,
  .composer-send,
  .channel-console-widget-save,
  .auth-page-submit,
  .lead-chip[data-active="true"],
  .lead-view-btn[data-active="true"],
  .script-saved-answer[data-color="blue"],
  .script-saved-answer[data-color="violet"],
  .script-answer[data-color="blue"],
  .script-answer[data-color="violet"]
) {
  appearance: none;
  border: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
