/* Avisos do sistema (js/core/toast.js), nos dois layouts. Por cima de tudo, inclusive
   dos modais (overlay.css, 1000) e da janela da SARA (10000, chatbot/modal.css). */
.ts-toasts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10050;
    width: min(420px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.ts-toast {
    --ts-fg: #1e3a8a;
    --ts-soft: #dbeafe;
    --ts-line: #93c5fd;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 14px;
    padding: 16px 14px 18px 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--ts-line);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    overflow: hidden;
    pointer-events: auto;
    animation: ts-toast-in .28s cubic-bezier(.2, .8, .2, 1);
}
.ts-toast--success { --ts-fg: #166534; --ts-soft: #dcf7e6; --ts-line: #9fdfb8; }
.ts-toast--error { --ts-fg: #991b1b; --ts-soft: #fee2e2; --ts-line: #fca5a5; }
.ts-toast--warning { --ts-fg: #9a3412; --ts-soft: #ffedd5; --ts-line: #fdba74; }
.ts-toast--info { --ts-fg: #1e3a8a; --ts-soft: #dbeafe; --ts-line: #93c5fd; }

.ts-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--ts-soft);
    color: var(--ts-fg);
    flex-shrink: 0;
}
.ts-toast-icon .ms {
    font-size: 24px;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.ts-toast-body { min-width: 0; padding-top: 1px; }
.ts-toast-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ts-fg);
}
.ts-toast-text {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: #334155;
    overflow-wrap: anywhere;
}

.ts-toast-close {
    width: 32px;
    height: 32px;
    margin: -4px -2px 0 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.ts-toast-close:hover { background: #f1f5f9; color: #0f172a; }
.ts-toast-close:focus-visible { outline: 3px solid #8a67f8; outline-offset: 1px; }
.ts-toast-close .ms { font-size: 20px; }

/* Tempo restante */
.ts-toast-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--ts-fg);
    opacity: .55;
    transform-origin: left center;
    transform: scaleX(1);
}

.ts-toast--out { animation: ts-toast-out .22s ease forwards; }

@keyframes ts-toast-in {
    from { opacity: 0; transform: translateX(24px) scale(.98); }
    to { opacity: 1; transform: none; }
}
@keyframes ts-toast-out {
    to { opacity: 0; transform: translateX(24px) scale(.98); }
}

@media (max-width: 600px) {
    .ts-toasts { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; }
}

@media print {
    .ts-toasts { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .ts-toast, .ts-toast--out { animation-duration: .01ms; }
    .ts-toast-bar { display: none; }
}
