.toast-stack {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 200;
    display: flex;
    flex-direction: column-reverse;
    gap: 9px;
    width: min(380px, calc(100vw - 30px));
    pointer-events: none;
}
.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    overflow: hidden;
    padding: 12px 12px 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 300ms var(--ease) both;
}
.toast.is-leaving { animation: toast-out 220ms var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(-12px); } }
.toast__icon { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; }
.toast__icon .icon { width: 15px; height: 15px; }
.toast__message { flex: 1; padding-top: 1px; color: var(--text-soft); font-size: 0.82rem; line-height: 1.55; }
.toast__close { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; }
.toast__close:hover { color: var(--text); background: var(--paper-2); }
.toast__close .icon { width: 14px; height: 14px; }
.toast__progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; transform-origin: left; animation: toast-progress 5s linear forwards; }
@keyframes toast-progress { to { transform: scaleX(0); } }
.toast--success .toast__icon { color: var(--green); background: var(--green-soft); }
.toast--success .toast__progress { background: var(--green); }
.toast--error .toast__icon, .toast--danger .toast__icon { color: var(--red); background: var(--red-soft); }
.toast--error .toast__progress, .toast--danger .toast__progress { background: var(--red); }
.toast--warning .toast__icon { color: var(--amber); background: var(--amber-soft); }
.toast--warning .toast__progress { background: var(--amber); }
.toast--info .toast__icon, .toast--debug .toast__icon { color: var(--blue); background: var(--blue-soft); }
.toast--info .toast__progress, .toast--debug .toast__progress { background: var(--blue); }

.modal {
    width: min(430px, calc(100vw - 30px));
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text);
}
.modal::backdrop { background: rgba(10, 18, 13, 0.55); backdrop-filter: blur(3px); }
.modal[open] { animation: pop-in 200ms var(--ease); }
.modal__panel { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.modal__icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 14px; border-radius: 12px; color: var(--red); background: var(--red-soft); }
.modal__icon .icon { width: 21px; height: 21px; }
.modal__title { margin-bottom: 6px; font-size: 1.12rem; }
.modal__text { color: var(--muted); font-size: 0.86rem; line-height: 1.65; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }
.modal[data-variant="primary"] .modal__icon { color: var(--green); background: var(--green-soft); }
.modal[data-variant="primary"] .modal__icon .icon { transform: rotate(180deg); }

.empty-state {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
    padding: 42px 20px;
    text-align: center;
}
.empty-state__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 13px; border: 1px dashed var(--border-strong); border-radius: 15px; color: var(--muted); background: var(--surface-muted); }
.empty-state__icon .icon { width: 23px; height: 23px; }
.empty-state h3 { margin-bottom: 4px; font-size: 1rem; }
.empty-state p { max-width: 350px; color: var(--muted); font-size: 0.82rem; }
.empty-state .btn { margin-top: 15px; }

.mini-empty { display: flex; align-items: center; gap: 10px; padding: 20px 22px 24px; color: var(--muted); font-size: 0.82rem; }
.mini-empty span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--green); background: var(--green-soft); }
.mini-empty .icon { width: 15px; height: 15px; }

@media (max-width: 620px) {
    .toast-stack { left: 15px; right: 15px; bottom: 15px; width: auto; }
    .modal__panel { padding: 20px; }
    .modal__actions .btn { flex: 1; }
}
