.tgx-toast-container,
.tgx-toast-container * {
    box-sizing: border-box;
}

.tgx-toast-container {
    position: fixed;
    z-index: var(--z-tgx-toast, 2147482600);
    display: flex;
    width: min(calc(100% - 2rem), 420px);
    max-height: calc(100vh - 2rem);
    padding: 0;
    gap: .75rem;
    flex-direction: column;
    overflow: visible;
    pointer-events: none;
    font-family: var(--font-family-ui, system-ui, sans-serif);
}

.tgx-toast-container[data-tgx-toast-position^="top-"] {
    top: 1rem;
}

.tgx-toast-container[data-tgx-toast-position^="bottom-"] {
    bottom: 1rem;
    flex-direction: column-reverse;
}

.tgx-toast-container[data-tgx-toast-position$="-left"] {
    left: 1rem;
}

.tgx-toast-container[data-tgx-toast-position$="-center"] {
    left: 50%;
    transform: translateX(-50%);
}

.tgx-toast-container[data-tgx-toast-position$="-right"] {
    right: 1rem;
}

.tgx-toast {
    --tgx-toast-background: var(--tgx-toast-surface, #fff);
    --tgx-toast-accent: #2f5fce;
    --tgx-toast-color: var(--tgx-toast-ink, #24344c);
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--tgx-toast-line, #dce3ed);
    border-inline-start: 4px solid var(--tgx-toast-accent);
    border-radius: 20px;
    background: var(--tgx-toast-background);
    color: var(--tgx-toast-color);
    box-shadow: 0 12px 36px rgb(5 24 50 / 16%);
    opacity: 0;
    transform: translateY(-.5rem);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: auto;
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
}

.tgx-toast-container[data-tgx-toast-position^="bottom-"] .tgx-toast {
    transform: translateY(.5rem);
}

.tgx-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.tgx-toast.is-hiding {
    opacity: 0;
}

.tgx-toast-content {
    display: flex;
    min-height: 3rem;
    align-items: center;
}

.tgx-toast-body {
    min-width: 0;
    padding: 16px;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.tgx-toast-dismiss {
    position: relative;
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    margin: 8px 8px 8px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: .72;
}

.tgx-toast-dismiss:hover,
.tgx-toast-dismiss:focus-visible {
    background: var(--tgx-toast-hover, #edf2fa);
    opacity: 1;
}

.tgx-toast-dismiss:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}

.tgx-toast-dismiss::before,
.tgx-toast-dismiss::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    content: "";
}

.tgx-toast-dismiss::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.tgx-toast-dismiss::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.tgx-toast-primary,.tgx-toast-info { --tgx-toast-accent: #386dec; }
.tgx-toast-success { --tgx-toast-accent: #27936b; }
.tgx-toast-danger { --tgx-toast-accent: #d94b61; }
.tgx-toast-warning { --tgx-toast-accent: #b87a16; }

:root[data-tgx-theme="dark"] .tgx-toast-container {
    --tgx-toast-surface:#18283d;
    --tgx-toast-ink:#eaf2ff;
    --tgx-toast-line:#34465c;
    --tgx-toast-hover:#24364d;
    color-scheme:dark;
}
@media(prefers-color-scheme:dark){
    :root:not([data-tgx-theme="light"]):not([data-tgx-theme="dark"]) .tgx-toast-container {
        --tgx-toast-surface:#18283d;
        --tgx-toast-ink:#eaf2ff;
        --tgx-toast-line:#34465c;
        --tgx-toast-hover:#24364d;
        color-scheme:dark;
    }
}
.tgx-toast-container[data-tgx-toast-position^="top-"]{top:max(16px,env(safe-area-inset-top))}
.tgx-toast-container[data-tgx-toast-position^="bottom-"]{bottom:max(16px,env(safe-area-inset-bottom))}

@media (prefers-reduced-motion: reduce) {
    .tgx-toast {
        transition: none;
    }
}
