/* THE TOWN - Thoroughbred Analysis Styles */
        
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #ffffff;
    font-size: 16px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.header {
    text-align: center;
    padding: 60px 0 40px 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 48px;
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.header .subtitle {
    font-size: 1.125rem;
    color: #666666;
    font-weight: 400;
}

.executive-summary {
    margin-bottom: 48px;
}

.section {
    margin-bottom: 48px;
}

.section h2 {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.section h3 {
    color: #1a1a1a;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 32px 0 16px 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 24px 0;
}

.metric-card {
    background: #ffffff;
    padding: 24px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    text-align: left;
}

.metric-card h4 {
    color: #666666;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.metric-description {
    font-size: 0.875rem;
    color: #666666;
    line-height: 1.4;
}

.content-box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 32px;
    margin: 24px 0;
}

.highlight-box {
    background: #fffdf0;
    border: 1px solid #f0d000;
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.confidence-badge {
    display: inline-block;
    background: #1a1a1a;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 2px 4px 2px 0;
}

.elite-badge {
    display: inline-block;
    background: #0070f3;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 2px 4px 2px 0;
}

ul {
    padding-left: 24px;
    margin: 16px 0;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.table-responsive {
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #f8fafb;
    color: #1a1a1a;
    font-weight: 500;
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

.conclusion {
    background: #1a1a1a;
    color: white;
    padding: 48px;
    border-radius: 8px;
    margin-top: 48px;
    text-align: center;
}

.conclusion h2 {
    color: white;
    margin-bottom: 24px;
    font-weight: 600;
}

.conclusion .metric-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.conclusion .metric-card h4 {
    color: rgba(255,255,255,0.7);
}

.conclusion .metric-value {
    color: white;
}

.conclusion .metric-description {
    color: rgba(255,255,255,0.8);
}

.footnote {
    font-size: 0.875rem;
    color: #666666;
    margin-top: 48px;
    padding: 24px;
    background: #f8fafb;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

strong {
    font-weight: 600;
}

p {
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Pedigree Chart Styles */
.pedigree-container {
    margin: 32px 0;
    background: #f8fafb;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    overflow-x: auto;
}

/* Hide only the inline pedigree container, not the modal version */
.section .pedigree-container {
    display: none;
}

.pedigree-chart {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    min-width: 1000px;
    align-items: center;
    transition: all 0.3s ease;
}

/* Expanded layout for when generation 5 is visible */
.pedigree-chart.expanded {
    grid-template-columns: 180px 160px 140px 120px 120px;
    min-width: 1200px;
    gap: 12px;
}

.pedigree-generation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gen-1 { 
    grid-column: 1;
    justify-self: center;
}
.gen-2 { 
    grid-column: 2;
    gap: 20px;
}
.gen-3 { 
    grid-column: 3;
    gap: 12px;
}
.gen-4 { 
    grid-column: 4;
    gap: 8px;
}
.gen-5 { 
    grid-column: 5;
    gap: 4px;
}

/* Improved spacing for expanded layout */
.pedigree-chart.expanded .gen-2 { gap: 16px; }
.pedigree-chart.expanded .gen-3 { gap: 10px; }
.pedigree-chart.expanded .gen-4 { gap: 6px; }
.pedigree-chart.expanded .gen-5 { gap: 3px; }

.horse-card {
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    max-width: 140px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Responsive card sizes for different generations */
.gen-5 .horse-card {
    min-width: 80px;
    max-width: 110px;
    min-height: 45px;
    padding: 6px;
    font-size: 0.8rem;
}

.pedigree-chart.expanded .gen-4 .horse-card {
    min-width: 85px;
    max-width: 115px;
    min-height: 50px;
}

.pedigree-chart.expanded .gen-5 .horse-card {
    min-width: 75px;
    max-width: 100px;
    min-height: 40px;
    padding: 4px;
    font-size: 0.75rem;
}

/* Inbreeding Analysis Styles */
.horse-card.inbreeding-contributor {
    border: 2px solid #ff6b35;
    background: linear-gradient(135deg, #fff 85%, #fff5f2 100%);
    position: relative;
}

.horse-card.inbreeding-contributor::after {
    content: "🧬";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b35;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.inbreeding-tooltip {
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 1000;
    max-width: 250px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.horse-card:hover {
    border-color: #0070f3;
    box-shadow: 0 4px 12px rgba(0,112,243,0.1);
    transform: translateY(-2px);
    cursor: pointer;
    background: #f8f9ff;
}

.horse-card::after {
    content: "ℹ️ Click/Hover for stats";
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
    background: white;
    padding: 2px 4px;
    border-radius: 2px;
    z-index: 10;
}

.horse-card:hover::after {
    opacity: 1;
}

.horse-card.subject {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: white;
    min-width: 160px;
}

.horse-card.subject:hover {
    border-color: #333;
    background: #333;
}

.horse-card.sire {
    border-left: 4px solid #0070f3;
}

.horse-card.dam {
    border-left: 4px solid #ff6b6b;
}

.horse-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 4px;
    line-height: 1.2;
}

.horse-details {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.3;
}

.horse-card.subject .horse-details {
    color: rgba(255,255,255,0.8);
}

/* Hidden state for horses */
.horse-card.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

/* Hover effects for interactive horses */
.horse-card[data-horse]:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 112, 243, 0.2);
    border-color: #0070f3;
}

.horse-card[data-horse]:active {
    transform: scale(0.95);
}

/* Visual indicator for expandable horses (DESKTOP ONLY) */
.desktop-pedigree .horse-card[data-horse]:not([data-horse="THE TOWN"])::after {
    content: '+';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 12px;
    font-weight: bold;
    color: #0070f3;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #0070f3;
}

.desktop-pedigree .horse-card[data-horse]:not([data-horse="THE TOWN"]):hover::after {
    opacity: 0.8;
}

/* Show minus when expanded (DESKTOP ONLY) */
.desktop-pedigree .horse-card.expanded::after {
    content: '−';
}

/* Remove hover effects from mobile pedigree */
.mobile-pedigree .horse-card[data-horse]:hover {
    transform: none;
    box-shadow: none;
    border-color: inherit;
}

.pedigree-chart {
    transition: grid-template-columns 0.3s ease;
}

/* Generation hiding transitions */
.pedigree-generation {
    transition: all 0.3s ease;
}

.pedigree-chart.expanded {
    grid-template-columns: 180px 160px 140px 120px 120px;
    min-width: 1200px;
    gap: 12px;
}

.modal-content.expanded {
    max-width: 1600px;
    width: 100vw;
    max-height: 90vh;
    height: auto;
    min-height: 600px;
}

.parent-generation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-column: 4;
    align-items: center;
}

/* Timeline Styles */
.timeline-new {
    display: flex;
    position: relative;
    gap: 20px;
    margin: 40px 0;
    padding: 0 20px;
    align-items: flex-start;
}

.timeline-new::before {
    content: '';
    position: absolute;
    bottom: 40px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #0070f3;
    z-index: 1;
}

.timeline-card {
    flex: 1;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin-bottom: 60px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.timeline-card::after {
    content: '';
    position: absolute;
    bottom: -31px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #0070f3;
    border: 4px solid white;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 0 2px #0070f3;
}

.phase-number {
    display: inline-block;
    background: #0070f3;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    line-height: 32px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.timeline-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.timeline-card p {
    color: #666;
    line-height: 1.5;
    font-size: 0.875rem;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.duration {
    background: #f8fafb;
    color: #1a1a1a;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

/* Pricing Table Styles */
.pricing-section {
    background: #f8fafb;
    padding: 40px;
    border-radius: 8px;
    margin: 48px 0;
    text-align: center;
}

.pricing-section h2 {
    color: #4a90e2;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.pricing-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin: 32px 0;
}

.pricing-table table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table th {
    background: #4a90e2;
    color: white;
    padding: 16px;
    font-weight: 600;
    text-align: center;
    font-size: 1rem;
}

.pricing-table td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
    font-size: 1rem;
}

.pricing-table tr:nth-child(even) td {
    background: #f8fafb;
}

.pricing-table tr:last-child td {
    border-bottom: none;
}

.pricing-table .ownership-col {
    background: #e8f4fd;
    font-weight: 600;
    color: #4a90e2;
}

.pricing-intro {
    font-size: 1.125rem;
    color: #1a1a1a;
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Pedigree Toggle Button */
.pedigree-toggle {
    background: #0070f3;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s ease;
    text-align: center;
}

.pedigree-toggle:hover {
    background: #0051a5;
    transform: translateY(-1px);
}

.pedigree-toggle:active {
    transform: translateY(0);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    border: none;
    outline: none;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 30px;
    border-radius: 12px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover,
.close:focus {
    color: #000;
}

/* Horse Stats Popup */
.horse-stats-popup {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    min-width: 320px;
    max-width: 450px;
    font-size: 14px;
    line-height: 1.5;
    pointer-events: none;
    max-height: 80vh;
    overflow-y: auto;
}

.horse-stats-popup.show {
    display: block !important;
    pointer-events: auto;
}

.horse-stats-popup h4 {
    margin: 0 0 16px 0;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: bold;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.horse-stats-popup .stats-content {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

/* Interactive horse names */
.horse-name-interactive, .horse-hover-tooltip {
    cursor: pointer !important;
    color: inherit;
    text-decoration: underline !important;
    text-decoration-style: solid !important;
    text-decoration-color: #999 !important;
    text-decoration-thickness: 1px !important;
    transition: all 0.2s ease;
    font-weight: inherit;
    padding: 0;
    border-radius: 0;
    background: transparent;
    -webkit-tap-highlight-color: rgba(53, 122, 189, 0.3);
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.horse-name-interactive:hover, .horse-hover-tooltip:hover,
.horse-name-interactive:active, .horse-hover-tooltip:active {
    color: #357abd !important;
    text-decoration-color: #357abd !important;
    text-decoration-style: solid !important;
}

/* Prevent text selection issues when making names interactive */
.horse-interactive {
    /* Allow normal text selection */
}

/* Horse Modal */
.horse-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1100;
    justify-content: center;
    align-items: center;
}

.horse-modal.show {
    display: flex;
}

.horse-modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 400px;
    margin: 20px;
}

.horse-modal h3 {
    margin-bottom: 16px;
    color: #1a1a1a;
}

.horse-modal-close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* Navigation Menu */
.nav-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: linear-gradient(180deg, #f8fafb 0%, #e9ecef 100%);
    padding: 0 0 20px 0;
    z-index: 100;
    overflow-y: auto;
}

.nav-ai-banner {
    background: #3d4449;
    color: white;
    text-align: center;
    padding: 20px 16px;
    font-size: 0.75rem;
    font-weight: 500;
    border-bottom: 1px solid #6c757d;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    height: 60px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu ul {
    list-style: none;
    padding: 0 0 0 16px;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-category {
    margin-bottom: 8px;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 8px;
    position: relative;
    box-sizing: border-box;
}

.category-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

.category-header.active {
    background: #e8f4fd;
    color: #1976d2;
    border-radius: 4px;
    border-left: 3px solid #4a90e2;
}

.category-header.active .category-title {
    color: #1976d2;
    font-weight: 600;
}

.category-header.active .chevron {
    color: #4a90e2;
}

.category-header.active:hover {
    background: #d4e8fc;
}

.chevron {
    font-size: 0.8rem;
    margin-right: 8px;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.category-header.collapsed .chevron {
    transform: rotate(-90deg);
}

.category-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    letter-spacing: 0.5px;
}

.category-items {
    margin-left: 24px;
    border-left: 2px solid #e9ecef;
    transition: all 0.3s ease;
    overflow: hidden;
    display: none; /* Start collapsed by default */
}

.category-items.nav-collapsed {
    display: none !important;
}

.category-items.collapsed {
    max-height: 0;
    opacity: 0;
}

.category-items:not(.collapsed) {
    max-height: 300px;
    opacity: 1;
}

.nav-menu a,
.nav-menu .nav-link {
    display: block;
    padding: 10px 24px;
    color: #495057;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-left: 8px;
}

.nav-menu a:hover,
.nav-menu .nav-link:hover {
    background: #f8f9fa;
    color: #343a40;
    border-left-color: #adb5bd;
}

.nav-menu a.active,
.nav-menu .nav-link.active {
    background: #e8f4fd;
    color: #1976d2;
    border-left-color: #4a90e2;
    font-weight: 500;
}

/* Tab Navigation */
.tab-navigation {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    background: #3d4449;
    border-bottom: 1px solid #6c757d;
    padding: 0 24px;
    z-index: 90;
    display: flex;
    gap: 0;
    height: 60px;
    box-sizing: border-box;
    align-items: center;
    justify-content: flex-start;
}

.tab-btn {
    background: none;
    border: none;
    padding: 16px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: #4dabf7;
    background: rgba(255, 255, 255, 0.15);
    border-bottom-color: #4dabf7;
}

.tab-content {
    display: none;
}

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

/* Main content with nav offset and tab offset */
.container {
    margin-left: 250px;
    margin-top: 60px;
    transition: margin-left 0.3s ease;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
    z-index: 250;
}

.mobile-nav-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #e9ecef;
    margin: 3px 0;
    transition: all 0.3s ease;
}

.mobile-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav-content {
    display: none;
    padding: 20px 0;
}

.desktop-nav-content {
    display: block;
}

.desktop-tab-buttons {
    display: flex;
    gap: 0;
    flex: 1;
}

.mobile-header-logo {
    display: none;
}

.mobile-nav-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 20px 24px;
    text-align: left;
    cursor: pointer;
    transition: background 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.mobile-nav-item:hover {
    background: #f8f9fa;
}

.mobile-nav-item:active {
    background: #e9ecef;
}

.mobile-nav-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.mobile-nav-subtitle {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    /* FORCE WHITE BACKGROUND ON MOBILE POPUP */
    .horse-stats-popup,
    .horse-stats-popup.show,
    #horseStatsPopup,
    #horseStatsPopup.show {
        background: white !important;
        background-color: white !important;
        background-image: none !important;
    }
    html {
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
    }

    .modal {
        box-shadow: none !important;
    }
    
    .horse-card {
        border: 1px solid #e5e5e5 !important;
        box-shadow: none !important;
    }
    
    .container {
        padding: 0 16px;
        margin-left: 0;
        margin-top: 60px;
    }
    
    .header {
        padding: 40px 0 30px 0;
        scroll-snap-align: start;
        scroll-margin-top: 60px;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
    }
    
    .metrics-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 20px;
        padding: 0 20px 0 24px;
        margin: 24px -16px 32px -8px;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
        position: relative;
    }

    .metrics-grid::-webkit-scrollbar {
        display: none;
    }

    .metric-card {
        flex: 0 0 300px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        padding: 24px;
        min-height: 160px;
        box-sizing: border-box;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        background: #ffffff;
        border: 1px solid #e5e5e5;
        position: relative;
        margin-bottom: 16px;
    }

    .metric-card h4 {
        font-size: 0.9rem;
        margin-bottom: 12px;
        letter-spacing: 0.03em;
    }
    
    .metric-card .metric-value {
        font-size: 2rem;
        margin-bottom: 8px;
        line-height: 1.1;
    }
    
    .metric-card .metric-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .metric-card:first-child::after {
        content: '→';
        position: absolute;
        right: 12px;
        bottom: 12px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        z-index: 10;
        opacity: 0.8;
        pointer-events: none;
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0%, 100% { opacity: 0.8; }
        50% { opacity: 0.4; }
    }

    .mobile-nav-toggle {
        display: flex;
        position: relative;
        z-index: 250;
    }

    .mobile-nav-content {
        display: block;
    }

    .desktop-nav-content {
        display: none !important;
    }

    .nav-menu {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .tab-navigation {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 0 16px;
        justify-content: flex-start;
        align-items: center;
        z-index: 300;
        background: #3d4449;
        border-bottom: 1px solid #6c757d;
    }

    .desktop-tab-buttons {
        display: none;
    }

    .mobile-header-logo {
        display: flex;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
        align-items: center;
    }

    .mobile-header-logo img {
        height: 28px;
        width: auto;
    }

    .section {
        scroll-snap-align: start;
        scroll-margin-top: 60px;
        margin-bottom: 56px;
        padding: 0 4px;
    }

    .executive-summary {
        margin: 32px 0 48px 0;
        line-height: 1.6;
        scroll-snap-align: start;
        scroll-margin-top: 60px;
    }

    .section h2 {
        font-size: 1.4rem;
        margin-bottom: 28px;
        line-height: 1.3;
    }
    
    .section h3 {
        font-size: 1.2rem;
        margin: 36px 0 20px 0;
        line-height: 1.3;
    }
    
    .section p {
        margin-bottom: 24px;
        font-size: 16px;
        line-height: 1.6;
    }

    .executive-summary p {
        margin-bottom: 28px;
        font-size: 16px;
        line-height: 1.7;
    }

    .mobile-restructured {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }

    .timeline-new {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 16px;
        padding: 0 16px;
        margin: 0 -16px;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
        position: relative;
    }

    .timeline-new::before {
        display: none;
    }

    .timeline-new::-webkit-scrollbar {
        display: none;
    }

    .timeline-card {
        flex: 0 0 300px;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        margin-bottom: 0;
        position: relative;
    }

    .timeline-card::after {
        display: none;
    }

    .timeline-new .timeline-card:first-child::after {
        content: '→' !important;
        position: absolute !important;
        right: 12px !important;
        top: 12px !important;
        left: auto !important;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        z-index: 10;
        opacity: 0.8;
        pointer-events: none;
        animation: pulse 2s infinite;
        text-align: initial !important;
        margin: 0 !important;
    }

    .pricing-section {
        padding: 24px;
    }

    .pricing-section h2 {
        font-size: 2rem;
    }

    .pricing-table {
        overflow-x: auto;
    }

    .pricing-table th,
    .pricing-table td {
        padding: 12px 8px;
        font-size: 0.875rem;
    }

    .content-box {
        padding: 28px 24px;
        margin: 32px 0;
        border-radius: 12px;
    }

    .executive-summary {
        padding: 28px 24px;
        margin: 36px 0 52px 0;
        line-height: 1.7;
    }

    .horse-stats-popup,
    .horse-stats-popup.show,
    #horseStatsPopup,
    #horseStatsPopup.show {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 85%;
        max-height: 75vh;
        overflow-y: auto;
        min-width: 300px;
        padding: 24px;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
        z-index: 10001;
        background-color: #ffffff !important;
        background: #ffffff !important;
        background-image: none !important;
        background-clip: border-box !important;
        border: 2px solid #e5e5e5;
        animation: mobilePopupSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    @keyframes mobilePopupSlideIn {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.8);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
    
    /* Mobile popup backdrop overlay - SIMPLIFIED */
    .horse-stats-popup.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        backdrop-filter: blur(2px);
        animation: backdropFadeIn 0.3s ease;
        pointer-events: none;
    }
    
    @keyframes backdropFadeIn {
        0% { opacity: 0; }
        100% { opacity: 1; }
    }
    
    /* Close button for mobile popup */
    .horse-stats-popup .mobile-close-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        background: rgba(0,0,0,0.1);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: #666;
        transition: all 0.2s ease;
    }
    
    .horse-stats-popup .mobile-close-btn:hover {
        background: rgba(0,0,0,0.2);
        color: #333;
    }

    .horse-stats-popup h4 {
        font-size: 22px;
        margin-bottom: 20px;
        position: relative;
        z-index: 10002;
        color: #1a1a1a !important;
    }

    .horse-stats-popup .stats-content {
        font-size: 16px;
        line-height: 1.7;
        position: relative;
        z-index: 10002;
        color: #333 !important;
    }

    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 5% auto;
        padding: 20px;
        border: none !important;
        outline: none !important;
    }

    .tab-btn {
        padding: 18px 16px;
        font-size: 0.875rem;
    }

    .nav-menu a,
    .nav-menu .nav-link {
        padding: 14px 24px;
        font-size: 0.9rem;
    }

    .nav-category {
        margin-bottom: 16px;
    }

    .category-header {
        padding: 12px 20px;
        font-size: 0.8rem;
    }

    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

    .nav-overlay.active {
        display: block;
    }

    /* Mobile Pedigree Styles */
    .desktop-pedigree {
        display: none !important;
    }
    
    .mobile-pedigree {
        display: block !important;
        padding: 16px;
        background: #f8fafb;
        border: none !important;
        border-radius: 8px;
        margin: 16px 0;
    }

    .pedigree-chart {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
        border: none !important;
        box-shadow: none !important;
    }

    .pedigree-table {
        border-collapse: separate;
        border-spacing: 2px;
        width: 100%;
        min-width: 480px;
        font-size: 0.7rem;
    }

    .pedigree-table td {
        padding: 2px;
        vertical-align: middle;
        border: 1px solid #ddd;
        color: #333 !important;
    }
    
    .pedigree-table .horse-card {
        color: #333 !important;
        padding: 4px 6px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.65rem;
        line-height: 1.1;
        font-weight: 500;
        border-radius: 3px;
        min-height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        word-break: break-word;
        hyphens: auto;
    }
    
    .pedigree-table small {
        color: #666 !important;
        font-size: 0.55rem;
        font-weight: normal;
        display: block;
    }

    .subject-cell {
        width: 120px;
        background: #f8f8f8;
        border: 2px solid #333;
    }

    .subject-cell .horse-card {
        font-size: 0.75rem;
        font-weight: bold;
        background: #f8f8f8;
        border: none;
    }

    .parent-cell {
        width: 90px;
        background: #fafafa;
    }

    .grandparent-cell {
        width: 80px;
        background: #fefefe;
    }

    .great-grandparent-cell {
        width: 70px;
        background: white;
    }

    .horse-card:hover {
        background: #f0f8ff;
        transform: translateY(-1px);
    }

    .horse-card.sire {
        background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
        border: 1px solid #4A90E2;
        color: #2c5f8a;
    }

    .horse-card.dam {
        background: linear-gradient(135deg, #fff0f8 0%, #ffe6f3 100%);
        border: 1px solid #E24A90;
        color: #a03568;
    }

    .horse-card.inbreeding-contributor {
        background: linear-gradient(135deg, #fff8f0 0%, #ffe6cc 100%) !important;
        border: 2px solid #FF8C00 !important;
        color: #b8650c !important;
        font-weight: bold !important;
        box-shadow: 0 0 0 1px rgba(255, 140, 0, 0.3);
    }

    .horse-card.sire:hover {
        background: #e0f0ff;
        border-color: #357ABD;
    }

    .horse-card.dam:hover {
        background: #ffe0f0;
        border-color: #B8357A;
    }

    .horse-card.inbreeding-contributor:hover {
        background: #ffeecc !important;
        border-color: #FF7700 !important;
    }

    .pedigree-modal .modal-content {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        margin: 2% auto;
        padding: 20px;
        overflow-y: auto;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    .pedigree-generation {
        min-width: 300px;
    }
}

/* Tablet responsive adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 0 20px;
    }
}

/* Large mobile/small tablet adjustments */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .header .subtitle {
        font-size: 0.9rem;
    }

    .tab-btn {
        padding: 16px 12px;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 98%;
        margin: 2% auto;
        padding: 15px;
    }

    .back-to-top-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: #0070f3;
        color: white;
        border: none;
        border-radius: 50%;
        font-size: 20px;
        font-weight: bold;
        cursor: pointer;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 112, 243, 0.3);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .back-to-top-btn.visible {
        opacity: 1;
        visibility: visible;
    }

    .back-to-top-btn:hover {
        background: #0051cc;
        transform: translateY(-2px);
    }
}

/* Hide back to top button on desktop */
@media (min-width: 769px) {
    .back-to-top-btn {
        display: none;
    }
    
    .mobile-restructured {
        display: none;
    }
    
    .desktop-only {
        display: block;
    }
    
    .desktop-pedigree {
        display: block !important;
    }
    
    .mobile-pedigree {
        display: none !important;
    }
}