:root {
    --primary-rgb: 59, 130, 246;
    --secondary-rgb: 147, 51, 234;
    --surface-rgb: 24, 24, 27;
    
    --primary: rgb(var(--primary-rgb));
    --primary-gradient: linear-gradient(135deg, rgb(var(--primary-rgb)), rgb(var(--secondary-rgb)));
    --background: #0a0a0b;
    --surface: rgba(var(--surface-rgb), 0.6);
    --surface-light: rgba(var(--surface-rgb), 0.3);
    --surface-darker: rgba(15, 15, 18, 0.8);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --glass: blur(20px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-purple {
    --primary-rgb: 147, 51, 234;
    --secondary-rgb: 219, 39, 119;
}

.theme-green {
    --primary-rgb: 34, 197, 94;
    --secondary-rgb: 59, 130, 246;
}

.theme-orange {
    --primary-rgb: 251, 146, 60;
    --secondary-rgb: 239, 68, 68;
}

.theme-cyan {
    --primary-rgb: 34, 211, 238;
    --secondary-rgb: 6, 182, 212;
}

.theme-pink {
    --primary-rgb: 236, 72, 153;
    --secondary-rgb: 219, 39, 119;
}

.theme-amber {
    --primary-rgb: 245, 158, 11;
    --secondary-rgb: 217, 119, 6;
}

.theme-emerald {
    --primary-rgb: 16, 185, 129;
    --secondary-rgb: 5, 150, 105;
}

.theme-violet {
    --primary-rgb: 139, 92, 246;
    --secondary-rgb: 124, 58, 237;
}

.theme-rose {
    --primary-rgb: 244, 63, 94;
    --secondary-rgb: 225, 29, 72;
}

.theme-custom {
    --primary-rgb: var(--custom-primary-rgb, 59, 130, 246);
    --secondary-rgb: var(--custom-secondary-rgb, 147, 51, 234);
}

.theme-indigo {
    --primary-rgb: 99, 102, 241;
    --secondary-rgb: 139, 92, 246;
}

.theme-teal {
    --primary-rgb: 20, 184, 166;
    --secondary-rgb: 6, 182, 212;
}

.theme-lime {
    --primary-rgb: 132, 204, 22;
    --secondary-rgb: 101, 163, 13;
}

.theme-red {
    --primary-rgb: 239, 68, 68;
    --secondary-rgb: 220, 38, 38;
}

.theme-yellow {
    --primary-rgb: 234, 179, 8;
    --secondary-rgb: 202, 138, 4;
}

.theme-blue {
    --primary-rgb: 59, 130, 246;
    --secondary-rgb: 147, 51, 234;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 8px; /* Make it slightly wider for easier interaction on touch devices */
}

::-webkit-scrollbar-track {
    background: transparent; /* Make track fully transparent */
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05); /* Very subtle white thumb */
    border-radius: 4px; /* Rounded corners for the thumb */
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1); /* Slightly more visible on hover */
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow-x: hidden; /* Prevent horizontal scroll */
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

.starry-background {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at top, rgba(var(--primary-rgb), 0.1) 0%, var(--background) 40%);
    z-index: -1;
    overflow: hidden;
}

.starry-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(1px 1px at 20% 30%, white, transparent),
        radial-gradient(1px 1px at 40% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(1px 1px at 10% 85%, white, transparent),
        radial-gradient(1px 1px at 30% 60%, white, transparent),
        radial-gradient(1px 1px at 70% 20%, white, transparent),
        radial-gradient(1px 1px at 90% 50%, white, transparent),
        radial-gradient(1px 1px at 15% 40%, white, transparent),
        radial-gradient(1px 1px at 85% 35%, white, transparent);
    background-size: 200px 200px;
    animation: twinkle 6s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Matrix Background (Falling Code) */
.starry-background.matrix {
    background: #000;
}

.starry-background.matrix::before {
    display: none;
}

.matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    width: 100vw;
    height: 100vh;
    background: #000;
}

/* Particles Background (Floating Dots) */
.starry-background.particles::before {
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 85% 75%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    background-size: 30px 30px, 40px 40px, 25px 25px;
    animation: particlesFloat 15s ease-in-out infinite alternate;
}

