:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f2f5;
  color: #111b21;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  cursor: pointer;
}

button.ready {
  box-shadow: 0 0 0 4px rgba(31, 122, 85, 0.08);
  transform: translateY(-1px);
}

.appShell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.appHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  min-height: 42px;
}

.appHeader .eyebrow {
  margin-bottom: 0;
  font-size: 14px;
}

.eyebrow,
.kicker {
  margin: 0 0 4px;
  color: #5d766d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

.topActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #d6dfda;
  border-radius: 8px;
  background: #ffffff;
  color: #33443d;
  font-weight: 800;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c5892d;
}

.dot.open {
  background: #1fa463;
}

.dot.close {
  background: #c2413b;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid #d6dfda;
  border-radius: 10px;
  background: #ffffff;
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  background: transparent;
  color: #48645a;
  font-weight: 900;
}

.tab.active {
  background: #1f7a55;
  color: #ffffff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  border: 1px solid #d6dfda;
  border-radius: 8px;
  background: #ffffff;
}

.panelHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.panelHeader > div:first-child {
  min-width: 0;
}

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

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

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

.accountManager,
.connectPanel {
  padding: 20px;
}

.autoReplyPanel {
  padding: 20px;
  width: 100%;
  max-width: none;
}

.autoReplyTopBar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.autoReplyTopBar > label:first-child {
  flex: 1 1 300px;
  min-width: min(100%, 320px);
}

.autoReplyTopBar > label:first-child select {
  min-height: 40px;
}

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

.panelSubsection {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #dce7e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
}

.autoReplySettingsPanel {
  position: relative;
  overflow: hidden;
  gap: 14px;
  border-color: #bddfc9;
  background:
    linear-gradient(180deg, rgba(241, 250, 244, 0.96) 0%, rgba(255, 255, 255, 0.98) 44%),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 0 rgba(31, 122, 85, 0.04);
}

.autoReplySettingsPanel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #1f7a55 0%, #58a66f 100%);
}

.autoReplySettingsPanel > * {
  position: relative;
  z-index: 1;
}

.panelSubsectionHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.optOutHeaderActions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.optOutSwitch {
  white-space: nowrap;
}

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

.panelSubsectionHeader h3 {
  font-size: 18px;
  line-height: 1.15;
}

.autoReplySettingsPanel .panelSubsectionHeader {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(31, 122, 85, 0.08);
}

.autoReplySectionNote {
  margin-top: 6px;
  max-width: 52ch;
  color: #5f7167;
  font-size: 12px;
  line-height: 1.45;
}

.autoReplyRulesSection {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid #e3ece7;
}

.ruleAccountsPanel {
  gap: 10px;
  padding: 14px;
  border-color: #d8e7de;
  background: linear-gradient(180deg, #ffffff 0%, #fcfefd 100%);
}

.autoReplyRuleAccounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 160px;
  overflow: auto;
  padding-right: 2px;
}

.autoReplyRuleAccount {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d8e7de;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.autoReplyRuleAccount:hover {
  border-color: #b6d4c2;
}

.autoReplyRuleAccount.selected {
  border-color: #98caa7;
  background: #f2faf5;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 85, 0.06);
}

.autoReplyRuleAccount input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #1f7a55;
}

.autoReplyRuleAccountName {
  color: #1f2c2a;
  font-size: 13px;
  font-weight: 800;
}

.autoReplyRuleAccount small {
  color: #667781;
  font-size: 11px;
  font-weight: 700;
}

.autoReplyRulesList {
  display: grid;
  gap: 12px;
  width: 100%;
}

.autoReplyRuleCard {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #dce7e1;
  border-radius: 12px;
  background: #ffffff;
}

.autoReplyRuleCard.enabled {
  border-color: #bfe7d0;
  background: #f6fcf8;
}

.autoReplyRuleCard.disabled {
  opacity: 0.9;
}

.autoReplyRuleCard.editing {
  box-shadow: 0 0 0 3px rgba(31, 122, 85, 0.08);
}

.autoReplyRuleTop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.autoReplyRuleTop .switchCompact {
  margin-top: 0;
}

.autoReplyRuleToggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.autoReplyRuleChevron {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 999px;
  background: #edf5ef;
  color: #1f7a55;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.autoReplyRuleCard.expanded .autoReplyRuleChevron {
  transform: rotate(90deg);
  background: #dff1e7;
}

.autoReplyRuleToggleText {
  min-width: 0;
  display: grid;
}

.autoReplyRuleSwitchWrap {
  justify-self: end;
}

.autoReplyRuleTopActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.autoReplyRuleDeleteIcon {
  color: #b42318;
  border-color: #f0c9c5;
  background: #fff7f6;
}

.autoReplyRuleDeleteIcon:hover {
  background: #fdeeee;
}

.autoReplyRuleDeleteIcon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.autoReplyRuleTitleBlock {
  min-width: 0;
}

.autoReplyRuleTitleBlock h4 {
  font-size: 17px;
  line-height: 1.2;
  margin: 0;
}

.autoReplyRuleTitleBlock p {
  margin-top: 4px;
  color: #667781;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.autoReplyRuleBody {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #e3ece7;
}

.autoReplyRuleCard.collapsed .autoReplyRuleBody {
  display: none;
}

.autoReplyRuleText {
  color: #1f2c2a;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.autoReplyRuleMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #667781;
  font-size: 12px;
  font-weight: 800;
}

.autoReplyRuleActions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.switchOption {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #1f2c2a;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.switchOption input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switchTrack {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d5dfd8;
  box-shadow: inset 0 0 0 1px rgba(17, 27, 33, 0.08);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.switchThumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(17, 27, 33, 0.16);
  transition: transform 0.15s ease;
}

.switchOption input:checked + .switchTrack {
  background: #1f7a55;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 85, 0.18);
}

.switchOption input:checked + .switchTrack .switchThumb {
  transform: translateX(18px);
}

.switchOption input:focus-visible + .switchTrack {
  box-shadow:
    inset 0 0 0 1px rgba(31, 122, 85, 0.18),
    0 0 0 3px rgba(31, 122, 85, 0.12);
}

.switchCompact {
  gap: 0;
}

.switchCompact .switchTrack {
  width: 46px;
}

.contactListsPanel,
.contactListPanel {
  padding: 24px;
}

.contactListsPanel .panelHeader,
.contactListPanel .panelHeader {
  display: block;
}

.contactListsPanel .panelHeader > div:first-child,
.contactListPanel .panelHeader > div:first-child {
  min-width: 0;
}

.contactListCreateBar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 18px;
}

.contactListCreateBar input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
}

.contactListCreateBar button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.contactListPanel .buttonRow {
  align-self: flex-end;
}

.contactListPanel .fileDropzone {
  padding: 16px 18px;
}

.contactListPanel .tableHeader {
  margin-top: 20px;
}

.contactListPanel .contactBulkBar {
  gap: 14px;
}

.accountForm {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  flex: 1 1 320px;
  min-width: min(100%, 320px);
  gap: 10px;
  margin: 0;
}

.accountCreateBar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 0 0 auto;
  max-width: 540px;
  margin: 0 0 16px;
}

.accountCreateBar input {
  min-width: 0;
  height: 40px;
}

.accountCreateBar button {
  white-space: nowrap;
}

.accounts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.contactLists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.accountCard {
  display: grid;
  gap: 12px;
  min-height: 138px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.accountCard.active {
  border-color: #1f7a55;
  background: #eff9f4;
}

.contactListCard {
  display: grid;
  gap: 8px;
  min-height: 0;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcfb;
}

.contactListCard.active {
  border-color: #1f7a55;
  background: #eff9f4;
}

.accountCardTop,
.accountTitleRow,
.contactListTitleRow,
.buttonRow,
.accountActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.contactListTitleRow {
  min-width: 0;
}

.contactListTitleButton {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: #111b21;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contactListTitleButton:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contactListInlineEdit {
  display: block;
}

.contactListNameInput {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 800;
}

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

.contactListActions .tinyButton {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.dangerTiny {
  border: 1px solid #f0c9c5;
  background: #fff7f6;
  color: #b42318;
}

.contactListMeta {
  color: #667781;
  font-size: 12px;
  line-height: 1.2;
}

.buttonRow {
  flex: 0 0 auto;
  align-items: stretch;
}

.connectPanel .panelHeader {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
}

.connectPanel .buttonRow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: none;
}

#connectTitle {
  max-width: 100%;
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.accountAvatar,
.avatar,
.chatAvatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #d9fdd3;
  color: #1f5d45;
  font-weight: 900;
}

