html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.global-toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    display: grid;
    gap: 0.55rem;
    max-width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.global-toast {
    pointer-events: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(165deg, rgba(24, 34, 54, 0.96), rgba(15, 23, 42, 0.96));
    color: #e2e8f0;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.45);
    padding: 0.72rem 0.86rem;
    transform: translateY(6px);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
    position: relative;
}

.global-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.global-toast-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-bottom: 0.2rem;
}

.global-toast-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.global-toast-time {
    font-size: 0.74rem;
    color: rgba(148, 163, 184, 0.96);
}

.global-toast-message {
    font-size: 0.84rem;
    line-height: 1.35;
    color: rgba(226, 232, 240, 0.95);
    white-space: pre-line;
}

.global-toast-close {
    position: absolute;
    top: 0.38rem;
    right: 0.42rem;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.72);
    color: rgba(226, 232, 240, 0.95);
    font-size: 0.84rem;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.global-toast-close:hover {
    border-color: rgba(191, 219, 254, 0.72);
    color: #fff;
}

.global-toast.success {
    border-color: rgba(34, 197, 94, 0.45);
}

.global-toast.error {
    border-color: rgba(239, 68, 68, 0.5);
}

.env-float-widget {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1190;
    width: min(360px, calc(100vw - 2rem));
    border-radius: 14px;
    border: 1px solid rgba(96, 165, 250, 0.34);
    background: linear-gradient(165deg, rgba(24, 34, 54, 0.98), rgba(15, 23, 42, 0.98));
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.52);
    color: #dbeafe;
    display: none;
    overflow: hidden;
    cursor: move;
}

.env-float-widget.show {
    display: block;
}

.env-float-head {
    cursor: move;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.58rem 0.68rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.56);
}

.env-float-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #bfdbfe;
}

.env-float-close {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.68);
    color: #e2e8f0;
    min-width: 26px;
    min-height: 24px;
    line-height: 1;
    font-size: 0.95rem;
    padding: 0;
}

.env-float-close:hover {
    border-color: rgba(191, 219, 254, 0.65);
    color: #fff;
}

.env-float-body {
    display: flex;
    align-items: flex-start;
    gap: 0.72rem;
    padding: 0.72rem 0.75rem 0.76rem;
}

.env-float-spinner {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.28);
    border-top-color: rgba(96, 165, 250, 0.98);
    animation: env-spin 900ms linear infinite;
    flex-shrink: 0;
}

.env-float-widget.state-success .env-float-spinner,
.env-float-widget.state-error .env-float-spinner {
    animation: none;
    border: none;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}

.env-float-widget.state-success .env-float-spinner::before {
    content: "✓";
    color: #6ee7b7;
}

.env-float-widget.state-error .env-float-spinner::before {
    content: "!";
    color: #fca5a5;
}

.env-float-message {
    font-size: 0.84rem;
    line-height: 1.35;
    color: rgba(226, 232, 240, 0.95);
}

.env-float-copy {
    flex: 1;
    min-width: 0;
}

.env-float-progress-row {
    margin-top: 0.42rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.env-float-progress-track {
    flex: 1;
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.env-float-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.95), rgba(96, 165, 250, 0.95));
    transition: width 260ms ease;
}

.env-float-widget.state-success .env-float-progress-fill {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.95), rgba(52, 211, 153, 0.95));
}

.env-float-widget.state-error .env-float-progress-fill {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(248, 113, 113, 0.95));
}

.env-float-progress-text {
    min-width: 40px;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(191, 219, 254, 0.95);
}

.env-float-meta {
    margin-top: 0.12rem;
    font-size: 0.76rem;
    color: rgba(148, 163, 184, 0.96);
}

@keyframes env-spin {
    to {
        transform: rotate(360deg);
    }
}
