/* Shared form controls adapted from TailAdmin's form-elements reference.
   Keep native semantics, MGN colours and Montserrat across every form surface. */
:root {
    --field-border: #d0d5dd;
    --field-label: #344054;
    --field-text: #101828;
    --field-muted: #667085;
    --field-focus: #484642;
    --field-error: #b42318;
    --field-surface: #fff;
    --field-subtle: #f9fafb;
    --field-disabled: #f2f4f7;
    --field-radius: 10px;
    --field-ring: 0 0 0 3px rgb(40 98 72 / .16);
    --field-error-ring: 0 0 0 3px rgb(180 35 24 / .12);
    --field-gap: 20px;
}
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form, .filters, .table-toolbar) {
    --form-border: var(--field-border);
    --form-label: var(--field-label);
    --form-helper: var(--field-muted);
    --form-focus: var(--field-focus);
    --form-danger: var(--field-error);
    font-size: 14px;
    line-height: 1.5;
}
body.mgn-forms :is(.form, .form-intelligent, .review-action-form) { display: grid; gap: var(--field-gap); }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form, .filters, .table-toolbar) label {
    display: grid;
    align-content: start;
    min-width: 0;
    gap: 6px;
    color: var(--field-label);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form, .filters, .table-toolbar) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea) {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 10px 16px;
    border: 1px solid var(--field-border);
    border-radius: var(--field-radius);
    background-color: var(--field-surface);
    color: var(--field-text);
    font: 400 14px/22px var(--font-sans);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: border-color .15s, box-shadow .15s;
}
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form, .filters, .table-toolbar) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea):where(textarea) { min-height: 120px; resize: vertical; }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form, .filters, .table-toolbar) select {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none' stroke='%23667085' stroke-width='1.5'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form, .filters, .table-toolbar) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea)::placeholder { color: #98a2b3; font-weight: 400; opacity: 1; }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form, .filters, .table-toolbar) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea):focus {
    outline: none;
    border-color: var(--field-focus);
    box-shadow: var(--field-ring);
}
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea):disabled { background-color: var(--field-disabled); border-color: #e4e7ec; color: var(--field-muted); box-shadow: none; cursor: not-allowed; }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea)[readonly] { background-color: var(--field-subtle); color: #475467; }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea)[aria-invalid="true"] { border-color: var(--field-error); box-shadow: var(--field-error-ring); }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(.grid, .identity-document-grid, .identity-person-grid, .identity-contact-grid, .address-component-grid) { gap: var(--field-gap); align-items: start; }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(.grid.two, .grid.three, .grid.four) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(.field-control, [data-field-feedback-host]) { gap: 6px; min-width: 0; }
body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(.form-hint, label small, .muted, .field-feedback, .billing-form-help) {
    margin: 0;
    padding: 0;
    color: var(--field-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    border: 0;
    background: transparent;
}
body.mgn-forms .field-feedback:empty { display: none; min-height: 0; }
body.mgn-forms .field-feedback:not(:empty) { min-height: 0; visibility: visible; color: var(--field-error); }
/* Blocking application notices use the same error palette as invalid fields. */
body.public.mgn-forms .cover-application :is(.application-existing, .form-error-summary) {
    border: 1px solid #fecdca;
    border-left: 3px solid var(--field-error);
    background: #fef3f2;
    color: var(--field-error);
}
body.public.mgn-forms .cover-application .application-existing :is(h2, p) { color: inherit; }
body.public.mgn-forms .cover-application [data-identity-check-status][data-state="error"] { color: var(--field-error); }
body.mgn-forms .form-intelligent .field-required { position: static; margin-left: 4px; color: var(--field-error); font-size: 14px; font-weight: 500; }
body.mgn-forms .form-intelligent .field-label { display: inline; line-height: 20px; }
body.mgn-forms form fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid #eaecf0; border-radius: var(--field-radius); }
body.mgn-forms form legend { padding: 0 6px; color: var(--field-label); font-size: 14px; font-weight: 600; }
body.mgn-forms form select:where([multiple], [size]:not([size="1"])) { min-height: 112px; padding: 8px; background-image: none; }
body.mgn-forms form select:where([multiple], [size]:not([size="1"])) option { padding: 8px; border-radius: 4px; }
body.mgn-forms form :is(input[type="range"], input[type="color"]) { accent-color: var(--field-focus); }
body.mgn-forms form input[type="color"] { width: 64px; height: 44px; padding: 4px; border: 1px solid var(--field-border); border-radius: var(--field-radius); }
body.mgn-forms form :is(.field-optional, .field-help) { color: var(--field-muted); font-size: 13px; font-weight: 400; }
body.mgn-forms form :is(.check, label:has(> input[type="checkbox"]), label:has(> input[type="radio"])) { min-height: 44px; padding-block: 10px; cursor: pointer; }
body.mgn-forms form :is(input[type="checkbox"], input[type="radio"]) { appearance: none; display: inline-grid; place-content: center; flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; padding: 0; border: 1px solid var(--field-border); border-radius: 5px; background: var(--field-surface); box-shadow: 0 1px 2px #1018280d; cursor: pointer; }
body.mgn-forms form input[type="radio"] { border-radius: 50%; }
body.mgn-forms form input[type="checkbox"]:checked { border-color: var(--field-focus); background: var(--field-focus) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='m3 7 2.5 2.5L11 4'/%3E%3C/svg%3E") center/14px no-repeat; }
body.mgn-forms form input[type="checkbox"]:indeterminate { border-color: var(--field-focus); background: var(--field-focus) linear-gradient(white, white) center/9px 2px no-repeat; }
body.mgn-forms form input[type="radio"]:checked { border: 5px solid var(--field-focus); }
body.mgn-forms form :is(input[type="checkbox"], input[type="radio"]):focus-visible { outline: 2px solid var(--field-focus); outline-offset: 3px; box-shadow: var(--field-ring); }
body.mgn-forms form :is(input[type="checkbox"], input[type="radio"]):disabled { background-color: var(--field-disabled); border-color: #d0d5dd; opacity: .6; cursor: not-allowed; box-shadow: none; }
body.mgn-forms form :is(input[type="checkbox"], input[type="radio"])[aria-invalid="true"] { outline: 2px solid var(--field-error); outline-offset: 2px; }
body.mgn-forms form :is(button, .button):disabled { opacity: .55; cursor: not-allowed; transform: none; }
body.mgn-forms .client-edit-form .identity-capture { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--field-gap); }
body.mgn-forms .client-edit-form .identity-capture > :is(.capture-section-head, .identity-document-grid, .form-hint, .identity-result-grid) { grid-column: 1 / -1; margin: 0; }
body.mgn-forms .client-edit-form :is(.identity-passport-date, .identity-title-grid) { width: 100%; max-width: none; margin: 0; }
@media (max-width: 680px) {
    body.mgn-forms .client-edit-form .identity-capture { grid-template-columns: minmax(0, 1fr); }
}
@media (forced-colors: active) {
    body.mgn-forms form :is(input[type="checkbox"], input[type="radio"]) { appearance: auto; background: Canvas; }
}
body.mgn-forms :is(form, .form, .journey-form, .review-action-form) :is(.capture-section, .form-section, .identity-capture, .address-capture) {
    margin: 0;
    padding: 0 0 var(--field-gap);
    border: 0;
    border-bottom: 1px solid #eaecf0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.mgn-forms :is(form, .form, .journey-form, .review-action-form) :is(.capture-section-head, .form-section-head, .address-capture-head) { margin: 0 0 var(--field-gap); padding: 0; }
body.mgn-forms :is(form, .form, .journey-form, .review-action-form) :is(h2, h3) { color: #101828; font-size: 16px; font-weight: 600; line-height: 24px; letter-spacing: normal; }
body.mgn-forms :is(form, .form, .journey-form, .review-action-form) :is(.capture-section-head, .address-capture-head) p { margin: 8px 0 0; color: #667085; font-size: 13px; line-height: 20px; }
body.mgn-forms :is(form, .form, .journey-form, .review-action-form) :is(.check, label:has(> input[type="checkbox"]), label:has(> input[type="radio"])) { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; }
body.mgn-forms :is(form, .form, .journey-form, .review-action-form) :is(input[type="checkbox"], input[type="radio"]) { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: #484642; }
body.mgn-forms :is(.form, .form-intelligent) .password-control { position: relative; display: block; width: 100%; border: 0; border-radius: var(--field-radius); background: transparent; box-shadow: none; }
body.mgn-forms :is(.form, .form-intelligent) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea):where(.password-control input) { padding-right: 48px; }
body.mgn-forms :is(.form, .form-intelligent) .password-toggle { position: absolute; inset: 0 6px 0 auto; display: grid; place-items: center; width: 36px; min-width: 0; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #667085; box-shadow: none; }
body.mgn-forms .password-toggle svg { width: 20px; height: 20px; }
body.mgn-forms .password-toggle:hover { color: #101828; background: #f9fafb; }
body.mgn-forms :is(form, .form, .journey-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea):where(input[type="file"]) { padding: 0; line-height: 42px; overflow: hidden; }
body.mgn-forms :is(form, .form, .journey-form) input[type="file"]::file-selector-button { height: 42px; margin: 0 12px 0 0; padding: 0 16px; border: 0; border-right: 1px solid #d0d5dd; background: #f9fafb; color: #344054; font-family: inherit; font-size: 14px; font-weight: 500; line-height: 20px; cursor: pointer; }
/* Shared Tailwind-style modal surface. Explicit insets survive preflight resets. */
dialog.cover-editor-dialog, dialog.plan-preview-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    max-height: calc(100dvh - 32px);
    box-sizing: border-box;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
}
dialog.cover-editor-dialog::backdrop, dialog.plan-preview-dialog::backdrop {
    background: rgb(17 24 39 / .5);
    backdrop-filter: none;
}
.review-access-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding: 14px 16px; margin: 12px 0; border: 1px solid #eaecf0; border-radius: 8px; background: #fff; font-size: .8125rem; }
.review-access-strip > div { flex: 1 1 230px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.review-access-strip small { flex-basis: 100%; color: #667085; }
.review-access-strip details { flex-basis: 100%; }
body.mgn-forms .cover-editor-dialog, body.mgn-forms.admin .cover-editor-dialog.crud-dialog { width: min(720px, calc(100vw - 32px)); border: 1px solid #eaecf0; border-radius: 12px; background: #fff; box-shadow: 0 20px 48px rgba(16, 24, 40, .18); }
body.mgn-forms.admin .cover-editor-dialog.crud-dialog-wide { width: min(920px, calc(100vw - 32px)); }
body.mgn-forms .cover-editor-dialog > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 24px 32px; border-bottom: 1px solid #eaecf0; background: #fff; }
body.mgn-forms .cover-editor-dialog > header h2 { margin: 0; font: 600 18px/28px var(--font-sans); color: #101828; }
body.mgn-forms .cover-editor-dialog .cover-editor-close { display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 50%; background: #f2f4f7; color: #667085; font-size: 24px; line-height: 1; }
body.mgn-forms .cover-editor-dialog-body, body.mgn-forms.admin .cover-editor-dialog-body { padding: 32px; background: #fff; }
body.mgn-forms .cover-editor-dialog .form, body.mgn-forms.admin .cover-editor-dialog .form { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body.mgn-forms .cover-editor-dialog::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: none; }
body.mgn-forms .form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding-top: 24px; margin-top: 8px; border-top: 1px solid #eaecf0; }
body.mgn-forms :is(form, .form, .journey-form, .review-action-form) .button, body.mgn-forms .form-actions .button { width: auto; min-height: 44px; padding: 10px 18px; border-radius: var(--field-radius); font-size: 14px; font-weight: 500; line-height: 22px; box-shadow: 0 1px 2px #1018280d; }
body.mgn-forms .form-actions .button.secondary { border: 1px solid #d0d5dd; background: #fff; color: #344054; }
body.mgn-forms .form-command-row:empty { display: none; }
body.mgn-forms #portal-setup .cover-editor-dialog-body { padding: 24px 28px 28px; }
body.mgn-forms #portal-setup .form { gap: var(--field-gap); }
body.mgn-forms #portal-setup > header { padding: 24px 28px 0; border-bottom: 0; }
@media (max-width: 680px) {
    body.mgn-forms :is(form, .form, .form-intelligent, .journey-form, .review-action-form) :is(.grid.two, .grid.three, .grid.four, .identity-document-grid, .identity-person-grid, .identity-contact-grid, .address-component-grid) { grid-template-columns: minmax(0, 1fr); gap: var(--field-gap); }
    body.mgn-forms .cover-editor-dialog > header { padding: 20px; }
    body.mgn-forms .cover-editor-dialog-body, body.mgn-forms.admin .cover-editor-dialog-body { padding: 24px 20px; }
    body.mgn-forms .form-actions { flex-wrap: wrap; }
    body.mgn-forms :is(form, .form, .journey-form, .review-action-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):where(:not([type="range"], [type="color"], [type="submit"], [type="button"], [type="reset"], [type="image"])), select, textarea) { font-size: 16px; }
}

body.mgn-forms.app-area .app-main :is(form, .form, .journey-form, .review-action-form) .button { border-radius: var(--field-radius); font-weight: 500; }
body.mgn-forms :is(.form, .form-intelligent) .password-toggle { transform: none; }
body.mgn-forms.app-area .app-main .form.panel { padding: 24px; border: 1px solid #eaecf0; border-radius: 12px; background: #fff; }
body.mgn-forms.app-area .app-main .page-head h1 { background-image: none; border-bottom: 0; }
body.mgn-forms .app-main :is(.filters, .table-toolbar) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
body.mgn-forms .app-main :is(.filters, .table-toolbar) > label:first-of-type { flex: 1 1 240px; min-width: 0; }
body.mgn-forms .table-toolbar > label:not(:first-of-type) { flex: 0 1 140px; }
/* Reserve the existing register search icon's space inside the shared control. */
body.mgn-forms.app-area .app-main .workspace-inner form.table-toolbar input[type="search"] { padding-inline-start: 40px; }
body.mgn-forms .app-main :is(.filters, .table-toolbar) > p { flex-basis: 100%; margin: 0; }
body.mgn-forms .app-main :is(.filters, .table-toolbar) .button { min-height: 44px; padding: 10px 16px; border-radius: var(--field-radius); font-weight: 500; }
@media (max-width: 680px) {
    body.mgn-forms .app-main :is(.filters, .table-toolbar) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
    body.mgn-forms .app-main :is(.filters, .table-toolbar) > label:first-of-type { grid-column: 1 / -1; }
    body.mgn-forms .app-main :is(.filters, .table-toolbar) > p { grid-column: 1 / -1; }
    body.mgn-forms .app-main :is(.filters, .table-toolbar) > :is(button, .button) { align-self: end; }
}
body.mgn-forms.auth .auth .form h1 { margin: 0; font-family: inherit; font-size: 28px; font-weight: 600; line-height: 36px; letter-spacing: -.02em; }

/* Shared customer/staff sign-in, preserving the existing form feedback and password controls. */
body.mgn-forms.auth .auth.sign-in-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    padding: 56px 20px 40px;
}
body.mgn-forms.auth .sign-in-page .form {
    width: min(100%, 460px);
    margin: 0;
    padding: 28px;
    gap: 20px;
}
body.mgn-forms.auth .sign-in-page .form p { margin: 0; }
body.mgn-forms.auth .sign-in-page .form > button[type="submit"] { width: 100%; min-height: 48px; }
body.mgn-forms.auth .sign-in-setup { padding-top: 20px; border-top: 1px solid var(--line); }
body.mgn-forms.auth .sign-in-setup h2 { margin: 0 0 8px; font-size: 1rem; line-height: 1.5; font-weight: 600; }
body.mgn-forms.auth .sign-in-setup a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; }
body.mgn-forms.auth .sign-in-page .sign-in-contact { margin: 16px 0 0; font-size: .875rem; }
body.mgn-forms.auth .sign-in-contact a { display: inline-flex; align-items: center; min-height: 44px; }
body.mgn-forms.auth .sign-in-page .form .sign-in-error { color: #9f2f2f; }
body.mgn-forms.auth .topbar #site-navigation { display: flex; grid-column: auto; justify-self: end; width: auto; margin: 0; padding: 0; }
body.mgn-forms.auth .topbar .nav-toggle { display: none; }
body.mgn-forms.auth .topbar #site-navigation a { padding: 6px 8px; font-size: .8125rem; white-space: normal; }
@media (max-width: 600px) {
    body.mgn-forms.auth .auth.sign-in-page { padding-top: 28px; }
    body.mgn-forms.auth .sign-in-page .form { padding: 24px 20px; }
}

/* Plan editors need room for pricing and inclusions within one workspace. */
body.mgn-forms.admin .cover-editor-dialog:has(.cover-editor-plan) {
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
}
body.mgn-forms.admin .cover-editor-plan .cover-editor-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 28px;
    margin-top: 24px;
}
body.mgn-forms.admin .cover-editor-columns > section { min-width: 0; }
body.mgn-forms.admin .cover-editor-plan .cover-editor-fee-form {
    padding: 20px;
    border: 1px solid #eaecf0;
    border-radius: var(--field-radius);
    background: #f9fafb;
    gap: 16px;
}
body.mgn-forms.admin .cover-editor-plan :is(.cover-editor-add, .cover-editor-plan-details) > form {
    padding: 20px;
    border-top: 1px solid #eaecf0;
}
body.mgn-forms.admin .cover-editor-plan :is(.cover-editor-plan-details, .cover-editor-fee-form, .cover-editor-add) .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
body.mgn-forms.admin .cover-editor-plan summary {
    transition: background-color 150ms ease;
    border-radius: var(--field-radius);
}
body.mgn-forms.admin .cover-editor-plan summary:hover { background: #f2f4f7; }
body.mgn-forms.admin .cover-editor-plan summary:focus-visible {
    outline: 2px solid #43423e;
    outline-offset: 2px;
}
body.mgn-forms.admin .cover-editor-plan .cover-editor-section-title { align-items: center; }
@media (max-width: 900px) {
    body.mgn-forms.admin .cover-editor-plan .cover-editor-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
    body.mgn-forms.admin .cover-editor-dialog:has(.cover-editor-plan) {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }
    body.mgn-forms.admin .cover-editor-plan :is(.cover-editor-plan-details, .cover-editor-fee-form, .cover-editor-add) .grid.four { grid-template-columns: minmax(0, 1fr); }
    body.mgn-forms.admin .cover-editor-plan .cover-editor-fee-form,
    body.mgn-forms.admin .cover-editor-plan :is(.cover-editor-add, .cover-editor-plan-details) > form { padding: 16px; }
    body.mgn-forms.admin .cover-editor-plan .cover-editor-fee-heading { flex-wrap: wrap; gap: 4px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    body.mgn-forms.admin .cover-editor-plan summary { transition: none; }
}

/* A consistent 44px calendar target while retaining native date validation. */
body.mgn-forms .date-picker-field { position: relative; display: block; min-width: 0; width: 100%; }
body.mgn-forms .date-picker-field input { width: 100%; min-height: 44px; padding-right: 52px !important; }
body.mgn-forms .date-picker-field input::-webkit-calendar-picker-indicator { opacity: 0; width: 0; padding: 0; }
body.mgn-forms .date-picker-field .date-picker-button { position: absolute; inset: 0 0 0 auto; display: grid; place-items: center; width: 44px; min-height: 44px; margin: 0; padding: 10px; border: 0; border-left: 1px solid #eaecf0; border-radius: 0 8px 8px 0; background: transparent; color: #43423e; cursor: pointer; }
body.mgn-forms .date-picker-button svg { width: 20px; height: 20px; }
body.mgn-forms .date-picker-button:hover { background: #f2f1f0; }
body.mgn-forms .date-picker-button:focus-visible { outline: 2px solid #43423e; outline-offset: 2px; }
body.mgn-forms.admin .operations-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
body.mgn-forms.admin .operations-head > .button { width: auto; }
@media (max-width: 680px) { body.mgn-forms.admin .operations-head { align-items: flex-start; flex-wrap: wrap; } }
/* The policy payment result stays compact, readable and distinct from cover approval. */
body.portal [data-payfast-status] {
    max-width: 56rem;
    display: grid;
    gap: .85rem;
    padding: clamp(1rem, 3vw, 1.6rem);
    background: #fff;
    border: 1px solid #e4e3e1;
    border-left: 4px solid #ad863a;
    border-radius: .65rem;
}
body.portal [data-payfast-status] p { margin: 0; }
body.portal [data-payfast-status] [data-payment-title] { margin: 0 0 .5rem; font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 700; line-height: 1.3; }
body.portal [data-payfast-status] [data-payment-message] { max-width: 65ch; line-height: 1.65; }
body.portal [data-payfast-status][data-received="1"] { border-left-color: #1c5a43; }
body.portal [data-payfast-status][data-received="1"] [data-payment-title] { color: #1c5a43; }
body.portal [data-payfast-status] details p { margin-top: .65rem; overflow-wrap: anywhere; }
body.portal [data-payfast-status] .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
