/*
 * Notify — system-wide toast notifications (public/js/notify.js).
 * Top-right, compact, light / dark (html[data-theme="dark"]), mobile: full width at the top.
 */
:root {
    --nt-bg: #ffffff;
    --nt-text: #17212e;
    --nt-muted: #5e6b7a;
    --nt-border: #e2e7ee;
    --nt-shadow: 0 10px 28px rgba(16, 35, 63, .16), 0 2px 6px rgba(16, 35, 63, .08);
    --nt-success: #1f8a5b;
    --nt-error: #c8372d;
    --nt-warning: #b7791f;
    --nt-info: #2b6cb0;
    --nt-loading: #475569;
}
html[data-theme="dark"] {
    --nt-bg: #1e293b;
    --nt-text: #e7edf6;
    --nt-muted: #9fb0c6;
    --nt-border: #334155;
    --nt-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
    --nt-success: #34d399;
    --nt-error: #f87171;
    --nt-warning: #fbbf24;
    --nt-info: #60a5fa;
    --nt-loading: #cbd5e1;
}

.nt-stack {
    position: fixed; top: 1rem; right: 1rem; z-index: 3000;
    display: flex; flex-direction: column; gap: .5rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;               /* never blocks the page; each toast takes its own clicks */
}
.nt {
    pointer-events: auto; position: relative; overflow: hidden;
    display: flex; align-items: flex-start; gap: .65rem;
    padding: .7rem .75rem .7rem .85rem;
    background: var(--nt-bg); color: var(--nt-text);
    border: 1px solid var(--nt-border); border-left: 4px solid var(--nt-accent, var(--nt-info));
    border-radius: 10px; box-shadow: var(--nt-shadow);
    font: 400 .875rem/1.45 "IBM Plex Sans", "IBM Plex Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
    animation: nt-in .22s cubic-bezier(.2, .8, .2, 1);
}
.nt.is-leaving { animation: nt-out .18s ease-in forwards; }
@keyframes nt-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes nt-out { to { opacity: 0; transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) { .nt, .nt.is-leaving { animation: none; } }

.nt-success { --nt-accent: var(--nt-success); }
.nt-error   { --nt-accent: var(--nt-error); }
.nt-warning { --nt-accent: var(--nt-warning); }
.nt-info    { --nt-accent: var(--nt-info); }
.nt-loading { --nt-accent: var(--nt-loading); }

.nt-icon { flex: none; width: 1.15rem; margin-top: .12rem; text-align: center; color: var(--nt-accent); font-size: 1rem; }
.nt-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nt-title { display: block; font-weight: 600; margin-bottom: .05rem; }
.nt-msg { color: var(--nt-text); }
.nt-title + .nt-msg { color: var(--nt-muted); }
.nt-list { margin: .3rem 0 0; padding-left: 1.05rem; color: var(--nt-muted); font-size: .82rem; }
.nt-list li + li { margin-top: .1rem; }
.nt-count { display: inline-block; margin-left: .35rem; padding: 0 .35rem; border-radius: 999px; font-size: .7rem; font-weight: 600; background: var(--nt-border); color: var(--nt-muted); vertical-align: 1px; }
.nt-action { margin-top: .4rem; padding: .15rem .55rem; border: 1px solid var(--nt-accent); border-radius: 6px; background: transparent; color: var(--nt-accent); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.nt-action:hover { background: var(--nt-accent); color: var(--nt-bg); }
.nt-x {
    flex: none; width: 1.6rem; height: 1.6rem; margin: -.25rem -.3rem 0 0; border: 0; border-radius: 6px;
    background: transparent; color: var(--nt-muted); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.nt-x:hover, .nt-x:focus-visible { background: var(--nt-border); color: var(--nt-text); outline: none; }
.nt-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--nt-accent); opacity: .45; transform-origin: left; animation: nt-bar linear forwards; }
.nt:hover .nt-bar, .nt:focus-within .nt-bar { animation-play-state: paused; }
@keyframes nt-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* fields the server (or the browser) rejected */
.nt-field-error { display: block; width: 100%; margin-top: .25rem; font-size: .8rem; color: var(--nt-error); }

@media (max-width: 575px) {
    .nt-stack { top: .5rem; right: auto; left: .5rem; width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); }
    .nt { padding: .6rem .65rem .6rem .75rem; }
}
@media print { .nt-stack { display: none !important; } }
