/* Themed confirm/alert dialog (see static/js/themed_dialogs.js). Colour follows the
   section theme through --current-accent. */
.themed-dialog {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0);
    transition: background .2s ease;
}
.themed-dialog[hidden] { display: none; }
.themed-dialog.is-open { background: rgba(15, 23, 42, .5); }
.themed-dialog__card {
    width: min(100%, 420px);
    background: var(--surface, #fff);
    color: var(--text-main, #0f172a);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    border-top: 4px solid var(--current-accent, #173065);
    opacity: 0;
    transform: translateY(10px) scale(.97);
    transition: opacity .2s ease, transform .2s ease;
    outline: none;
}
.themed-dialog.is-open .themed-dialog__card { opacity: 1; transform: none; }
.themed-dialog__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.themed-dialog__icon {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .9rem;
    color: var(--current-accent, #173065);
    background: var(--current-accent-soft, rgba(23, 48, 101, .12));
}
.themed-dialog__title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.themed-dialog__body { margin: 0 0 18px; color: var(--text-secondary, #475569); font-size: .92rem; line-height: 1.5; }
.themed-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.themed-dialog__btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 18px;
    font: inherit;
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
}
.themed-dialog__btn--ghost { background: transparent; border-color: var(--border, #cbd5e1); color: var(--text-secondary, #475569); }
.themed-dialog__btn--ghost:hover { background: rgba(100, 116, 139, .1); }
.themed-dialog__btn--primary { background: var(--current-accent, #173065); color: #fff; }
.themed-dialog__btn--primary:hover { filter: brightness(.92); }
.themed-dialog__btn:focus-visible { outline: 3px solid var(--current-accent-soft, rgba(23, 48, 101, .3)); outline-offset: 2px; }
.themed-dialog.is-danger .themed-dialog__card { border-top-color: #dc2626; }
.themed-dialog.is-danger .themed-dialog__icon { color: #dc2626; background: rgba(220, 38, 38, .12); }
.themed-dialog.is-danger .themed-dialog__btn--primary { background: #dc2626; }
.themed-dialog-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
    .themed-dialog, .themed-dialog__card { transition: none; }
}
