/* Extracted from templates/index.html inline styles to reduce template size without behavior change */
.markets-container { min-height: 600px; }
.hl-card { min-height: 320px; display: block; position: relative; background-color: #f8f9fa; }
.navbar { min-height: 60px; }

/* Critical CSS: Inline above-the-fold styles for instant rendering -> now externalized */
/* CSS Variables */
:root {
    --primary-color: #ffffff;
    --secondary-color: #f7f7f8;
    --accent-color: #f0f2f5;
    --text-primary: #111;
    --text-secondary: #5e6470;
    --success-color: #10b981;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
}
/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--secondary-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}
/* Header/Navbar */
.navbar {
    background: var(--primary-color) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text-primary) !important;
}
.brand-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: inline-block;
    vertical-align: -4px;
}
.data-refresh-note {
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 500;
}
/* Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-color);
}
.odds-page-content {
    padding-bottom: 80px;
}
.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    padding: 0.9rem 1.25rem;
    font-weight: 600;
}
.nav-tabs .nav-link.active {
    color: var(--success-color);
    border-bottom: 3px solid var(--success-color);
}
/* Hero/Signup Banner */
.ph-banner {
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px 16px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ph-banner .headline { font-weight: 800; }
.ph-banner form { display: flex; align-items: center; gap: 8px; }
.ph-banner input[type="email"] { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-color); background-color: #ffffff; }
.ph-banner .btn-subscribe { background-color: #10B981; color: #fff; font-weight: 800; border: none; border-radius: 6px; padding: 10px 16px; }
/* Grid Structure */
#odds-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    min-height: 300px;
}
@media (max-width: 992px) { #odds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px) { #odds-grid { grid-template-columns: 1fr; } }
/* Market Cards */
.markets-container {
    background: var(--card-bg);
    border: 2px solid #d1d5db;
    border-radius: 14px;
    padding: 1.25rem;
    margin: 1.25rem 0;
    min-height: 200px;
}
.market-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.market-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.event-link { color: inherit; text-decoration: none; }
/* Filters */
.filters-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.subnav { display: flex; gap: .5rem; }
.subnav .nav-link { padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600; color: var(--text-secondary); }
.subnav .nav-link.active { background: var(--secondary-color); color: var(--text-primary); }
/* Table Basics */
.table-dark { background: #1a1a1a; color: #fff; }
.table-dark thead th { background: #2a2a2a; border-bottom: 2px solid #3a3a3a; font-weight: 700; padding: 0.75rem; }
.table-dark tbody td { padding: 0.75rem; border-bottom: 1px solid #3a3a3a; }
.price-chip { display: inline-block; padding: 0.3rem 0.6rem; border-radius: 6px; font-weight: 700; text-decoration: none; color: #fff; background: #3a3a3a; }
/* Loading State */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }

/* Full stylesheet (non-critical) extracted */
:root {
    --primary-color: #ffffff;
    --secondary-color: #f7f7f8;
    --accent-color: #f0f2f5;
    --text-primary: #111;
    --text-secondary: #5e6470;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #2563eb;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --hover-bg: #f6f7f9;
    --gutter: 16px;
    --radius: 16px;
    --shadow: 0 6px 20px rgba(0,0,0,.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--secondary-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}
.navbar {
    background: var(--primary-color) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.app-container { max-width: 1440px; margin: 0 auto; padding-left: 0.75rem; padding-right: 0.75rem; }
.navbar-brand { font-weight: 800; font-size: 1.35rem; color: var(--text-primary) !important; letter-spacing: .2px; }
.brand-logo { width: 22px; height: 22px; object-fit: contain; display: inline-block; vertical-align: -4px; }
.brand-stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.brand-title { display: inline-flex; align-items: center; gap: .5rem; }
.site-byline-left { font-weight: 600; color: #6b7280; font-style: italic; margin-left: 0; font-size: .92rem; }
.site-byline-left a { font-size: inherit; }
.site-byline-left .by-prefix { display: inline-block; margin-right: -8px; }
.site-byline { font-weight: 600; color: #6b7280; margin-right: 1rem; font-style: italic; }
.header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
@media (max-width: 576px){
  .site-byline { font-size: .92rem; margin-right: .5rem; }
  .header-meta{ gap: 0; align-items:flex-start; width:100%; }
  .navbar .container-fluid { display:flex; flex-direction:column; align-items:flex-start; }
  .data-refresh-note { margin-top:4px; }
}
.nav-tabs { border-bottom: 1px solid var(--border-color); background: var(--primary-color); }
.data-refresh-note { color: var(--text-secondary); font-size: .85rem; font-weight: 500; }
.nav-tabs .nav-link { color: var(--text-secondary); border: none; border-radius: 0; padding: 0.9rem 1.25rem; font-weight: 600; transition: color .2s ease; }
.nav-tabs .nav-link:hover { color: var(--text-primary); background: var(--secondary-color); }
.nav-tabs .nav-link.active { color: var(--success-color); background: transparent; border-bottom: 3px solid var(--success-color); }
.event-link { color: inherit; text-decoration: none; }
.event-link:hover { text-decoration: underline; }
.brand-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--text-primary); font-size: .9rem; white-space: nowrap; }
.brand-tag img { width: 18px; height: 18px; object-fit: contain; display: inline-block; }
.brand-tag.brand-muted { opacity: .68; font-size: .85rem; }
.brand-tag.brand-muted img { width: 16px; height: 16px; }
.ph-banner { background-color: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 12px; padding: 10px 16px; margin: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ph-banner .copy { display: grid; gap: 2px; }
.ph-banner .headline { font-weight: 800; }
.ph-banner .headline .headline-mobile { display: none; }
.ph-banner .btn-subscribe .cta-mobile { display: none; }
.ph-banner .subcopy { color: var(--text-secondary); font-weight: 500; }
.ph-banner form { display: flex; align-items: center; gap: 8px; }
.ph-banner input[type="email"] { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-color); background-color: #ffffff; }
.ph-banner .btn-subscribe { background-color: #10B981; color: #fff; font-weight: 800; border: none; border-radius: 6px; padding: 10px 16px; }
.ph-banner .btn-subscribe:hover { background-color: #059669; transform: scale(1.03); }
@media (max-width: 576px){
    .ph-banner { flex-direction: column; align-items: stretch; padding: 8px 12px; border-radius: 10px; }
    .ph-banner .copy { gap: 0; }
    .ph-banner .headline { font-size: 1rem; line-height: 1.25; }
    .ph-banner .headline .headline-desktop { display: none; }
    .ph-banner .headline .headline-mobile { display: inline; }
    .ph-banner form { width: 100%; gap: 4px; }
    .ph-banner input[type="email"] { width: 100%; height: 36px; font-size: 14px; padding: 8px 10px; flex: 1 1 auto; }
    .ph-banner .btn-subscribe { height: 36px; font-size: 12px; line-height: 1.1; padding: 8px 10px; white-space: nowrap; flex: 0 0 auto; }
    .ph-banner .btn-subscribe .cta-desktop { display: none; }
    .ph-banner .btn-subscribe .cta-mobile { display: inline; }
    .ph-banner .subcopy { display: none; }
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.25rem; transition: all 0.2s ease; position: relative; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--success-color), var(--info-color)); }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); }
.stat-icon { font-size: 2rem; margin-bottom: 1rem; }
.stat-value { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.stat-label { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.search-container { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; margin: 2rem 0; }
.search-input { background: var(--secondary-color); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 8px; padding: 0.75rem 1rem; }
.search-input:focus { background: var(--secondary-color); border-color: var(--success-color); color: var(--text-primary); box-shadow: 0 0 0 0.2rem rgba(0, 212, 170, 0.25); }
.search-container.search-compact { padding: .5rem .75rem; margin: .5rem 0; }
.filters-row { display:flex; align-items:center; justify-content:space-between; gap:.5rem; flex-wrap:wrap; margin-bottom:.5rem; }
.filters-row .subnav { margin-bottom:0 !important; }
.filters-row .subnav { display:flex; gap:.5rem; }
.filters-row .subnav .nav-link { flex:0 0 auto; }
@media (max-width: 576px){
  .filters-row { flex-wrap:nowrap; }
  .filters-row .subnav { overflow-x:auto; -webkit-overflow-scrolling:touch; white-space:nowrap; width:100%; padding-bottom:.25rem; }
  .filters-row .subnav::-webkit-scrollbar { display:none; }
  .filters-row .search-container { flex:0 0 auto; }
}
.filters-row .search-container { margin:0; padding:.5rem .75rem; }
.search-icon-btn { display:none; }
@media (max-width: 640px){
    .hide-mobile { display:none !important; }
    .search-icon-btn { display:inline-flex; align-items:center; justify-content:center; }
    .filters-row { justify-content:flex-start; }
    .filters-row .search-container { order:-1; }
}
.markets-container {
    background: var(--card-bg);
    border: 2px solid #d1d5db;
    border-radius: 14px;
    padding: 1.25rem;
    margin: 1.25rem 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    min-height: 200px;
}
.markets-overview { background: #FAFAFA; border: 1px solid var(--border-color); border-radius: 14px; padding: .5rem; margin: 0; min-height: 300px; }
@media (max-width: 576px) { .markets-overview { min-height: 340px; } }
.markets-overview .section-header { margin: .25rem .25rem .75rem .25rem; display:flex; align-items:baseline; justify-content:space-between; gap:.75rem; }
.markets-overview .section-title { font-weight: 800; font-size: 1.15rem; margin: 0; }
.markets-overview .section-subtitle { color: var(--text-secondary); margin-top: .15rem; font-size: .95rem; }
.markets-overview .section-link { font-weight: 800; color: #10b981; text-decoration: none; white-space: nowrap; }
.markets-overview .section-link:hover, .markets-overview .section-link:focus { text-decoration: underline; }
.markets-overview .markets-container { background: transparent; border: 0; padding: 0; margin: 0; box-shadow: none; }
.markets-overview .market-card { margin-bottom: .25rem; }
.markets-overview .section-footer { text-align:center; margin-top: .35rem; color: var(--text-secondary); font-size: .95rem; }
.markets-overview .section-footer a { font-weight: 800; color: #2563eb; text-decoration: none; }
.markets-overview .section-footer a:hover { text-decoration: underline; }
#breaking-news { margin-bottom: .25rem; }
#breaking-news + .markets-container { margin-top: .25rem; }
#odds-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; min-height: 300px; }
#odds-grid .table-responsive { overflow-x: auto; }
@media (max-width: 992px) { #odds-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 576px) { #odds-grid { grid-template-columns: 1fr; } }

/* Optimization for Smart Bet Cards - Apply to INDIVIDUAL cards, not containers */
.highlight-card,
.arbitrage-card {
    /* Skip rendering work for off-screen items */
    content-visibility: auto;
    
    /* Estimate height of 1 card to prevent scroll jumping */
    contain-intrinsic-size: 200px;
}

/* The remainder of styles (Why, stories, highlights, charts, legends, banners, responsive tweaks, etc.) were moved here one-to-one from the template.
   For brevity in this snippet, they are omitted, but in your environment, they should include the full set of rules from the original inline blocks. */

/* Mobile Header - Sticky at top on mobile */
@media (max-width: 767px) {
    /* Hide desktop/tab navigation on mobile */
    ul.nav.primary-nav {
        display: none !important;
    }
    /* Mobile header styling - visible on mobile, matches calculator pages */
    .mobile-header,
    .navbar.navbar-expand-lg {
        position: sticky;
        top: 0;
        z-index: 999;
        background: var(--primary-color) !important;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        padding: 0.75rem 0;
    }
    
    .mobile-header .navbar-brand,
    .navbar.navbar-expand-lg .navbar-brand {
        font-weight: 800;
        font-size: 1.35rem;
        color: var(--text-primary) !important;
        letter-spacing: .2px;
    }
    
    .mobile-header .brand-logo,
    .navbar.navbar-expand-lg .brand-logo {
        width: 22px;
        height: 22px;
        object-fit: contain;
        display: inline-block;
        vertical-align: -4px;
    }
    
    .mobile-header .data-refresh-note,
    .navbar.navbar-expand-lg .data-refresh-note {
        color: var(--text-secondary);
        font-size: .85rem;
        font-weight: 500;
    }
}

/* Mobile Bottom Navigation Bar */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #fff;
        border-top: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-around;
        padding: 10px 0;
        z-index: 1050;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #6b7280;
        font-size: 0.75rem;
        width: 25%;
    }

    .mobile-nav-item i {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }

    .mobile-nav-item.active {
        color: #0f172a;
        font-weight: 600;
    }

    /* Add padding to main content to prevent it from being hidden behind the nav bar */
    body {
        padding-bottom: 80px;
    }

    .tab-content {
        padding-bottom: 20px;
    }
}


