/* Centre bottom form and dialog actions without changing header controls. */
body form .form-actions,
body form.rc-opportunity-form .form-actions,
body form.rc-infrastructure-create-form .form-actions,
body .rc-profile-popup__actions,
body .rc-new-msg-modal__actions,
body .rc-booking-actions,
body .rc-booking-modal-dialog > footer,
body .rc-registration-legal-popup-actions,
body .rc-invite-expert-form__actions,
body [role="dialog"] .form-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 16px !important;
  width: 100%;
  box-sizing: border-box;
  margin-inline: auto !important;
}
body .form-actions > .button,
body .rc-profile-popup__actions > button,
body .rc-new-msg-modal__actions > button {
  flex: 0 0 auto !important;
  margin-inline: 0 !important;
}

/* Compact the Add new dropdown only. */
html body .rc-add-dropdown .rc-add-menu.rc-an-dropdown {
  width: 480px !important; max-width: calc(100vw - 24px); padding: 12px !important; gap: 14px !important;
  max-height: calc(100vh - 110px); overflow-y: auto;
}
html body .rc-add-menu .rc-add-column { gap: 1px !important; }
html body .rc-add-menu .rc-add-column h4 { margin: 10px 0 4px !important; padding: 0 6px 5px !important; font-size: 10px !important; line-height: 1.3 !important; }
html body .rc-add-menu .rc-add-column h4:first-child { margin-top: 0 !important; }
html body .rc-add-menu .rc-add-column a { padding: 6px !important; min-height: 28px !important; gap: 7px !important; font-size: 12px !important; line-height: 1.35 !important; }

/* Compact creation pages, including the shared booking planner. */
html body .rc-create-form-shell { margin: 16px auto 28px !important; }
html body .rc-create-form-shell .rc-create-form-header { margin-bottom: 14px !important; padding: 0 !important; gap: 12px !important; }
html body .rc-create-form-shell .rc-create-form-header h1 { font-size: clamp(25px, 3vw, 34px) !important; line-height: 1.2 !important; margin: 3px 0 6px !important; }
html body .rc-create-form-shell .rc-cf-description { margin: 4px 0 !important; line-height: 1.45 !important; }
html body .rc-create-form-shell .rc-create-form-card { padding: 14px !important; }
html body .rc-create-form-shell form.node-form,
html body.rc-preview-create-page .rc-create-form-shell form.node-form.rc-preview-node-form { padding: 20px !important; gap: 14px 18px !important; }
html body .rc-create-form-shell form.node-form .form-item,
html body.rc-preview-create-page .rc-create-form-shell form.node-form.rc-preview-node-form .form-item { margin-top: 0 !important; margin-bottom: 8px !important; }
html body .rc-create-form-shell form.node-form label { margin-bottom: 5px !important; }
html body .rc-create-form-shell form.node-form textarea { min-height: 85px !important; height: 100px; }
html body .rc-create-form-shell form.node-form fieldset { padding: 12px !important; margin: 0 !important; }
html body .rc-create-form-shell form.node-form .description { margin-top: 5px !important; line-height: 1.4 !important; }
html body .rc-create-form-shell form.node-form .form-actions { padding-top: 14px !important; margin-top: 6px !important; margin-bottom: 0 !important; }
html body .rc-create-form-shell .rc-file-drop { padding: 14px !important; }
html body .rc-profile-booking-app .rc-profile-card-head { padding: 16px !important; }
html body .rc-profile-booking-app .rc-booking-planner { padding: 14px !important; gap: 14px !important; }
html body .rc-profile-booking-app .rc-booking-calendar-panel,
html body .rc-profile-booking-app .rc-booking-side-panel { padding: 14px !important; }
@media(max-width: 720px) { html body .rc-create-form-shell form.node-form { padding: 14px !important; } }

