:root {
  color-scheme: light;
  --green: #008f83;
  --green-dark: #006f66;
  --green-soft: #d9f3ed;
  --ink: #172522;
  --muted: #657570;
  --surface: #ffffff;
  --chat-bg: #efeae2;
  --outgoing: #d9fdd3;
  --line: #dce4e1;
  --danger: #b45c22;
  --shadow: 0 24px 70px rgba(18, 56, 49, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  padding: 20px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 14%, rgba(255, 214, 0, 0.26), transparent 22%),
    radial-gradient(circle at 92% 86%, rgba(0, 143, 131, 0.24), transparent 28%),
    linear-gradient(135deg, #f7faf8 0%, #e8f5f1 100%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1420px, 100%);
  height: min(900px, calc(100vh - 40px));
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(0, 111, 102, 0.12);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.inbox {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: #fbfdfc;
}

.inbox-header {
  position: relative;
  overflow: hidden;
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 20px;
  color: white;
  background:
    linear-gradient(145deg, rgba(0, 143, 131, 0.96), rgba(0, 111, 102, 0.98)),
    var(--green);
}

.inbox-header::before,
.inbox-header::after {
  position: absolute;
  content: "";
  pointer-events: none;
  border-radius: 50%;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.075);
}

.inbox-header::before {
  width: 210px;
  height: 210px;
  left: -150px;
  top: -126px;
  border-width: 34px;
}

.inbox-header::after {
  width: 128px;
  height: 128px;
  right: -70px;
  bottom: -100px;
  border-width: 28px;
}

.brand-mark,
.welcome-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  height: 50px;
  border-radius: 16px;
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: white;
  box-shadow: 0 8px 22px rgba(0, 48, 44, 0.2);
}

.brand-logo,
.welcome-logo {
  display: block;
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.brand-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
}

