.theme-toggle-wrapper {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    position: relative;
    width: 56px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    cursor: pointer;
    color: #e5e7eb;
    font-size: 10px;
}

.theme-toggle__thumb {
    position: absolute;
    top: 3px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 55%), linear-gradient(135deg, #facc15, #f97316);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.9);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle__icon {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.theme-toggle__icon--moon::before {
    content: "🌙";
}

.theme-toggle__icon--sun::before {
    content: "☀";
}

/* Default/dark: moon visible */
body.app-body.theme-dark .theme-toggle__icon--moon,
body.app-body:not(.theme-light):not(.theme-dark) .theme-toggle__icon--moon {
    opacity: 1;
}

body.app-body.theme-dark .theme-toggle__icon--sun,
body.app-body:not(.theme-light):not(.theme-dark) .theme-toggle__icon--sun {
    opacity: 0;
}

body.app-body.theme-light .theme-toggle__thumb {
    transform: translateX(22px);
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 55%),
                linear-gradient(135deg, #facc15, #f97316);
}

/* Light: sun visible */
body.app-body.theme-light .theme-toggle__icon--sun {
    opacity: 1;
}

body.app-body.theme-light .theme-toggle__icon--moon {
    opacity: 0;
}
