:root {
    --apx-modal-ink: #07142b;
    --apx-modal-muted: #5f6f86;
    --apx-modal-line: #d6e0ec;
    --apx-modal-soft: #f6f9fd;
    --apx-modal-brand: var(--apx-brand, var(--apx-editor-brand, #155dfc));
    --apx-modal-accent: #0f9f8f;
    --apx-modal-radius: 18px;
}

body.kt-modal-open,
body.apx-site-modal-open,
body.apx-site-cart-open {
    overflow: hidden;
}

dialog.apx-app-dialog {
    width: min(720px, calc(100vw - 30px)) !important;
    max-width: calc(100vw - 30px) !important;
    max-height: calc(100dvh - 30px) !important;
    margin: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--apx-modal-radius) !important;
    background: transparent !important;
    color: var(--apx-modal-ink) !important;
    overflow: visible !important;
}

dialog.apx-app-dialog.is-lg { width: min(860px, calc(100vw - 30px)) !important; }
dialog.apx-app-dialog.is-xl { width: min(1040px, calc(100vw - 30px)) !important; }

dialog.apx-app-dialog::backdrop {
    background: rgba(7, 18, 34, .62) !important;
    backdrop-filter: blur(5px);
}

.apx-app-dialog-shell {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    max-height: calc(100dvh - 30px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--apx-modal-line) !important;
    border-radius: var(--apx-modal-radius) !important;
    background: #fff !important;
    box-shadow: 0 34px 110px rgba(7, 19, 38, .30) !important;
}

.apx-app-dialog-shell > header {
    position: relative;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 13px !important;
    min-height: 76px;
    padding: 16px 18px 15px !important;
    border-bottom: 1px solid #e4ebf4 !important;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--apx-modal-brand) 12%, transparent), transparent 44%),
        linear-gradient(180deg, #fff, #fbfdff) !important;
}

.apx-app-dialog-shell > header::after {
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--apx-modal-brand), var(--apx-modal-accent), #f59e0b, #7c3aed);
    content: "";
}

.apx-app-dialog-heading {
    display: flex !important;
    min-width: 0;
    align-items: flex-start;
    gap: 11px;
}

.apx-app-dialog-heading > div {
    min-width: 0;
}

.apx-app-dialog-icon {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    border-radius: 13px !important;
    box-shadow: 0 13px 27px color-mix(in srgb, var(--apx-modal-brand) 20%, transparent) !important;
}

.apx-app-dialog-shell h2,
.apx-app-dialog-shell header h2 {
    margin: 2px 0 0 !important;
    color: var(--apx-modal-ink) !important;
    font-size: clamp(17px, 2vw, 21px) !important;
    font-weight: 950 !important;
    line-height: 1.13 !important;
    letter-spacing: 0 !important;
}

.apx-app-dialog-shell header p {
    max-width: 680px;
    margin: 5px 0 0 !important;
    color: var(--apx-modal-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
}

.apx-app-dialog-shell .apx-app-eyebrow {
    color: color-mix(in srgb, var(--apx-modal-brand) 82%, #0f172a) !important;
    letter-spacing: .1em !important;
    font-size: 10px !important;
    font-weight: 950 !important;
}

.apx-app-dialog-body {
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
    -webkit-overflow-scrolling: touch;
    padding: 15px 16px max(22px, env(safe-area-inset-bottom)) !important;
    background: linear-gradient(180deg, #f8fbff, #f3f7fc) !important;
}

.apx-app-dialog-body :where(form, .apx130-form, .apx129-form) {
    min-height: 0;
}

.apx-app-dialog-body > :where(form, .apx130-form, .apx129-form, .apx-app-form) {
    display: grid;
    gap: 12px;
}

.apx-app-dialog-body :where(.apx-app-form-section, .apx130-form-section, .apx129-form-section, fieldset) {
    border: 1px solid #dce6f1 !important;
    border-radius: 15px !important;
    background: #fff !important;
    padding: 14px !important;
    box-shadow: 0 10px 26px rgba(15, 35, 64, .055) !important;
}

.apx-app-dialog-body :where(.apx-app-form-section header, .apx130-form-section header, .apx129-form-section header) {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f7;
}

.apx-app-dialog-body :where(.apx-app-form-grid, .apx130-form-grid, .apx129-form-grid, .kt-modal-form-grid, .kt-form-grid) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.apx-app-dialog-body :where(label, .kt-modal-field) {
    min-width: 0;
}

.apx-app-dialog-body :where(label > span, .kt-modal-field span, .apx130-form-section header strong, .apx129-form-section header strong) {
    color: var(--apx-modal-ink) !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
}

.apx-app-dialog-body :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
.kt-modal :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    width: 100%;
    min-height: 43px;
    border: 1px solid #cdd9e8 !important;
    border-radius: 13px !important;
    background: #fff !important;
    color: var(--apx-modal-ink) !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
    outline: none !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
}

.apx-app-dialog-body :where(textarea),
.kt-modal textarea {
    min-height: 90px;
    resize: vertical;
}

.apx-app-dialog-body :where(input:focus, select:focus, textarea:focus),
.kt-modal :where(input:focus, select:focus, textarea:focus) {
    border-color: color-mix(in srgb, var(--apx-modal-brand) 62%, #cdd9e8) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--apx-modal-brand) 11%, transparent) !important;
}

.apx-app-dialog :where(.apx-app-form-actions, .apx129-form-actions, .apx130-form-actions),
.kt-modal .kt-modal-actions {
    position: sticky !important;
    bottom: calc(-1 * max(22px, env(safe-area-inset-bottom))) !important;
    z-index: 5 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 9px !important;
    margin: 4px -16px calc(-1 * max(22px, env(safe-area-inset-bottom))) !important;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom)) !important;
    border-top: 1px solid #dfe7f0 !important;
    background: rgba(255, 255, 255, .96) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 -14px 32px rgba(15, 35, 64, .08) !important;
}

.apx-app-dialog :where(.apx-app-button, .kt-btn-primary, .kt-btn-secondary),
.kt-modal :where(.kt-btn-primary, .kt-btn-secondary, button) {
    min-height: 42px;
    border-radius: 13px !important;
    font-size: 12px !important;
    font-weight: 950 !important;
}

/* Slide-out / large form dialogs */
dialog.apx-app-dialog.apx130-drawer,
dialog.apx-app-dialog.apx129-drawer,
dialog.apx-app-dialog.is-drawer {
    width: min(760px, 100vw) !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 0 0 auto !important;
    border-radius: 0 !important;
}

dialog.apx-app-dialog.apx130-drawer .apx-app-dialog-shell,
dialog.apx-app-dialog.apx129-drawer .apx-app-dialog-shell,
dialog.apx-app-dialog.is-drawer .apx-app-dialog-shell {
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-block: 0 !important;
    border-right: 0 !important;
    border-radius: 22px 0 0 22px !important;
}

dialog.apx-app-dialog.apx130-drawer .apx-app-dialog-body,
dialog.apx-app-dialog.apx129-drawer .apx-app-dialog-body,
dialog.apx-app-dialog.is-drawer .apx-app-dialog-body {
    padding: 14px 16px max(24px, env(safe-area-inset-bottom)) !important;
}

/* Legacy kt-modal repair used by school and older record pages. */
.kt-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10080 !important;
    display: none !important;
    place-items: center !important;
    padding: 18px !important;
    background: rgba(7, 18, 34, .62) !important;
    backdrop-filter: blur(5px);
}

.kt-modal.kt-modal-open,
.kt-modal[aria-hidden="false"] {
    display: grid !important;
}

.kt-modal-panel,
.kt-modal-panel-detail,
.kt-pro-modal-panel,
.kt-learning-submit-panel {
    position: relative !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    width: min(780px, calc(100vw - 30px)) !important;
    max-width: calc(100vw - 30px) !important;
    max-height: calc(100dvh - 30px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border: 1px solid var(--apx-modal-line) !important;
    border-radius: 20px !important;
    background:
        linear-gradient(180deg, #fff 0 76px, #f7faff 76px 100%) !important;
    color: var(--apx-modal-ink) !important;
    box-shadow: 0 34px 110px rgba(7, 19, 38, .31) !important;
}

.kt-modal-panel::before,
.kt-modal-panel-detail::before,
.kt-pro-modal-panel::before,
.kt-learning-submit-panel::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--apx-modal-brand), var(--apx-modal-accent), #f59e0b, #7c3aed);
    content: "";
}

.kt-modal-panel > .kt-modal-close,
.kt-modal-panel-detail > .kt-modal-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 8 !important;
    display: grid !important;
    width: 36px !important;
    height: 36px !important;
    place-items: center !important;
    border: 1px solid #dce6f1 !important;
    border-radius: 11px !important;
    background: #fff !important;
    color: #44546a !important;
    font-size: 0 !important;
    box-shadow: 0 8px 18px rgba(15, 35, 64, .08) !important;
}

