:root {
    --color-bg: #ffffff;
    --color-surface: #f5f5f7;
    --color-surface-elevated: #ffffff;
    --color-border: #d2d2d7;
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-primary: #0066cc;
    --color-success: #34c759;
    --color-standard: #8e8e93;
    --color-warning: #ff9500;
    --color-category-bg: #e8e8ed;
}
html, body {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE / old Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari */
}

/* 1. Standard way to hide scrollbar for Chrome, Safari, and newer Edge */
/* --- OPTIMIZED TABLE STYLES --- */
/* --- COMPACT & PERMANENT TABLE STYLES --- */
.speed-table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.speed-table-wrapper::-webkit-scrollbar { display: none; }

.speed-table { 
    width: 100% !important; 
    /* This was likely the culprit. Setting it to auto allows it to be compact on desktop. */
    min-width: auto !important; 
    max-width: 100% !important;
    border-collapse: collapse !important; 
    background: var(--color-surface-elevated); 
    table-layout: auto !important;
}

.speed-table th, .speed-table td { 
    /* Compact padding: 10px top/bottom, 4px sides */
    padding: 10px 4px !important; 
    text-align: center !important; 
    border-bottom: 1px solid var(--color-border); 
    white-space: nowrap !important;
    font-size: 13px !important; /* Slightly smaller text for more efficiency */
}

/* Fix the Gear column to the left for mobile usability */
.speed-table th:first-child, .speed-table td:first-child { 
    text-align: left !important; 
    padding-left: 12px !important;
    position: sticky !important; 
    left: 0; 
    background: var(--color-surface-elevated); 
    z-index: 2; 
    border-right: 1px solid var(--color-border);
}

/* Center the hero text as requested earlier */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

[data-theme="dark"] {
    --color-bg: #000000;
    --color-surface: #1c1c1e;
    --color-surface-elevated: #2c2c2e;
    --color-border: #38383a;
    --color-text: #f5f5f7;
    --color-text-secondary: #86868b;
    --color-primary: #0a84ff;
    --color-success: #30d158;
    --color-standard: #636366;
    --color-warning: #ff9f0a;
    --color-category-bg: #2c2c2e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 40px 0;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.content-wrapper { flex: 1; margin-left: 280px; padding: 64px 80px; max-width: calc(100% - 280px); }

.sidebar-brand { padding: 0 2px 24px; border-bottom: 1px solid var(--color-border); margin-bottom: 24px; }
.sidebar-brand h1 { font-size: 26px; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.sidebar-brand p { font-size: 14px; color: var(--color-text-secondary); }

.sidebar-header-controls {
    display: flex;
    gap: 8px;
    padding: 0 12px 24px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
    align-items: center;
}

.theme-toggle-wrapper { padding: 0 0px 0px; border-bottom: 1px solid var(--color-border); margin-bottom: 24px; }
.theme-toggle {
    flex: 1;
    padding: 10px 16px; 
    background: var(--color-surface-elevated); 
    border: 1px solid var(--color-border); 
    border-radius: 8px; 
    color: var(--color-text); 
    font-size: 14px; 
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--color-surface);
    border-color: var(--color-primary);
}

.sidebar-section { margin-bottom: 32px; }
.sidebar-section-title { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--color-text-secondary); padding: 0 32px 12px; }
.sidebar a { display: block; padding: 10px 32px; color: var(--color-text); text-decoration: none; font-size: 15px; font-weight: 500; border-left: 3px solid transparent; }
.sidebar a:hover { background: rgba(0, 102, 204, 0.1); border-left-color: var(--color-primary); color: var(--color-primary); }

.sidebar-header-controls {
    display: flex !important;
}

.mobile-menu-toggle { display: none; }
.sidebar-close { display: none; }

