/* Shared portal dialog header paint. Keep geometry, contents and actions intact.
   Theme colors deliberately override legacy per-dialog light/dark palettes. */
:root {
  --dialog-header-bg: #17365d;
  --dialog-header-text: #fff;
  --dialog-header-muted: #d9e6f3;
  --dialog-header-hover: #31557e;
}
/* Confirmation forms have outer padding; extend only their header to the rim. */
.admin-action-dialog > form > header {
  margin: -20px -20px 0;
  padding: 16px 20px;
  border-radius: 7px 7px 0 0;
}
@media (max-width: 680px) {
  .admin-action-dialog > form > header { margin: -17px -17px 0; padding: 14px 17px; }
}
:is(.modal-head, .modal-dialog > header, .academic-space-dialog > form > header,
    .admin-action-dialog > form > header, .mail-preview-dialog > header,
    .public-help-export-card > header, .console-profile-head) {
  color: var(--dialog-header-text) !important;
  background: var(--dialog-header-bg) !important;
  border-bottom-color: var(--dialog-header-hover) !important;
}
:is(.modal-head, .modal-dialog > header, .academic-space-dialog > form > header,
    .admin-action-dialog > form > header, .mail-preview-dialog > header,
    .public-help-export-card > header, .console-profile-head) :is(b, h2, h3) {
  color: var(--dialog-header-text) !important;
}
:is(.modal-head, .modal-dialog > header, .academic-space-dialog > form > header,
    .admin-action-dialog > form > header, .mail-preview-dialog > header,
    .public-help-export-card > header, .console-profile-head) :is(small, p, .section-kicker, div > span) {
  color: var(--dialog-header-muted) !important;
}
:is(.modal-head, .modal-dialog > header, .academic-space-dialog > form > header,
    .admin-action-dialog > form > header, .mail-preview-dialog > header,
    .public-help-export-card > header, .console-profile-head) button {
  color: var(--dialog-header-text) !important;
  background: transparent !important;
}
:is(.modal-head, .modal-dialog > header, .academic-space-dialog > form > header,
    .admin-action-dialog > form > header, .mail-preview-dialog > header,
    .public-help-export-card > header, .console-profile-head) button:hover {
  background: var(--dialog-header-hover) !important;
}
:is(.modal-head, .modal-dialog > header, .academic-space-dialog > form > header,
    .admin-action-dialog > form > header, .mail-preview-dialog > header,
    .public-help-export-card > header, .console-profile-head) button:focus-visible {
  outline: 2px solid var(--dialog-header-text);
  outline-offset: 2px;
}
.portal-dialog-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid #dce5ee;
  background: #f8fafc;
}
.portal-dialog-actions .ui-button,
.portal-dialog-actions button {
  min-width: 88px;
  min-height: 32px;
}
.portal-dialog-actions [hidden] {
  display: none !important;
}
body.dark .portal-dialog-actions {
  border-color: #40516a;
  background: #18263a;
}
