








.kn-toasts {
    position: fixed;
    z-index: 12000;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}



@media (max-width: 720px) {
    .kn-toasts {
        top: auto;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        right: 12px;
        max-width: none;
        align-items: stretch;
    }
}





.kn-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 15px;
    border-radius: 18px;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .018)),
        rgba(15, 15, 21, .96);
    border: 1px solid var(--border-strong, rgba(255, 255, 255, .14));
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--text-primary, #fff);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    line-height: 1.4;
    
    animation: kn-toast-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}



.kn-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--kn-tone, var(--accent, #A98EEF));
    opacity: .85;
}

.kn-toast.kn-toast--out {
    animation: kn-toast-out 0.2s ease forwards;
}

@keyframes kn-toast-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes kn-toast-out {
    to { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

@media (max-width: 720px) {
    @keyframes kn-toast-in {
        from { opacity: 0; transform: translateY(12px) scale(0.98); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes kn-toast-out {
        to { opacity: 0; transform: translateY(10px) scale(0.98); }
    }
}


@media (prefers-reduced-motion: reduce) {
    .kn-toast, .kn-toast.kn-toast--out { animation: none; }
}




.kn-toast__icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin-top: 1px;
    font-size: 0.78rem;
    font-weight: 700;
}

.kn-toast__icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kn-toast__body { flex: 1 1 auto; min-width: 0; }

.kn-toast__title {
    

    font-family: var(--font-display, 'Manrope', sans-serif);
    font-weight: 700;
    font-size: 0.93rem;
    letter-spacing: -.01em;
    margin: 0 0 3px;
}

.kn-toast__text {
    margin: 0;
    color: var(--text-secondary, #B8B8C7);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.kn-toast__close {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    border-radius: 50%;
    color: var(--text-muted, #7C7C8A);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    
    min-width: 28px;
    min-height: 28px;
    transition: color .2s ease, background .2s ease;
}

.kn-toast__close svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.kn-toast__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}


.kn-toast__bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    border-radius: 0 0 18px 18px;
    opacity: 0.6;
    background: var(--kn-tone, var(--accent, #A98EEF));
}

.kn-toast { position: relative; overflow: hidden; }





.kn-toast--info    { --kn-tone: var(--accent, #A98EEF); }
.kn-toast--success { --kn-tone: var(--success, #34d399); }
.kn-toast--warn    { --kn-tone: var(--warning, #fbbf24); }
.kn-toast--error   { --kn-tone: var(--danger, #fb7185); }

.kn-toast__icon {
    


    background: color-mix(in srgb, var(--kn-tone) 18%, transparent);
    color: color-mix(in srgb, var(--kn-tone) 72%, white);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--kn-tone) 22%, transparent);
}


@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .kn-toast--info    .kn-toast__icon { background: rgba(169, 142, 239, .18); color: #C6B2FF; }
    .kn-toast--success .kn-toast__icon { background: rgba(52, 211, 153, .16);  color: #6EE7B7; }
    .kn-toast--warn    .kn-toast__icon { background: rgba(251, 191, 36, .16);  color: #FCD34D; }
    .kn-toast--error   .kn-toast__icon { background: rgba(251, 113, 133, .16); color: #FCA5A5; }
}



.kn-dialog {
    position: fixed;
    inset: 0;
    z-index: 12500;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 7, 14, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: kn-fade-in 0.18s ease;
}

@keyframes kn-fade-in { from { opacity: 0; } to { opacity: 1; } }




.kn-dialog__card {
    position: relative;
    width: min(420px, 100%);
    background:
        radial-gradient(120% 80% at 50% -10%, var(--accent-glow, rgba(169, 142, 239, .25)), transparent 62%),
        linear-gradient(155deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .018)),
        rgba(17, 17, 25, .985);
    border: 1px solid var(--border-strong, rgba(255, 255, 255, .14));
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
    padding: 26px;
    color: var(--text-primary, #fff);
    font-family: var(--font-body, 'Inter', sans-serif);
    animation: kn-pop-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}



.kn-dialog--danger .kn-dialog__card {
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(251, 113, 133, .2), transparent 62%),
        linear-gradient(155deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .018)),
        rgba(17, 17, 25, .985);
}

@keyframes kn-pop-in {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .kn-dialog, .kn-dialog__card { animation: none; }
}



.kn-dialog__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
    background: linear-gradient(140deg, var(--accent, #A98EEF), var(--accent-deep, #6D5BFF));
    color: #fff;
    box-shadow: 0 8px 22px rgba(109, 91, 255, .3);
}

.kn-dialog__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kn-dialog--danger .kn-dialog__icon {
    background: linear-gradient(140deg, #fb7185, #dc2626);
    box-shadow: 0 8px 22px rgba(220, 38, 38, .3);
}

.kn-dialog__title {
    margin: 0 0 8px;
    font-size: 1.16rem;
    font-weight: 750;
    letter-spacing: -.02em;
    font-family: var(--font-display, 'Manrope', 'Inter', sans-serif);
}

.kn-dialog__text {
    margin: 0 0 20px;
    color: var(--text-secondary, #B8B8C7);
    font-size: 0.93rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}




.kn-dialog__field {
    width: 100%;
    padding: 12px 14px;
    margin: 0 0 18px;
    border-radius: var(--radius-xs, 12px);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border-strong, rgba(255, 255, 255, .14));
    color: var(--text-primary, #fff);
    font: inherit;
    font-size: 0.92rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.kn-dialog__field::placeholder { color: var(--text-muted, #7C7C8A); }

.kn-dialog__field:focus {
    outline: none;
    border-color: var(--accent, #A98EEF);
    box-shadow: 0 0 0 3px var(--accent-glow, rgba(169, 142, 239, .25));
}

.kn-dialog__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}



@media (max-width: 480px) {
    .kn-dialog__actions { flex-direction: column-reverse; }
    .kn-dialog__actions > * { width: 100%; }
}




.kn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
    min-height: 44px;
    transition: transform .2s ease, box-shadow .2s ease, color .2s ease, background .2s ease;
}

.kn-btn--ghost {
    background: transparent;
    border-color: var(--border-strong, rgba(255, 255, 255, .14));
    color: var(--text-secondary, #B8B8C7);
}

.kn-btn--ghost:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}

.kn-btn--primary {
    background: linear-gradient(135deg, var(--accent, #A98EEF), var(--accent-deep, #6D5BFF));
    color: #fff;
    box-shadow: 0 8px 24px rgba(109, 91, 255, .28);
}

.kn-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(109, 91, 255, .4);
}

.kn-btn--danger {
    background: linear-gradient(135deg, #fb7185, #dc2626);
    color: #fff;
    box-shadow: 0 8px 24px rgba(220, 38, 38, .26);
}

.kn-btn--danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(220, 38, 38, .38);
}



.kn-btn:focus-visible,
.kn-toast__close:focus-visible {
    outline: 2px solid var(--accent-light, #C2B2FF);
    outline-offset: 2px;
}


@media (prefers-reduced-motion: reduce) {
    .kn-btn--primary:hover,
    .kn-btn--danger:hover { transform: none; }
}
