/* JKA Dealer Portal v1.6.24 — card-row balance + settings-layout hardening
   Final override after v1.6.23. Fixes two remaining layout regressions:
   sibling cards in the same visual row finish at the same height without wasting
   the extra height as dead space, and settings cards balance their inner controls. */

body.homeaid-system .email-compose-settings-grid{
  align-items:stretch!important;
  grid-auto-rows:1fr!important;
}
body.homeaid-system .email-compose-settings-grid > .premium-card{
  height:100%!important;
  min-height:0!important;
  align-self:stretch!important;
  display:flex!important;
  flex-direction:column!important;
}
body.homeaid-system .email-compose-settings-grid > .premium-card > .premium-card-body{
  flex:1 1 auto!important;
  min-height:0!important;
}
body.homeaid-system .email-compose-card .premium-card-body,
body.homeaid-system .email-compose-card .premium-card-body > form{
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
}
body.homeaid-system .email-compose-card .premium-card-body > form{flex:1 1 auto!important}
body.homeaid-system .email-compose-card .email-message-field{
  flex:1 1 auto!important;
  display:flex!important;
  flex-direction:column!important;
  min-height:142px!important;
}
body.homeaid-system .email-compose-card .email-compose-message{
  flex:1 1 auto!important;
  width:100%!important;
  min-height:118px!important;
  height:auto!important;
  max-height:none!important;
  resize:vertical!important;
}
body.homeaid-system .email-compose-card .btn.w-100{margin-top:.12rem!important}
body.homeaid-system .email-preferences-card{
  display:flex!important;
  flex-direction:column!important;
}
body.homeaid-system .email-preferences-card .premium-card-body{
  flex:1 1 auto!important;
  display:flex!important;
  flex-direction:column!important;
  min-height:0!important;
}
body.homeaid-system .email-preferences-card .email-preferences-form{margin:0!important}
body.homeaid-system .email-preferences-card .email-pref-row{padding:.7rem .8rem!important}
body.homeaid-system .email-preferences-card .email-pref-actions{margin-top:.58rem!important}
body.homeaid-system .email-preferences-card hr{margin:.62rem 0!important}
body.homeaid-system .email-preferences-card .email-security-note{margin-top:0!important}

body.homeaid-system .system-settings-page .settings-card-grid{
  --bs-gutter-x:.9rem;
  --bs-gutter-y:.9rem;
  align-items:stretch!important;
}
body.homeaid-system .system-settings-page .settings-card-grid > [class*="col-"]{
  display:flex!important;
  min-width:0!important;
}
body.homeaid-system .system-settings-page .settings-card-grid > [class*="col-"] > .settings-card{
  flex:1 1 auto!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
}
body.homeaid-system .system-settings-page .settings-card .premium-card-head{flex:0 0 auto!important}
body.homeaid-system .system-settings-page .settings-card .premium-card-body{
  flex:1 1 auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
}
body.homeaid-system .system-settings-page .settings-card .premium-card-body > .row{
  flex:1 1 auto!important;
  align-content:space-between!important;
  row-gap:.72rem!important;
}
body.homeaid-system .system-settings-page .settings-card textarea{min-height:76px!important}
body.homeaid-system .system-settings-page .settings-save-bar{margin-top:.82rem!important}
body.homeaid-system .system-settings-page .notification-settings-card{margin-top:.82rem!important}
body.homeaid-system .system-settings-page .notification-settings-card .premium-card-body{padding-top:.82rem!important}
body.homeaid-system .system-settings-page .notification-settings-card .row.g-4{
  --bs-gutter-x:1rem;
  --bs-gutter-y:.85rem;
  align-items:start!important;
}
body.homeaid-system .system-settings-page .notification-channel-toggle{
  padding:.68rem .78rem!important;
  gap:.62rem!important;
}
body.homeaid-system .system-settings-page .notification-recipient-card > summary{padding:.72rem .82rem!important}

body.homeaid-system .email-compose-settings-grid + .email-delivery-history-card{margin-top:.68rem!important}
body.homeaid-system .system-settings-page .settings-form + .notification-settings-card{margin-top:.82rem!important}

@media(max-width:1199.98px){
  body.homeaid-system .system-settings-page .settings-card-grid > [class*="col-"]{display:block!important}
  body.homeaid-system .system-settings-page .settings-card-grid > [class*="col-"] > .settings-card{height:auto!important}
  body.homeaid-system .system-settings-page .settings-card .premium-card-body > .row{align-content:flex-start!important}
}
@media(max-width:850px){
  body.homeaid-system .email-compose-settings-grid{grid-auto-rows:auto!important;align-items:stretch!important}
  body.homeaid-system .email-compose-settings-grid > .premium-card{height:auto!important}
  body.homeaid-system .email-compose-card .email-message-field{min-height:132px!important}
  body.homeaid-system .email-compose-card .email-compose-message{min-height:120px!important}
}
@media(max-width:575.98px){
  body.homeaid-system .system-settings-page .settings-card-grid{--bs-gutter-y:.62rem}
  body.homeaid-system .system-settings-page .settings-save-bar,
  body.homeaid-system .system-settings-page .notification-settings-card{margin-top:.62rem!important}
  body.homeaid-system .email-compose-card .email-message-field{min-height:122px!important}
  body.homeaid-system .email-compose-card .email-compose-message{min-height:110px!important}
}
