/* Speedy Pit Stop - site-wide optional dark background */
/* Unchanged body backgrounds remain in effect in Bright Mode. */

html.sps-dark:root body {
    background-color: #080e20 !important;

    background-image:
        radial-gradient(
            ellipse 1100px 900px at left top,
            #2a4aa3 0px,
            #182e75 260px,
            #0a1436 650px,
            transparent 100%
        ),
        linear-gradient(
            165deg,
            #182e75 0px,
            #0a1436 650px,
            #080e20 1300px
        ) !important;

    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-position: left top !important;
    min-height: 100vh;
}

/* Fixed, site-wide theme control; does not change page text styling. */

#sps-theme-toggle {
	position: fixed;
	top: 2px;
	right: 30px;
	bottom: auto !important;
	left: auto;
	width: auto;
	height: auto;
	white-space: nowrap;	
    z-index: 2147483647;
	font-family: Arial, sans-serif;
	font-size: 28px !important;
	font-weight: bold !important;
	padding: 6px 22px;
	min-width: 140px;
	min-height: 52px;
    border: 1px solid #8da0c9;
    border-radius: 6px;
    background: #243d72;
    color: #ffffff;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

#sps-theme-toggle:hover,
#sps-theme-toggle:focus-visible {
    background: #37579b;
}


html.sps-dark .td-clickable {
    background-color: #182e75;
}

/* Mobile compatibility - avoid fixed gradient rendering issues */

/* Firefox - narrow-screen gradient compatibility */

/* Firefox on touch-screen devices */

@supports (-moz-appearance: none) {
    @media (pointer: coarse) {
        html.sps-dark:root body {
            min-width: 1200px !important;

            background-image: linear-gradient(
                135deg,
                #2a4aa3 0px,
                #182e75 180px,
                #0a1436 480px,
                #080e20 900px
            ) !important;

            background-size: 1200px 1100px !important;
            background-position: left top !important;
            background-repeat: no-repeat !important;
            background-attachment: scroll !important;
        }
    }
}

/* Bright Mode button */
#sps-theme-toggle {
    background: #4344B8;
    color: #FFFFFF;
    border-color: #8B8CE0;
}

#sps-theme-toggle:hover {
    background: #5556CC;
    color: #FFFFFF;
}

/* Dark Mode button */
html.sps-dark #sps-theme-toggle {
    background: #142744;
    color: #b9d7ff;
    border-color: #5e84b5;
}

html.sps-dark #sps-theme-toggle:hover {
    background: #223b63;
    color: #d1e4fb;
}