.brand-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-copy strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.header-actions {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.header-logout,
.header-reports {
  position: relative;
  z-index: 1;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  color: white;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

.header-logout:hover,
.header-reports:hover {
  background: rgba(255, 255, 255, 0.2);
}

.header-logout:disabled {
  cursor: wait;
  opacity: 0.55;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 16px 18px 8px;
  padding: 12px 14px;
  border: 1px solid #dbe7e3;
  border-radius: 15px;
  background: white;
}

.connection-card div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.connection-card strong {
  font-size: 13px;
}

.connection-card span:not(.status-dot) {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #d69a39;
  box-shadow: 0 0 0 4px rgba(214, 154, 57, 0.14);
}

.status-dot.connected {
  background: #19b972;
  box-shadow: 0 0 0 4px rgba(25, 185, 114, 0.14);
}

.status-dot.disconnected {
  background: #d45a50;
  box-shadow: 0 0 0 4px rgba(212, 90, 80, 0.14);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 18px 12px;
  padding: 0 13px;
  border: 1px solid #dbe5e2;
  border-radius: 13px;
  color: var(--muted);
  background: white;
}

.search:focus-within {
  border-color: rgba(0, 143, 131, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 143, 131, 0.08);
}

.search input {
  min-width: 0;
  width: 100%;
  height: 43px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.conversation-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 0 18px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.quick-reply-trigger {
  min-width: 0;
  height: 36px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #dbe5e2;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  font-size: 11px;
  font-weight: 730;
  background: white;
}

.filter-options {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #dbe5e2;
  border-radius: 12px;
  background: #eef4f2;
}

.filter-options button {
  min-width: 0;
  height: 30px;
  overflow: hidden;
  padding: 0 7px;
  border: 0;
  border-radius: 8px;
  color: #697a75;
  font-size: 10px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  transition:
    color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.filter-options button:hover {
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.72);
}

.filter-options button[aria-pressed="true"] {
  color: white;
  background: var(--green);
  box-shadow: 0 3px 9px rgba(0, 111, 102, 0.2);
}

.filter-options button:focus-visible,
.quick-reply-trigger:focus-visible {
  outline: 2px solid rgba(0, 143, 131, 0.38);
  outline-offset: 2px;
}

.inbox-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 20px 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inbox-heading span {
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--green-dark);
  text-align: center;
  background: var(--green-soft);
}

.conversation-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.conversation {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  border: 0;
  border-top: 1px solid #edf1ef;
  color: inherit;
  text-align: left;
  background: transparent;
}

.conversation:hover {
  background: #f1f8f6;
}

.conversation.selected {
  background: #e1f4ef;
  box-shadow: inset 4px 0 var(--green);
}

.conversation-avatar,
.avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: white;
  font-size: 14px;
  font-weight: 850;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
}

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

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

.conversation-preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-side {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  padding: 2px 0;
}

.conversation-time {
  color: #82908b;
  font-size: 10px;
}

.unread {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: white;
  font-size: 10px;
  font-weight: 800;
  background: var(--green);
}

.manual-badge {
  color: var(--danger);
  font-size: 10px;
  font-weight: 750;
}

.empty-list {
  display: none;
  place-self: center;
  max-width: 230px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-list.visible {
  display: grid;
  gap: 7px;
}

.empty-list > span {
  color: #aab8b3;
  font-size: 38px;
}

.empty-list strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-list p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.chat {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--chat-bg);
}

.no-selection {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background:
    radial-gradient(circle at 20px 20px, rgba(92, 108, 102, 0.05) 1.5px, transparent 1.8px)
      0 0 / 42px 42px,
    var(--chat-bg);
}

.welcome-mark {
  width: 118px;
  height: 118px;
  flex-basis: 118px;
  border-radius: 27px;
  background: white;
}

.no-selection h1 {
  margin: 24px 0 8px;
  font-size: clamp(27px, 4vw, 40px);
  letter-spacing: -0.045em;
}

.no-selection p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.no-selection > span {
  margin-top: 18px;
  color: #81908b;
  font-size: 12px;
}

.active-chat {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.active-chat[hidden] {
  display: none;
}

.chat-header {
  min-height: 79px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.contact {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.contact strong,
.contact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact strong {
  font-size: 15px;
}

.contact span {
  color: var(--muted);
  font-size: 12px;
}

.automation {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.automation-state {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 750;
  background: var(--green-soft);
}

.automation-state.paused {
  color: #945022;
  background: #fff0df;
}

.automation-button {
  height: 38px;
  padding: 0 13px;
  border: 1px solid #d7e1de;
  border-radius: 11px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  background: white;
}

.automation-button:hover {
  border-color: #a4cdc5;
  background: #f5fbf9;
}

.messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px clamp(18px, 5vw, 58px);
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 20px 20px, rgba(92, 108, 102, 0.055) 1.5px, transparent 1.8px)
      0 0 / 42px 42px,
    radial-gradient(circle at 8px 8px, rgba(92, 108, 102, 0.04) 1px, transparent 1.3px)
      0 0 / 27px 27px,
    var(--chat-bg);
}

.message-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
}

.message-row.outgoing {
  justify-content: flex-end;
}

.message-row.outgoing .message-delete {
  order: -1;
}

.message-delete {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(168, 61, 61, 0.2);
  border-radius: 9px;
  color: #a13b3b;
  font-size: 10px;
  font-weight: 760;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    background 120ms ease;
}

.message-row:hover .message-delete,
.message-delete:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.message-delete:hover {
  background: #fff0f0;
}

@media (hover: none) {
  .message-delete {
    opacity: 1;
    transform: none;
  }
}

.message-card {
  width: fit-content;
  max-width: min(620px, 84%);
  padding: 10px 12px 7px;
  border-radius: 7px 16px 16px 16px;
  background: white;
  box-shadow: 0 1px 2px rgba(20, 42, 36, 0.12);
}

.message-card.has-image,
.message-card.has-attachment {
  width: min(430px, 84%);
}

.message-image {
  display: block;
  width: calc(100% + 24px);
  max-height: 540px;
  margin: -10px -12px 9px;
  border-radius: 7px 16px 0 0;
  object-fit: contain;
  background: white;
}

.outgoing .message-image {
  border-radius: 16px 7px 0 0;
}

.message-video {
  display: block;
  width: calc(100% + 24px);
  max-height: 540px;
  margin: -10px -12px 9px;
  border-radius: 7px 16px 0 0;
  background: #13201d;
}

.outgoing .message-video {
  border-radius: 16px 7px 0 0;
}

.message-audio {
  display: block;
  width: min(340px, 100%);
  margin: 2px 0 8px;
}

.message-document {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: min(330px, 100%);
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid rgba(77, 103, 95, 0.16);
  border-radius: 11px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
}

.message-document > span:first-child {
  font-size: 26px;
}

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

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

.message-document small {
  color: var(--muted);
  font-size: 10px;
}

.outgoing .message-card {
  border-radius: 16px 7px 16px 16px;
  background: var(--outgoing);
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-text strong {
  font-weight: 800;
}

.message-text .whatsapp-monospace {
  padding: 2px 4px;
  border-radius: 4px;
  font-family:
    "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  background: rgba(49, 69, 63, 0.1);
}

.message-link {
  color: #0676b8;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.message-meta {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 4px;
  color: #77847f;
  font-size: 10px;
}

.message-source {
  margin-right: auto;
  color: #61716c;
  font-weight: 700;
}

.checks {
  color: #1687d9;
  font-weight: 900;
}

.manual-note {
  padding: 7px 18px;
  border-top: 1px solid rgba(99, 115, 110, 0.12);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  background: #f7f9f8;
}

.manual-note.paused {
  color: #7a572f;
  background: #fff9ef;
}

.composer-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 0;
  border-top: 1px solid rgba(99, 115, 110, 0.12);
  background: #f7f9f8;
}

.tool-button,
.quick-reply-trigger {
  height: 36px;
}

.tool-button {
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid #d7e1de;
  border-radius: 10px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 780;
  background: white;
}

.tool-button:hover {
  border-color: #a4cdc5;
  background: #f1faf7;
}

.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.quick-reply-picker {
  min-width: 150px;
  flex: 1;
}

.quick-reply-trigger:hover,
.quick-reply-trigger[aria-expanded="true"] {
  border-color: #a4cdc5;
  color: var(--green-dark);
  background: #f1faf7;
}

.quick-reply-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.attachment-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 16px 0;
  background: #f7f9f8;
}

.attachment-preview[hidden] {
  display: none;
}

#attachmentList {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-item {
  min-width: 0;
  max-width: 280px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #dbe5e2;
  border-radius: 9px;
  color: var(--muted);
  font-size: 10px;
  background: white;
}