.accountTitleRow h3 {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.accountPhone {
  color: #5d766d;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.accountStatus {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef3f1;
  color: #537066;
  font-size: 12px;
  font-weight: 900;
}

.accountStatus.open {
  background: #dff5ea;
  color: #1f7a55;
}

.accountStatus.close {
  background: #fae8e6;
  color: #b42318;
}

.deleteAccount,
.secondary,
.iconOnly,
.iconButton,
.tinyButton,
button[type='submit'] {
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

button[type='submit'] {
  min-height: 40px;
  padding: 9px 14px;
  background: #1f7a55;
  color: #ffffff;
}

.accountActions {
  align-items: stretch;
}

.deleteAccount {
  min-height: 40px;
  border: 1px solid #f0c9c5;
  padding: 9px 14px;
  background: #fff7f6;
  color: #b42318;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #cbd8d1;
  padding: 9px 14px;
  background: #ffffff;
  color: #1f5d45;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.templateLink {
  white-space: nowrap;
}

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

.iconOnly,
.iconButton {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  border: 1px solid #cbd8d1;
  background: #ffffff;
  color: #1f5d45;
}

.accountNameForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.contactEditForm {
  display: grid;
  gap: 8px;
}

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

.tinyButton {
  min-height: 32px;
  padding: 6px 9px;
  background: #1f7a55;
  color: #ffffff;
  font-size: 12px;
}

.secondaryTiny {
  border: 1px solid #cbd8d1;
  background: #ffffff;
  color: #1f5d45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd8d1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #111b21;
  outline: none;
}

input[type='file'] {
  padding: 9px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1f7a55;
  box-shadow: 0 0 0 3px rgba(31, 122, 85, 0.14);
}

textarea {
  resize: vertical;
}

.qrBox {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px dashed #cbd8d1;
  border-radius: 8px;
  background: #fbfcfb;
}

.qrBox img {
  width: min(320px, 100%);
  height: auto;
}

.connectedBadge {
  display: grid;
  place-items: center;
  width: 172px;
  height: 172px;
  border-radius: 999px;
  background: #d9fdd3;
  color: #1f7a55;
  font-size: 22px;
  font-weight: 900;
}

.messenger {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  height: min(760px, calc(100vh - 150px));
  min-height: min(620px, calc(100vh - 150px));
  overflow: hidden;
  border: 1px solid #d6dfda;
  border-radius: 8px;
  background: #ffffff;
}

.chatSidebar {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid #dce7e1;
  background: #ffffff;
}

.sidebarHeader,
.conversationHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid #cbd9d2;
  background: #edf3f0;
  box-shadow: 0 1px 0 rgba(17, 27, 33, 0.04);
}

.compactLabel {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  color: #48645a;
  font-size: 13px;
  font-weight: 800;
}

.newChatForm {
  display: grid;
  gap: 8px;
  padding: 0 16px 14px;
  margin: 0;
  border-bottom: 1px solid #eef3f1;
}

.chats {
  min-height: 0;
  overflow: auto;
}

.chatItem {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid #eef3f1;
  border-radius: 0;
  padding: 12px 14px;
  background: #ffffff;
  color: #111b21;
  text-align: left;
}

.chatItem:hover,
.chatItem.active {
  background: #f0f2f5;
}

.chatMain {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
}

.chatName {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatPreview {
  overflow: hidden;
  color: #667781;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatMeta {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: #667781;
  font-size: 12px;
}

.unread {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  background: #25d366;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.chatPane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: #efeae2;
}

.conversationHeader {
  justify-content: flex-start;
  z-index: 1;
}

.chatSubline {
  margin-top: 3px;
  color: #667781;
  font-size: 13px;
}

.messages {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
}

.conversation {
  min-height: 0;
  overflow: auto;
  padding: 22px 7%;
}

.message {
  display: grid;
  gap: 5px;
  width: fit-content;
  max-width: min(620px, 82%);
  border-radius: 8px;
  padding: 8px 10px 6px;
  box-shadow: 0 1px 1px rgba(17, 27, 33, 0.12);
}

.message.in {
  justify-self: start;
  background: #ffffff;
}

.message.out {
  justify-self: end;
  background: #d9fdd3;
}

.body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.38;
}

.messageTime {
  justify-self: end;
  color: #667781;
  font-size: 11px;
}

.replyForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  background: #f0f2f5;
}

