.app-dialog-layer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    box-sizing: border-box;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 20px;
    border: 0;
    place-items: center;
    color: inherit;
    background: rgba(2, 5, 11, .78);
    backdrop-filter: blur(10px);
    animation: appDialogFade .18s ease both;
}

.app-dialog-layer[open] { display: grid; }
.app-dialog-layer::backdrop { background: transparent; }

.app-dialog-panel {
    position: relative;
    overflow: hidden;
    width: min(470px, 100%);
    padding: 22px;
    border: 1px solid var(--line, rgba(196, 217, 237, .16));
    border-radius: 22px;
    color: var(--text, #f7fbff);
    background:
        radial-gradient(circle at 100% 0, rgba(255, 117, 136, .12), transparent 44%),
        linear-gradient(145deg, rgba(255, 255, 255, .035), transparent 46%),
        #0d1523;
    box-shadow: 0 38px 110px rgba(0, 0, 0, .68);
    animation: appDialogEnter .22s cubic-bezier(.2, .8, .2, 1) both;
}

.app-dialog-panel::before {
    position: absolute;
    top: 0;
    right: 22px;
    left: 22px;
    height: 2px;
    border-radius: 999px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--red, #ff7588), transparent);
    opacity: .8;
}

.app-dialog-heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
}

.app-dialog-icon {
    display: grid;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 117, 136, .25);
    border-radius: 14px;
    place-items: center;
    color: #ff9aaa;
    background: rgba(255, 117, 136, .09);
    font-size: 18px;
    font-weight: 900;
}

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

.app-dialog-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #ff91a3;
    font-size: 11.5px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.app-dialog-title {
    margin: 0;
    font-size: clamp(19px, 4vw, 23px);
    line-height: 1.15;
    letter-spacing: -.025em;
}

.app-dialog-message {
    margin: 18px 0 0;
    padding: 14px 15px;
    border: 1px solid var(--line, rgba(196, 217, 237, .14));
    border-radius: 14px;
    color: var(--muted, #9aaabe);
    background: rgba(2, 7, 16, .38);
    font-size: 13.5px;
    line-height: 1.58;
    white-space: pre-line;
}

.app-dialog-actions {
    display: flex;
    margin-top: 20px;
    justify-content: flex-end;
    gap: 10px;
}

.app-dialog-button {
    display: inline-flex;
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid var(--line, rgba(196, 217, 237, .14));
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    color: var(--text, #f7fbff);
    background: rgba(255, 255, 255, .045);
    font-size: 13px;
    font-weight: 850;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.app-dialog-button:hover {
    border-color: rgba(196, 217, 237, .3);
    background: rgba(255, 255, 255, .075);
    transform: translateY(-1px);
}

.app-dialog-button.is-danger {
    border-color: rgba(255, 117, 136, .32);
    color: #2c0710;
    background: linear-gradient(135deg, #ff7588, #ff9cac);
    box-shadow: 0 13px 30px rgba(255, 117, 136, .2);
}

.app-dialog-button.is-danger:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #ff8798, #ffadba);
}

.app-dialog-panel[data-tone="info"]::before {
    background: linear-gradient(90deg, transparent, var(--cyan, #59efd4), transparent);
}

.app-dialog-panel[data-tone="info"] .app-dialog-icon {
    color: var(--cyan, #59efd4);
    border-color: rgba(89, 239, 212, .24);
    background: rgba(89, 239, 212, .075);
}

.app-dialog-panel[data-tone="info"] .app-dialog-eyebrow { color: var(--cyan, #59efd4); }

.app-dialog-open { overflow: hidden !important; }

@keyframes appDialogFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes appDialogEnter {
    from { opacity: 0; transform: translateY(10px) scale(.975); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
    .app-dialog-layer { padding: 13px; align-items: end; }
    .app-dialog-panel { padding: 20px 17px 17px; border-radius: 20px; }
    .app-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .app-dialog-button { width: 100%; padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .app-dialog-layer,
    .app-dialog-panel,
    .app-dialog-button { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