.attachment-item > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item button,
#clearAttachmentsButton {
  border: 0;
  color: #9c443c;
  background: transparent;
}

.attachment-item button {
  padding: 0 2px;
  font-size: 18px;
  line-height: 1;
}

#clearAttachmentsButton {
  flex: 0 0 auto;
  padding: 6px 0;
  font-size: 10px;
  font-weight: 750;
}

.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 11px;
  padding: 11px 16px 15px;
  background: #f7f9f8;
}

.slash-reply-menu {
  position: absolute;
  z-index: 12;
  bottom: calc(100% - 4px);
  left: 16px;
  width: min(520px, calc(100% - 118px));
  max-height: min(360px, 48vh);
  padding: 7px;
  overflow-y: auto;
  border: 1px solid #d8e3df;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(20, 42, 36, 0.18);
  backdrop-filter: blur(10px);
}

.slash-reply-menu[hidden] {
  display: none;
}

.slash-reply-menu.toolbar-mode {
  bottom: calc(100% + 42px);
}

.slash-reply-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 10px 8px;
  color: var(--muted);
  font-size: 10px;
}

.slash-reply-heading strong {
  color: var(--green-dark);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slash-reply-option {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.slash-reply-option:hover,
.slash-reply-option.active {
  background: #eaf8f4;
}

.slash-reply-option strong {
  color: var(--green-dark);
  font-size: 12px;
}

.slash-reply-option span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slash-reply-empty {
  margin: 0;
  padding: 13px 10px;
  color: var(--muted);
  font-size: 11px;
}

.composer textarea {
  min-width: 0;
  min-height: 48px;
  max-height: 130px;
  flex: 1;
  resize: none;
  padding: 13px 17px;
  border: 1px solid transparent;
  border-radius: 16px;
  outline: none;
  color: var(--ink);
  line-height: 1.45;
  background: white;
  box-shadow: 0 1px 2px rgba(20, 42, 36, 0.06);
}

.composer textarea:focus {
  border-color: rgba(0, 143, 131, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 143, 131, 0.09);
}

#sendButton {
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 19px;
  border: 0;
  border-radius: 16px;
  color: white;
  font-weight: 800;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(0, 143, 131, 0.24);
}

#sendButton:hover {
  background: var(--green-dark);
}

