/* NanhiSmile — modals, bottom sheets, toasts */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 768px) { .overlay { align-items: center; padding: 20px; } }
.overlay__backdrop { position: absolute; inset: 0; background: rgba(42, 32, 48, 0.55); animation: ns-fade 0.18s ease; }

.modal { position: relative; width: 100%; max-width: 520px; background: var(--ns-surface); border-radius: var(--ns-radius-sheet) var(--ns-radius-sheet) 0 0; max-height: 88vh; display: flex; flex-direction: column; animation: ns-sheet-up 0.24s cubic-bezier(0.2, 0.9, 0.3, 1); box-shadow: var(--ns-shadow-lg); }
@media (min-width: 768px) { .modal { border-radius: var(--ns-radius-card); animation: ns-pop 0.18s ease; } }
.modal__grabber { width: 44px; height: 5px; border-radius: 999px; background: #E3D3DC; margin: 10px auto 4px; flex: none; }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--ns-border); flex: none; }
.modal__title { font-family: var(--ns-font-head); font-weight: 800; font-size: 1.1rem; }
.modal__body { padding: 16px 18px; overflow-y: auto; }
.modal__footer { padding: 12px 18px; border-top: 1px solid var(--ns-border); display: flex; gap: 10px; flex: none; background: var(--ns-surface); border-radius: 0 0 var(--ns-radius-card) var(--ns-radius-card); }
body.ns-locked { overflow: hidden; }

.toast-root { position: fixed; top: 14px; left: 0; right: 0; z-index: 140; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: #2A2030; color: #fff; border-radius: 14px; padding: 12px 16px; max-width: 440px; width: 100%; box-shadow: var(--ns-shadow-lg); animation: ns-toast-in 0.22s ease; font-weight: 700; font-size: 0.9rem; }
.toast.is-leaving { animation: ns-toast-out 0.18s ease forwards; }
.toast__icon { flex: none; display: flex; }
.toast__msg { flex: 1; min-width: 0; }
.toast--success .toast__icon { color: #7BE0AE; }
.toast--error .toast__icon { color: #FF9AA6; }
.toast--info .toast__icon { color: #9DB9FF; }
.toast--warn .toast__icon { color: #FFD98A; }

@keyframes ns-fade { from { opacity: 0; } }
@keyframes ns-sheet-up { from { transform: translateY(40px); opacity: 0.4; } }
@keyframes ns-pop { from { transform: scale(0.94); opacity: 0; } }
@keyframes ns-toast-in { from { transform: translateY(-14px); opacity: 0; } }
@keyframes ns-toast-out { to { transform: translateY(-14px); opacity: 0; } }