@keyframes particlesFloat {
    0% { transform: translate(0, 0); opacity: 0.8; }
    50% { transform: translate(10px, 20px); opacity: 0.5; }
    100% { transform: translate(-10px, -20px); opacity: 0.8; }
}

/* Waves Background (Undulating Gradient) */
.starry-background.waves::before {
    background: linear-gradient(90deg, 
        rgba(var(--primary-rgb), 0.1) 0%, 
        rgba(var(--secondary-rgb), 0.15) 25%,
        rgba(var(--primary-rgb), 0.1) 50%,
        rgba(var(--secondary-rgb), 0.15) 75%,
        rgba(var(--primary-rgb), 0.1) 100%);
    background-size: 200% 200%;
    animation: wavesAnim 10s ease-in-out infinite;
}

@keyframes wavesAnim {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Geometric Background (Interlocking shapes) */
.starry-background.geometric::before {
    background-image: 
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 20px);
    background-size: 20px 20px;
    animation: geometricAnim 15s linear infinite;
    opacity: 0.6;
}

@keyframes geometricAnim {
    0% { background-position: 0 0; }
    100% { background-position: 200px 200px; }
}

/* Neural Background (Glowing nodes and connections) */
.starry-background.neural::before {
    background-image: 
        radial-gradient(circle at var(--node1-x, 20%) var(--node1-y, 30%), rgba(0, 200, 255, 0.2) 0%, transparent 5%),
        radial-gradient(circle at var(--node2-x, 80%) var(--node2-y, 70%), rgba(255, 0, 200, 0.2) 0%, transparent 5%);
    background-size: 100% 100%;
    opacity: 0.8;
    animation: neuralAnim 12s ease-in-out infinite alternate;
}

@keyframes neuralAnim {
    0% { 
        --node1-x: 20%; --node1-y: 30%; 
        --node2-x: 80%; --node2-y: 70%;
    }
    33% { 
        --node1-x: 70%; --node1-y: 60%; 
        --node2-x: 30%; --node2-y: 20%;
    }
    66% { 
        --node1-x: 40%; --node1-y: 80%; 
        --node2-x: 60%; --node2-y: 10%;
    }
    100% { 
        --node1-x: 20%; --node1-y: 30%; 
        --node2-x: 80%; --node2-y: 70%;
    }
}

/* Binary Background (Falling 0s and 1s) */
.starry-background.binary::before {
    content: ''; /* Remove direct content injection */
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Ctext x='0' y='15' fill='rgba(0, 255, 0, 0.1)' font-family='monospace' font-size='16'%3E0%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Ctext x='0' y='15' fill='rgba(0, 255, 0, 0.1)' font-family='monospace' font-size='16'%3E1%3C/text%3E%3C/svg%3E");
    background-size: 20px 40px; /* Small binary characters */
    background-repeat: repeat;
    animation: binaryAnim 8s linear infinite;
    opacity: 0.8;
}