.kt-modal-close::before {
    color: inherit;
    content: "x";
    font-size: 16px;
    font-weight: 950;
    line-height: 1;
}

.kt-modal-panel > .kt-eyebrow,
.kt-modal-panel-detail > .kt-eyebrow,
.kt-pro-modal-panel > .kt-eyebrow {
    padding: 20px 58px 0 18px !important;
    color: color-mix(in srgb, var(--apx-modal-brand) 78%, #0f172a) !important;
    letter-spacing: .11em !important;
    text-transform: uppercase !important;
    font-size: 10px !important;
    font-weight: 950 !important;
}

.kt-modal-panel > h2,
.kt-modal-panel-detail > h2,
.kt-pro-modal-panel > h2 {
    margin: 4px 58px 12px 18px !important;
    color: var(--apx-modal-ink) !important;
    font-size: clamp(20px, 3vw, 28px) !important;
    font-weight: 950 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
}

.kt-modal-panel > p,
.kt-modal-panel-detail > p,
.kt-pro-modal-panel > p {
    margin: -4px 58px 14px 18px !important;
    color: var(--apx-modal-muted) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
}

.kt-modal-panel > :not(.kt-modal-close):not(.kt-eyebrow):not(h2):not(p),
.kt-modal-panel-detail > :not(.kt-modal-close):not(.kt-eyebrow):not(h2):not(p),
.kt-pro-modal-panel > :not(.kt-modal-close):not(.kt-eyebrow):not(h2):not(p) {
    min-height: 0;
}

.kt-modal-form {
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: auto !important;
    padding: 0 18px max(18px, env(safe-area-inset-bottom)) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.kt-modal-form > :where(.kt-form-grid, .kt-modal-form-grid),
.kt-modal-form > :where(input, select, textarea, .kt-check-row, .kt-modal-field) {
    min-width: 0;
}

.kt-modal-form > button:not(.kt-modal-close),
.kt-modal-form > .kt-btn-primary,
.kt-modal-form > .kt-btn-secondary {
    position: sticky !important;
    bottom: calc(-1 * max(18px, env(safe-area-inset-bottom))) !important;
    z-index: 5 !important;
    justify-self: end;
    min-width: 160px;
    margin: 2px 0 calc(-1 * max(18px, env(safe-area-inset-bottom))) !important;
    box-shadow: 0 14px 28px rgba(21, 93, 252, .18) !important;
}

.kt-modal-form-grid,
.kt-modal-form .kt-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.kt-modal-field {
    display: grid !important;
    gap: 6px !important;
}

.kt-modal-field small,
.kt-modal-form small,
.apx-app-dialog-body small {
    color: #738198 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.kt-check-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    padding: 10px !important;
    border: 1px solid #dce6f1 !important;
    border-radius: 13px !important;
    background: #fff !important;
}

.kt-check-row label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    color: var(--apx-modal-ink) !important;
    font-size: 12px !important;
    font-weight: 850 !important;
}

/* Public website login, product and cart overlays. */
.apx-site-modal,
.apx-site-drawer {
    z-index: 10120 !important;
}

.apx-site-modal-card {
    display: grid !important;
    width: min(520px, calc(100vw - 28px)) !important;
    max-height: calc(100dvh - 28px) !important;
    overflow: hidden !important;
    border: 1px solid #d9e3ee !important;
    border-radius: 20px !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: 0 34px 100px rgba(7, 19, 38, .30) !important;
}

.apx-site-modal-card > :not(.apx-site-modal-close) {
    margin-inline: 22px;
}

.apx-site-modal-card > .apx-site-kicker {
    margin-top: 24px;
}

.apx-site-modal-card > p {
    color: #5f6f86 !important;
    font-weight: 650;
}

.apx-site-modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 20px 0 0 !important;
    padding: 14px 22px 18px !important;
    border-top: 1px solid #dfe7f0;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
}

