.app-modal-root[hidden] { display: none; }

.app-modal-root {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(5px);
    animation: app-modal-fade .18s ease-out;
}

.app-modal-dialog {
    position: relative;
    width: min(440px, 100%);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 20px;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .26);
    animation: app-modal-in .2s ease-out;
}

.app-modal-body { padding: clamp(24px, 5vw, 32px); }
.app-modal-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 16px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 23px;
}
.app-modal-dialog[data-variant="info"] .app-modal-icon { background: #eef2ff; color: #4338ca; }
.app-modal-title { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -.025em; font-weight: 800; }
.app-modal-message { margin: 10px 0 0; color: #64748b; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.app-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px clamp(24px, 5vw, 32px); border-top: 1px solid #e2e8f0; background: #f8fafc; }
.app-modal-btn { min-height: 44px; padding: 10px 18px; border: 1px solid #dbe1ea; border-radius: 11px; background: #fff; color: #334155; font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
.app-modal-btn:hover { background: #f1f5f9; }
.app-modal-btn.primary { border-color: #111827; background: #111827; color: #fff; }
.app-modal-btn.primary:hover { background: #000; }
.app-modal-btn.danger { border-color: #dc2626; background: #dc2626; color: #fff; }
.app-modal-btn.danger:hover { background: #b91c1c; }
.app-modal-btn:focus-visible { outline: 3px solid rgba(79, 70, 229, .24); outline-offset: 2px; }
body.app-modal-open { overflow: hidden; }

@keyframes app-modal-fade { from { opacity: 0; } }
@keyframes app-modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

@media (max-width: 520px) {
    .app-modal-root { align-items: end; padding: 12px; }
    .app-modal-dialog { border-radius: 18px; }
    .app-modal-actions { flex-direction: column-reverse; }
    .app-modal-btn { width: 100%; min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .app-modal-backdrop, .app-modal-dialog { animation: none; }
}