#sendButton:disabled,
.automation-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

#sendButton svg {
  width: 18px;
  fill: currentColor;
}

.panel-dialog {
  width: min(680px, calc(100vw - 30px));
  max-height: min(780px, calc(100vh - 30px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: white;
  box-shadow: 0 28px 90px rgba(17, 44, 38, 0.3);
}

.panel-dialog::backdrop {
  background: rgba(12, 31, 27, 0.48);
  backdrop-filter: blur(3px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  color: white;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
}

.dialog-heading > div {
  display: grid;
  gap: 4px;
}

.dialog-heading strong {
  font-size: 18px;
}

.dialog-heading span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.dialog-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  font-size: 25px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.13);
}

.dialog-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(220px, 1fr);
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}

.dialog-form label {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.dialog-form input,
.dialog-form textarea {
  width: 100%;
  border: 1px solid #d6e2de;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: white;
}

.dialog-form input {
  height: 42px;
  padding: 0 12px;
}

.dialog-form textarea {
  min-height: 105px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

.dialog-form input:focus,
.dialog-form textarea:focus {
  border-color: rgba(0, 143, 131, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 143, 131, 0.08);
}

.dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-actions button,
.saved-message button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d8e2df;
  border-radius: 9px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 780;
  background: white;
}

.dialog-actions .primary-action {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.saved-message-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px 20px 18px;
}

.saved-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #e9efed;
}

.saved-message > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.saved-message p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-message > div:last-child {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
}

.saved-message .danger-action {
  color: #9c443c;
}

.saved-empty {
  margin: 22px auto 8px;
  max-width: 410px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.schedule-status {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #76521e;
  font-size: 10px;
  font-weight: 750;
  background: #fff0cf;
}

.schedule-status.sent {
  color: var(--green-dark);
  background: var(--green-soft);
}

.schedule-status.failed {
  color: #8b3e37;
  background: #fde5e2;
}

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

.login-shell {
  width: min(940px, 100%);
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  overflow: hidden;
  border: 1px solid rgba(0, 111, 102, 0.12);
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow);
}

.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(36px, 6vw, 68px);
  color: white;
  background:
    linear-gradient(145deg, rgba(0, 143, 131, 0.97), rgba(0, 95, 87, 0.99)),
    var(--green-dark);
}

.login-brand-decoration {
  position: absolute;
  width: 440px;
  height: 440px;
  right: -280px;
  top: -180px;
  border: 62px solid rgba(255, 255, 255, 0.065);
  border-radius: 50%;
}

.login-brand img {
  position: relative;
  width: 88px;
  height: 88px;
  object-fit: contain;
  padding: 7px;
  border-radius: 21px;
  background: white;
  box-shadow: 0 14px 34px rgba(0, 49, 44, 0.25);
}