.apx-site-product-modal {
    width: min(860px, calc(100vw - 28px)) !important;
    grid-template-columns: minmax(260px, .85fr) minmax(0, 1fr) !important;
}

.apx-site-product-modal-media {
    min-height: 0 !important;
    height: min(460px, calc(100dvh - 110px)) !important;
}

.apx-site-product-modal-copy {
    min-height: 0;
    overflow-y: auto;
    padding: 30px !important;
}

.apx-site-product-modal-copy form {
    position: sticky;
    bottom: -30px;
    margin-inline: -30px;
    padding: 14px 30px 18px;
    border-top: 1px solid #e3ebf3;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
}

.apx-site-drawer-panel {
    width: min(440px, 100vw) !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-left: 1px solid #d9e3ee !important;
}

.apx-site-drawer-content {
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
}

/* Website editor overlay polish. */
.apx-editor-body :where(.apx-site-modal-card, .apx-app-dialog-shell, .kt-modal-panel) {
    font-family: inherit;
}

@media (max-width: 760px) {
    dialog.apx-app-dialog,
    dialog.apx-app-dialog.is-lg,
    dialog.apx-app-dialog.is-xl {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .apx-app-dialog-shell {
        height: 100dvh !important;
        max-height: 100dvh !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    .apx-app-dialog-shell > header {
        min-height: 66px;
        padding: 13px 12px 12px !important;
    }

    .apx-app-dialog-icon {
        width: 36px !important;
        height: 36px !important;
        flex-basis: 36px !important;
        border-radius: 11px !important;
    }

    .apx-app-dialog-body {
        padding: 12px 12px max(20px, env(safe-area-inset-bottom)) !important;
    }

    .apx-app-dialog-body :where(.apx-app-form-grid, .apx130-form-grid, .apx129-form-grid, .kt-modal-form-grid, .kt-form-grid),
    .kt-modal-form-grid,
    .kt-modal-form .kt-form-grid {
        grid-template-columns: 1fr !important;
    }

    dialog.apx-app-dialog.apx130-drawer,
    dialog.apx-app-dialog.apx129-drawer,
    dialog.apx-app-dialog.is-drawer {
        align-self: end;
        height: min(94dvh, 820px) !important;
        margin-top: auto !important;
    }

    dialog.apx-app-dialog.apx130-drawer .apx-app-dialog-shell,
    dialog.apx-app-dialog.apx129-drawer .apx-app-dialog-shell,
    dialog.apx-app-dialog.is-drawer .apx-app-dialog-shell {
        height: min(94dvh, 820px) !important;
        border-radius: 22px 22px 0 0 !important;
    }

    .kt-modal {
        padding: 0 !important;
        align-items: end !important;
    }

    .kt-modal-panel,
    .kt-modal-panel-detail,
    .kt-pro-modal-panel,
    .kt-learning-submit-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 94dvh !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        border-left: 0 !important;
        border-radius: 22px 22px 0 0 !important;
    }

    .kt-modal-form {
        padding-inline: 12px !important;
    }

    .kt-modal .kt-modal-actions,
    .apx-app-dialog :where(.apx-app-form-actions, .apx129-form-actions, .apx130-form-actions) {
        justify-content: stretch !important;
    }

    .kt-modal .kt-modal-actions > *,
    .apx-app-dialog :where(.apx-app-form-actions, .apx129-form-actions, .apx130-form-actions) > * {
        flex: 1 1 145px !important;
        justify-content: center !important;
    }

    .apx-site-modal {
        align-items: end !important;
        place-items: end center !important;
    }

    .apx-site-modal-card,
    .apx-site-product-modal {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 92dvh !important;
        border-radius: 22px 22px 0 0 !important;
        border-bottom: 0 !important;
    }

    .apx-site-product-modal {
        display: block !important;
    }

    .apx-site-product-modal-media {
        height: 230px !important;
    }

    .apx-site-product-modal-copy {
        max-height: calc(92dvh - 230px);
        padding: 22px !important;
    }

    .apx-site-product-modal-copy form {
        bottom: -22px;
        margin-inline: -22px;
        padding-inline: 22px;
    }

    .apx-site-drawer-panel {
        width: 100vw !important;
        border-left: 0 !important;
    }
}

/* Phase 132 repair coverage: keep every sheet scrollable and every action visible. */
:root {
    --apx-modal-brand: var(--apx-brand, var(--apx127-brand, var(--apx130-navy, var(--kt-agency-brand, var(--apx-editor-brand, #155dfc)))));
}

body.apx-app-layer-open,
body.apx126-drawer-open,
html.apx126-drawer-open,
body.apx-ops-drawer-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

dialog.apx-app-dialog {
    width: min(640px, calc(100vw - 32px)) !important;
    max-height: calc(100dvh - 32px) !important;
    overscroll-behavior: contain;
}

dialog.apx-app-dialog.is-md { width: min(560px, calc(100vw - 32px)) !important; }
dialog.apx-app-dialog.is-lg { width: min(740px, calc(100vw - 32px)) !important; }
dialog.apx-app-dialog.is-xl { width: min(920px, calc(100vw - 32px)) !important; }

.apx-app-dialog-shell {
    width: 100%;
    max-height: min(840px, calc(100dvh - 32px)) !important;
}

.apx-app-dialog-body {
    max-height: none !important;
    overflow-x: hidden !important;
    scroll-padding-block: 16px 112px;
}

.apx-app-dialog-body > form.apx-app-form,
.apx-app-dialog-body > form.apx129-form,
.apx-app-dialog-body > form.apx130-form {
    min-height: 100%;
}

dialog.apx-app-dialog.apx127-drawer,
dialog.apx-app-dialog.apx130-drawer,
dialog.apx-app-dialog.apx129-drawer,
dialog.apx-app-dialog.is-drawer,
body[data-apx-page^="agency.business-suite."] dialog.apx-app-dialog,
body[data-apx-page^="agency.billing."] dialog.apx-app-dialog {
    width: min(700px, 100vw) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 0 0 auto !important;
}

dialog.apx-app-dialog.apx127-drawer.is-xl,
dialog.apx-app-dialog.apx130-drawer.is-xl,
dialog.apx-app-dialog.apx129-drawer.is-xl,
body[data-apx-page^="agency.business-suite."] dialog.apx-app-dialog.is-xl,
body[data-apx-page^="agency.billing."] dialog.apx-app-dialog.is-xl {
    width: min(880px, 100vw) !important;
}

dialog.apx-app-dialog.apx127-drawer.is-md,
dialog.apx-app-dialog.apx130-drawer.is-md,
dialog.apx-app-dialog.apx129-drawer.is-md,
body[data-apx-page^="agency.business-suite."] dialog.apx-app-dialog.is-md,
body[data-apx-page^="agency.billing."] dialog.apx-app-dialog.is-md {
    width: min(580px, 100vw) !important;
}

dialog.apx-app-dialog.apx127-drawer .apx-app-dialog-shell,
dialog.apx-app-dialog.apx130-drawer .apx-app-dialog-shell,
dialog.apx-app-dialog.apx129-drawer .apx-app-dialog-shell,
dialog.apx-app-dialog.is-drawer .apx-app-dialog-shell,
body[data-apx-page^="agency.business-suite."] dialog.apx-app-dialog .apx-app-dialog-shell,
body[data-apx-page^="agency.billing."] dialog.apx-app-dialog .apx-app-dialog-shell {
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-width: 0 0 0 1px !important;
    border-radius: 18px 0 0 18px !important;
    box-shadow: -28px 0 86px rgba(7, 19, 38, .26) !important;
}

.apx-app-dialog :where(.apx-app-form-actions, .apx129-form-actions, .apx130-form-actions, .apx127-form-actions) {
    bottom: -1px !important;
    z-index: 20 !important;
    margin-top: auto;
    background: rgba(255, 255, 255, .97) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.apx-app-command,
.apx-app-guide-drawer {
    z-index: 10080 !important;
}

.apx-app-command-shell,
.apx-app-guide-shell {
    min-height: 0;
    overflow: hidden !important;
}

.apx-app-command-results,
.apx-app-guide-content,
[data-apx-scroll-region] {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.apx-app-guide-shell {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    width: min(460px, 100vw) !important;
}

.apx-ops-drawer-shell,
.apx126-drawer-panel {
    min-height: 0;
    overflow: hidden !important;
}

.apx-ops-drawer-shell {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.apx-ops-drawer-body,
.apx126-drawer-body {
    min-height: 0 !important;
    overflow-x: hidden;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    scroll-padding-block: 16px 110px;
}

.apx-ops-drawer-footer {
    position: relative;
    z-index: 6;
    flex-wrap: wrap;
    background: #fff !important;
    box-shadow: 0 -12px 28px rgba(15, 35, 64, .075);
}

.apx126-drawer {
    isolation: isolate;
}

.apx126-drawer-panel {
    height: 100dvh;
    max-height: 100dvh !important;
}

.kt-modal-panel,
.kt-modal-panel-detail,
.kt-pro-modal-panel,
.kt-learning-submit-panel {
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: clamp(16px, 2.2vw, 22px) !important;
    scroll-padding-block: 18px 118px;
}

.kt-modal-panel > .kt-eyebrow,
.kt-modal-panel-detail > .kt-eyebrow,
.kt-pro-modal-panel > .kt-eyebrow {
    display: block;
    padding: 4px 48px 0 0 !important;
}

.kt-modal-panel > h2,
.kt-modal-panel-detail > h2,
.kt-pro-modal-panel > h2 {
    margin: 4px 48px 12px 0 !important;
}

.kt-modal-panel > p,
.kt-modal-panel-detail > p,
.kt-pro-modal-panel > p {
    margin: -4px 48px 14px 0 !important;
}

.kt-modal-form {
    display: grid !important;
    grid-template-rows: none !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
}

.kt-modal .kt-modal-actions {
    bottom: 0 !important;
    margin-inline: calc(-1 * clamp(16px, 2.2vw, 22px)) !important;
    margin-bottom: calc(-1 * clamp(16px, 2.2vw, 22px)) !important;
    padding: 13px clamp(16px, 2.2vw, 22px) max(13px, env(safe-area-inset-bottom)) !important;
    background: rgba(255, 255, 255, .97) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.kt-modal-form > button:not(.kt-modal-close),
.kt-modal-form > .kt-btn-primary,
.kt-modal-form > .kt-btn-secondary {
    bottom: 0 !important;
}

.apx-editor-dialog,
.apx-ai-builder-dialog {
    max-height: calc(100dvh - 28px) !important;
}

.apx-editor-dialog form {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100dvh - 28px) !important;
    min-height: 0;
}

.apx-editor-dialog-body,
.apx-ai-builder-step.is-active {
    min-height: 0;
    overflow-y: auto !important;
    scrollbar-gutter: stable;
}

.apx-editor-dialog footer,
.apx-ai-builder-step footer {
    position: sticky;
    bottom: -1px;
    z-index: 3;
    background: #fff !important;
    box-shadow: 0 -10px 24px rgba(15, 35, 64, .06);
}

.apx-ai-builder-shell {
    max-height: calc(100dvh - 28px) !important;
    min-height: 0;
}

@media (max-width: 760px) {
    dialog.apx-app-dialog,
    dialog.apx-app-dialog.is-md,
    dialog.apx-app-dialog.is-lg,
    dialog.apx-app-dialog.is-xl,
    dialog.apx-app-dialog.apx127-drawer,
    dialog.apx-app-dialog.apx130-drawer,
    dialog.apx-app-dialog.apx129-drawer,
    body[data-apx-page^="agency.business-suite."] dialog.apx-app-dialog,
    body[data-apx-page^="agency.billing."] dialog.apx-app-dialog {
        width: 100vw !important;
        height: min(94dvh, 900px) !important;
        max-height: 94dvh !important;
        margin: auto 0 0 !important;
    }

    .apx-app-dialog-shell,
    dialog.apx-app-dialog.apx127-drawer .apx-app-dialog-shell,
    dialog.apx-app-dialog.apx130-drawer .apx-app-dialog-shell,
    dialog.apx-app-dialog.apx129-drawer .apx-app-dialog-shell,
    body[data-apx-page^="agency.business-suite."] dialog.apx-app-dialog .apx-app-dialog-shell,
    body[data-apx-page^="agency.billing."] dialog.apx-app-dialog .apx-app-dialog-shell {
        height: 100% !important;
        max-height: 100% !important;
        border-width: 1px 0 0 !important;
        border-radius: 18px 18px 0 0 !important;
        box-shadow: 0 -24px 70px rgba(7, 19, 38, .24) !important;
    }

    .apx-app-dialog-shell::before,
    .apx-app-guide-shell::before,
    .apx-ops-drawer-shell::before,
    .apx126-drawer-panel::before {
        position: absolute;
        z-index: 8;
        top: 7px;
        left: 50%;
        width: 42px;
        height: 4px;
        border-radius: 999px;
        background: #c8d2df;
        content: "";
        transform: translateX(-50%);
    }

    .apx-app-dialog-shell > header {
        padding: 20px 14px 13px !important;
    }

    .apx-app-dialog-body {
        padding: 13px 12px max(24px, env(safe-area-inset-bottom)) !important;
    }

    .apx-app-dialog :where(.apx-app-form-actions, .apx129-form-actions, .apx130-form-actions) {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .apx-app-dialog :where(.apx-app-form-actions, .apx129-form-actions, .apx130-form-actions) :where(button, .apx-app-button, a) {
        width: 100%;
        justify-content: center;
    }

    .apx-app-guide-drawer {
        display: grid;
        align-items: end;
    }

    .apx-app-guide-shell {
        width: 100vw !important;
        height: min(94dvh, 900px) !important;
        max-height: 94dvh !important;
        border-width: 1px 0 0 !important;
        border-radius: 18px 18px 0 0;
    }

    .apx126-drawer,
    .apx126-drawer[data-size="sm"],
    .apx126-drawer[data-size="lg"] {
        grid-template-columns: 1fr !important;
        align-items: end;
    }

    .apx126-drawer-panel {
        height: min(94dvh, 900px);
        max-height: 94dvh !important;
        border-radius: 18px 18px 0 0;
    }

    .kt-modal-panel,
    .kt-modal-panel-detail,
    .kt-pro-modal-panel,
    .kt-learning-submit-panel {
        max-height: 94dvh !important;
    }

    .apx-editor-dialog,
    .apx-ai-builder-dialog {
        width: 100vw !important;
        height: min(94dvh, 900px) !important;
        max-height: 94dvh !important;
        margin: auto 0 0 !important;
        border-radius: 18px 18px 0 0 !important;
    }

    .apx-editor-dialog form,
    .apx-ai-builder-shell {
        height: 100% !important;
        max-height: 100% !important;
    }
}