@keyframes binaryAnim {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* Quantum Background (Abstract glowing particles and connections) */
.starry-background.quantum::before {
    background-image: 
        radial-gradient(circle at 30% 40%, rgba(255, 0, 150, 0.15) 1px, transparent 2px),
        radial-gradient(circle at 70% 60%, rgba(0, 150, 255, 0.12) 1px, transparent 2px),
        radial-gradient(circle at 50% 20%, rgba(150, 255, 0, 0.1) 1px, transparent 2px);
    background-size: 50px 50px, 70px 70px, 40px 40px;
    animation: quantumAnim 10s ease-in-out infinite alternate;
    opacity: 0.9;
}

@keyframes quantumAnim {
    0%, 100% { 
        transform: rotate(0deg) scale(1) translate(0, 0);
        filter: hue-rotate(0deg);
    }
    25% { 
        transform: rotate(90deg) scale(1.05) translate(10px, 5px);
        filter: hue-rotate(90deg);
    }
    50% { 
        transform: rotate(180deg) scale(0.95) translate(-5px, 10px);
        filter: hue-rotate(180deg);
    }
    75% { 
        transform: rotate(270deg) scale(1.02) translate(5px, -10px);
        filter: hue-rotate(270deg);
    }
}

/* Grid Background (Simple, subtle grid) */
.starry-background.grid {
    background: radial-gradient(ellipse at center, 
        rgba(var(--primary-rgb), 0.05) 0%, 
        rgba(var(--surface-rgb), 0.95) 100%);
}

.starry-background.grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(var(--primary-rgb), 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 30s linear infinite;
    opacity: 0.4;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* === Stars Background (Default) === */
.starry-background.stars {
    background: radial-gradient(ellipse at top, 
        rgba(var(--primary-rgb), 0.1) 0%, 
        var(--background) 40%);
}

/* === Wave Background === */
.starry-background.wave::before {
    display: none; /* Hide default stars */
}

.wave-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.wave-background .ocean {
    height: 100%;
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(var(--primary-rgb), 0.1) 50%, 
        rgba(var(--primary-rgb), 0.3) 100%);
}

.wave-background .wave {
    background: linear-gradient(to right, 
        rgba(var(--primary-rgb), 0.6), 
        rgba(var(--secondary-rgb), 0.6), 
        rgba(var(--primary-rgb), 0.6));
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.25' fill='rgb(var(--primary-rgb))'/%3E%3Cpath d='M1200,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.5' fill='rgb(var(--secondary-rgb))'/%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='rgb(var(--primary-rgb))'/%3E%3C/svg%3E") no-repeat;
    mask-size: 100% 100px;
    position: absolute;
    top: 20%;
    left: 0;
    width: 200%;
    height: 100px;
    animation: waveFlow 20s linear infinite;
    transform: translate3d(0, 0, 0);
}

.wave-background .wave:nth-child(2) {
    top: 22%;
    opacity: 0.6;
    animation-duration: 15s;
    animation-delay: -2s;
}

@keyframes waveFlow {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 24px;
}

.sidebar {
    width: 240px;
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 0;
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.logo span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.nav-tab:hover {
    background: var(--surface-light);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-tab.active {
    background: var(--surface-light);
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--border);
}

.main-content {
    flex: 1;
    padding: 48px 0;
    min-height: 100vh;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.home-clock {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 500;
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.6s ease-out;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.stat-card.large {
    grid-column: span 2;
}

.stat-card.large .stat-value {
    font-size: 48px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px -8px rgba(var(--primary-rgb), 0.2);
    border-color: var(--border-hover);
}

.stat-card h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.metrics-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

.metric-group h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.metric-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.metric-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.data-container {
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
}

.chart-container {
    height: 600px;
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.chart-container.large {
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    filter: brightness(1.1) contrast(1.1);
}

.tabs-pill {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--surface);
    border-radius: 100px;
    width: max-content;
}

.net-pill {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.net-pill:hover {
    color: var(--text-primary);
}

.net-pill.active {
    background: var(--primary-gradient);
    color: white;
}

.settings-card {
    max-width: 800px;
    margin: 0 auto 48px auto;
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.settings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-gradient);
    opacity: 0.5;
}

.settings-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.02);
    margin: 0 -24px;
    padding: 32px 24px;
    border-radius: 16px;
    transform: translateX(4px);
}

.setting-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    margin-right: 24px;
}

.setting-description {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
    max-width: 100%;
}

.theme-pill {
    padding: 16px 20px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-pill::before {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--preview-gradient, var(--primary-gradient));
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-pill:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: var(--border-hover);
}

.theme-pill.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--text-primary);
    box-shadow: 0 0 24px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-2px);
}

.theme-pill.active::before {
    box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.6);
}

.background-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
    max-width: 100%; /* Ensure it doesn't overflow */
}

.background-pill {
    padding: 20px 16px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden; /* Crucial to contain previews */
}

