.messenger-account-selector {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: #17263e;
}
.messenger-account-selector legend {
  margin-bottom: 16px;
  padding: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
}
.messenger-account-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.messenger-account-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 128px;
  margin: 0;
  padding: 22px 18px;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.messenger-account-option.is-selected {
  border-color: #416bd1;
  background: #f3f6ff;
  box-shadow: 0 0 0 1px #416bd1;
}
.messenger-account-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
  accent-color: #416bd1;
}
.messenger-account-option svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: #536a91;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.messenger-account-option span {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.messenger-account-option strong {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 650;
}
.messenger-account-option small {
  font-size: 13px;
  line-height: 1.6;
  color: #596b82;
}
.messenger-account-option:focus-within {
  outline: 2px solid #416bd1;
  outline-offset: 4px;
}
.messenger-account-selector:disabled .messenger-account-option {
  opacity: 0.65;
  cursor: default;
}
.messenger-account-helper {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #596b82;
}
@media (max-width: 600px) {
  .messenger-account-options {
    grid-template-columns: 1fr;
  }
  .messenger-account-option {
    min-height: 110px;
    padding: 20px 16px;
  }
}
.em-entry,
.em-dialog {
  font-family: inherit;
  color: #14213d;
  box-sizing: border-box;
}
.em-entry {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0;
  padding: 24px;
  border: 1px solid #dbe6f7;
  background: linear-gradient(120deg, #f7faff, #eef4ff);
  border-radius: 22px;
}
.em-entry h3 {
  margin: 6px 0;
  font-size: 21px;
}
.em-entry p,
.em-header p {
  color: #53627a;
  margin: 0;
}
.em-entry .em-primary {
  margin-left: auto;
  white-space: nowrap;
}
.em-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1667ed, #7954df);
  color: #fff;
  font-size: 25px;
}
.em-eyebrow {
  color: #3f5ba5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.em-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: #0d193e99;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.em-dialog {
  width: min(1040px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 28px 100px #06133155;
}
.em-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 26px;
  border-bottom: 1px solid #e5ebf3;
}
.em-header h2 {
  font-size: 26px;
  margin: 6px 0;
}
.em-content {
  padding: 24px;
  display: grid;
  gap: 18px;
}
.em-close,
.em-primary,
.em-secondary {
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  min-height: 44px;
}
.em-close,
.em-secondary {
  border: 1px solid #d4dfef;
  background: #fff;
  color: #243a5f;
}
.em-primary {
  border: 0;
  background: #225ce7;
  color: #fff;
}
.em-field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
}
.em-field input,
.em-field select,
.em-field textarea,
.em-controls input {
  font: inherit;
  padding: 12px;
  border: 1px solid #cbd7e8;
  background: #fff;
  border-radius: 10px;
  min-width: 0;
  color: #14213d;
}
.em-agent-setup {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid #d4dfef;
  border-radius: 16px;
  background: #f7f9fd;
}
.em-agent-setup h3,
.em-agent-setup p {
  margin: 0;
}
.em-agent-setup p {
  font-size: 14px;
  line-height: 1.6;
  color: #364d70;
}
.em-setup-form,
.em-setup-chat {
  display: grid;
  gap: 14px;
}
.em-setup-form[hidden],
.em-setup-chat[hidden] {
  display: none;
}
.em-field textarea {
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.em-agent-setup [aria-pressed="true"] {
  background: #e4ecff;
  border-color: #225ce7;
  color: #183e9c;
}
.em-setup-chat-log {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
}
.em-notice.is-error {
  color: #9b2435;
  border: 1px solid #df9ca8;
  background: #fff0f3;
}
.em-modes {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.em-modes legend {
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 700;
}
.em-mode {
  border: 1px solid #d9e3f0;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  cursor: pointer;
}
.em-mode:has(:checked) {
  border-color: #326cea;
  background: #f1f6ff;
}
.em-mode small {
  grid-column: 2;
  color: #53627a;
}
.em-page-fields {
  display: grid;
  gap: 12px;
}
.em-page-fields[hidden] {
  display: none;
}
.em-notice {
  padding: 14px 18px;
  border-radius: 12px;
  background: #f4f7fc;
  color: #435775;
  font-size: 13px;
  line-height: 1.6;
}
.em-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.em-browser img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #d8e2f0;
  cursor: crosshair;
  touch-action: manipulation;
}
.em-browser img[hidden] {
  display: none;
}
.em-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.em-controls input {
  flex: 1 1 240px;
}
.em-message {
  padding: 0 24px 24px;
  font-size: 14px;
  color: #3e5b86;
}
.em-message.is-error {
  color: #b12535;
}
.em-dialog button:focus-visible,
.em-dialog input:focus-visible,
.em-dialog select:focus-visible,
.em-entry button:focus-visible {
  outline: 3px solid #638dfa;
  outline-offset: 3px;
}
.em-backdrop[aria-busy="true"] .em-primary[aria-busy="true"] {
  opacity: 0.65;
}
@media (max-width: 600px) {
  .em-entry {
    flex-wrap: wrap;
    padding: 18px;
  }
  .em-entry .em-primary {
    width: 100%;
    margin: 0;
  }
  .em-backdrop {
    padding: 8px;
  }
  .em-dialog {
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }
  .em-header,
  .em-content {
    padding: 18px;
  }
  .em-modes {
    grid-template-columns: 1fr;
  }
  .em-controls button {
    flex: 1;
  }
  .em-header h2 {
    font-size: 22px;
  }
}

/* Action feedback stays next to the control that was pressed. */
.em-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  line-height: 1.35;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.16s ease;
}
.em-action:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}
.em-action:focus-visible {
  outline: 3px solid #a8c8ff;
  outline-offset: 3px;
}
.em-primary.em-action {
  background: linear-gradient(135deg, #225ce7, #454ed4);
  border: 1px solid #315be0;
  box-shadow: 0 4px 12px rgb(34 92 231 / 16%);
  font-size: 14px;
  font-weight: 650;
}
.em-primary.em-action:hover:not(:disabled) {
  background: linear-gradient(135deg, #194fd2, #393cbd);
  box-shadow: 0 6px 16px rgb(34 92 231 / 22%);
}
.em-secondary.em-action:hover:not(:disabled) {
  background: #f2f6fc;
  border-color: #9eb7e0;
}
.em-action[aria-busy="true"] {
  cursor: wait;
  opacity: 1;
}
.em-action.is-complete {
  box-shadow: 0 0 0 3px rgb(20 146 112 / 20%);
}
.em-button-spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: em-button-spin 0.7s linear infinite;
}
@keyframes em-button-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .em-action {
    transition: none;
  }
  .em-action:active:not(:disabled) {
    transform: none;
  }
  .em-button-spinner {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.6;
  }
}
.em-customer-actions{border:1px solid #dce3ef;border-radius:18px;background:#fff;color:#17243b;margin:18px 0;padding:0;max-width:880px;font-family:inherit}.em-customer-actions>summary{cursor:pointer;padding:17px 20px;font-weight:700;list-style-position:inside}.em-customer-actions>summary:focus-visible{outline:2px solid #7552e8;outline-offset:3px}.em-customer-actions-body{padding:0 20px 20px}.em-customer-actions-body>p{font-size:14px;line-height:1.6}.em-customer-inputs,.em-customer-proposal{display:grid;gap:14px;margin-top:18px}.em-customer-proposal{border-top:1px solid #e5eaf3;padding-top:18px}.em-customer-actions label{display:grid;gap:7px;font-size:13px;font-weight:600}.em-customer-actions select,.em-customer-actions textarea{box-sizing:border-box;width:100%;min-height:42px;padding:10px 12px;border:1px solid #ccd6e4;border-radius:10px;background:#f9fafc;color:#17243b;font:inherit}.em-customer-actions textarea{resize:vertical}.em-customer-actions .em-button{width:fit-content;min-height:42px}.em-customer-status{padding:10px 12px;border-radius:10px;background:#eef5ff;color:#233e66}.em-customer-status[data-error=true]{background:#fff0ee;color:#9b2922}.em-customer-note{color:#506079}@media(max-width:600px){.em-customer-actions-body{padding:0 14px 16px}.em-customer-actions>summary{padding:15px 14px}}
/* Customer action controls share the same compact visual treatment in every agent. */
.em-customer-actions{--ca-action-accent:#7152b9;border-radius:16px;border-color:#e1e5ef;box-shadow:0 4px 18px #26344c06}
.em-customer-actions>summary{font-size:14px;padding:16px 20px;letter-spacing:-.2px}
.em-customer-actions-body>p{font-size:12px;line-height:1.8;color:#52647c}
.em-customer-inputs{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px 18px}
.em-customer-inputs>label:nth-child(3),.em-customer-inputs>.em-button{grid-column:1/-1}
.em-customer-actions label{gap:8px;font-size:12px;font-weight:600;color:#344963}
.em-customer-actions select,.em-customer-actions textarea{font:400 12px/1.7 Inter,ui-sans-serif,system-ui,sans-serif;border-color:#dbe1eb;border-radius:10px;background:#fafbfe;color:#20334d;min-height:40px;transition:border-color .15s,box-shadow .15s}
.em-customer-actions select{padding:9px 32px 9px 12px}.em-customer-actions textarea{padding:12px;min-height:92px}
.em-customer-actions textarea::placeholder{color:#718098;font-size:12px;line-height:1.8}
.em-customer-actions :is(select,textarea):focus-visible{outline:0;border-color:#957ccf;box-shadow:0 0 0 3px #7152b918}
.em-customer-actions .em-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:fit-content;min-height:36px;padding:9px 15px;border:1px solid #223750;border-radius:9px;background:#223750;color:white;font:600 12px/1.2 Inter,ui-sans-serif,system-ui,sans-serif;letter-spacing:0;cursor:pointer;box-shadow:0 2px 5px #22375010;transition:background .15s,border-color .15s,box-shadow .15s,transform .15s}
.em-customer-actions .em-button:hover:not(:disabled){background:#304b69;border-color:#304b69;box-shadow:0 4px 10px #22375018}
.em-customer-actions .em-button:active:not(:disabled){transform:translateY(1px);box-shadow:none}
.em-customer-actions .em-button:focus-visible{outline:3px solid #b8a4e7;outline-offset:3px}
.em-customer-actions .em-button:disabled{opacity:.7;cursor:wait}
.em-customer-proposal{padding:18px;margin-top:22px;border:1px solid #e8e0f4;border-radius:12px;background:linear-gradient(125deg,#f9f7fe,#f6fafc)}
.em-customer-proposal .em-button{border-color:#d6c9ed;background:white;color:#6846a7;box-shadow:0 2px 5px #7152b908}
.em-customer-proposal .em-button:hover:not(:disabled){background:#f0eaf9;border-color:#bda8dd;box-shadow:0 4px 10px #7152b90c}
.em-customer-proposal .em-button::before{content:'✦';font-size:15px;line-height:1}
.em-customer-actions .em-button[aria-busy=true]::before{content:'';display:block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:ca-button-spin .8s linear infinite}
.em-customer-actions .em-customer-status{font-size:11px;color:#456079;background:#f2f6fa;border:1px solid #e1e9f1;padding:9px 11px;border-radius:8px}
.em-customer-actions .em-customer-status[data-error=true]{color:#9b2922;background:#fff0ee;border-color:#f1d8d4}
.em-customer-actions .em-customer-note{font-size:11px;color:#708099;line-height:1.7;margin:16px 0 0}
@keyframes ca-button-spin{to{transform:rotate(360deg)}}
@media(max-width:600px){.em-customer-inputs{grid-template-columns:minmax(0,1fr);gap:14px}.em-customer-proposal{padding:14px}.em-customer-actions :is(select,textarea){font-size:16px}.em-customer-actions .em-button{min-height:40px;padding:10px 15px;font-size:12px}.em-customer-actions .em-customer-note{font-size:11px}}
@media(prefers-reduced-motion:reduce){.em-customer-actions :is(select,textarea,.em-button){transition:none}.em-customer-actions .em-button[aria-busy=true]::before{animation:none}}

/* Messenger account activation uses the same compact controls as app setup. */
.em-attention{margin:18px 0;padding:20px;border:1px solid #dce3ee;border-radius:16px;background:#fff;color:#20334c;box-shadow:0 3px 14px #22375006}
.em-attention-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.em-attention-heading h3{margin:0;font-size:16px;line-height:1.4;letter-spacing:-.25px}.em-attention>p{font-size:13px;line-height:1.65;color:#52647c;max-width:68ch}.em-attention-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:100px;background:#f1f4f8;color:#52647c;font-size:11px;font-weight:650}.em-attention-badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}.em-attention-badge[data-state=active]{background:#eaf6f0;color:#20754e}.em-attention .em-attention-status{margin:15px 0;padding:11px 13px;border-radius:10px;background:#f6f8fc;color:#344963}.em-attention-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.em-attention-actions .em-action{width:auto;min-height:38px;padding:9px 14px;border-radius:10px;font-size:12px;line-height:1.3}.em-attention-actions .em-primary{background:#283d59;border-color:#283d59;color:#fff}.em-attention-actions .em-primary:hover:not(:disabled){background:#365576}.em-attention-actions .em-secondary{background:#fff;border:1px solid #dbe2ed;color:#344963}.em-attention-actions .em-action:disabled{cursor:default;opacity:.5}.em-attention-actions .em-action:focus-visible{outline:3px solid #b8a4e7;outline-offset:3px}.em-attention-note{display:block;margin-top:14px;font-size:11px;line-height:1.6;color:#62738a}@media(max-width:600px){.em-attention{padding:16px}.em-attention-heading h3{font-size:15px}.em-attention-actions{gap:7px}.em-attention-actions .em-action{flex:1 1 auto;min-height:42px}}
/* Account → instructions → activation. Each step keeps its fields and drafts. */
.em-dialog .em-step[hidden],.em-dialog .em-page-fields[hidden],.em-dialog .em-step-footer button[hidden]{display:none!important}
.em-step-navigation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0 0 24px;padding:6px;border:1px solid #e1e6ef;border-radius:14px;background:#f4f6fb}
.em-step-tab{min-height:42px;border:0;border-radius:9px;background:transparent;color:#52647c;font-family:inherit;font-size:13px;font-weight:600;line-height:1.3;cursor:pointer;padding:10px 8px}
.em-step-tab[aria-current=step]{background:#fff;color:#6846a7;box-shadow:0 2px 8px #283d5912}
.em-step-tab:disabled{opacity:.5;cursor:default}.em-step-tab:focus-visible{outline:3px solid #b8a4e7;outline-offset:2px}
.em-step-title{margin:0 0 8px;font-size:21px;letter-spacing:-.5px;color:#20334c}.em-step-description{margin:0 0 22px;color:#52647c;font-size:13px;line-height:1.7;max-width:68ch}
.em-step>.em-actions{margin:20px 0;display:flex;flex-wrap:wrap;gap:8px}.em-step>.em-actions .em-primary{padding:12px 20px;min-height:44px;background:#6846a7;color:#fff;border-radius:11px;font-weight:700}
.em-step-footer{display:flex;justify-content:space-between;gap:12px;margin-top:24px;border-top:1px solid #e1e6ef;padding-top:18px}.em-step-footer .em-primary{margin-left:auto;background:#283d59;color:white}.em-step-footer .em-action{min-height:42px;padding:11px 18px;border-radius:10px}.em-step-footer .em-action:disabled{opacity:.45;cursor:default}
.em-activation-summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:16px;border:1px solid #e1e6ef;border-radius:13px;background:#f8f9fd}.em-activation-summary strong{width:100%;font-size:16px;color:#20334c}.em-activation-summary span{font-size:12px;padding:5px 9px;background:white;border:1px solid #e1e6ef;border-radius:7px;color:#52647c}
@media(max-width:600px){.em-step-navigation{gap:3px;padding:4px;margin-bottom:20px}.em-step-tab{font-size:11px;min-height:42px;padding:8px 4px}.em-step-title{font-size:19px}.em-step>.em-actions .em-primary{flex:1 1 100%}.em-step-footer{padding-top:14px;margin-top:20px}}

.em-instruction-choice{padding:18px;margin-bottom:22px;border:1px solid #dce4ef;border-radius:14px;background:#f8faff}.em-instruction-choice h4{margin:0 0 8px;color:#20334c;font-size:16px}.em-instruction-choice>p{font-size:12px;line-height:1.7;color:#52647c}.em-instruction-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.em-instruction-option{width:100%;min-height:42px;padding:10px;border:1px solid #cad5e5;border-radius:9px;background:white;color:#344963;font:600 12px/1.4 Inter,system-ui,sans-serif;cursor:pointer}.em-instruction-option[aria-pressed=true]{background:#eee8fa;border-color:#9274c8;color:#563789}.em-instruction-option:focus-visible{outline:3px solid #b8a4e7;outline-offset:2px}.em-instruction-description{margin:8px 0 0;color:#52647c;font-size:11px;line-height:1.65}.em-instruction-result{padding-top:12px;border-top:1px solid #e0e6f0}.em-instruction-choice.has-conflict{border-color:#e3be81;background:#fffaf0}@media(max-width:600px){.em-instruction-options{grid-template-columns:1fr}.em-instruction-choice{padding:15px}}

.em-setup-form[data-instruction-mode=SHARED] [data-local-work]{display:none}

.em-general-instruction-edit{display:inline-flex;padding:8px 0;color:#6846a7;font-size:12px;font-weight:600}.em-general-instruction-edit[hidden]{display:none}
