/* JKA Dealer Portal v1.6.27 — external email deliverability + visual release gate */

body.homeaid-system .external-delivery-readiness-card .premium-card-head{
  align-items:center!important;
  justify-content:space-between!important;
}
body.homeaid-system .external-delivery-readiness-card .premium-card-body{
  display:grid;
  gap:.8rem;
}
body.homeaid-system .deliverability-domain{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.7rem .8rem;
  border:1px solid var(--ha-border);
  border-radius:.78rem;
  background:var(--ha-soft);
}
body.homeaid-system .deliverability-domain span{
  color:var(--ha-muted);
  font-size:.68rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
body.homeaid-system .deliverability-domain strong{
  min-width:0;
  overflow-wrap:anywhere;
  text-align:right;
}
body.homeaid-system .deliverability-check-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr));
  gap:.65rem;
}
body.homeaid-system .deliverability-check{
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  gap:.65rem;
  align-items:start;
  min-width:0;
  padding:.72rem .78rem;
  border:1px solid var(--ha-border);
  border-radius:.78rem;
  background:var(--ha-soft);
}
body.homeaid-system .deliverability-check-icon{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:.65rem;
  flex:none;
}
body.homeaid-system .deliverability-check.is-pass .deliverability-check-icon{background:rgba(25,135,84,.12);color:#2ea66f}
body.homeaid-system .deliverability-check.is-warning .deliverability-check-icon{background:rgba(216,182,52,.14);color:var(--ha-accent)}
body.homeaid-system .deliverability-check.is-fail .deliverability-check-icon{background:rgba(220,53,69,.12);color:#d95b68}
body.homeaid-system .deliverability-check strong{
  display:block;
  margin:0 0 .16rem;
  font-size:.78rem;
  line-height:1.25;
}
body.homeaid-system .deliverability-check small{
  display:block;
  margin:0;
  color:var(--ha-muted);
  line-height:1.42;
  overflow-wrap:anywhere;
}
body.homeaid-system .deliverability-actions{
  padding:.78rem .85rem;
  border:1px solid var(--ha-border);
  border-radius:.78rem;
  background:var(--ha-surface-raised,var(--ha-soft));
}
body.homeaid-system .deliverability-actions>strong{
  display:flex;
  align-items:center;
  gap:.45rem;
  margin-bottom:.45rem;
}
body.homeaid-system .deliverability-actions ol{
  margin:.15rem 0 .5rem 1.15rem;
  padding:0;
}
body.homeaid-system .deliverability-actions li{
  margin:.24rem 0;
  line-height:1.4;
}

/* Email-center spacing gate: compact, even section rhythm with no extra dead bands. */
body.homeaid-system .email-center-v1619>.premium-card,
body.homeaid-system .email-center-v1619>.detail-grid{
  margin-top:.8rem!important;
}
body.homeaid-system .external-delivery-readiness-card + .email-compose-settings-grid{
  margin-top:.8rem!important;
}
body.homeaid-system .email-delivery-history-card{
  margin-top:.8rem!important;
}

/* Keep setup/help text readable when domains/records are long. */
body.homeaid-system .smtp-config-summary span,
body.homeaid-system .smtp-evidence-grid span,
body.homeaid-system .delivery-trace-details dd{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Release-gate modal safety remains explicit. */
body.homeaid-system .modal-dialog-scrollable{
  max-height:calc(100dvh - 1rem)!important;
}
body.homeaid-system .modal-dialog-scrollable .modal-content{
  max-height:calc(100dvh - 1rem)!important;
  overflow:hidden!important;
}
body.homeaid-system .modal-dialog-scrollable .modal-body{
  overflow-y:auto!important;
  overscroll-behavior:contain;
}

@media(max-width:767.98px){
  body.homeaid-system .external-delivery-readiness-card .premium-card-head{
    align-items:flex-start!important;
  }
  body.homeaid-system .external-delivery-readiness-card .premium-card-head>.status-pill{
    margin-top:.35rem;
  }
  body.homeaid-system .deliverability-domain{
    align-items:flex-start;
    flex-direction:column;
    gap:.22rem;
  }
  body.homeaid-system .deliverability-domain strong{text-align:left}
  body.homeaid-system .deliverability-check-grid{grid-template-columns:1fr}
}
