/* Shared notification/dialog surface — v9.0.13 */
.tm-dialog-lock {
    overflow: hidden;
}

.tm-notify-stack {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 10000;
    display: grid;
    width: min(calc(100vw - 2rem), 24rem);
    gap: .7rem;
    pointer-events: none;
}

.tm-notify {
    --tm-notify-bg: #155a96;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: .7rem;
    overflow: hidden;
    padding: .9rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 1rem;
    background: var(--tm-notify-bg);
    box-shadow: 0 28px 70px rgba(2, 8, 23, .28);
    color: #fff;
    pointer-events: auto;
    animation: tm-notify-in .32s cubic-bezier(.22, 1, .36, 1) both;
}

.tm-notify--success { --tm-notify-bg: #087152; }
.tm-notify--error { --tm-notify-bg: #a72439; }
.tm-notify--warning { --tm-notify-bg: #875000; }
.tm-notify--info { --tm-notify-bg: #155a96; }
.tm-notify.is-leaving { animation: tm-notify-out .25s ease both; }

.tm-notify > svg {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .15rem;
}

.tm-notify__message {
    min-width: 0;
    font: 750 .8rem/1.55 Inter, system-ui, sans-serif;
    overflow-wrap: anywhere;
}

.tm-notify__close {
    display: grid;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
}

.tm-notify__close:hover { background: rgba(255, 255, 255, .24); }
.tm-notify__close svg { width: .9rem; height: .9rem; }

.tm-notify__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: .2rem;
    background: rgba(255, 255, 255, .5);
    transform-origin: left;
    animation: tm-notify-shrink linear both;
}

.tm-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 10, 16, .66);
    opacity: 0;
    transition: opacity .2s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.tm-dialog-backdrop[hidden] { display: none !important; }
.tm-dialog-backdrop[data-open="true"] { opacity: 1; }

.tm-dialog {
    width: min(100%, 29rem);
    overflow: hidden;
    border: 1px solid var(--tm-line, #dce4e9);
    border-radius: 1.45rem;
    background: var(--tm-surface, #fff);
    box-shadow: 0 32px 84px rgba(2, 8, 23, .34);
    color: var(--tm-ink-soft, #334252);
    transform: translateY(.75rem) scale(.97);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}

.tm-dialog-backdrop[data-open="true"] .tm-dialog { transform: none; }

.tm-dialog__body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .9rem;
    padding: 1.25rem;
}

.tm-dialog__icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    place-items: center;
    border-radius: .9rem;
    background: var(--tm-danger-soft, #fff0f2);
    color: var(--tm-danger, #be3144);
}

.tm-dialog__icon[data-tone="brand"] {
    background: color-mix(in srgb, var(--tm-brand, #0e7490) 10%, var(--tm-surface, #fff));
    color: var(--tm-brand, #0e7490);
}

.tm-dialog__icon[data-tone="emerald"] {
    background: var(--tm-success-soft, #e6f7f0);
    color: var(--tm-success, #087f5b);
}

.tm-dialog__icon[data-tone="amber"] {
    background: var(--tm-warning-soft, #fff3dc);
    color: var(--tm-warning, #a45c00);
}

.tm-dialog__icon svg { width: 1.2rem; height: 1.2rem; }

.tm-dialog__copy h3 {
    margin: 0 0 .4rem;
    color: var(--tm-ink, #101923);
    font: 800 1.05rem/1.2 Manrope, Inter, system-ui, sans-serif;
}

.tm-dialog__copy p {
    margin: 0;
    color: var(--tm-muted, #647383);
    font: 500 .82rem/1.65 Inter, system-ui, sans-serif;
    overflow-wrap: anywhere;
}

.tm-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .55rem;
    padding: .9rem 1.25rem 1.25rem;
    border-top: 1px solid var(--tm-line, #dce4e9);
    background: var(--tm-surface-soft, #f8fafb);
}

.tm-dialog .tm-btn {
    display: inline-flex;
    min-height: 2.6rem;
    align-items: center;
    justify-content: center;
    padding: .6rem .9rem;
    border: 1px solid transparent;
    border-radius: .8rem;
    background: linear-gradient(135deg, var(--tm-brand, #0e7490), var(--tm-accent, #6d4aff));
    color: #fff;
    cursor: pointer;
    font: 800 .8rem/1.1 Inter, system-ui, sans-serif;
}

.tm-dialog .tm-btn--secondary {
    border-color: var(--tm-line-strong, #cbd6de);
    background: var(--tm-surface, #fff);
    color: var(--tm-ink, #101923);
}

.tm-dialog .tm-btn--danger { background: #b4233a; }
.tm-dialog .tm-btn--success { background: #087152; }
.tm-dialog .tm-btn--warning { background: #875000; }

html.dark .tm-dialog,
html[data-theme="dark"] .tm-dialog {
    --tm-surface: #0e1a24;
    --tm-surface-soft: #111f2b;
    --tm-ink: #f4f8fb;
    --tm-ink-soft: #c6d1da;
    --tm-muted: #93a4b3;
    --tm-line: #21323f;
    --tm-line-strong: #304452;
    --tm-danger: #ff8c9a;
    --tm-danger-soft: #35171d;
    --tm-success: #55d6aa;
    --tm-success-soft: #0b2d27;
    --tm-warning: #f3ba63;
    --tm-warning-soft: #302412;
}

@keyframes tm-notify-in {
    from { opacity: 0; transform: translateX(1.5rem) scale(.97); }
    to { opacity: 1; transform: none; }
}

@keyframes tm-notify-out {
    to { opacity: 0; transform: translateX(1.5rem) scale(.97); }
}

@keyframes tm-notify-shrink {
    to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .tm-notify,
    .tm-dialog {
        animation: none;
        transition: none;
    }
}
