.thv2-toast-region {
    position: fixed;
    z-index: 100000;
    right: 20px;
    bottom: 20px;
    display: grid;
    width: min(390px, calc(100vw - 32px));
    gap: 10px;
    pointer-events: none;
}

.thv2-toast {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 16px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-left-width: 4px;
    border-radius: 14px;
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
    opacity: 0;
    transform: translateY(10px) scale(.98);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: auto;
}

.thv2-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.thv2-toast.is-leaving {
    opacity: 0;
    transform: translateY(8px) scale(.98);
}

.thv2-toast--success { border-left-color: #16a34a; }
.thv2-toast--error { border-left-color: #dc2626; }
.thv2-toast--warning { border-left-color: #d97706; }
.thv2-toast--info { border-left-color: #2563eb; }

.thv2-toast__message {
    min-width: 0;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}

.thv2-toast__close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font: 24px/1 system-ui, sans-serif;
    cursor: pointer;
}

.thv2-toast__close:hover { background: #f1f5f9; color: #111827; }

.toolhub-v2-managed-page :where(a, button, input, textarea, select, summary):focus-visible {
    outline: 3px solid rgba(37, 99, 235, .38);
    outline-offset: 3px;
}

.toolhub-v2-managed-page :where(button, .thv2-button).is-loading {
    position: relative;
    cursor: wait;
    opacity: .78;
}

.toolhub-v2-managed-page :where(button, .thv2-button).is-loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 9px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: thv2-ui-spin .65s linear infinite;
}

@keyframes thv2-ui-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
    .thv2-toast-region {
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thv2-toast,
    .toolhub-v2-managed-page :where(button, .thv2-button).is-loading::after {
        animation: none !important;
        transition: none !important;
    }
}
