
.fx-shell {
    --feedback-surface: var(--fx-bg-elevated, #16161a);
    --feedback-radius: var(--fx-radius-md, 24px);
    --feedback-control: 49px;
    --feedback-edge: max(14px, env(safe-area-inset-bottom, 0px));
}

.fxm-overlay, #proModalOverlay {
    position: fixed; inset: 0; z-index: 10020;
    display: grid; place-items: center; align-items: center; justify-content: center;
    box-sizing: border-box; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    background: rgba(5,5,9,.68); overscroll-behavior: contain;
}
.fxm-overlay { opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.fxm-overlay.fxm-show { opacity: 1; pointer-events: auto; }
.fxm-box, #proModal {
    position: relative; box-sizing: border-box; width: min(460px, calc(100vw - 32px));
    min-width: 0; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
    overflow: auto; overscroll-behavior: contain; padding: 28px;
    border: 1px solid var(--fx-border); border-radius: var(--feedback-radius);
    background: var(--feedback-surface); color: var(--fx-text-main); box-shadow: var(--fx-shadow-lg);
    font-family: var(--fx-font-main, system-ui); text-align: left;
}
.fxm-box { transform: translateY(8px); transition: transform .22s ease-out; }
.fxm-show .fxm-box, #proModal { transform: none; }
.fxm-box:focus, #proModal:focus { outline: none; }
.fxm-box--wide { width: min(600px, calc(100vw - 32px)); }
.fxm-head, #proModalTitle { padding-right: 38px; }
.fxm-mark { color: var(--fx-ac1); margin-bottom: 12px; }
.fxm-mark svg { width: 24px; height: 24px; }
.fxm-title { margin: 0; color: var(--fx-text-main); font-size: clamp(21px, 4vw, 25px); line-height: 1.2; font-weight: 750; overflow-wrap: anywhere; }
.fxm-text { margin: 10px 0 0; color: var(--fx-text-muted); font-size: 14px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.fxm-content { margin-top: 18px; min-width: 0; }
.fxm-buttons, .fx-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.fxm-buttons > *, .fx-result-actions > * { flex: 1 1 120px; }
.fxm-btn, #proModal .modal-btn, .fx-shell .fx-cookie-btn {
    appearance: none; display: inline-flex; align-items: center; justify-content: center;
    box-sizing: border-box; min-height: var(--feedback-control); padding: 10px 20px;
    border: 0; border-radius: var(--fx-radius-pill, 999px); text-decoration: none;
    font: 650 14px/1.35 var(--fx-font-main, system-ui); text-align: center; cursor: pointer;
}
.fxm-btn--primary, #proModal .primary, .fx-shell .fx-cookie-btn { color: #fff; background: var(--fx-ac1); }
.fxm-btn--ghost, #proModal .ghost { color: var(--fx-text-main); background: var(--fx-bg-hover); }
.fxm-btn--danger { color: var(--fx-error); background: color-mix(in srgb, var(--fx-error) 14%, var(--feedback-surface)); }
.fxm-btn:hover, #proModal .modal-btn:hover, .fx-shell .fx-cookie-btn:hover { filter: brightness(1.14); box-shadow: none; }
.fxm-btn:disabled { opacity: .5; cursor: default; }
.fxm-close, #proModal .fxm-close, .fx-shell .fx-result-close {
    appearance: none; position: absolute; top: 10px; right: 10px; z-index: 1;
    display: grid; place-items: center; margin: 0; padding: 0; width: 44px; height: 44px;
    border: 0; background: transparent; color: var(--fx-text-muted); box-shadow: none; cursor: pointer;
}
.fxm-close svg, .fx-result-close svg { display: block; width: 24px; height: 24px; }
.fxm-close:hover, .fx-result-close:hover { color: var(--fx-text-main); }
:where(.fxm-box,#proModal,.fx-result-dialog) :focus-visible { outline: 2px solid var(--fx-ac1); outline-offset: 2px; }
.fxm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fxm-chip, .fxm-input, .fxm-textarea { border: 1px solid var(--fx-border); background: var(--fx-bg-subtle); color: var(--fx-text-main); font: inherit; }
.fxm-chip { border-radius: var(--fx-radius-pill); cursor: pointer; }
.fxm-field-label { display: block; margin: 12px 0 6px; color: var(--fx-text-muted); font-size: 13px; }
.fxm-input,.fxm-textarea { box-sizing: border-box; width: 100%; padding: 12px; border-radius: var(--fx-radius-sm); }
.fxm-textarea { resize: vertical; }
.fxm-offer { padding: 16px; border-radius: var(--fx-radius-sm); line-height: 1.55; }

.fx-shell .fx-toast-container .fx-toast {
    display: flex; align-items: center; gap: 11px; box-sizing: border-box; min-height: 48px; padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--feedback-accent, var(--fx-ac1)) 42%, var(--fx-border));
    background: var(--feedback-surface); border-radius: var(--feedback-radius); box-shadow: var(--fx-shadow-md);
    color: var(--fx-text-main); font: 600 14px/1.45 var(--fx-font-main, system-ui); overflow-wrap: anywhere;
}
.fx-toast-container .success { --feedback-accent: var(--fx-success); }
.fx-toast-container .error { --feedback-accent: var(--fx-error); }
.fx-toast-container .warning { --feedback-accent: var(--fx-warning); }
.fx-shell .fx-cookie-banner { box-sizing: border-box; bottom: var(--feedback-edge); border-radius: var(--feedback-radius); }
.fx-shell .fx-studio-next { align-items: center; border-radius: var(--feedback-radius); }
.fx-shell :is(#phToast,#producerToast,#contactsToast,#flowToast), .fx-shell #toast:is(.toast,.ac-toast) {
    box-sizing: border-box; max-width: min(560px, calc(100% - 28px)); min-height: 44px;
    padding: 12px 18px; border: 1px solid var(--fx-border); border-radius: var(--feedback-radius);
    color: var(--fx-text-main); background: var(--feedback-surface); box-shadow: var(--fx-shadow-md);
    line-height: 1.45; overflow-wrap: anywhere; text-align: center;
}
.fx-shell :is(#phToast,#producerToast,#contactsToast) { bottom: var(--feedback-edge); }
.fx-shell :is(#phToast,#producerToast,#contactsToast) { right: auto; left: 50%; width: max-content; translate: -50% 0; }
.fx-shell :is(#phToast,#producerToast) {
    --feedback-tone: var(--fx-success);
    color: var(--feedback-tone);
    background: color-mix(in srgb, var(--feedback-tone) 12%, var(--feedback-surface));
    border-color: color-mix(in srgb, var(--feedback-tone) 45%, var(--feedback-surface));
}
.fx-shell :is(#phToast,#producerToast).is-error { --feedback-tone: var(--fx-error); }
[data-theme="light"] .fx-shell :is(#phToast,#producerToast) { color: color-mix(in srgb, var(--feedback-tone) 35%, var(--fx-text-main)); }

@media (max-width: 768px) {
    body[data-page-slug="subscription"] .fxm-overlay { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; padding: max(10px, env(safe-area-inset-top)) 0 0; }
    body[data-page-slug="subscription"] .fxm-overlay .fxm-box {
        width: 100%; max-height: 100%; margin: 0; padding: 20px max(20px, env(safe-area-inset-right)) max(18px,calc(env(safe-area-inset-bottom) + 12px)) max(20px,env(safe-area-inset-left));
        border-radius: 26px 26px 0 0; border-width: 1px 0 0; transform: translateY(100%); transition: transform .24s cubic-bezier(.22,.75,.2,1);
    }
    body[data-page-slug="subscription"] .fxm-overlay.fxm-show .fxm-box { transform: none; }
    body[data-page-slug="subscription"] .fxm-overlay .fxm-box::before { content: ''; display: block; position: static; width: 34px; height: 4px; margin: -9px auto 17px; background: var(--fx-border-strong); border-radius: 4px; }
    body[data-page-slug="subscription"] .fxm-close { top: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .fxm-overlay, .fxm-overlay .fxm-box, .fx-toast-container .fx-toast, body[data-page-slug="subscription"] .fxm-overlay .fxm-box { transition: none; }
}

.fx-result-dialog {
    box-sizing: border-box; width: min(470px, calc(100% - 28px)); max-height: calc(100dvh - 36px);
    padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--fx-border);
    border-radius: var(--feedback-radius); background: var(--feedback-surface); color: var(--fx-text-main);
}
body:has(.fx-result-dialog[open]) { overflow: hidden; }
.fx-result-dialog #storyTitle:focus { outline: none; }
.fx-result-dialog::backdrop { background: rgba(5,5,9,.68); }
.fx-result-dialog .fx-result-actions { margin: 0; padding: 16px 20px max(16px, env(safe-area-inset-bottom)); }
.fx-result-dialog .storyCard { border: 0; border-radius: 0; box-shadow: none; }
.fx-shell :is(#svCoverPicker,#veCollectionsDialog,#packDialog,#emailVerificationDialog,#artistCoverPeek,.fx-studio-next,.daw-tutorial)
    :is([aria-label^="Закрыть"],.fx-studio-next-close) {
    display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px;
    padding: 0; background: transparent; border: 0; box-shadow: none; color: var(--fx-text-main); cursor: pointer;
}
.fx-shell :is(#svCoverPicker,#veCollectionsDialog,#packDialog,#emailVerificationDialog) [aria-label^="Закрыть"] svg { width: 22px; height: 22px; }
@media (min-width: 769px) {
    .fx-shell :is(#toast.toast,#toast.ac-toast) { bottom: var(--feedback-edge); }
}
.fx-shell .fx-toast-container { z-index: 10050; }
.fx-shell .fx-toast-container .fx-toast { transform: translateY(-8px); transition: opacity .18s, transform .22s ease; }
.fx-shell .fx-toast-container .fx-toast.show { transform: none; }
.fx-shell .fx-toast-container .fx-toast i { color: var(--feedback-accent, var(--fx-ac1)); font-style: normal; font-weight: 800; }
.fx-shell .fx-toast-container .fx-toast span { flex: 1 1 auto; min-width: 0; }
.fx-shell .fx-notice-close {
    display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; margin: -6px -6px -6px 0;
    padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--fx-text-muted); cursor: pointer; font: 400 25px/1 system-ui;
}
.fx-shell .fx-notice-close:focus-visible { outline: 2px solid var(--fx-ac1); outline-offset: -3px; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .fx-shell .fx-toast-container .fx-toast, .fx-shell .fx-studio-next {
        background: color-mix(in srgb, var(--feedback-surface) 82%, transparent);
        -webkit-backdrop-filter: blur(18px) saturate(130%); backdrop-filter: blur(18px) saturate(130%);
    }
}
@media (prefers-reduced-transparency: reduce) {
    .fx-shell .fx-toast-container .fx-toast, .fx-shell .fx-studio-next { background: var(--feedback-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
    .fx-shell .fx-toast-container .fx-toast { transition: none; transform: none; }
}
.fx-shell :is(.rp-dialog-footer, .email-proof:not(.email-proof--inline) .email-proof-actions, #dawTutorial > div, .ve-collections-footer) button,
.fx-shell :is(#flowDialogClose, #backToEditor, #packAction) { min-height: var(--feedback-control); }
.fx-shell :is(.rp-dialog-header .rp-icon-button, #svToastClose, #fxNotifClose) {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 44px; height: 44px; padding: 0; border: 0; background: transparent; box-shadow: none;
}
