.em-page {
  display: grid;
  gap: 18px;
  color: #17324b;
}
.em-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 25px 27px;
  border-radius: 20px;
  background: linear-gradient(125deg, #123f55, #09687b);
  background:linear-gradient(125deg, color-mix(in srgb, var(--brand) 21%, color-mix(in srgb, #fff 2.5%, #10283f)), color-mix(in srgb, var(--brand) 69%, #10283f));
  color: #fff;
  box-shadow: 0 16px 36px rgba(18, 63, 85, 0.16);
  box-shadow:0 16px 36px color-mix(in srgb, color-mix(in srgb, var(--brand) 21%, color-mix(in srgb, #fff 2.5%, #10283f)) 16%, transparent);
}
.em-hero-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.em-hero-icon svg {
  width: 26px;
}
.em-hero h2 {
  margin: 3px 0 4px;
  font-size: 25px;
  color: #fff;
}
.em-hero p {
  margin: 0;
  color: #cce6ec;
  color:color-mix(in srgb, var(--brand) 20%, #fff);
}
.em-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.45px;
  color: #91e4ef;
}
.em-enable {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
  white-space: nowrap;
}
.em-enable input {
  accent-color: #20c0d3;
  width: 18px;
  height: 18px;
}
.em-auto-card {
  background: linear-gradient(145deg, #fff 0%, #f5fbfc 100%);
  background:linear-gradient(145deg, #fff 0%, color-mix(in srgb, var(--brand) 4%, #fff) 100%);
}
.em-auto-toggle {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 18px;
  border: 1px solid #cce4ea;
  border:1px solid color-mix(in srgb, var(--brand) 21%, #fff);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.em-auto-toggle input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: #078fac;
  flex: 0 0 auto;
}
.em-auto-toggle span {
  display: grid;
  gap: 5px;
  color: #173650;
}
.em-auto-toggle small {
  color: #688095;
  line-height: 1.5;
  font-weight: 500;
}
.em-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.em-status-grid > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid #dce7ec;
  border:1px solid color-mix(in srgb, var(--brand) 8%, color-mix(in srgb, #fff 93.5%, #10283f));
  border-radius: 14px;
  background: #fff;
}
.em-status-grid svg {
  width: 19px;
  color: #0796ad;
}
.em-status-grid span {
  display: grid;
}
.em-status-grid small {
  color: #7b91a1;
}
.em-status-grid strong {
  font-size: 13px;
}
.em-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 14px;
}
.em-message svg {
  width: 19px;
  flex: none;
}
.em-message.ok {
  background: #eaf8f3;
  color: #13765f;
}
.em-message.error {
  background: #fff0f0;
  color: #b63d49;
}
.em-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.9fr);
  gap: 18px;
}
.em-column {
  display: grid;
  align-content: start;
  gap: 18px;
}
.em-card {
  padding: 22px;
  border: 1px solid #dce7ec;
  border:1px solid color-mix(in srgb, var(--brand) 8%, color-mix(in srgb, #fff 93.5%, #10283f));
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 50, 75, 0.045);
}
.em-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.em-card-title > span {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 11px;
  background: #e9f8fa;
  background:color-mix(in srgb, var(--brand) 8%, #fff);
  color: #078ca3;
}
.em-card-title svg {
  width: 19px;
}
.em-card-title h3 {
  margin: 0 0 3px;
  font-size: 17px;
}
.em-card-title p {
  margin: 0;
  color: #758b9c;
  font-size: 13px;
}
.em-providers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 13px;
}
.em-providers button,
.em-template-tabs button {
  border: 1px solid #dce7ec;
  border:1px solid color-mix(in srgb, var(--brand) 8%, color-mix(in srgb, #fff 93.5%, #10283f));
  background: #f8fbfc;
  background:color-mix(in srgb, var(--brand) 3%, #fff);
  color: #324e63;
  border-radius: 11px;
  text-align: left;
  padding: 11px 12px;
  cursor: pointer;
}
.em-providers button.active,
.em-template-tabs button.active {
  border-color: #0796ad;
  background: #eaf8fa;
  background:color-mix(in srgb, var(--brand) 8%, #fff);
  color: #06788d;
  color:color-mix(in srgb, var(--brand) 88%, #10283f);
  box-shadow: inset 0 0 0 1px #0796ad;
}
.em-providers strong,
.em-providers small {
  display: block;
}
.em-providers strong {
  font-size: 13px;
}
.em-providers small {
  margin-top: 3px;
  font-size: 11px;
  color: #7c91a0;
}
.em-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 17px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f2f7f9;
  background:color-mix(in srgb, var(--brand) 4%, color-mix(in srgb, #fff 99%, #10283f));
  color: #60798c;
  font-size: 12px;
}
.em-hint svg {
  width: 15px;
  flex: none;
  color: #0796ad;
}
.em-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.em-fields label {
  display: grid;
  gap: 6px;
  color: #405d72;
  font-size: 12px;
  font-weight: 700;
}
.em-fields label.wide {
  grid-column: 1/-1;
}
.em-fields input,
.em-fields select,
.em-fields textarea,
.em-test input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccdce4;
  border:1px solid color-mix(in srgb, var(--brand) 13%, color-mix(in srgb, #fff 90.8%, #10283f));
  border-radius: 10px;
  background: #fff;
  color: #17324b;
  padding: 11px 12px;
  font: inherit;
  outline: none;
}
.em-fields input:focus,
.em-fields select:focus,
.em-fields textarea:focus,
.em-test input:focus {
  border-color: #0796ad;
  box-shadow: 0 0 0 3px rgba(7, 150, 173, 0.11);
}
.em-fields textarea {
  min-height: 82px;
  resize: vertical;
}
.em-template-tabs {
  display: flex;
  gap: 7px;
  overflow: auto;
  margin-bottom: 15px;
}
.em-template-tabs button {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}
.em-variables {
  display: block;
  margin: 13px 0;
  color: #7a8f9f;
}
.em-preview {
  overflow: hidden;
  border: 1px solid #dce7ec;
  border:1px solid color-mix(in srgb, var(--brand) 8%, color-mix(in srgb, #fff 93.5%, #10283f));
  border-radius: 13px;
  background: #eef4f7;
  background:color-mix(in srgb, var(--brand) 5%, color-mix(in srgb, #fff 97.9%, #10283f));
}
.em-preview > div {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  background: #f8fbfc;
  background:color-mix(in srgb, var(--brand) 3%, #fff);
  border-bottom: 1px solid #dce7ec;
  border-bottom:1px solid color-mix(in srgb, var(--brand) 8%, color-mix(in srgb, #fff 93.5%, #10283f));
}
.em-preview > div span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cfdae0;
}
.em-preview > div strong {
  margin-left: 5px;
  font-size: 10px;
  color: #7b8f9d;
}
.em-preview iframe {
  display: block;
  width: 100%;
  height: 405px;
  border: 0;
  background: #eef4f7;
  background:color-mix(in srgb, var(--brand) 5%, color-mix(in srgb, #fff 97.9%, #10283f));
}
.em-preview > p {
  padding: 30px;
  text-align: center;
  color: #7a8f9f;
}
.em-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 0 2px;
  background: linear-gradient(transparent, #f6f9fb 18%);
}
.em-footer > div,
.em-test {
  display: flex;
  gap: 9px;
}
.em-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cbdce4;
  border:1px solid color-mix(in srgb, var(--brand) 13%, color-mix(in srgb, #fff 90.8%, #10283f));
  border-radius: 11px;
  background: #fff;
  color: #27495e;
  padding: 11px 15px;
  font-weight: 750;
  cursor: pointer;
}
.em-footer button.primary {
  background: #078fa7;
  border-color: #078fa7;
  color: #fff;
}
.em-footer button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.em-footer svg {
  width: 17px;
}
.em-test input {
  min-width: 250px;
}
.em-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 50px;
  color: #6d8495;
}
.spin {
  animation: em-spin 1s linear infinite;
}
@keyframes em-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1100px) {
  .em-layout {
    grid-template-columns: 1fr;
  }
  .em-preview iframe {
    height: 470px;
  }
}
@media (max-width: 720px) {
  .em-hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .em-enable {
    margin-left: 0;
  }
  .em-status-grid,
  .em-fields {
    grid-template-columns: 1fr;
  }
  .em-fields label.wide {
    grid-column: auto;
  }
  .em-providers {
    grid-template-columns: 1fr;
  }
  .em-footer {
    position: static;
    flex-direction: column;
  }
  .em-footer > div,
  .em-test {
    flex-direction: column;
  }
  .em-test input {
    min-width: 0;
  }
}

/* ajustes de layout: colunas não estouram, rodapé sólido e legível */
.em-column, .em-card, .em-layout > * { min-width: 0; }
.em-footer { align-items: center; flex-wrap: wrap; padding: 12px 14px; border: 1px solid #dce7ec; border-radius: 16px; background: #fff; box-shadow: 0 -6px 22px rgba(23, 50, 75, 0.08); }
.em-footer button { white-space: nowrap; }
.em-test { flex: 1 1 380px; min-width: 0; }
.em-test input { flex: 1; min-width: 0; }
.em-footer > div:last-child { flex-wrap: wrap; }
.em-message.error { color: #9d2f3a; }
.em-status-grid small, .em-card-title p, .em-providers small, .em-variables { color: #55687a; }
@media (max-width: 1360px) { .em-layout { grid-template-columns: 1fr; } }
.em-page{container-type:inline-size}
@container (max-width: 1040px){.em-layout{grid-template-columns:minmax(0,1fr)}}
@container (max-width: 620px){.em-status-grid,.em-fields,.em-providers{grid-template-columns:minmax(0,1fr)}.em-footer{flex-direction:column;align-items:stretch}.em-footer > div,.em-test{flex-direction:column}}

.em-purpose-card {display:grid;gap:10px;padding:22px;border:1px solid #dbe6ef;border-radius:18px;background:var(--surface,#fff)}
.em-purpose-card select {width:100%;min-height:48px;padding:12px;border:1px solid #cbdce8;border-radius:10px;background:var(--surface,#fff);color:inherit;font:inherit}
.em-purpose-card p {margin:0;color:#587084}
.em-purpose-card small {color:#748b9d}