.background-pill::before {
    content: '';
    width: 100%;
    height: 40px;
    border-radius: 8px;
    background: var(--preview-bg);
    transition: var(--transition);
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Specific background previews for pills */
.background-pill[data-background="stars"]::before {
    background: radial-gradient(ellipse at center, rgba(var(--primary-rgb), 0.1) 0%, #0f0f0f 100%);
    background-image: radial-gradient(1px 1px at 20% 30%, var(--text-primary), transparent), radial-gradient(1px 1px at 70% 80%, var(--text-primary), transparent);
    background-size: 10px 10px;
}
.background-pill[data-background="matrix"]::before {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--secondary-rgb), 0.1) 100%); /* Use translucent theme colors for background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Ctext x='0' y='8' fill='rgb(var(--primary-rgb))' font-family='monospace' font-size='10'%3E01%3C/text%3E%3C/svg%3E"); /* Dynamic fill for numbers */
    background-size: 10px 10px;
}
.background-pill[data-background="particles"]::before {
    background: radial-gradient(circle at center, #1a1a1a 0%, #2a2a2a 100%);
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.4) 1px, transparent 1px), radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 8px 8px;
}
.background-pill[data-background="wave"]::before {
    background: linear-gradient(45deg, rgba(var(--primary-rgb), 0.6) 0%, rgba(var(--secondary-rgb), 0.6) 100%); /* Dynamic background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.5' fill='rgb(var(--primary-rgb))'/%3E%3Cpath d='M1200,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' opacity='.5' fill='rgb(var(--secondary-rgb))'/%3E%3Cpath d='M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z' fill='rgb(var(--primary-rgb))'/%3E%3C/svg%3E") no-repeat;
    background-size: 20px 20px;
}
.background-pill[data-background="geometric"]::before {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%);
    background-size: 15px 15px;
}
.background-pill[data-background="neural"]::before {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3a 100%);
    background-image: radial-gradient(circle at 20% 50%, rgba(0, 255, 255, 0.2) 1px, transparent 2px), radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.15) 1px, transparent 2px);
    background-size: 10px 10px;
}
.background-pill[data-background="binary"]::before {
    background: linear-gradient(135deg, #0d1421 0%, #1a252f 100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Ctext x='0' y='15' fill='rgba(0, 255, 0, 0.2)' font-family='monospace' font-size='16'%3E0%3C/text%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Ctext x='0' y='15' fill='rgba(0, 255, 0, 0.2)' font-family='monospace' font-size='16'%3E1%3C/text%3E%3C/svg%3E");
    background-size: 10px 20px;
}
.background-pill[data-background="quantum"]::before {
    background: radial-gradient(circle at center, #2a0845 0%, #0f0f0f 100%);
    background-image: radial-gradient(circle at 30% 40%, rgba(255, 0, 150, 0.2) 1px, transparent 2px), radial-gradient(circle at 70% 60%, rgba(0, 150, 255, 0.15) 1px, transparent 2px);
    background-size: 12px 12px;
}
.background-pill[data-background="grid"]::before {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--surface-rgb), 0.3) 100%); /* Dynamic background */
    background-image: linear-gradient(rgba(var(--primary-rgb), 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--primary-rgb), 0.1) 1px, transparent 1px);
    background-size: 10px 10px;
}

.background-pill .bg-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.background-pill:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: var(--border-hover);
}

.background-pill:hover::before {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.2);
}

.background-pill.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    box-shadow: 0 0 24px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-2px);
}

.background-pill.active .bg-label {
    color: var(--text-primary);
}

.background-pill.active::before {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--primary-rgb), 0.3);
}

