:root {
            /* Light mode colors */
            --bg-primary: #ffffff;
            --bg-secondary: #f8f9fa;
            --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            --text-primary: #2c3e50;
            --text-secondary: #495057; /* Darker gray for better contrast: #6c757d -> #495057 (7.0:1 on white) */
            --border-color: #dee2e6;
            --shadow: rgba(0,0,0,0.1);
            --hover-bg: #3498db;
            --hover-text: #ffffff;
            --card-bg: rgba(255, 255, 255, 0.95);
            --sidebar-bg: rgba(255, 255, 255, 0.95);
        }

        [data-theme="dark"] {
            /* Dark mode colors */
            --bg-primary: #1a1a1a;
            --bg-secondary: #2d2d2d;
            --bg-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
            --text-primary: #e8e8e8;
            --text-secondary: #b0b0b0;
            --border-color: #404040;
            --shadow: rgba(0,0,0,0.3);
            --hover-bg: #3498db;
            --hover-text: #ffffff;
            --card-bg: rgba(45, 45, 45, 0.95);
            --sidebar-bg: rgba(45, 45, 45, 0.95);
        }

        html {
            overflow-x: hidden; /* Prevent horizontal scrolling */
            width: 100%;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            line-height: 1.6;
            margin: 0;
            padding: 0;
            min-height: 100vh;
            background: var(--bg-gradient);
            color: var(--text-primary);
            transition: background 0.3s ease, color 0.3s ease;
            overflow-x: hidden; /* Prevent horizontal scrolling */
            width: 100%;
            max-width: 100vw; /* Ensure body doesn't exceed viewport width */
        }
        
                .top-bar {
            display: block;
        }
        
        .desktop-logo-container {
            display: none;
        }
        
        .desktop-footer-container {
            display: none;
        }
        
        .left-column {
            display: none;
        }
        
        .header {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            padding: 1rem 0;
            box-shadow: 0 2px 20px var(--shadow);
            position: sticky;
            top: 0;
            z-index: 100;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }
        
        .header-content {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            line-height: 1;
            height: 2.5rem;
        }
        
        .logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
            transition: opacity 0.3s ease;
        }
        
        .logo:hover {
            opacity: 0.8;
        }
        
        .logo img {
            height: 50px;
            width: auto;
            max-width: 250px;
            object-fit: contain;
        }
        
        .logo-text {
            font-size: 1.8rem;
            font-weight: bold;
            color: var(--text-primary);
        }
        
        .desktop-logo {
            height: 400px;
            width: 400px;
            object-fit: contain;
        }
        
        @media (min-width: 769px) {
            .top-bar {
                display: block; /* Changed from flex - left-column is fixed, header is separate */
                position: relative;
                z-index: 100;
                pointer-events: none;
            }
            
            .top-bar > * {
                pointer-events: auto;
            }
            
            .left-column {
                display: flex;
                flex-direction: column;
                width: 250px;
                flex-shrink: 0;
                height: 100vh;
                position: fixed; /* Fixed instead of sticky to stay in place */
                left: 0;
                top: 0;
                z-index: 101; /* Above top-bar (100) to prevent overlap */
                pointer-events: none; /* Allow clicks to pass through to sidebar */
            }
            
            .left-column > * {
                pointer-events: auto; /* Re-enable clicks for logo and footer */
            }
            
            .desktop-logo-container {
                width: 100%; /* Full width of left column */
                background: var(--card-bg);
                backdrop-filter: blur(10px);
                box-shadow: 0 2px 20px var(--shadow);
                padding: 5px;
                display: flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
                height: 250px; /* Fixed height, taller than header */
                box-sizing: border-box;
            }
            
            .desktop-logo-container a {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 100%;
                height: 100%;
                text-decoration: none;
                transition: opacity 0.3s ease;
            }
            
            .desktop-logo-container a:hover {
                opacity: 0.8;
            }
            
            .desktop-logo {
                height: auto;
                width: calc(100% - 10px);
                max-width: 240px;
                max-height: 240px;
                object-fit: contain;
            }
            
            .desktop-footer-container {
                width: 100%; /* Full width of left column */
                background: var(--card-bg);
                backdrop-filter: blur(10px);
                box-shadow: 0 2px 20px var(--shadow);
                padding: 10px;
                display: flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
                box-sizing: border-box;
                min-height: 80px; /* Minimum height for footer */
                margin-top: auto; /* Push footer to bottom of left-column */
                z-index: 100;
            }
            
            .footer-content {
                font-size: 0.8em;
                color: var(--text-secondary);
                text-align: center;
                line-height: 1.4;
                word-wrap: break-word;
                width: 100%;
            }
            
            .header {
                position: fixed; /* Fixed positioning like left-column */
                left: 250px; /* Start at right edge of left-column */
                right: 0; /* Extend to right edge of viewport */
                top: 0;
                background: var(--card-bg);
                backdrop-filter: blur(10px);
                box-shadow: 0 2px 20px var(--shadow);
                transition: background 0.3s ease, box-shadow 0.3s ease;
                padding: 1rem 0;
                z-index: 100;
                height: 72px; /* Fixed height */
                box-sizing: border-box;
            }
            
            .header-content {
                height: 2.5rem;
                line-height: 1;
                padding: 0 2rem;
                margin: 0;
                max-width: none;
                width: 100%;
                box-sizing: border-box;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
            
            .header .logo img {
                display: none;
            }
            
            .header .logo-text {
                display: block;
            }
        }
        
        @media (max-width: 768px) {
            .top-bar {
                display: block !important;
                position: sticky;
                top: 0;
                z-index: 100;
            }
            
            .desktop-logo-container {
                display: none !important;
            }
            
            /* On mobile, hide logo but allow sidebar and footer to be shown */
            .left-column {
                position: fixed;
                left: 0;
                right: 0;
                width: 100%;
                height: auto;
                flex-direction: column;
                top: auto;
                z-index: 97; /* Below nav (99) but above content */
                pointer-events: auto; /* Allow clicks on sidebar and footer */
                display: none;
            }
            
            .left-column.active {
                display: flex;
            }
            
            /* Hide logo on mobile */
            .left-column .desktop-logo-container {
                display: none !important;
            }
            
            /* Show sidebar on mobile when left-column is active */
            .left-column .sidebar {
                position: relative !important;
                left: auto !important;
                right: auto !important;
                top: auto !important;
                width: 100% !important;
                height: auto !important;
                max-height: none !important;
                background: var(--sidebar-bg) !important;
                backdrop-filter: blur(10px) !important;
                padding: 1rem !important;
                border-right: none !important;
                border-top: 1px solid var(--border-color) !important;
                z-index: auto !important;
                overflow-y: auto !important;
                box-sizing: border-box !important;
                pointer-events: auto !important;
                display: block !important;
                flex: 0 0 auto;
            }
            
            /* Show footer on mobile when left-column is active */
            .left-column .desktop-footer-container {
                position: relative !important;
                left: auto !important;
                right: auto !important;
                top: auto !important;
                width: 100% !important;
                background: var(--card-bg) !important;
                backdrop-filter: blur(10px) !important;
                padding: 1rem !important;
                box-shadow: 0 -2px 20px var(--shadow) !important;
                z-index: auto !important;
                box-sizing: border-box !important;
                pointer-events: auto !important;
                display: flex !important;
                flex: 0 0 auto;
                margin-top: 0;
            }
            
            .header {
                width: 100%;
                display: block !important;
                flex: none !important;
                align-self: stretch !important;
            }
            
            /* Header adjustments */
            .header-content {
                padding: 0 1rem;
                flex-wrap: wrap;
            }
            
            .logo img {
                height: 36px;
                max-width: 180px;
            }
            
            .logo-text {
                font-size: 1.4rem;
            }
        }


        
        .nav {
            display: flex;
            gap: 2rem;
            align-items: center;
        }
        
        .nav select, .nav a {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 500;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
            background: var(--bg-primary);
            font-size: 1rem;
            height: 2.5rem;
            display: inline-flex;
            align-items: center;
            box-sizing: border-box;
        }
        .nav-social-group {
            display: inline-flex;
            gap: 0;
            align-items: center;
        }
        .nav .nav-social-link {
            padding: 0.59375rem;
            width: 2.375rem;
            height: 2.375rem;
            min-width: 2.375rem;
            min-height: 2.375rem;
            border: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
        }
        .nav .nav-social-link .nav-social-icon {
            display: block;
            width: 1.1875rem;
            height: 1.1875rem;
            min-width: 1.1875rem;
            min-height: 1.1875rem;
            flex-shrink: 0;
        }
        
        .nav select {
            cursor: pointer;
        }
        
        .nav select:hover, .nav a:hover {
            background: var(--hover-bg);
            color: var(--hover-text);
            border-color: var(--hover-bg);
        }
        
        /* Dark mode toggle */
        .theme-toggle {
            position: relative;
            width: 60px;
            height: 30px;
            background: var(--border-color);
            border-radius: 15px;
            cursor: pointer;
            transition: background 0.3s ease;
            border: none;
            outline: none;
        }
        
        .theme-toggle:hover {
            background: var(--text-secondary);
        }
        
        .theme-toggle::before {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 24px;
            height: 24px;
            background: var(--bg-primary);
            border-radius: 50%;
            transition: transform 0.3s ease;
            box-shadow: 0 2px 4px var(--shadow);
        }
        
        [data-theme="dark"] .theme-toggle::before {
            transform: translateX(30px);
        }
        
        .theme-toggle-icon {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            transition: opacity 0.3s ease;
        }
        
        .theme-toggle-icon.sun {
            left: 8px;
            /* No color property - emoji uses natural yellow color for better contrast */
        }
        
        .theme-toggle-icon.moon {
            right: 8px;
            color: #FFD700; /* Gold/yellow to match moon emoji color - 8.6:1 on #404040 */
            opacity: 0;
            visibility: hidden; /* Completely hide from accessibility tools in light mode */
        }
        
        [data-theme="dark"] .theme-toggle-icon.sun {
            opacity: 0;
            visibility: hidden;
        }
        
        [data-theme="dark"] .theme-toggle-icon.moon {
            opacity: 1;
            visibility: visible;
            color: #FFD700; /* Gold/yellow to match moon emoji color - 8.6:1 on #404040 */
        }
        
        /* Explicitly show sun in light mode */
        .theme-toggle-icon.sun {
            opacity: 1;
            visibility: visible;
        }
        
        .container {
            display: flex;
            min-height: calc(100vh - 80px);
        }
        
        .sidebar {
            width: 100%; /* Full width of left-column */
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            padding: 20px;
            border-right: 1px solid var(--border-color);
            flex-shrink: 0;
            overflow-y: auto;
            box-sizing: border-box;
            transition: background 0.3s ease, border-color 0.3s ease;
            z-index: 99; /* Below top-bar (100) but above content */
            pointer-events: auto; /* Ensure clicks work */
        }
        
        @media (min-width: 769px) {
            .container {
                display: block; /* Not flex on desktop - left-column is in top-bar */
                position: relative;
                margin-top: 72px; /* Start below fixed header bar */
                margin-left: 250px; /* Shift right to account for left-column */
                z-index: 1;
                width: calc(100% - 250px); /* Account for left-column width */
                box-sizing: border-box;
            }
            .main-content {
                margin-top: 0; /* Already accounted for by container padding */
                position: relative;
                z-index: 1;
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }
            .sidebar {
                /* Sidebar is now in left-column, positioned between logo and footer */
                /* It will flex to fill space between logo (250px) and footer */
                flex: 1;
                min-height: 0; /* Allow flex shrinking */
                overflow-y: auto; /* Scrollable */
            }
        }
        
        .sidebar h2 {
            color: var(--text-primary);
            margin-bottom: 20px;
            font-size: 1.3rem;
            transition: color 0.3s ease;
        }
        
        .league-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .league-list li {
            margin-bottom: 8px;
        }
        
        .league-list a {
            display: block;
            color: var(--text-primary);
            text-decoration: none;
            padding: 10px 15px;
            border-radius: 6px;
            transition: all 0.3s ease;
            border: 1px solid transparent;
        }
        
        .league-list a:hover {
            background: var(--hover-bg);
            color: var(--hover-text);
            border-color: var(--hover-bg);
        }
        
        .main-content {
            flex: 1;
            padding: 2rem;
            color: var(--text-primary);
            overflow-x: auto;
            min-width: 0;
            transition: color 0.3s ease;
        }
        
        .content-section {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            padding: 2rem;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            margin-bottom: 2rem;
            transition: background 0.3s ease, border-color 0.3s ease;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            margin-left: auto;
            margin-right: auto;
        }
        
        .content-section h2 {
            color: #f39c12;
            margin-bottom: 1rem;
            font-size: 1.8rem;
        }
        
        .content-section h3 {
            color: #1a5f8f; /* Darker blue for better contrast: #3498db -> #1a5f8f (4.5:1 on white) */
            margin-top: 1.5rem;
            margin-bottom: 0.5rem;
            font-size: 1.3rem;
        }
        
        .content-section p {
            margin-bottom: 1rem;
            opacity: 0.9;
        }
        
        .content-section ul {
            margin-bottom: 1rem;
            padding-left: 2rem;
        }
        
        .content-section li {
            margin-bottom: 0.5rem;
            opacity: 0.9;
        }
        
        .highlight {
            background: rgba(52, 152, 219, 0.2);
            padding: 1rem;
            border-radius: 8px;
            border-left: 4px solid #3498db;
            margin: 1rem 0;
        }
        
        /* Mobile hamburger menu */
        .mobile-menu-toggle {
            display: none;
            flex-direction: column;
            gap: 5px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 8px;
            z-index: 101;
        }
        
        .mobile-menu-toggle span {
            width: 25px;
            height: 3px;
            background: var(--text-primary);
            border-radius: 2px;
            transition: all 0.3s ease;
        }
        
        .mobile-menu-toggle.active span:nth-child(1) {
            transform: rotate(45deg) translate(8px, 8px);
        }
        
        .mobile-menu-toggle.active span:nth-child(2) {
            opacity: 0;
        }
        
        .mobile-menu-toggle.active span:nth-child(3) {
            transform: rotate(-45deg) translate(7px, -7px);
        }
        
        /* Make the layout responsive */
        @media (max-width: 1024px) {
            .container {
                flex-direction: column;
            }
            .sidebar {
                width: 100%;
                height: auto;
                position: static;
            }
            .main-content {
                padding: 20px;
            }
        }
        
        @media (max-width: 768px) {
            /* Mobile menu toggle */
            .mobile-menu-toggle {
                display: flex;
            }
            
            /* Navigation - hide on mobile, show in mobile menu */
            .nav {
                display: none;
                position: fixed;
                top: 60px;
                left: 0;
                right: 0;
                background: var(--card-bg);
                backdrop-filter: blur(10px);
                flex-direction: column;
                padding: 1rem;
                gap: 1rem;
                box-shadow: 0 4px 20px var(--shadow);
                z-index: 99;
                max-height: calc(100vh - 60px);
                overflow-y: auto;
            }
            
            .nav.active {
                display: flex;
            }
            
            .nav select, .nav a {
                width: 100%;
                justify-content: center;
                min-height: 44px; /* Touch-friendly size */
                font-size: 1rem;
            }
            
            /* Sidebar - hide on mobile, show in mobile menu below nav */
            /* Note: Sidebar is now inside .left-column, styles are handled in header_styles.html */
            /* No local styles needed here to avoid conflicts */
            
            /* Main content adjustments */
            .main-content {
                padding: 1rem 0.75rem; /* Less horizontal padding, let content-section handle spacing */
                width: 100%;
                max-width: 100vw;
                box-sizing: border-box;
                overflow-x: hidden;
            }
            
            /* Content sections - add equal margin from edges */
            .content-section {
                margin-left: 0.75rem !important;
                margin-right: 0.75rem !important;
                padding: 1.5rem;
                width: calc(100% - 1.5rem) !important; /* Account for margins */
                max-width: calc(100% - 1.5rem) !important;
            }
            
            /* Touch-friendly controls */
            button, .nav a, .nav select, .theme-toggle {
                min-height: 44px;
                min-width: 44px;
            }
            
            .container {
                flex-direction: column;
            }
            
            /* Spacing adjustments */
            h1 {
                font-size: 1.8rem;
            }
            
            h2 {
                font-size: 1.5rem;
            }
            
            h3 {
                font-size: 1.3rem;
            }
        }
        
        /* Color arrows in Position History documentation */
        .position-arrows .arrow-up {
            color: #28a745; /* Green for up arrow */
        }
        
        .position-arrows .arrow-down {
            color: #dc3545; /* Red for down arrow */
        }
        
        .position-arrows .arrow-stable {
            color: var(--text-primary); /* Default color for stable arrow */
        }
        
        /* Visually hidden but accessible to screen readers */
        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border-width: 0;
        }

/* utilities */
.is-hidden{display:none!important}.link-accent{color:#1a5f8f}.logo-md{object-fit:contain;margin-right:8px;vertical-align:middle}.logo-40{width:40px;height:40px}.logo-50{width:50px;height:50px}.logo-60{width:60px;height:60px}.logo-75{width:75px;height:75px}.link-muted-xs{text-decoration:none;color:#495057;font-size:0.5em}