.replyForm textarea {
  min-height: 44px;
  max-height: 120px;
  border-radius: 999px;
  resize: none;
}

.replyForm button {
  white-space: nowrap;
  padding-inline: 18px;
}

.replyFormActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 2;
  grid-row: 1;
}

.result,
.empty,
.helper {
  margin-top: 12px;
  color: #667781;
}

.result {
  padding: 0 16px;
  font-size: 13px;
}

.replyResult {
  margin: 0;
  padding: 0 16px 10px;
  background: #f0f2f5;
}

.campaignGrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.campaignComposer,
.campaignsPanel {
  width: 100%;
  padding: 20px;
}

.stackForm {
  display: grid;
  gap: 12px;
  margin: 0;
}

.stackForm label {
  display: grid;
  gap: 7px;
  color: #48645a;
  font-size: 13px;
  font-weight: 800;
}

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

.checkboxOption {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkboxOption input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.checkboxOption span {
  color: #1f2c2a;
  font-size: 14px;
  font-weight: 800;
}

.fileDropzone {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1.5px dashed #c7d7d0;
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf9 100%);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.fileDropzone:hover {
  border-color: #82b89f;
  box-shadow: 0 8px 22px rgba(31, 122, 85, 0.08);
}

.fileDropzone.dragover {
  border-color: #1f7a55;
  background: #eef9f2;
  box-shadow: 0 0 0 4px rgba(31, 122, 85, 0.08);
  transform: translateY(-1px);
}

.fileDropzone.hasFile {
  border-style: solid;
  border-color: #1f7a55;
  background: linear-gradient(180deg, #effaf4 0%, #e5f5eb 100%);
  box-shadow: 0 0 0 4px rgba(31, 122, 85, 0.06);
}

.fileDropzone input {
  display: none;
}

.fileDropzoneIcon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #dff5ea;
  color: #1f7a55;
  font-size: 20px;
  font-weight: 900;
}

.fileDropzoneText {
  display: grid;
  gap: 3px;
}

.fileDropzoneText strong {
  color: #111b21;
  font-size: 14px;
  font-weight: 900;
}

.fileDropzoneText small {
  color: #667781;
  font-size: 12px;
  font-weight: 700;
}

.fileDropzoneName {
  color: #1f7a55;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

#listImportHint,
.fileDropzoneHint {
  display: none !important;
}

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

.checkboxList {
  display: grid;
  gap: 8px;
}

.selectionBlock {
  display: grid;
  gap: 10px;
  position: relative;
}

.selectionBlock .searchField {
  display: block;
}

.selectionBlock .searchField input {
  min-height: 40px;
}

.selectionDropdown {
  position: relative;
}

.searchField {
  position: relative;
  display: block;
}

.searchField input {
  min-height: 40px;
}

.dropdownMenu {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #d6dfda;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 30px rgba(17, 27, 33, 0.08);
}

.selectionDropdown.open .dropdownMenu {
  display: grid;
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.selectionHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.selectionTitle {
  display: block;
  color: #48645a;
  font-size: 13px;
  font-weight: 800;
}

.selectionHint {
  margin-top: 3px;
  color: #667781;
  font-size: 12px;
  font-weight: 600;
}

.selectionCount {
  flex: 0 0 auto;
  margin-top: 2px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef3f1;
  color: #1f5d45;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.selectedListSummary {
  position: relative;
  width: 100%;
  min-height: 42px;
  margin: 10px 0 0;
  padding: 10px 36px 10px 12px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #f7faf8;
  color: #1f5d45;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.selectedListSummary:hover,
.selectionDropdown.open .selectedListSummary {
  border-color: #9cc9ae;
  background: #f2f8f5;
}

.selectedListSummary::after {
  content: "▾";
  position: absolute;
  top: 50%;
  right: 12px;
  color: #667781;
  font-size: 12px;
  transform: translateY(-50%);
  transition: transform 0.15s ease;
}

.selectionDropdown.open .selectedListSummary::after {
  transform: translateY(-50%) rotate(180deg);
}

.selectedListSummary.emptySelection {
  color: #667781;
}

.ruleAccountsSelect {
  padding: 14px;
  border: 1px solid #dce7e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
}

.ruleAccountsSelect.open {
  z-index: 30;
}

.ruleAccountsSummary {
  width: 100%;
  margin: 0;
  text-align: left;
  background: #f7faf8;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ruleAccountsSummary:hover {
  border-color: #b6d4c2;
  background: #f3f8f5;
}

.ruleAccountsSummary::after {
  content: "▾";
  float: right;
  color: #667781;
  font-weight: 900;
  transition: transform 0.15s ease;
}

.ruleAccountsSelect.open .ruleAccountsSummary::after {
  transform: rotate(180deg);
}

.ruleAccountsDropdown {
  position: relative;
}

.ruleAccountsDropdown .dropdownMenu {
  width: 100%;
  max-height: 260px;
  padding: 6px;
  border-radius: 12px;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
}

.ruleAccountsSelect.open .dropdownMenu {
  display: grid;
}

.ruleAccountsDropdown .checkboxItem {
  background: #ffffff;
  min-height: 40px;
  padding: 6px 8px;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.ruleAccountsDropdown .checkboxItem:first-of-type {
  margin-top: 2px;
}

.ruleAccountsScroll {
  min-height: 0;
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-top: 4px;
  padding-right: 2px;
}

.ruleAccountsNote {
  color: #5f7167;
  font-size: 12px;
  line-height: 1.45;
}

.ruleAccountsMenu .checkboxItem strong {
  font-size: 13px;
}

.ruleAccountsAccountStatus,
.autoReplyRuleAccountStatus {
  justify-self: end;
  padding: 4px 8px;
  font-size: 11px;
}

.dropdownToolbar {
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 2px 0 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid #e3ece7;
  background: #ffffff;
}

.ruleAccountsToolbar .searchField {
  min-width: 0;
}

.ruleAccountsToolbar .searchField input {
  width: 100%;
}

.dropdownToolbar .secondary {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.ruleAccountsClear {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.ruleAccountsReset {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.recipientsSelect {
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.campaignAccountsSelect .checkboxItem {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 8px 10px;
}

.campaignAccountsSelect .pill {
  justify-self: end;
  font-size: 11px;
  white-space: nowrap;
}

.checkboxItem {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfb;
}

.checkboxItem input {
  width: 18px;
  height: 18px;
  accent-color: #1f7a55;
}

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

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

.checkboxItem small {
  color: #667781;
  font-size: 12px;
}

.inlineResult {
  padding: 0;
}

.tableHeader,
.campaignTop,
.campaignStats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tableHeader {
  margin: 18px 0 10px;
}

.contactBulkBar {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}

.contactBulkActions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.contactBulkActions .secondary,
.contactBulkActions .dangerButton {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.contactBulkMeta {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #dce7e1;
  border-radius: 999px;
  background: #fbfcfb;
}

.contactBulkMeta strong {
  color: #1f5d45;
  font-size: 14px;
  font-weight: 900;
}

.contactBulkSearch {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contactSearchField {
  display: flex;
  width: 100%;
  min-width: 0;
}

.contactSearchField input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
}

.contactSearchMeta {
  margin: 0;
  white-space: nowrap;
  text-align: right;
}

.muted {
  color: #667781;
  font-size: 13px;
  font-weight: 800;
}

.variableHint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.variableHintLabel {
  color: #667781;
  font-size: 13px;
  font-weight: 800;
}

.variableToken {
  border: 1px solid #d6dfda;
  border-radius: 999px;
  padding: 5px 10px;
  background: #ffffff;
  color: #1f7a55;
  font-size: 12px;
  font-weight: 900;
}

.variableToken:hover {
  border-color: #82b89f;
  background: #eef9f2;
}

.variableToken:focus-visible {
  outline: 2px solid #1f7a55;
  outline-offset: 2px;
}

.compactList,
.campaignsList {
  display: grid;
  gap: 8px;
}

.compactItem,
.campaignCard {
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #fbfcfb;
}

.contactTableWrap {
  overflow: auto;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #ffffff;
}

.contactTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.contactTable th,
.contactTable td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef3f1;
  vertical-align: middle;
  text-align: left;
  font-size: 13px;
}

.contactTable th {
  background: #f7faf8;
  color: #48645a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contactTable tbody tr:hover {
  background: #fbfcfb;
}

.contactTable th.contactSelectionHead,
.contactTable td.contactSelectionCell {
  width: 54px;
  text-align: center;
}

.contactTable th.contactSelectionHead {
  padding: 8px 6px;
  background: linear-gradient(180deg, #f7faf8 0%, #eef6f1 100%);
}

.contactSelectionCell {
  padding-left: 10px;
  padding-right: 10px;
}

.contactPageSelectAllWrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow:
    0 0 0 1px #c9ddd2 inset,
    0 0 0 3px rgba(31, 122, 85, 0.06);
  cursor: pointer;
}

.contactRowCheckbox {
  width: 18px;
  height: 18px;
  accent-color: #1f7a55;
}

.contactPageSelectAll {
  display: block;
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: #1f7a55;
}

.contactTable th:nth-child(2),
.contactTable td:nth-child(2) {
  width: 140px;
}

.contactTable td:nth-child(3),
.contactTable td:nth-child(4),
.contactTable td:nth-child(5) {
  width: 16%;
}

.contactTable td:nth-child(6) {
  width: 18%;
}

.contactTable td:nth-child(7) {
  width: 110px;
}

.contactTable td:nth-child(8) {
  width: 118px;
}

.contactPager {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #dce7e1;
  border-radius: 8px;
  background: #fbfcfb;
}

.contactPagerSummary,
.contactPagerNav,
.contactPagerControls {
  display: flex;
  align-items: center;
}

.contactPagerSummary {
  gap: 8px;
  flex-wrap: wrap;
}

.contactPagerSummary strong,
.contactPagerPage strong {
  color: #1f5d45;
  font-weight: 900;
}

.contactPagerControls {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.contactPagerSize {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.contactPagerSize span {
  color: #667781;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.contactPagerSize select {
  width: 120px;
  min-height: 34px;
  padding: 6px 10px;
}

.contactPagerNav {
  justify-content: flex-end;
  gap: 10px;
}

.contactPagerPage {
  color: #48645a;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.scrollContactsTopButton {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #cbd8d1;
  border-radius: 999px;
  background: #ffffff;
  color: #1f5d45;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(17, 27, 33, 0.12);
}

.scrollContactsTopButton:hover,
.scrollContactsTopButton:focus-visible {
  border-color: #1f7a55;
  box-shadow: 0 12px 32px rgba(31, 122, 85, 0.2);
}

.contactCellValue {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: text;
  text-align: left;
}

.contactCellValue span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contactCellValue:hover span,
.contactCellValue:focus-visible span {
  color: #1f5d45;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.contactCellEditor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.contactCellEditor input {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
}

.contactCellEditor select {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
}

.contactRowActions {
  white-space: nowrap;
}

.dangerButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid #f0c9c5;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff7f6;
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
}

.dangerButton:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tinyButton:disabled,
.secondaryTiny:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.45);
}

.compactItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
}

.compactActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.deleteContact {
  min-height: 32px;
  border: 1px solid #f0c9c5;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff7f6;
  color: #b42318;
  font-weight: 900;
}

.compactItem p,
.campaignCard p {
  margin-top: 3px;
  color: #667781;
  font-size: 13px;
}

.campaignCard {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.campaignCard.active {
  border-color: #1f7a55;
  background: #eff9f4;
}

.campaignCard.status-neutral {
  border-color: #dce7e1;
  background: #fbfcfb;
}

.campaignCard.status-green {
  border-color: #7ac69a;
  background: #eef9f2;
}

.campaignCard.status-yellow {
  border-color: #e5c46a;
  background: #fffaf0;
}

.campaignCard.status-red {
  border-color: #efb0a8;
  background: #fff6f5;
}

.campaignCard.status-blue {
  border-color: #8fb7e9;
  background: #f4f8ff;
}

.campaignCard.status-green.active {
  border-color: #1f7a55;
  box-shadow: 0 0 0 1px rgba(31, 122, 85, 0.08) inset;
}

.campaignCard.status-yellow.active {
  border-color: #c9a43b;
  box-shadow: 0 0 0 1px rgba(201, 164, 59, 0.08) inset;
}

.campaignCard.status-red.active {
  border-color: #d96d63;
  box-shadow: 0 0 0 1px rgba(217, 109, 99, 0.08) inset;
}

.campaignCard.status-blue.active {
  border-color: #5f97db;
  box-shadow: 0 0 0 1px rgba(95, 151, 219, 0.08) inset;
}

.campaignStats {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: #667781;
  font-size: 13px;
  font-weight: 800;
}

.pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef3f1;
  color: #537066;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.green {
  background: #dff5ea;
  color: #1f7a55;
}

.pill.neutral {
  background: #eef3f1;
  color: #537066;
}

.pill.red {
  background: #fae8e6;
  color: #b42318;
}

.pill.yellow {
  background: #fef3c7;
  color: #92400e;
}

.pill.blue {
  background: #dbeafe;
  color: #1e40af;
}

.progressTrack {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eeea;
}

.progressTrack span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1f7a55;
}

.progressTrack.tone-neutral span {
  background: #94a3b8;
}

.progressTrack.tone-green span {
  background: #1f7a55;
}

.progressTrack.tone-yellow span {
  background: #c9a43b;
}

.progressTrack.tone-red span {
  background: #b42318;
}

.progressTrack.tone-blue span {
  background: #2563eb;
}

.recipientsPanel {
  margin-top: 18px;
}

.result.error {
  color: #b42318;
}

.chatEmpty,
.conversationEmpty {
  padding: 16px;
}

.loginPage {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.loginShell {
  width: min(420px, calc(100% - 32px));
}

.loginPanel {
  padding: 22px;
}

@media (max-width: 900px) {
  .appHeader,
  .panelHeader {
    align-items: stretch;
    flex-direction: column;
  }

  .topActions,
  .buttonRow {
    align-items: stretch;
    flex-direction: column;
  }

  .connectPanel .buttonRow {
    max-width: none;
    grid-template-columns: 1fr;
  }

  .accountsGrid,
  .messenger {
    grid-template-columns: 1fr;
  }

  .messenger {
    height: auto;
    min-height: 0;
  }

  .chatSidebar,
  .chatPane {
    min-height: 520px;
  }

  .accountForm,
  .accountNameForm,
  .replyForm,
  .campaignGrid,
  .formRow {
    grid-template-columns: 1fr;
  }

  .contactTable {
    min-width: 860px;
  }

  .contactPagerControls {
    align-items: stretch;
    flex-direction: column;
  }

  .contactBulkBar {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .contactSearchMeta {
    text-align: left;
    white-space: normal;
  }

  .contactBulkActions {
    width: 100%;
    justify-content: stretch;
  }

  .contactBulkActions .dangerButton {
    width: 100%;
  }

  .contactPagerNav {
    justify-content: space-between;
  }

  .contactPagerSize {
    width: 100%;
    min-width: 0;
  }

  .contactPagerSize select {
    flex: 1;
    width: 100%;
  }

  .scrollContactsTopButton {
    right: 16px;
    bottom: 16px;
  }

  .contactListsPanel .panelHeader,
  .contactListPanel .panelHeader {
    display: block;
  }

  .contactListCreateBar {
    width: 100%;
    margin: 12px 0 14px;
  }

  .autoReplyTopBar > label:first-child {
    min-width: 0;
    width: 100%;
  }

  .contactListPanel .buttonRow {
    justify-self: stretch;
  }

  .switchOption {
    width: 100%;
    justify-content: space-between;
  }

  .switchCompact {
    width: auto;
  }
}

#contactsSection .contactListsPanel,
#contactsSection .contactListPanel {
  box-sizing: border-box;
  padding: 24px !important;
}

#contactsSection .contactListPanel .stackForm,
#contactsSection .contactBulkBar,
#contactsSection .compactList {
  max-width: 100%;
}
