/* Release 49: restored CTA, structured account forms and shared contact states.
   Deliberately scoped; previous page-specific layouts remain intact. */
body:not(.portal-body) .quick-contact-section {
  background: linear-gradient(120deg, #102f43 0%, #16566d 100%);
  color: #fff;
  padding-block: clamp(40px, 5vw, 80px);
  position: relative;
  z-index: auto;
  margin-block: 0;
}
body:not(.portal-body) .quick-contact-section .quick-contact-copy h2 {
  color: #fff;
  max-width: 17ch;
  font-size: clamp(1.85rem, 3.2vw, 3rem);
  line-height: 1.18;
  margin-block: 12px 20px;
}
body:not(.portal-body) .quick-contact-description {
  max-width: 46ch;
  font-size: 1.05rem;
  line-height: 1.7;
}
body:not(.portal-body) .quick-contact-description :is(p,li) { color: #e0ebf1; }
body:not(.portal-body) .quick-contact-description p { margin-block: 0 12px; }
body:not(.portal-body) .quick-contact-description a { color: #fff; text-decoration: underline; }
body:not(.portal-body) .quick-contact-copy .eyebrow { color: #ffc0c0; }
body:not(.portal-body) .quick-contact-section .lead-form {
  color: #17384c;
  background: #fff;
  border-color: #d6e4ed;
  box-shadow: 0 16px 44px rgba(3, 21, 33, .17);
}
body:not(.portal-body) .quick-contact-section .lead-form :is(input,select,textarea) {
  color: #17384c;
  background-color: #fff;
}
.quick-contact-grid > *, .identity-grid > *, .backup-check-grid > * { min-width: 0; }
.identity-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.identity-fields > legend {
  margin-bottom: 16px;
  font-weight: 750;
  color: #17384c;
  font-size: 1.05rem;
}
.identity-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.identity-grid label { display: grid; gap: 8px; align-content: start; font-weight: 650; }
.identity-fields > .field-help { display: block; margin-top: 12px; font-weight: 400; }
.identity-review {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: #fff8e7;
  border: 1px solid #e5d2a3;
  border-radius: 12px;
  color: #654b19;
  font-size: .9rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.primary-contact-panel > .field-help { max-width: 85ch; }
.status.status-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #124b63;
  background: #e6f3f8;
  border: 1px solid #a6cbdc;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 750;
  line-height: 1.5;
  white-space: normal;
}
.status.status-primary::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.user-contact-list { display: grid; gap: 0; margin: 4px 0 20px; }
.user-contact-list > div {
  display: grid;
  grid-template-columns: minmax(120px,.4fr) minmax(0,1fr);
  gap: 12px;
  border-bottom: 1px solid #e1eaf0;
  padding: 15px 0;
}
.user-contact-list dt { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 700; }
.user-contact-list dd { margin: 0; overflow-wrap: anywhere; }
.user-contact-list dd small { display: block; color: #526b7b; margin-top: 4px; }
.contact-editor { margin-top: 16px; border: 1px solid #cbdde7; border-radius: 14px; background: #f7fafc; }
.contact-editor summary { padding: 16px; cursor: pointer; font-weight: 700; color: #164960; }
.contact-editor > .form-grid { padding: 4px 16px 18px; }
.contact-directory-link { display: inline-block; margin-top: 18px; line-height: 1.6; }
.contact-card-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.contact-card-labels .eyebrow { margin: 0; }
.notification-contact-card.is-primary-contact { border-color: #93bdce; background: #f6fbfd; }
.notification-contact-card h3 a { color: inherit; }
.notification-contact-card h3 a:hover { text-decoration: underline; }
.notification-contact-card .crm-actions { align-items: stretch; gap: 8px; }
.notification-contact-card .crm-actions form { display: flex; margin: 0; }
.notification-contact-card .crm-actions .button { min-height: 42px; }
.primary-contact-choice { padding: 14px; border: 1px solid #bad4e1; border-radius: 12px; background: #f0f7fb; }
.selected-contact-user { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.selected-contact-user h2 { margin-block: 6px; }
.selected-contact-user p { margin: 0; overflow-wrap: anywhere; }
.backup-check-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.backup-check-grid article { padding: 18px; border: 1px solid #d9e5ec; border-radius: 14px; background: #f8fbfd; }
.backup-check-grid article > strong { display: block; color: #1a4056; margin-bottom: 12px; line-height: 1.5; }
.backup-check-grid article p { margin-block: 10px 5px; }
.backup-check-grid article small { color: #526b7b; }
.notification-template-help dl { display: grid; grid-template-columns: minmax(160px,.7fr) minmax(0,1fr); gap: 10px 18px; }
.notification-template-help dt, .notification-template-help dd { margin: 0; overflow-wrap: anywhere; }
.notification-template-help dt { font-weight: 650; }
.portal-body .panel > form { min-width: 0; }
.portal-body .portal-content :is(pre,code) { max-width: 100%; overflow-wrap: anywhere; }
.portal-body .portal-content pre { overflow: auto; }
.portal-body .table-wrap { max-width: 100%; overscroll-behavior-inline: contain; }
:is(.identity-grid,.primary-contact-panel) :is(input,select,textarea) { width: 100%; min-width: 0; }
.primary-contact-panel input[type="checkbox"] { width: auto; }
:is(.identity-fields,.primary-contact-panel,.notification-contact-card) :focus-visible {
  outline: 3px solid #397ba0;
  outline-offset: 3px;
}
@media (max-width: 1100px) {
  .backup-check-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 700px) {
  .identity-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .user-contact-list > div { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .notification-template-help dl { grid-template-columns: minmax(0,1fr); }
  .notification-template-help dd { margin-bottom: 8px; }
  .portal-body .sticky-actions { position: static; flex-wrap: wrap; margin-top: 20px; }
  .notification-contact-card .crm-actions > :is(form,a) { flex: 1 1 140px; }
  .notification-contact-card .crm-actions form > .button { width: 100%; }
  .notification-contact-card .crm-actions .button { min-height: 44px; }
  :is(.identity-grid,.primary-contact-panel) :is(input,select,textarea) { font-size: 16px; }
  body:not(.portal-body) .quick-contact-description { font-size: 1rem; }
  body:not(.portal-body) .quick-contact-section .quick-contact-copy h2 { max-width: 22ch; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-editor, .notification-contact-card { scroll-behavior: auto; transition: none; }
}

/* Keep account-save controls in the document flow, never above editable fields. */
.portal-body :is([data-user-form],[data-user-profile]) > .sticky-actions {
  position: static;
  inset: auto;
  width: fit-content;
  max-width: 100%;
  margin-top: 20px;
  flex-wrap: wrap;
}

.auth-section .auth-card :is(.check-card,.consent-check) {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.auth-section .auth-card :is(.check-card,.consent-check) > input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
}
.auth-section .auth-card :is(.check-card,.consent-check) > span { flex: 1 1 auto; min-width: 0; }
.auth-section .auth-card form > .page-head-actions { gap: 10px; }