.login-brand > span {
  position: relative;
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-brand h1 {
  position: relative;
  max-width: 380px;
  margin: 8px 0 12px;
  font-size: clamp(31px, 4vw, 45px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.login-brand > p {
  position: relative;
  max-width: 350px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.65;
}

.privacy-note {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 34px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(0, 40, 36, 0.16);
}

.privacy-note > span {
  font-size: 19px;
}

.privacy-note > div {
  display: grid;
  gap: 2px;
}

.privacy-note strong {
  font-size: 12px;
}

.privacy-note small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  line-height: 1.45;
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 7vw, 78px);
}

.login-heading > span {
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-heading h2 {
  margin: 7px 0 8px;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.04em;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

.login-form > label {
  display: grid;
  gap: 7px;
  color: #495a55;
  font-size: 11px;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d4e0dc;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fbfdfc;
}

.login-form input:focus {
  border-color: rgba(0, 143, 131, 0.55);
  background: white;
  box-shadow: 0 0 0 4px rgba(0, 143, 131, 0.09);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 70px;
}

.password-field button {
  position: absolute;
  right: 7px;
  top: 7px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 850;
  background: var(--green-soft);
}

.login-submit {
  height: 49px;
  border: 0;
  border-radius: 13px;
  color: white;
  font-weight: 850;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(0, 143, 131, 0.23);
}

.login-submit:hover {
  background: var(--green-dark);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-error {
  margin: -5px 0 0;
  padding: 10px 12px;
  border: 1px solid #f1c6c1;
  border-radius: 10px;
  color: #963e36;
  font-size: 11px;
  line-height: 1.45;
  background: #fff0ee;
}

.login-footnote {
  margin-top: 22px;
  color: #899792;
  font-size: 10px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 28px;
  max-width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 12px;
  color: white;
  font-size: 13px;
  font-weight: 650;
  background: #273833;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

.toast.error {
  background: #9c443c;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  body {
    padding: 0;
  }

  .app-shell {
    width: 100%;
    height: 100vh;
    min-height: 540px;
    grid-template-columns: 310px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
  }

  .automation-state {
    display: none;
  }

  .login-page {
    padding: 18px;
  }

  .login-shell {
    grid-template-columns: minmax(280px, 0.8fr) minmax(340px, 1.2fr);
  }
}

@media (max-width: 660px) {
  .login-page {
    display: block;
    padding: 0;
    background: white;
  }

  .login-shell {
    min-height: 100vh;
    display: block;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand {
    min-height: 245px;
    padding: 28px;
  }

  .login-brand img {
    width: 66px;
    height: 66px;
  }

  .login-brand > span {
    margin-top: 18px;
  }

  .login-brand h1 {
    margin-bottom: 8px;
    font-size: 30px;
  }

  .login-brand > p {
    font-size: 12px;
  }

  .privacy-note {
    display: none;
  }

  .login-card {
    padding: 34px 28px 42px;
  }

  .app-shell {
    display: block;
  }

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

  .app-shell.chat-open .inbox {
    display: none;
  }

  .app-shell:not(.chat-open) .chat {
    display: none;
  }

  .chat-header {
    padding: 11px 12px;
  }

  .chat-header::before {
    content: "‹";
    color: var(--green-dark);
    font-size: 32px;
    cursor: pointer;
  }

  .automation-button {
    padding: 0 9px;
  }

  .messages {
    padding: 20px 12px;
  }

  .message-card {
    max-width: 92%;
  }

  .message-card.has-image {
    width: 92%;
  }

  .message-card.has-attachment {
    width: 92%;
  }

  .composer-tools {
    gap: 6px;
    padding: 7px 9px 0;
    overflow-x: auto;
  }

  .tool-button {
    white-space: nowrap;
  }

  .quick-reply-picker {
    min-width: 180px;
  }

  .composer {
    padding: 9px;
  }

  .slash-reply-menu {
    left: 9px;
    width: calc(100% - 84px);
  }

  .slash-reply-heading span {
    display: none;
  }

  #sendButton {
    width: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  #sendButton span {
    display: none;
  }

  .dialog-form {
    grid-template-columns: 1fr;
  }

  .saved-message {
    align-items: flex-start;
    flex-direction: column;
  }

  .saved-message > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
}