@media (max-width: 1024px) {
    .content-wrapper { margin-left: 0; max-width: 100%; padding: 80px 24px 40px; }
    
    .mobile-menu-toggle { 
        display: block; 
        position: fixed; 
        top: 20px; 
        left: 20px; 
        z-index: 999; 
        background: var(--color-surface); 
        border: 1px solid var(--color-border); 
        border-radius: 8px; 
        padding: 12px; 
        cursor: pointer; 
        width: 44px; 
        height: 44px; 
    }
    
    body.menu-open .mobile-menu-toggle { display: none; }
    
    .hamburger { display: block; width: 20px; height: 2px; background: var(--color-text); position: relative; }
    .hamburger::before, .hamburger::after { content: ''; position: absolute; width: 20px; height: 2px; background: var(--color-text); left: 0; }
    .hamburger::before { top: -6px; }
    .hamburger::after { bottom: -6px; }
    
    .sidebar { 
        left: -280px; 
        transition: left 0.3s ease;
        z-index: 1001;
    }
    
    .sidebar.active { 
        left: 0; 
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5); 
    }
    
    .sidebar-close {
        display: none;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        font-size: 36px;
        color: var(--color-text);
        background: var(--color-surface-elevated);
        border: 1px solid var(--color-border);
        border-radius: 8px;
        cursor: pointer;
        line-height: 1;
        flex-shrink: 0;
        transition: all 0.2s;
    }
    
    .sidebar-close:hover {
        background: var(--color-surface);
        border-color: var(--color-primary);
    }
    
    .sidebar.active .sidebar-close {
        display: flex;
    }
    
    .sidebar.active .sidebar-header-controls {
        display: flex;
    }
    
    .sidebar-header-controls {
        display: none;
    }
    
    body.menu-open::before { 
        content: ''; 
        position: fixed; 
        inset: 0; 
        background: rgba(0, 0, 0, 0.6); 
        z-index: 1000; 
        backdrop-filter: blur(2px); 
    }
}
.hero-section {
    text-align: center;
    padding: 40px 20px; /* Optional: adds some breathing room */
}
.hero-section h1 { font-size: 72px; font-weight: 800; letter-spacing: -2px; margin-bottom: 20px; line-height: 1; }
.hero-section p { font-size: 20px; color: var(--color-text-secondary); max-width: 700px; }

.section { margin-bottom: 100px; }
.section-title { font-size: 48px; font-weight: 700; letter-spacing: -1.5px; margin-bottom: 16px; }
.section-description { font-size: 18px; color: var(--color-text-secondary); max-width: 800px; }

.info-box { background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 28px; margin: 32px 0; display: flex; gap: 20px; }
.info-icon { font-size: 32px; flex-shrink: 0; }
.info-content h4 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.info-content p { font-size: 15px; color: var(--color-text-secondary); line-height: 1.7; margin-bottom: 10px; }
.info-content p:last-child { margin-bottom: 0; }
.info-content p strong { color: var(--color-text); font-weight: 600; }

/* Link styling */
a { color: var(--color-primary); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.7; text-decoration: underline; }
.info-content a { color: var(--color-primary); font-weight: 500; }

.year-chart-wrapper { display: flex; flex-direction: column; gap: 32px; margin: 40px 0; }
.year-category { background-color: var(--color-surface); border-radius: 12px; overflow: hidden; border: 1px solid var(--color-border); }
.year-category-header { background-color: var(--color-category-bg); padding: 16px 24px; border-bottom: 1px solid var(--color-border); }
.year-category-header h3 { font-size: 15px; font-weight: 600; margin: 0; text-transform: uppercase; }
.year-header { display: grid; grid-template-columns: 300px repeat(8, 1fr); background-color: var(--color-surface-elevated); border-bottom: 1px solid var(--color-border); padding: 12px 0; }
.year-header-cell { padding: 0 8px; font-size: 13px; font-weight: 600; color: var(--color-text-secondary); text-align: center; }
.year-header-cell:first-child { padding: 0 24px; text-align: left; }
.year-part-row { display: grid; grid-template-columns: 300px repeat(8, 1fr); background-color: var(--color-surface-elevated); border-bottom: 1px solid var(--color-surface); min-height: 52px; align-items: center; padding: 8px 0; }
.year-part-row:last-of-type { border-bottom: none; }
.year-part-name { padding: 0 24px; font-size: 14px; color: var(--color-text); }
.year-part-name.preferred { font-weight: 500; }
.year-cell { padding: 0 8px; display: flex; justify-content: center; }
.year-bar { height: 24px; width: 100%; border-radius: 4px; }
.year-bar.preferred { background-color: var(--color-success); }
.year-bar.standard { background-color: var(--color-standard); }
.year-note { padding: 16px 24px; background-color: var(--color-surface); border-top: 1px solid var(--color-border); font-size: 14px; line-height: 1.6; }
.year-note-title { margin-bottom: 8px; font-weight: 500; }
.year-note-reason { color: var(--color-text-secondary); font-size: 13px; }

@media (max-width: 768px) {
    .hero-section h1 { font-size: 40px; }
    .section-title { font-size: 32px; }
    .year-chart-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .year-category { min-width: 900px; }
    .year-header, .year-part-row { grid-template-columns: 180px repeat(8, 80px); }
}