/* --------------------------------------------------------------------------
 * 토스트(assets/js/toast.js — mfToast, 세션 알림은 layouts/partials/flash) — 오른쪽 위 고정.
 *   확인 창(app-confirm)과 같은 어법: 둥근 면 · 종류 색의 동그란 아이콘 · 굵은 문구 + 흐린 둘째 줄.
 *   성공 · 안내는 아래 가는 막대가 줄어들며 저절로 사라지고(올리면 멈춤), 경고 · 오류는 ✕ 로 닫는다.
 *   휴대폰(576px 미만)은 상단바 아래 화면 폭.
 * -------------------------------------------------------------------------- */
.mf-toasts {
    position: fixed;
    top: calc(var(--theme-topbar-height, 58px) + 0.75rem);
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}
.mf-toast {
    --toast-color: var(--st-success);
    --toast-tint: var(--st-success-row);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.625rem 0.75rem 0.875rem;
    overflow: hidden;
    border: 1px solid var(--theme-border-color);
    border-radius: 0.75rem;
    background: var(--theme-secondary-bg);
    box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.28);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(1rem);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.mf-toast.is-shown {
    opacity: 1;
    transform: none;
}
.mf-toast.is-leaving {
    opacity: 0;
    transform: translateX(0.5rem);
    transition-duration: 0.14s;
}
.mf-toast.is-info {
    --toast-color: var(--st-info);
    --toast-tint: var(--st-info-row);
}
.mf-toast.is-warning {
    --toast-color: var(--st-warning);
    --toast-tint: var(--st-warning-row);
}
.mf-toast.is-danger {
    --toast-color: var(--st-danger);
    --toast-tint: var(--st-danger-row);
}
[data-bs-theme="dark"] .mf-toast {
    border-color: var(--ln);
    background: var(--sf-float);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.6);
}

.mf-toast-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--toast-tint);
    color: var(--toast-color);
}
.mf-toast-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}
.mf-toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 0.125rem;
}
.mf-toast-title {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--theme-body-color);
}
.mf-toast-detail {
    display: -webkit-box;
    margin-top: 0.125rem;
    overflow: hidden;
    color: var(--theme-secondary-color);
    font-size: 0.8125rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.mf-toast-close {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--theme-secondary-color);
}
.mf-toast-close svg {
    width: 1rem;
    height: 1rem;
}
.mf-toast-close:hover {
    background: var(--sf-hover);
    color: var(--theme-body-color);
}

/* 남은 시간 — 줄어들다 끝나면 toast.js 가 닫는다. 올려 두면 멈춘다. */
.mf-toast-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: var(--toast-color);
    opacity: 0.55;
    transform-origin: left;
    animation: mf-toast-timer linear forwards;
}
.mf-toast:hover .mf-toast-timer {
    animation-play-state: paused;
}
@keyframes mf-toast-timer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 575.98px) {
    .mf-toasts {
        right: 0.75rem;
        width: calc(100vw - 1.5rem);
    }
}
@media (prefers-reduced-motion: reduce) {
    .mf-toast,
    .mf-toast.is-leaving {
        transform: none;
        transition: none;
    }
}
