/* ── Secondhander – in-app dialogs (replace the browser's alert/confirm) ──── */
.ub-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 8, 8, 0.45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.ub-dialog-overlay.show { opacity: 1; }

.ub-dialog {
    width: 100%;
    max-width: 340px;
    max-height: 86vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    padding: 26px 22px 18px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    transform: translateY(14px) scale(0.97);
    transition: transform 0.2s ease;
    font-family: inherit;
}
.ub-dialog-overlay.show .ub-dialog { transform: none; }

.ub-dialog-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdf2f2;
    box-shadow: 0 0 0 7px #fef8f8;
    color: #931e1e;
    font-size: 1.45rem;
}
.ub-dialog-icon.success { background: #eef8ee; box-shadow: 0 0 0 7px #f6fbf6; color: #3d9f38; }
.ub-dialog-icon.warn    { background: #fff6e8; box-shadow: 0 0 0 7px #fffaf2; color: #d98a00; }

.ub-dialog-title {
    margin: 0 0 6px;
    font-size: 1.02rem;
    font-weight: 700;
    color: #2b2b2b;
}
.ub-dialog-msg {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #777;
    white-space: pre-line;
    word-break: break-word;
}

.ub-dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}
.ub-dialog-btn {
    border: none;
    border-radius: 22px;
    padding: 11px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    background: #931e1e;
    color: #fff;
    transition: opacity 0.15s, transform 0.12s;
}
.ub-dialog-btn:active { transform: scale(0.97); }
.ub-dialog-btn.secondary { background: #f3f3f3; color: #555; }
.ub-dialog-btn.danger    { background: #c62828; }
.ub-dialog-btn.option    { background: #fff; color: #931e1e; border: 1.5px solid #931e1e; }

@media (min-width: 420px) {
    .ub-dialog-actions.row { flex-direction: row-reverse; }
    .ub-dialog-actions.row .ub-dialog-btn { flex: 1; }
}

.ub-dialog-btn:focus { outline: none; }
.ub-dialog-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(147, 30, 30, 0.28); }