html body.rc-preview-create-page .rc-create-form-shell .rc-create-form-header.rc-preview-hero { padding: 0 !important; margin: 12px 0 !important; }
html body.rc-preview-create-page .rc-create-form-shell form.node-form.rc-preview-node-form > * { margin-block: 0 !important; padding-block: 0; }
html body.rc-preview-create-page .rc-create-form-shell form.node-form.rc-preview-node-form { padding: 18px !important; gap: 12px 18px !important; }

/* Owner avatar control and right-aligned QR beneath profile actions. */
html body .rc-profile-photo .rc-profile-photo-edit { width: 28px !important; height: 28px !important; display: flex !important; align-items: center; justify-content: center; padding: 0 !important; border-radius: 50% !important; background: #fff !important; color: #111 !important; border: 1px solid #cbd1da !important; font-size: 22px !important; line-height: 1; }
html body .rc-profile-actions--header { display: flex !important; flex-direction: column !important; align-items: flex-end !important; }
html body .rc-profile-actions--header .rc-profile-side-tools { display: flex !important; justify-content: flex-end !important; width: 100% !important; }
html body .rc-profile-actions--header .rc-profile-side-tools > * { margin-left: auto !important; }

/* Balanced, compact Add new menu; keep all entries and native permissions. */
html body .rc-site .rc-add-dropdown .rc-add-menu.rc-an-dropdown {
  width: min(640px, calc(100vw - 24px)) !important;
  padding: 10px !important;
  gap: 0 16px !important;
}
html body .rc-site .rc-add-menu.rc-an-dropdown .rc-add-column { gap: 0 !important; }
html body .rc-site .rc-add-menu.rc-an-dropdown .rc-add-column h4 {
  margin: 8px 0 3px !important;
  padding: 0 5px 3px !important;
  font-size: 10px !important;
  line-height: 1.25 !important;
}
html body .rc-site .rc-add-menu.rc-an-dropdown .rc-add-column h4:first-child { margin-top: 0 !important; }
html body .rc-site .rc-add-menu.rc-an-dropdown .rc-add-column a {
  min-height: 26px !important;
  padding: 4px 5px !important;
  gap: 7px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}
html body .rc-site .rc-add-menu.rc-an-dropdown .rc-add-column a i { width: 15px; flex: 0 0 15px; text-align: center; }
html body .rc-site .rc-add-menu.rc-an-dropdown .rc-add-menu-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 5px;
  border-top: 1px solid #eee;
  font-size: 12px !important;
  line-height: 1.25;
}
@media(max-width:760px) {
  html body .rc-site .rc-add-dropdown .rc-add-menu.rc-an-dropdown { width: calc(100vw - 24px) !important; }
  html body .rc-site .rc-add-menu.rc-an-dropdown .rc-add-column a { min-height: 32px !important; padding-block: 7px !important; }
}

/* Neutral buttons retain their existing fill; labels follow that fill. */
html body .rc-site [data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill="dark"],
html body [data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill="dark"] { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html body .rc-site [data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill="light"],
html body [data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill][data-rc-neutral-fill="light"] { color: #000 !important; -webkit-text-fill-color: #000 !important; }
html body [data-rc-neutral-fill] :is(span,i,svg,strong,em,b,small) { color: inherit !important; -webkit-text-fill-color: inherit !important; }
/* The event CTA is readable before scripts initialise as well. */
html body .rc-infra-page .rc-infra-actions a.rc-infra-primary { color: #fff !important; }

/* The keyboard skip control also has a dark fill. */
html body a.skip-link { color: #fff !important; }

/* Authentication feedback lives in a sidebar hidden by the shared layout.
   Let only that message-bearing wrapper participate in the auth-page flow. */
body:has(:is(form.user-login-form, form.user-register-form, form.user-pass)) .rc-left-rail:has(.messages-list),
body:has(:is(form.user-login-form, form.user-register-form, form.user-pass)) .rc-left-rail .region--sidebar:has(.messages-list) {
  display: contents !important;
}
body:has(:is(form.user-login-form, form.user-register-form, form.user-pass)) .messages-list {
  display: block !important;
  width: min(560px, calc(100% - 32px));
  margin: 16px auto;
  box-sizing: border-box;
}
