.app-message-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 31, 43, .48);
    backdrop-filter: blur(2px);
}
.app-message-dialog {
    width: min(430px, 100%);
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .28);
    animation: app-message-in .16s ease-out;
}
.app-message-body { display: flex; gap: 14px; padding: 22px 22px 16px; }
.app-message-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 22px;
    background: #e8f4fd;
    color: #1688c7;
}
.app-message-dialog[data-type="success"] .app-message-icon { background: #e8f7ed; color: #218c45; }
.app-message-dialog[data-type="warning"] .app-message-icon { background: #fff4d9; color: #b77800; }
.app-message-dialog[data-type="error"] .app-message-icon { background: #fdeaea; color: #c93636; }
.app-message-copy { min-width: 0; }
.app-message-title { margin: 0 0 7px; color: #23384d; font-size: 18px; line-height: 1.25; }
.app-message-text { margin: 0; color: #526273; font-size: 14px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.app-message-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.app-message-button { min-width: 92px; padding: 10px 17px; border: 0; border-radius: 6px; cursor: pointer; font-weight: 600; }
.app-message-button:focus-visible { outline: 3px solid rgba(31, 151, 218, .28); outline-offset: 2px; }
.app-message-button-primary { background: #2398d1; color: #fff; }
.app-message-button-primary:hover { background: #1687bf; }
.app-message-button-secondary { background: #eef1f4; color: #34495e; }
.app-message-button-danger { background: #d84242; color: #fff; }
.app-message-button-danger:hover { background: #bd3030; }
.app-toast-stack { position: fixed; z-index: 200001; top: 18px; right: 18px; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.app-toast { padding: 13px 16px; border-radius: 8px; color: #fff; background: #258dc2; box-shadow: 0 8px 25px rgba(0,0,0,.2); animation: app-message-in .16s ease-out; }
.app-toast.success { background: #278d49; }.app-toast.warning { background: #b77800; }.app-toast.error { background: #c93636; }
@keyframes app-message-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
    .app-message-overlay { align-items: flex-end; padding: 12px; }
    .app-message-dialog { width: 100%; border-radius: 14px; }
    .app-message-body { padding: 22px 18px 14px; }
    .app-message-actions { padding: 12px 18px 18px; }
    .app-message-button { min-height: 46px; flex: 1; font-size: 15px; }
}
