:root{--mm-modal-surface:#f8f8f9;--mm-modal-ink:#18191c;--mm-modal-line:#d9dadd;--mm-modal-accent:#386dc7;--mm-modal-danger:#c83f46;--mm-modal-ease:cubic-bezier(.23,1,.32,1)}
.mm-system-night{--mm-modal-surface:#27272b;--mm-modal-ink:#f5f5f7;--mm-modal-line:#45454a;--mm-modal-accent:#8aaff0;--mm-modal-danger:#f17b81}.mm-system-night .mm-system-body input{background:#34343a}
.mm-system-dialog{position:fixed;inset:var(--mm-modal-top,0px) 0 calc(100dvh - var(--mm-modal-height,100dvh) - var(--mm-modal-top,0px));margin:auto;height:fit-content;box-sizing:border-box;width:min(288px,calc(100vw - 48px));max-height:calc(var(--mm-modal-height,100dvh) - var(--app-safe-top,env(safe-area-inset-top,0px)) - var(--app-safe-bottom,env(safe-area-inset-bottom,0px)) - 32px);overflow:auto;border:0;padding:0;border-radius:18px;background:var(--mm-modal-surface);color:var(--mm-modal-ink);box-shadow:0 16px 48px #0002;font-family:inherit;opacity:1;transform:scale(1);transition:opacity 200ms var(--mm-modal-ease),transform 200ms var(--mm-modal-ease)}
@starting-style{.mm-system-dialog[open]{opacity:0;transform:scale(.95)}}
.mm-system-dialog::backdrop{background:#0005}.mm-system-closing{opacity:0;transform:scale(.95);pointer-events:none}.mm-system-body{padding:22px 20px 20px;text-align:center}.mm-system-body h2{margin:0 0 8px;font-size:17px;font-weight:650;line-height:1.4}.mm-system-body p{margin:0;font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}.mm-system-body input{box-sizing:border-box;width:100%;margin-top:16px;padding:10px;border:1px solid var(--mm-modal-line);border-radius:8px;background:#fff;color:var(--mm-modal-ink);font:inherit;font-size:16px}.mm-system-actions{display:flex;border-top:1px solid var(--mm-modal-line)}.mm-system-actions button{flex:1;min-height:48px;padding:10px 14px;border:0;background:transparent;color:var(--mm-modal-accent);font:inherit;font-size:16px;cursor:pointer}.mm-system-actions button+button{border-left:1px solid var(--mm-modal-line)}.mm-system-actions button:last-child{font-weight:600}.mm-system-actions .mm-system-destructive{color:var(--mm-modal-danger)}.mm-system-actions button:focus-visible{outline:2px solid var(--mm-modal-accent);outline-offset:-4px;border-radius:7px}
.mm-system-sheet{width:min(420px,calc(100vw - 20px));margin:0 auto;inset:auto 0 calc(100dvh - var(--mm-modal-height,100dvh) - var(--mm-modal-top,0px) + max(10px,var(--app-safe-bottom,env(safe-area-inset-bottom,0px))));border-radius:20px;transform:translateY(0);transition:opacity 240ms var(--mm-modal-ease),transform 240ms cubic-bezier(.32,.72,0,1)}.mm-system-sheet .mm-system-actions{display:flex;flex-direction:column}.mm-system-sheet .mm-system-actions button+button{border-left:0;border-top:1px solid var(--mm-modal-line)}@starting-style{.mm-system-sheet[open]{opacity:0;transform:translateY(100%)}}.mm-system-sheet.mm-system-closing{transform:translateY(100%)}
/* Existing form sheets consume the same shell tokens; their business controls remain intact. */
:is(.im-sheet,.launcher-menu,.life-sheet,.wx-dialog,.wx-modal,.sheet-dialog,dialog:not(.mm-system-dialog)){border-radius:20px;border-color:var(--mm-modal-line);color:inherit;max-height:calc(var(--mm-modal-height,100dvh) - var(--app-safe-top,env(safe-area-inset-top,0px)) - var(--app-safe-bottom,env(safe-area-inset-bottom,0px)) - 24px);overflow:auto}
.mm-system-form{border-radius:20px!important;max-height:calc(var(--mm-modal-height,100dvh) - var(--app-safe-top,env(safe-area-inset-top,0px)) - var(--app-safe-bottom,env(safe-area-inset-bottom,0px)) - 24px)!important;overflow:auto;overscroll-behavior:contain;box-shadow:0 16px 48px #0002}.mm-system-form>header{border-bottom:1px solid var(--mm-modal-line)}.mm-system-form h2{font-size:18px;line-height:1.4}.mm-system-form .danger,.mm-system-form .destructive{color:var(--mm-modal-danger)}
@media(prefers-reduced-motion:reduce){.mm-system-dialog,.mm-system-sheet,.mm-system-closing{transform:none;transition:opacity 120ms ease-out}}
