.update-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(20, 22, 38, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(200, 195, 230, 0.18);
    border-radius: 12px;
    z-index: 50;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: #e8e5f4;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.update-toast.visible {
    display: flex;
    animation: utSlideIn 0.5s cubic-bezier(0.22, 0.72, 0.14, 1);
}
.update-toast.dismissing {
    animation: utSlideOut 0.3s cubic-bezier(0.22, 0.72, 0.14, 1) forwards;
}
@keyframes utSlideIn {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes utSlideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(24px); opacity: 0; }
}
.ut-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 176, 218, 0.15);
    border: 1px solid rgba(184, 176, 218, 0.25);
    border-radius: 8px;
    color: #b8b0da;
    font-size: 14px;
    font-weight: 600;
}
.ut-body { flex: 1; min-width: 0; }
.ut-title {
    font-size: 13px;
    font-weight: 600;
    color: #e8e5f4;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}
.ut-desc {
    font-size: 12px;
    color: #a9a3c7;
    line-height: 1.4;
}
.ut-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #706b8f;
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}
.ut-close:hover {
    background: rgba(200, 195, 230, 0.08);
    color: #e8e5f4;
}
@media (max-width: 600px) {
    .update-toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

.changelog-overlay {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 3, 8, 0.7);
    backdrop-filter: blur(6px);
    animation: clFade 0.22s ease forwards;
}
.changelog-overlay.open { display: flex; }
@keyframes clFade { from { opacity: 0; } to { opacity: 1; } }

.changelog-modal {
    width: calc(100% - 40px);
    max-width: 460px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: #0a0b14;
    border: 1px solid rgba(200, 195, 230, 0.16);
    border-radius: 14px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(200, 195, 230, 0.04);
    padding: 24px 26px 22px;
    color: var(--fg-2);
    animation: clRise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes clRise {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cl-banner {
    text-align: center;
    margin: -4px -6px 14px;
    padding: 12px 12px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--fg);
    background: linear-gradient(135deg, rgba(184, 176, 218, 0.14), rgba(184, 176, 218, 0.04));
    border: 1px solid rgba(184, 176, 218, 0.22);
    border-radius: 10px;
    text-shadow: 0 0 18px rgba(201, 193, 255, 0.35);
}
.cl-banner strong { font-weight: 800; }

.cl-banner-flash strong {
    display: inline-block;
    animation: clFlashColor 0.55s steps(1) infinite, clFlashWobble 0.7s ease-in-out infinite;
    will-change: color, transform;
}

@keyframes clFlashColor {
    0%   { color: #ff4d6d; text-shadow: 0 0 18px rgba(255, 77, 109, 0.7); }
    14%  { color: #ff9f43; text-shadow: 0 0 18px rgba(255, 159, 67, 0.7); }
    28%  { color: #f9ed69; text-shadow: 0 0 18px rgba(249, 237, 105, 0.7); }
    42%  { color: #6ee787; text-shadow: 0 0 18px rgba(110, 231, 135, 0.7); }
    57%  { color: #45e0e0; text-shadow: 0 0 18px rgba(69, 224, 224, 0.7); }
    71%  { color: #6c8cff; text-shadow: 0 0 18px rgba(108, 140, 255, 0.7); }
    85%  { color: #c084fc; text-shadow: 0 0 18px rgba(192, 132, 252, 0.7); }
    100% { color: #ff6bd6; text-shadow: 0 0 18px rgba(255, 107, 214, 0.7); }
}

@keyframes clFlashWobble {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25%      { transform: scale(1.04) rotate(-1.2deg); }
    50%      { transform: scale(1.02) rotate(0.8deg); }
    75%      { transform: scale(1.05) rotate(-0.6deg); }
}

.cl-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.cl-icon {
    font-size: 22px;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 0 12px rgba(201, 193, 255, 0.4);
}
.cl-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--fg);
}
.cl-version {
    margin-top: 2px;
    font-size: 11px;
    color: var(--fg-3);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.cl-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--fg-2);
}
.cl-list li {
    padding: 9px 12px;
    background: rgba(200, 195, 230, 0.04);
    border: 1px solid rgba(200, 195, 230, 0.08);
    border-radius: 8px;
}
.cl-list strong { color: var(--fg); font-weight: 500; }
.cl-list a { color: var(--accent); }
.cl-list code {
    background: rgba(200, 195, 230, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11.5px;
}
.cl-close {
    position: relative;
    display: block;
    margin: 0 auto;
    padding: 11px 30px;
    border: 1px solid rgba(200, 195, 230, 0.18);
    background: linear-gradient(180deg, #b8b0da, #8a80b6);
    background-size: 100% 100%;
    color: #0a0b14;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.18s ease, background-position 0.4s linear, color 0.18s ease;
    box-shadow: 0 6px 18px rgba(138, 128, 182, 0.35);
    overflow: hidden;
}
.cl-close:hover {
    transform: translateY(-1px) scale(1.02);
    background: linear-gradient(90deg,
        #ff4d6d, #ff9f43, #f9ed69, #6ee787, #45e0e0, #6c8cff, #c084fc, #ff6bd6, #ff4d6d
    );
    background-size: 300% 100%;
    color: #0a0b14;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 32px rgba(255, 120, 180, 0.45),
                0 0 24px rgba(108, 140, 255, 0.35);
    animation: clBtnRainbow 2.2s linear infinite;
}
.cl-close:active { transform: translateY(0) scale(0.99); }

@keyframes clBtnRainbow {
    from { background-position: 0% 50%; }
    to   { background-position: 300% 50%; }
}