.custom-color-input {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.color-input {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-input:hover {
    border-color: var(--border-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.custom-theme-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.apply-custom-btn {
    padding: 12px 24px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.3);
}

.apply-custom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

.network-content {
    display: none;
}

.network-content.active {
    display: block;
}

.worker-card, .agent-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.worker-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px -8px rgba(var(--primary-rgb), 0.2);
}

.worker-header, .agent-header {
    font-weight: 600;
    margin-bottom: 12px;
}

.agent-name {
    font-family: 'Courier New', monospace;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 16px;
    color: var(--text-primary);
}

.agent-count {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Leaderboard Specific Styles */
.leaderboard-list {
    display: grid;
    gap: 12px;
}

.leaderboard-entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.leaderboard-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px -8px rgba(var(--primary-rgb), 0.2);
    border-color: var(--border-hover);
}

.leaderboard-rank {
    font-size: 32px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    min-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.leaderboard-details {
    flex-grow: 1;
}

.leaderboard-ua {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.leaderboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px; /* Slightly adjusted gap */
    font-size: 14px;
    color: var(--text-secondary);
}

.leaderboard-stats span strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
    font-family: 'Courier New', monospace;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 48px;
}

.field {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label {
    color: var(--text-secondary);
    font-size: 14px;
}

.value {
    font-weight: 700;
    color: var(--text-primary);
}

.client-overview {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.client-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.client-stat-card {
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    transition: var(--transition);
    animation: slideInLeft 0.6s ease-out;
}

.client-stat-card:nth-child(1) { animation-delay: 0.1s; }
.client-stat-card:nth-child(2) { animation-delay: 0.2s; }
.client-stat-card:nth-child(3) { animation-delay: 0.3s; }
.client-stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.client-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.client-stat-value {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.workers-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.worker-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.worker-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.worker-times {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.time-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.time-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.time-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.client-card {
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    padding: 6px 12px;
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.worker-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.detail-group {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.block-timer {
    text-align: center;
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    transition: var(--transition);
    animation: pulseGlow 2s ease-in-out infinite;
}

.block-timer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.2);
    border-color: var(--border-hover);
}

.timer-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Courier New', monospace;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.2);
    }
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.wallet-display {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface-light);
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid var(--border);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.login-card input {
    width: 100%;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.login-card button {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    padding: 16px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.3);
}

.login-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 16px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-light);
    transition: var(--transition);
    border-radius: 32px;
    border: 2px solid var(--border);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, #ffffff, #f1f1f1);
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: var(--primary-gradient);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(var(--primary-rgb), 0.3);
}

input:checked + .slider:before {
    transform: translateX(24px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.loading {
    display: grid;
    place-items: center;
    min-height: 200px;
    color: var(--text-secondary);
    font-size: 16px;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Styles for the transparent clean select dropdown */
select.clean-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--surface-light); /* Transparent-like background */
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 40px 12px 16px; /* Extra padding for custom arrow */
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 200px; /* Adjust as needed */
}

select.clean-select:hover {
    border-color: var(--border-hover);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

select.clean-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.3);
}

/* Custom dropdown arrow */
select.clean-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a1a1aa'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

/* Options styling */
select.clean-select option {
    background-color: var(--surface-darker); /* Darker background for options */
    color: var(--text-primary);
    padding: 10px 16px;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    padding: 20px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-code-img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    border: 4px solid white; /* A small white border for the QR code itself */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.qr-code-img:hover {
    transform: scale(1.03);
}

.qr-code-label {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        padding: 0 16px;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        margin-bottom: 24px;
    }
    
    .main-content {
        padding: 24px 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card.large {
        grid-column: span 1;
    }
    
    .metrics-section {
        grid-template-columns: 1fr;
    }
    
    .metric-grid {
        grid-template-columns: 1fr;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .client-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .worker-stats {
        grid-template-columns: 1fr;
    }
    
    .worker-times {
        grid-template-columns: 1fr;
    }
    
    .field {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .chart-container.large {
        height: 300px;
        padding: 16px;
    }
    
    .worker-details {
        grid-template-columns: 1fr;
    }

    .block-timer {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .timer-value {
        font-size: 24px;
    }
    
    .settings-card {
        margin: 0 0 24px 0;
        padding: 32px 24px;
        max-width: none;
        border-radius: 16px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 28px 0;
    }
    
    .setting-item:hover {
        margin: 0;
        padding: 28px 0;
        background: none;
        transform: none;
    }
    
    .theme-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .background-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .custom-theme-controls {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .wallet-display {
        max-width: 200px;
        font-size: 11px;
    }

    .setting-label {
        margin-right: 0;
    }

    .custom-color-input {
        width: 100%;
        justify-content: flex-start;
    }

    .theme-pill {
        font-size: 11px;
        padding: 14px 16px;
    }

    .theme-pill::before {
        width: 28px;
        height: 28px;
    }

    .background-pill {
        padding: 16px 12px;
    }

    .background-pill::before {
        height: 32px;
    }
}
@media (max-width: 768px) {
    .toggle {
        width: 48px;
        height: 24px;
    }
}

/* === Animated Gradient Background === */
.starry-background.gradient {
    background: linear-gradient(-45deg, 
        rgba(var(--primary-rgb), 0.8),
        rgba(var(--secondary-rgb), 0.8),
        rgba(var(--primary-rgb), 0.6),
        rgba(var(--secondary-rgb), 0.6));
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === Hide stars for gradient background === */
.starry-background.gradient::before {
    display: none;
}