:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --border-color: #334155;
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 98%;
    width: 98%;
    margin: 0 auto;
    padding: 1.25rem;
}

header {
    margin-bottom: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}

/* Control Panel */
.control-panel {
    margin-bottom: 2rem;
}

.status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    transition: background-color 0.3s ease;
}

.status-dot.active {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.status-details p {
    margin: 0;
}

.last-run {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.primary-btn {
    background-color: var(--accent-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.secondary-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    justify-content: space-between;
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    min-width: 220px;
}

.search-box input {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 2.2rem 0.75rem 2.4rem;
    border-radius: 8px;
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    pointer-events: none;
    user-select: none;
}

.search-clear-btn {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #f87171;
}

.dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

select {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    padding: 0.55rem 0.9rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.toggle-switch:hover {
    border-color: var(--accent-color);
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: #334155;
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    transition: transform 0.2s ease;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--accent-color);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(16px);
}

.toggle-text {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* Table */
.table-container {
    overflow-x: auto;
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

th {
    background-color: #0f172a;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    padding: 7px 12px;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 5px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.84rem;
    white-space: nowrap;
    line-height: 1.35;
}

/* Zebra striping - alternating darker/lighter rows */
tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.022);
}

tbody tr:nth-child(odd) {
    background-color: transparent;
}

tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.12) !important;
}

th {
    background-color: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    user-select: none;
}

th.sortable {
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.th-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.sort-indicator {
    font-size: 0.75rem;
    opacity: 0.3;
    transition: opacity 0.2s, color 0.2s;
}

th.sortable:hover .sort-indicator {
    opacity: 0.75;
}

th.sort-asc .sort-indicator,
th.sort-desc .sort-indicator {
    opacity: 1;
    color: #60a5fa;
    font-weight: bold;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Red Highlight for Best Performance (World Record) in Discipline */
tr.best-performance {
    background-color: rgba(239, 68, 68, 0.16) !important;
    border-left: 4px solid #ef4444;
}

tr.best-performance:hover {
    background-color: rgba(239, 68, 68, 0.26) !important;
}

tr.best-performance td.perf-cell {
    color: #fca5a5 !important;
    font-weight: 700;
}

.wr-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    text-transform: uppercase;
}

.top3-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.4px;
    vertical-align: middle;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
    text-transform: uppercase;
}

.nr-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
    text-transform: uppercase;
}

/* Count Column Pill */
.count-pill {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

.country-athletes-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 280px;
}

.country-athletes-list {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.35;
    max-height: 62px;
    overflow-y: auto;
    white-space: normal;
}

/* Country Flag */
.country-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.country-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

/* Wind Cell & Strength Bar */
.wind-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 46px;
}

.wind-val {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.1;
}

.wind-pos .wind-val {
    color: #34d399;
}

.wind-neg .wind-val {
    color: #f87171;
}

.wind-zero .wind-val {
    color: #94a3b8;
}

.wind-bar-track {
    width: 44px;
    height: 4px;
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    overflow: hidden;
}

.wind-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.wind-pos .wind-bar-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.wind-neg .wind-bar-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.wind-zero .wind-bar-fill {
    background: #64748b;
}

/* Column Header Filters */
.th-filter-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 5px;
}

.th-filter-select {
    background-color: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    font-size: 0.72rem;
    padding: 2px 4px;
    border-radius: 5px;
    max-width: 115px;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.th-filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.th-filter-select.active-filter {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.16);
    color: #ffffff;
}

.th-filter-clear {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1;
    padding: 2px 5px;
    cursor: pointer;
    flex-shrink: 0;
}

.th-filter-clear:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
        min-width: 100%;
    }

    .dropdowns {
        width: 100%;
    }

    .dropdowns select,
    .toggle-switch {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .actions {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: 0.5rem;
    }

    .actions button {
        flex: 1 1 calc(33.333% - 0.5rem);
    }
}

@media (max-width: 600px) {

    .dropdowns select,
    .toggle-switch {
        flex: 1 1 100%;
    }

    .actions button {
        flex: 1 1 100%;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.icon-btn {
    padding: 0.5rem 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.icon-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.clickable:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Header Credit */
.header-source-credit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

.header-source-credit a {
    color: var(--accent-color);
    text-decoration: none;
}

.header-source-credit a:hover {
    text-decoration: underline;
}

/* Athlete Filter Bar */
.athlete-filter-bar {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.athlete-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.athlete-bar-header .bar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}

.text-btn {
    background: none;
    border: none;
    color: #f87171;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.text-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
    text-decoration: underline;
}

.athlete-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.athlete-chip {
    display: inline-flex;
    align-items: center;
    background-color: #1e293b;
    border: 1px solid #3b82f6;
    border-radius: 20px;
    padding: 0.25rem 0.6rem 0.25rem 0.8rem;
    font-size: 0.85rem;
    gap: 0.4rem;
    color: #f8fafc;
    transition: all 0.2s ease;
}

.athlete-chip.disabled {
    background-color: #0f172a;
    border-color: #475569;
    color: #64748b;
    opacity: 0.6;
}

.athlete-chip .chip-name {
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.athlete-chip.disabled .chip-name {
    text-decoration: line-through;
}

.athlete-chip .chip-only-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 700;
}

.athlete-chip .chip-only-btn:hover {
    background: #3b82f6;
    color: white;
}

.athlete-chip .chip-remove-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

.athlete-chip .chip-remove-btn:hover {
    color: #ef4444;
}

.chip-color-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Dynamic Search Athlete Results Dropdown */
.search-sidebar-group,
.athlete-selector-group {
    position: relative;
}

.athlete-multiselect {
    position: relative;
    width: 100%;
}

.athlete-multiselect-input-wrap {
    display: flex;
    align-items: center;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.3rem 0.45rem 0.3rem 0.65rem;
    gap: 0.35rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.athlete-multiselect-input-wrap:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.athlete-multiselect-input-wrap input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    padding: 0.2rem 0;
}

.athlete-multiselect-input-wrap input::placeholder {
    color: var(--text-secondary);
}

.athlete-selector-clear,
.athlete-selector-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background-color 0.15s;
}

.athlete-selector-clear:hover,
.athlete-selector-toggle:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.athlete-selector-dropdown {
    margin-top: 0.35rem;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    z-index: 30;
}

.athlete-selector-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
    font-size: 0.83rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.athlete-selector-item:last-child {
    border-bottom: none;
}

.athlete-selector-item:hover {
    background-color: rgba(59, 130, 246, 0.14);
}

.athlete-selector-item.selected {
    background-color: rgba(16, 185, 129, 0.12);
}

.athlete-selector-checkbox {
    width: 15px;
    height: 15px;
    accent-color: #10b981;
    cursor: pointer;
    flex-shrink: 0;
}

.athlete-selector-empty {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.search-athlete-results {
    margin-top: 0.45rem;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 230px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.search-athlete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.48rem 0.65rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 0.84rem;
    transition: background-color 0.15s ease;
}

.search-athlete-item:last-child {
    border-bottom: none;
}

.search-athlete-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.search-athlete-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.search-athlete-name {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-athlete-meta {
    color: var(--text-secondary);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-add-to-filter {
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.45);
    color: #93c5fd;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-add-to-filter:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-add-to-filter.added {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
}

.btn-add-to-filter.added:hover {
    background: rgba(16, 185, 129, 0.3);
}

/* Sidebar Selected Athletes List */
.sidebar-selected-athletes {
    margin-top: 0.6rem;
    padding: 0.6rem 0.7rem;
    background-color: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.selected-athletes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sidebar-athlete-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sidebar-athlete-chips .athlete-chip {
    padding: 0.2rem 0.5rem 0.2rem 0.55rem;
    font-size: 0.78rem;
    gap: 0.32rem;
}

/* Add to filter button in table row */
.btn-filter-add {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border-radius: 4px;
    font-size: 0.72rem;
    padding: 2px 5px;
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.15s ease;
    vertical-align: middle;
}

.btn-filter-add:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

.btn-raw-icon {
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 6px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.15s;
    vertical-align: middle;
}

.btn-raw-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

.btn-source-link {
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 4px;
    opacity: 0.65;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s, transform 0.15s;
    vertical-align: middle;
}

.btn-source-link:hover {
    opacity: 1;
    transform: scale(1.2);
}

.btn-source-link-sm {
    font-size: 0.78rem;
    text-decoration: none;
    margin-left: 5px;
    opacity: 0.7;
    display: inline-block;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-source-link-sm:hover {
    opacity: 1;
    transform: scale(1.2);
}

.event-cell-flex {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

/* Chart Header & Controls */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-header-titles {
    min-width: 220px;
    flex: 1 1 auto;
}

.chart-controls-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chart-toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.75rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.chart-toggle-switch:hover {
    border-color: var(--accent-color);
}

.chart-type-segmented {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.chart-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.chart-type-btn:hover {
    color: var(--text-primary);
    background: rgba(56, 189, 248, 0.1);
}

.chart-type-btn.active {
    background: var(--accent-color);
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

.chart-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    padding: 0.48rem 0.85rem;
    white-space: nowrap;
}

.chart-icon-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
}

.chart-wrapper {
    height: 360px;
    width: 100%;
}

/* Chart Fullscreen Mode */
.graph-view.chart-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 2500;
    margin: 0 !important;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.98);
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
}

.graph-view.chart-fullscreen .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
}

.graph-view.chart-fullscreen .chart-wrapper {
    flex: 1;
    min-height: 0;
    height: 100% !important;
}

/* Footer */
.app-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.app-footer a {
    color: var(--accent-color);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Modal for Raw Source */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 10000;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: 90vw;
    max-width: 1100px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    background-color: #1e293b;
    border-bottom: 1px solid var(--border-color);
}

.admin-badge {
    display: inline-block;
    background: #8b5cf6;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
}

.raw-url {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    word-break: break-all;
}

.raw-url a {
    color: #60a5fa;
    text-decoration: none;
}

.raw-url a:hover {
    text-decoration: underline;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: white;
}

.modal-stats {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background-color: #131d31;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.stat-pill {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.stat-pill.green {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.stat-pill.gray {
    background-color: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.stat-pill.blue {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.modal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #0b1120;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.raw-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    flex: 1 1 250px;
}

.raw-search-box input {
    background: none;
    border: none;
    color: white;
    outline: none;
    font-size: 0.85rem;
    width: 100%;
}

.raw-filters-radio {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.raw-filters-radio label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.raw-lines-container {
    flex: 1;
    overflow-y: auto;
    background-color: #020617;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 0.5rem 0;
    line-height: 1.5;
}

.raw-loading {
    padding: 3rem;
    text-align: center;
    color: #94a3b8;
    font-size: 1rem;
}

.raw-line {
    display: flex;
    align-items: flex-start;
    padding: 1px 1rem;
    white-space: pre;
}

.raw-line:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.raw-line-num {
    width: 50px;
    flex-shrink: 0;
    color: #475569;
    user-select: none;
    text-align: right;
    margin-right: 1.25rem;
}

.raw-line-content {
    flex: 1;
}

.raw-line-parsed {
    background-color: rgba(16, 185, 129, 0.08);
    border-left: 3px solid #10b981;
}

.raw-line-parsed .raw-line-content {
    color: #a7f3d0;
}

.raw-line-parsed:hover {
    background-color: rgba(16, 185, 129, 0.16);
}

.raw-line-skipped {
    color: #64748b;
    border-left: 3px solid transparent;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.5rem;
    background-color: #1e293b;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-footer a {
    color: #60a5fa;
    text-decoration: none;
}

/* Header Nav Actions */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav-action-btn {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #3b82f6;
    color: #60a5fa;
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-action-btn:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #60a5fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Points Column in Table */
.points-cell-content {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.points-badge {
    font-weight: 700;
    font-size: 0.9rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    letter-spacing: 0.3px;
}

.points-info-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.points-info-btn:hover {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
    transform: scale(1.15);
}

/* Raw viewer invalid row */
.stat-pill.red {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.invalid-filter-label {
    color: #fca5a5;
    font-weight: 600;
}

.raw-line-invalid {
    background-color: rgba(239, 68, 68, 0.15);
    border-left: 3px solid #ef4444;
}

.raw-line-invalid .raw-line-content {
    color: #fca5a5;
}

.raw-line-invalid:hover {
    background-color: rgba(239, 68, 68, 0.25);
}

.corrupted-tag {
    display: inline-block;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

/* All Stats Modal */
.all-stats-content {
    max-width: 1050px !important;
    width: 95% !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
}

.stats-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.all-stats-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #090e17;
    border-bottom: 1px solid var(--border-color);
}

.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
}

.summary-card.green {
    border-color: rgba(16, 185, 129, 0.4);
}

.summary-card.green .summary-val {
    color: #34d399;
}

.summary-card.red {
    border-color: rgba(239, 68, 68, 0.4);
}

.summary-card.red .summary-val {
    color: #f87171;
}

.summary-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f8fafc;
}

.summary-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.all-stats-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #0b1120;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.all-stats-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: #f8fafc;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
}

.bad-only-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #fca5a5;
    cursor: pointer;
    user-select: none;
}

.all-stats-table-wrapper {
    flex: 1;
    overflow-y: auto;
    background: #020617;
}

.all-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.all-stats-table th {
    position: sticky;
    top: 0;
    background: #0f172a;
    color: #94a3b8;
    text-align: left;
    padding: 0.7rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.all-stats-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.all-stats-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.all-stats-table tr.has-bad-rows {
    background: rgba(239, 68, 68, 0.06);
}

.source-url-link {
    color: #60a5fa;
    text-decoration: none;
    font-family: monospace;
    font-size: 0.8rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.source-url-link:hover {
    text-decoration: underline;
    color: #93c5fd;
}

.badge-count-good {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-count-bad {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-count-zero {
    color: #64748b;
    font-size: 0.8rem;
}

.btn-table-action {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-table-action:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* Score / Points Breakdown Modal */
.score-modal-content {
    max-width: 650px !important;
    width: 92% !important;
}

.score-badge {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.score-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 75vh;
    overflow-y: auto;
}

.score-hero {
    text-align: center;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.score-hero-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

.score-hero-pts {
    font-size: 2.8rem;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1.1;
    margin: 0.3rem 0;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.score-hero-pts .pts-unit {
    font-size: 1.3rem;
    font-weight: 500;
    color: #94a3b8;
}

.score-hero-perf {
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 600;
}

.formula-box {
    background: #090e17;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.formula-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.formula-code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fde047;
    letter-spacing: 0.5px;
}

.formula-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.3rem;
}

.score-coefficients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.coef-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
}

.coef-item.highlight {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.05);
}

.coef-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.coef-val {
    font-family: monospace;
    font-size: 0.88rem;
    font-weight: 600;
    color: #f8fafc;
    word-break: break-all;
}

.score-steps {
    background: #090e17;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-steps h4 {
    margin: 0 0 0.3rem 0;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.step-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #94a3b8;
    font-family: monospace;
}

.step-row.sum-row {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.4rem;
    margin-top: 0.2rem;
    font-weight: 600;
    color: #e2e8f0;
}

.step-row.final-row {
    font-size: 0.95rem;
    font-weight: 700;
    color: #38bdf8;
}

.score-credits {
    font-size: 0.78rem;
    color: #64748b;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    line-height: 1.5;
}

.score-credits a {
    color: #60a5fa;
    text-decoration: none;
}

.score-credits a:hover {
    text-decoration: underline;
}


/* Compact Single-Row Crawler Bar */
.crawler-compact-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    margin-bottom: 1rem;
    gap: 1.25rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.compact-bar-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.compact-label {
    color: #94a3b8;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.compact-val {
    color: #e2e8f0;
    font-weight: 600;
}

.compact-val-highlight {
    color: #38bdf8;
    font-weight: 700;
    font-size: 0.95rem;
}

.compact-bar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
}

.compact-bar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.compact-btn {
    padding: 0.35rem 0.85rem !important;
    font-size: 0.82rem !important;
    border-radius: 6px !important;
}

.console-toggle-btn {
    border-color: #475569;
    color: #cbd5e1;
}

.console-toggle-btn:hover {
    background: #334155;
    color: white;
}

.console-drawer {
    margin-bottom: 1rem;
    background: #000;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    animation: fadeIn 0.2s ease-in-out;
}

.console-log-box {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    color: #0f0;
    padding: 0.8rem 1rem;
    height: 120px;
    overflow-y: auto;
}

/* Athlete Name Cell and Card Button */
.athlete-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.athlete-name-link {
    font-weight: 500;
}

.btn-athlete-card {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
    width: 21px;
    height: 21px;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.btn-athlete-card:hover {
    background: #3b82f6;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Athlete Profile Card Modal */
.athlete-card-content {
    max-width: 1050px !important;
    width: 95% !important;
    max-height: 92vh !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    background: #0b1120;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.athlete-modal-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.athlete-hero-flex {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.athlete-avatar-wrapper {
    width: 175px;
    height: 175px;
    flex-shrink: 0;
    border-radius: 22px;
    overflow: hidden;
    border: 3px solid #38bdf8;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.athlete-avatar-wrapper:hover {
    transform: scale(1.03);
}

.athlete-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
    cursor: zoom-in;
}

/* Full-Res Athlete Photo Lightbox */
.photo-lightbox-modal {
    z-index: 10050;
}

.photo-lightbox-modal .modal-backdrop {
    background-color: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(6px);
}

.photo-lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 10052;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(15, 23, 42, 0.88);
    color: #f8fafc;
    font-size: 1.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.photo-lightbox-close:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(248, 113, 113, 0.8);
    transform: scale(1.06);
}

.photo-lightbox-content {
    position: relative;
    z-index: 10051;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.photo-lightbox-img {
    max-width: 90vw;
    max-height: 84vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
    background: #0f172a;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.photo-lightbox-caption {
    margin-top: 0.75rem;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
    pointer-events: auto;
}

.photo-lightbox-spinner {
    position: absolute;
    width: 42px;
    height: 42px;
    border: 3px solid rgba(56, 189, 248, 0.25);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: photoLightboxSpin 0.8s linear infinite;
}

@keyframes photoLightboxSpin {
    to {
        transform: rotate(360deg);
    }
}

.athlete-avatar-fallback {
    font-size: 3.2rem;
    font-weight: 700;
    color: #38bdf8;
    user-select: none;
}

.athlete-hero-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.athlete-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.athlete-title-row h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #f8fafc;
}

.athlete-meta-row {
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-dot {
    color: #475569;
}

.athlete-bio-snippet {
    margin: 0.2rem 0 0 0;
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.4;
    max-width: 650px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.athlete-external-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.ext-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid #334155;
    text-decoration: none;
    transition: all 0.15s ease;
}

.ext-profile-link:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    transform: translateY(-1px);
}

.athlete-header-right {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

.ac-header-activity-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ac-header-activity-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-header-activity-canvas-wrap {
    position: relative;
    height: 78px;
    width: 100%;
}

.athlete-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-export-4k {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border: 1px solid #38bdf8;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
    transition: all 0.2s ease;
}

.btn-export-4k:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.5);
}

.athlete-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-title-row h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #f8fafc;
}

.badge-accent {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.ac-table-wrapper {
    background: #090e17;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
}

.ac-pb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    white-space: nowrap;
}

.ac-pb-table th {
    background: #0f172a;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.ac-pb-table td {
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.ac-pb-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.athlete-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1.25rem;
}

.athlete-progressions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.ac-progression-tile .ac-canvas-wrap {
    height: 195px;
    min-height: 195px;
}

.ac-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ac-tile-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}

@media (max-width: 820px) {
    .athlete-card-content {
        width: 96vw !important;
        max-height: 94vh !important;
        overflow-y: auto;
    }
    .athlete-modal-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        position: relative;
        gap: 0.85rem;
    }
    .athlete-hero-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
        padding-top: 2rem;
    }
    .athlete-avatar-wrapper {
        width: 120px;
        height: 120px;
        border-radius: 18px;
    }
    .athlete-avatar-fallback {
        font-size: 2.4rem;
    }
    .athlete-hero-info {
        align-items: center;
        width: 100%;
    }
    .athlete-title-row {
        justify-content: center;
    }
    .athlete-title-row h2 {
        font-size: 1.35rem;
    }
    .athlete-meta-row {
        justify-content: center;
        flex-wrap: wrap;
    }
    .athlete-bio-snippet {
        -webkit-line-clamp: 3;
        max-width: 100%;
    }
    .athlete-external-links {
        justify-content: center;
    }
    .athlete-header-right {
        width: 100%;
        flex-direction: column;
        margin-left: 0;
        gap: 0.75rem;
    }
    .ac-header-activity-box {
        width: 100%;
    }
    .athlete-header-actions {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        gap: 0.5rem;
    }
    .btn-export-4k {
        padding: 0.35rem 0.7rem;
        font-size: 0.78rem;
    }
    .athlete-modal-body {
        overflow-y: visible;
        flex: none;
        padding: 1rem;
        gap: 1.25rem;
    }
    .section-title-row {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .athlete-progressions-grid {
        grid-template-columns: 1fr;
    }
    .athlete-modal-footer {
        flex-direction: column;
        gap: 0.6rem;
        text-align: center;
        padding: 0.85rem 1rem;
    }
}

.ac-chart-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.chart-box-header {
    margin-bottom: 0.75rem;
}

.chart-box-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #f8fafc;
}

.chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.ac-canvas-wrap {
    position: relative;
    height: 220px;
    width: 100%;
}

.athlete-modal-footer {
    padding: 0.9rem 1.5rem;
    background: #1e293b;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.athlete-modal-footer a {
    color: #60a5fa;
    text-decoration: none;
}


/* ==========================================================================
   Vertical Collapsible Sidebar Layout & Fast Controls
   ========================================================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

.app-sidebar {
    width: 340px;
    min-width: 340px;
    max-width: 340px;
    flex-shrink: 0;
    background: #0f172a;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: width 0.25s ease, min-width 0.25s ease, margin-left 0.25s ease, transform 0.25s ease;
    z-index: 100;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.35);
}

.app-sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin-left: 0 !important;
    border-right: none !important;
    overflow: hidden !important;
    visibility: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.45);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.brand-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.4));
}

.sidebar-toggle-btn {
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #334155;
    color: #fff;
    border-color: #3b82f6;
}

.sidebar-nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #0b1120;
}

.nav-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.4rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab-btn.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    font-weight: 600;
}

.sidebar-scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
}

.sidebar-scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scrollable-content::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.sidebar-footer {
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.95);
    font-size: 0.76rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.45;
    flex-shrink: 0;
}

.sidebar-footer a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 500;
}

.sidebar-footer a:hover {
    text-decoration: underline;
}

.sidebar-footer-sub {
    font-size: 0.72rem;
    color: #64748b;
}

.sidebar-tab-pane {
    display: none;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.sidebar-tab-pane.active {
    display: flex;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.sidebar-group select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-sidebar-group {
    position: relative;
}

.search-sidebar-group .search-box {
    min-width: 0;
    width: 100%;
}

.search-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 0.3rem);
    left: 0;
    right: 0;
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 290px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    z-index: 60;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
    font-size: 0.83rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background-color: rgba(59, 130, 246, 0.18);
}

.search-suggestion-name {
    color: var(--text-primary, #f8fafc);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggestion-meta {
    color: #94a3b8;
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-suggestion-meta.type-city {
    color: #7dd3fc;
}

.search-suggestion-meta.type-athlete {
    color: #86efac;
}

.search-suggestion-meta.type-event {
    color: #fcd34d;
}

.search-suggestions-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #1e293b;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.65rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.7);
    user-select: none;
}

.sidebar-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #94a3b8;
}

.gender-segmented-control {
    display: flex;
    gap: 0.4rem;
    width: 100%;
}

.btn-gender-pill {
    flex: 1;
    padding: 0.5rem 0.3rem;
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-gender-pill:hover {
    border-color: #60a5fa;
    color: #f8fafc;
    background: #26334d;
}

.btn-gender-pill.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #3b82f6;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.quick-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(32px, auto);
    gap: 0.4rem;
}

.quick-preset-chip {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.55rem;
    background: #172033;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.2;
    color: #cbd5e1;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-preset-chip:hover {
    background: #1e293b;
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-1px);
}

.quick-preset-chip.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    color: #38bdf8;
    font-weight: 600;
}

.event-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.event-filter-wrapper select {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    max-width: 100%;
}

.btn-raw-quick,
.btn-orig-quick {
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.52rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-raw-quick {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.btn-raw-quick:hover {
    background: #38bdf8;
    color: #0f172a;
}

.btn-orig-quick {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    text-decoration: none;
}

.btn-orig-quick:hover {
    background: #10b981;
    color: #0f172a;
}

.toggles-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.4);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sidebar-actions-col {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.4rem;
}

.reset-btn-wide,
.all-stats-btn-wide {
    width: 100%;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.55rem;
}

.exports-group {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.exports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.btn-export {
    font-size: 0.78rem;
    padding: 0.45rem;
    text-align: center;
    justify-content: center;
}

.all-export {
    border-color: #8b5cf6 !important;
    color: #c4b5fd !important;
}

.all-export:hover {
    background: #8b5cf6 !important;
    color: #fff !important;
}

/* Crawler Tab in Sidebar */
.crawler-sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crawler-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.65rem;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
}

.crawler-stat-item .c-label {
    color: var(--text-secondary);
}

.crawler-stat-item .c-val {
    color: #f1f5f9;
}

.crawler-stat-item .c-val.highlight {
    color: #38bdf8;
    font-size: 0.9rem;
}

.btn-crawl-start {
    width: 100%;
    justify-content: center;
    padding: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.crawler-console-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

.btn-console-copy {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 5px;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0.22rem 0.45rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-console-copy:hover {
    background: rgba(51, 65, 85, 0.95);
    border-color: rgba(56, 189, 248, 0.6);
    color: #f8fafc;
}

.sidebar-console-log {
    background: #020617;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.75rem;
    color: #22c55e;
    height: 380px;
    min-height: 180px;
    resize: vertical;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* About Tab in Sidebar */
.about-sidebar-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.about-sidebar-card h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #f8fafc;
}

.about-features-list {
    margin: 0.25rem 0 0 1.2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.about-features-list li {
    font-size: 0.8rem;
}

.about-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.about-source-item {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
}

.about-source-item .source-title {
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
}

.about-source-item .source-desc {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.about-source-item a {
    color: #60a5fa;
    text-decoration: underline;
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.75rem;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.sidebar-open-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 99;
    background: #2563eb;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.sidebar-open-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-add-athlete-filter {
    padding: 0.14rem 0.42rem;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.25;
}

.btn-add-athlete-filter:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    transform: translateY(-1px);
}

.btn-add-athlete-filter.added {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.55);
    color: #34d399;
}

.athlete-bar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.athlete-apply-toggle {
    margin: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid #334155;
}

.athlete-apply-toggle .toggle-text {
    font-size: 0.74rem;
    font-weight: 700;
    min-width: 28px;
}

.athlete-filter-bar.filter-paused {
    border-color: rgba(148, 163, 184, 0.35);
    opacity: 0.92;
}

.athlete-filter-bar.filter-active {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.12);
}

.main-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.55rem;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.03em;
}

.lang-btn:hover {
    color: #f8fafc;
    background: rgba(51, 65, 85, 0.5);
}

.lang-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.about-links-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.about-links-list li {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(51, 65, 85, 0.7);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.about-links-list li a {
    color: #38bdf8;
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
}

.about-links-list li a:hover {
    text-decoration: underline;
}

.about-links-list li .link-desc {
    display: block;
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.main-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.main-title-block h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #f8fafc;
}

.main-subtitle {
    margin: 0.2rem 0 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.credit-span a {
    color: #60a5fa;
    text-decoration: none;
}

.credit-span a:hover {
    text-decoration: underline;
}

/* Make Table Container stretch properly */
.table-container {
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 480px;
    max-height: calc(100vh - 230px);
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#records-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
}

/* Reset Filters Buttons & Icons */
.sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sidebar-icon-btn {
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.sidebar-icon-btn:hover {
    background: #334155;
    color: #38bdf8;
    border-color: #38bdf8;
    transform: rotate(180deg);
}

.main-top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-topbar-reset {
    font-size: 0.82rem;
    padding: 0.45rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-color: #475569;
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.btn-topbar-reset:hover {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.btn-topbar-reset:hover .icon,
.reset-btn-wide:hover .icon {
    display: inline-block;
    transform: rotate(180deg);
    transition: transform 0.35s ease;
}

.floating-top-controls {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.floating-reset-btn {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.floating-reset-btn:hover {
    background: #334155;
    color: #38bdf8;
    border-color: #38bdf8;
    transform: translateY(-1px);
}

/* Mobile & Tablet Responsive Layout Fix (prevent left table clipping) */
@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-layout {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-sidebar {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        position: relative;
        top: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .app-sidebar.collapsed {
        margin-left: 0 !important;
        max-height: 0 !important;
        border-bottom: none;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        padding: 0.75rem;
        overflow-y: visible;
    }

    .table-container {
        display: block;
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        max-height: none;
        min-height: 280px;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    #records-table {
        width: max-content;
        min-width: 100%;
        margin: 0;
    }

    #records-table th,
    #records-table td {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
}

/* Export PIN Unlock Badge & Modal */
.exports-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.export-pin-badge {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 0.18rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s ease;
}

.export-pin-badge:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.export-pin-badge.unlocked {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
}

.pin-modal-content {
    max-width: 400px;
    width: 92%;
    height: auto !important;
    min-height: 0;
    max-height: 90vh;
}

.pin-modal-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pin-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.35rem;
    letter-spacing: 0.45em;
    text-align: center;
    background: #0b1120;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    box-sizing: border-box;
}

.pin-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.pin-error {
    color: #f87171;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

/* Red Reset Filters Button (Sidebar Top & Main Topbar) */
.sidebar-top-reset-wrap {
    margin-bottom: 0.65rem;
}

.btn-reset-red {
    background: rgba(239, 68, 68, 0.16) !important;
    border: 1px solid rgba(239, 68, 68, 0.7) !important;
    color: #fecaca !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.18s ease;
}

.btn-reset-red:hover {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-reset-gray {
    background: rgba(51, 65, 85, 0.35) !important;
    border: 1px solid rgba(100, 116, 139, 0.45) !important;
    color: #94a3b8 !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.18s ease;
}

.btn-reset-gray:hover {
    background: rgba(71, 85, 105, 0.55) !important;
    border-color: #94a3b8 !important;
    color: #e2e8f0 !important;
}

.filter-active-border {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35) !important;
}

.gender-segmented-control.filter-active-border {
    border: 1px solid #ef4444 !important;
    border-radius: 8px;
    padding: 2px;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35) !important;
}

.search-compact-group {
    margin-top: -0.25rem;
    flex: 0 0 auto !important;
}

.search-compact-group .search-box {
    flex: 0 0 auto !important;
}

.athlete-multiselect-input-wrap .search-icon {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    flex-shrink: 0;
    pointer-events: none;
}

/* Multi-Select Filter Label Row & Inline Reset */
.filter-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.filter-label-row .sidebar-label {
    margin-bottom: 0;
}

.filter-inline-reset {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.55);
    color: #fca5a5;
    border-radius: 5px;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-inline-reset:hover:not(:disabled) {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.filter-inline-reset:disabled {
    opacity: 0.35;
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: default;
}

.filter-multiselect {
    position: relative;
}

.filter-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.48rem;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 999px;
    color: #e0f2fe;
    font-size: 0.74rem;
    font-weight: 500;
}

.filter-chip button {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.1rem;
}

.filter-chip button:hover {
    color: #f87171;
}

.year-multiselect-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.52rem 0.75rem;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease;
}

.year-multiselect-trigger:hover {
    border-color: var(--accent-color);
}

.year-multiselect-trigger .trigger-arrow {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.year-dropdown-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(30px, auto);
    gap: 3px;
    padding: 0.4rem;
}

.year-dropdown-grid .athlete-selector-item {
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.2;
    min-height: 30px;
    justify-content: flex-start;
}

.year-range-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.year-range-input {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.4rem 0.55rem;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: inherit;
}

.year-range-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.year-range-sep {
    color: var(--text-secondary);
    font-weight: 600;
}

.event-combobox-item {
    padding: 0.45rem 0.7rem;
    font-size: 0.83rem;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.12s;
}

.event-combobox-item:hover {
    background: rgba(56, 189, 248, 0.14);
}

.event-combobox-item.active {
    background: rgba(56, 189, 248, 0.22);
    color: #38bdf8;
    font-weight: 600;
}

/* Table Centered Loading Spinner Overlay */
.table-container {
    position: relative;
}

.table-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    border-radius: inherit;
}

.table-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(56, 189, 248, 0.22);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: table-spin 0.75s linear infinite;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

@keyframes table-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sidebar Bottom PIN-Protected Batch 4K Export */
.sidebar-batch-export-group {
    margin-top: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(51, 65, 85, 0.7);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-all-disciplines-4k {
    width: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(56, 189, 248, 0.55);
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.2);
    transition: all 0.2s ease;
    text-align: center;
}

.btn-all-disciplines-4k:hover:not(:disabled) {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
}

.btn-all-disciplines-4k.unlocked {
    border-color: rgba(16, 185, 129, 0.7);
    color: #6ee7b7;
}

.btn-all-disciplines-4k:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.batch-export-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.batch-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    font-size: 0.74rem;
    color: #cbd5e1;
}

.batch-progress-status {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(56, 189, 248, 0.25);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: table-spin 0.75s linear infinite;
    flex-shrink: 0;
    display: inline-block;
}

.batch-progress-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #38bdf8;
    flex-shrink: 0;
}

.batch-progress-track {
    width: 100%;
    height: 9px;
    background: rgba(30, 41, 59, 0.9);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(51, 65, 85, 0.7);
}

.batch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #3b82f6, #10b981);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    flex-shrink: 0;
}

/* =========================================================================
   Experimental: Export Movie Timeline Button & Modal
   ========================================================================= */

.btn-movie-timeline {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.86rem;
    color: #fff;
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 45%, #ec4899 100%);
    border: 1px solid rgba(251, 191, 36, 0.45);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.22);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.btn-movie-timeline:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.38);
    filter: brightness(1.06);
}

.btn-movie-timeline:disabled {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(71, 85, 105, 0.45);
    color: #64748b;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.72;
}

.exp-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.65);
    color: #fcd34d;
    border: 1px solid rgba(252, 211, 77, 0.4);
}

.btn-movie-timeline:disabled .exp-badge {
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.35);
}

.exp-badge-lg {
    font-size: 0.68rem;
    padding: 0.18rem 0.55rem;
}

#movie-timeline-modal {
    align-items: flex-start !important;
    padding-top: 1.8vh !important;
    padding-bottom: 1.8vh !important;
}

#movie-timeline-modal .modal-content,
.modal-content.mt-modal-content,
.mt-modal-content {
    width: 95vw !important;
    max-width: 1240px !important;
    height: auto !important;
    max-height: 96vh !important;
    background: #0b1120 !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7) !important;
    overflow: hidden !important;
}

.mt-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mt-modal-body {
    padding: 1.05rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1.0rem;
    max-height: 89vh;
    overflow-y: auto;
}

.mt-rolling-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    margin-top: 0.15rem;
}

.mt-range-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mt-range-row .mt-select {
    flex: 1;
    min-width: 0;
}

.mt-range-sep {
    color: #64748b;
    font-weight: 700;
}

.mt-sub-pills {
    margin-top: 0.15rem;
}

.mt-error-box {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    font-size: 0.86rem;
}

.mt-config-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid #1e293b;
}

.mt-config-left {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    min-width: 180px;
}

.mt-config-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mt-config-save-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 100%;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(51, 65, 85, 0.7);
}

.mt-config-name-input {
    flex: 1 1 200px;
}

.mt-config-del-btn {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
}

#movie-timeline-modal .mt-form-grid,
.mt-form-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 1.15rem 1.35rem !important;
}

.mt-field-span-2 {
    grid-column: span 2 !important;
}

@media (max-width: 760px) {
    #movie-timeline-modal .mt-form-grid,
    .mt-form-grid {
        grid-template-columns: 1fr !important;
    }
    .mt-field-span-2 {
        grid-column: span 1 !important;
    }
}

.mt-field {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.mt-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mt-pill-group {
    display: flex;
    gap: 0.35rem;
    background: #0f172a;
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid #1e293b;
}

.mt-pill {
    flex: 1;
    padding: 0.45rem 0.5rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mt-pill:hover:not(:disabled) {
    color: #f8fafc;
    background: rgba(51, 65, 85, 0.5);
}

.mt-pill.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.mt-pill:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.mt-select,
.mt-input {
    width: 100%;
    padding: 0.52rem 0.75rem;
    border-radius: 9px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #f8fafc;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.mt-select:focus,
.mt-input:focus {
    border-color: #3b82f6;
}

.mt-hint {
    font-size: 0.73rem;
    color: #64748b;
}

.mt-bitrate-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mt-bitrate-row .mt-input {
    width: 96px;
}

.mt-unit-badge {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.mt-quick-chips {
    display: flex;
    gap: 0.32rem;
    flex-wrap: wrap;
}

.mt-chip {
    padding: 0.2rem 0.5rem;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mt-chip:hover {
    border-color: #60a5fa;
    color: #fff;
}

.mt-chip.active {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fcd34d;
}

.mt-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid #1e293b;
}

.mt-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mt-sum-lbl {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mt-summary-item strong {
    font-size: 1rem;
    color: #f8fafc;
    margin-top: 0.15rem;
}

.mt-progress-box {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.mt-badge-dim {
    color: #64748b;
    font-size: 0.78rem;
    margin-left: 0.25rem;
}

.mt-preview-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 560px;
    background: #050811;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #1e293b;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

#mt-preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

#mt-preview-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.mt-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.83rem;
    color: #e2e8f0;
    gap: 0.5rem;
}

.mt-progress-track {
    width: 100%;
    height: 10px;
    background: #1e293b;
    border-radius: 999px;
    overflow: hidden;
}

.mt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ec4899, #3b82f6);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.mt-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    color: #94a3b8;
}

.mt-done-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
    font-size: 0.88rem;
    font-weight: 500;
}

.mt-start-btn {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    border: none;
    color: #0f172a;
    font-weight: 700;
}

.mt-start-btn:hover:not(:disabled) {
    filter: brightness(1.08);
}

.mt-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pin-subtle {
    width: 100%;
    background: rgba(15, 23, 42, 0.55);
    border: 1px dashed rgba(100, 116, 139, 0.5);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-pin-subtle:hover {
    border-color: #38bdf8;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.85);
}

.mt-bulk-section {
    margin-top: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mt-bulk-header strong {
    color: #fbbf24;
    font-size: 0.92rem;
}

.mt-bulk-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
}

.mt-bulk-year-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 200px;
}

.mt-bulk-year-wrap .mt-input {
    max-width: 150px;
}

.mt-bulk-start-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 260px;
}

.mt-bulk-start-wrap .mt-select {
    max-width: 320px;
}

.mt-bulk-start-btn {
    white-space: nowrap;
}

.mt-bulk-skip-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.mt-bulk-skip-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mt-bulk-skip-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mt-bulk-skip-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.4;
    resize: vertical;
}

.mt-bulk-skip-textarea:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.7);
}

.mt-bulk-skip-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mt-bulk-skip-count {
    color: #fbbf24;
    font-weight: 600;
    white-space: nowrap;
}

/* ========================================================================= */
/* Interactive Chart Subpage ("Interaktívny graf All Time Top")             */
/* ========================================================================= */
.btn-interactive-chart {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.9), rgba(30, 64, 175, 0.88));
    color: #f0f9ff;
    font-weight: 700;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(14, 165, 233, 0.22);
}

.btn-interactive-chart:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.95), rgba(37, 99, 235, 0.95));
    box-shadow: 0 5px 16px rgba(56, 189, 248, 0.35);
}

.btn-interactive-chart:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    filter: grayscale(0.5);
    box-shadow: none;
}

.interactive-chart-subpage {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0.25rem;
}

.ic-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(51, 65, 85, 0.8);
}

.ic-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.ic-back-btn {
    padding: 0.42rem 0.8rem;
    font-size: 0.84rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ic-title-wrap {
    display: flex;
    flex-direction: column;
}

.ic-title-wrap h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.ic-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
}

.ic-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ic-ctrl-group {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.65);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.ic-pill {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.58rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ic-pill:hover:not(:disabled) {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.5);
}

.ic-pill.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 6px rgba(2, 132, 199, 0.45);
}

.ic-pill:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ic-canvas-stage {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 360px;
    background: #050811;
    border-radius: 14px;
    border: 1px solid rgba(51, 65, 85, 0.85);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.ic-canvas-stage:active {
    cursor: grabbing;
}

#ic-canvas {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 235px);
    aspect-ratio: 16 / 9;
    object-fit: contain;
    display: block;
}

.ic-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 17, 0.82);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    z-index: 10;
}

.ic-loading-text {
    color: #cbd5e1;
    font-size: 0.92rem;
    font-weight: 600;
}

.ic-error-box {
    position: absolute;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    background: rgba(127, 29, 29, 0.92);
    border: 1px solid #ef4444;
    color: #fecaca;
    font-size: 0.9rem;
    max-width: 80%;
    text-align: center;
    z-index: 11;
}

.ic-scrubber-bar {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(51, 65, 85, 0.85);
}

.ic-scrubber-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ic-step-btn,
.ic-play-btn {
    padding: 0.42rem 0.68rem;
    font-size: 0.85rem;
    line-height: 1;
    min-width: 34px;
}

.ic-slider-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ic-scrubber {
    width: 100%;
    accent-color: #f59e0b;
    cursor: pointer;
    height: 6px;
}

.ic-slider-ticks {
    position: relative;
    width: 100%;
    height: 36px;
    margin-top: 2px;
    pointer-events: auto;
    overflow: visible;
}

.ic-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.ic-tick-line {
    width: 1px;
    height: 5px;
    background: rgba(148, 163, 184, 0.45);
}

.ic-tick.major .ic-tick-line {
    width: 1.5px;
    height: 7px;
    background: rgba(245, 158, 11, 0.8);
}

.ic-tick-label {
    font-size: 0.65rem;
    line-height: 1;
    color: #94a3b8;
    white-space: nowrap;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
    transform: rotate(-45deg);
    transform-origin: top center;
}

.ic-tick.major .ic-tick-label {
    color: #e2e8f0;
    font-weight: 600;
}

.ic-tick:hover .ic-tick-label {
    color: #fbbf24;
}

.ic-slider-bounds {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    color: #94a3b8;
}

.ic-hint-label {
    color: #64748b;
}

.ic-current-badge {
    min-width: 84px;
    text-align: center;
    padding: 0.38rem 0.75rem;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    font-weight: 700;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.ic-controls-toggle-btn {
    display: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem 0.5rem;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

.ic-topbar.ic-controls-open .ic-toggle-chevron {
    transform: rotate(180deg);
}

.ic-toggle-chevron {
    display: inline-block;
    transition: transform 0.18s ease;
}

@media (max-width: 900px) {
    .ic-hint-label {
        display: none;
    }
    #ic-canvas {
        max-height: calc(100dvh - 260px);
    }
}

@media (max-width: 640px) {
    .interactive-chart-subpage {
        gap: 0.35rem;
        margin-top: 0;
        min-height: calc(100dvh - 76px);
    }
    .ic-topbar {
        padding: 0.38rem 0.5rem;
        gap: 0.38rem;
        border-radius: 10px;
    }
    .ic-topbar-left {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.4rem;
    }
    .ic-back-btn {
        padding: 0.28rem 0.5rem;
        font-size: 0.72rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .ic-title-wrap {
        flex: 1 1 auto;
        min-width: 0;
        text-align: center;
    }
    .ic-title-wrap h2 {
        font-size: 0.84rem;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ic-subtitle {
        font-size: 0.66rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ic-controls-toggle-btn {
        display: inline-flex;
        min-height: 30px;
    }
    .ic-controls {
        display: none;
        width: 100%;
        gap: 0.3rem;
        padding-top: 0.35rem;
        border-top: 1px solid rgba(51, 65, 85, 0.65);
    }
    .ic-topbar.ic-controls-open .ic-controls {
        display: flex;
    }
    .ic-ctrl-group {
        max-width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 2px;
        gap: 1px;
    }
    .ic-ctrl-group::-webkit-scrollbar {
        display: none;
    }
    #ic-xwindow-group .ic-pill:disabled {
        display: none;
    }
    .ic-pill {
        font-size: 0.68rem;
        padding: 0.22rem 0.42rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .ic-canvas-stage {
        min-height: 0;
        flex: 0 0 auto;
        border-radius: 8px;
        border-left: none;
        border-right: none;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        width: calc(100% + 0.5rem);
    }
    #ic-canvas {
        max-height: calc(100dvh - 185px);
    }
    .ic-scrubber-bar {
        flex-wrap: wrap;
        gap: 0.35rem 0.5rem;
        padding: 0.45rem 0.55rem;
        border-radius: 10px;
    }
    .ic-slider-wrap {
        order: 1;
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        gap: 0.1rem;
    }
    .ic-scrubber {
        height: 22px;
        margin: 0;
    }
    .ic-scrubber-actions {
        order: 2;
        flex: 0 0 auto;
    }
    .ic-step-btn,
    .ic-play-btn {
        padding: 0.32rem 0.55rem;
        font-size: 0.76rem;
        min-width: 32px;
        min-height: 32px;
    }
    .ic-current-badge {
        order: 3;
        margin-left: auto;
        min-width: 64px;
        padding: 0.24rem 0.5rem;
        font-size: 0.8rem;
    }
    .ic-slider-ticks {
        height: 18px;
        margin-top: 0;
        overflow: hidden;
    }
    .ic-tick-label {
        font-size: 0.58rem;
        transform: none;
        margin-top: 2px;
    }
    .ic-slider-bounds {
        font-size: 0.66rem;
    }
}

/* ========================================================================= */
/* View Mode Switcher (Table & Chart vs Heatmap) & Full-Area Heatmap         */
/* ========================================================================= */
.view-mode-segmented,
.heatmap-gran-segmented {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.view-mode-btn,
.heatmap-gran-btn {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.78rem;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.view-mode-btn:hover,
.heatmap-gran-btn:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.45);
}

.view-mode-btn.active,
.heatmap-gran-btn.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.92));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.drilldown-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #a7f3d0;
    font-size: 0.88rem;
    font-weight: 600;
}

.heatmap-view {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.heatmap-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1.15rem 1.25rem;
    gap: 0.85rem;
    min-height: calc(100vh - 150px);
}

.heatmap-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.heatmap-title-group h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #f8fafc;
}

.heatmap-subtitle {
    margin: 0.2rem 0 0 0;
    font-size: 0.86rem;
    color: #94a3b8;
}

.heatmap-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.heatmap-trend-select {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.heatmap-trend-select:hover,
.heatmap-trend-select:focus {
    border-color: rgba(16, 185, 129, 0.7);
    background: rgba(30, 41, 59, 0.9);
}

.heatmap-trend-select option {
    background: #0f172a;
    color: #f8fafc;
}

.heatmap-canvas-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 460px;
    width: 100%;
    background: #070d1b;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

#heatmap-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.heatmap-empty-msg {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.95rem;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 12px;
}

.heatmap-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(56, 189, 248, 0.6);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: #f8fafc;
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    white-space: nowrap;
}

.heatmap-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heatmap-legend-bar {
    width: 160px;
    height: 12px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(90deg, #0f2942 0%, #0ea5e9 30%, #10b981 60%, #f59e0b 82%, #ef4444 100%);
}

.altitude-perf-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    cursor: help;
}

.altitude-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.08rem 0.32rem;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    line-height: 1.1;
}


/* =========================================================================
   Versus Comparison View (1 to 4 athletes)
   ========================================================================= */
.versus-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.5rem;
}

.versus-card {
    background: var(--card-bg, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.versus-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.versus-title {
    margin: 0;
    font-size: 1.15rem;
    color: #f8fafc;
}

.versus-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

.versus-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.versus-picker-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.versus-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #0b1120;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 0.65rem;
    min-width: 280px;
    flex: 0 1 360px;
}

.versus-search-wrap .search-icon {
    position: static;
    transform: none;
    left: auto;
    top: auto;
    flex-shrink: 0;
    pointer-events: none;
}

.versus-search-wrap input {
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 0.86rem;
    padding: 0.55rem 0.25rem;
    width: 100%;
    outline: none;
}

.versus-selected-slots {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    flex: 1;
}

.versus-slot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid #38bdf8;
    color: #f8fafc;
    font-size: 0.83rem;
    font-weight: 600;
}

.versus-slot-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.versus-slot-remove {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

.versus-slot-remove:hover {
    color: #ef4444;
}

.versus-presets-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.versus-presets-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.versus-presets-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.versus-preset-chip {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(100, 116, 139, 0.45);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 0.3rem 0.72rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.versus-preset-chip:hover {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.versus-empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 2.5rem 1rem;
    font-size: 0.95rem;
}

.versus-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.versus-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.versus-section-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #f8fafc;
}

.versus-badge {
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
}

.versus-top-2col {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.35fr);
    gap: 1rem;
    align-items: stretch;
}

.versus-athletes-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.65rem;
    align-content: start;
}

.versus-ath-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    border-top: 3px solid #38bdf8;
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.7rem;
}

.versus-ath-photo-wrap {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #334155;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.versus-ath-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.versus-ath-avatar-fallback {
    font-weight: 700;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.versus-ath-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    flex: 1;
    min-width: 0;
}

.versus-ath-card-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: #f8fafc;
}

.versus-ath-info-btn {
    margin-left: auto;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 0.74rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.versus-ath-info-btn:hover {
    background: rgba(56, 189, 248, 0.3);
    border-color: #38bdf8;
    color: #f8fafc;
    transform: scale(1.08);
}

.versus-ath-card-meta {
    font-size: 0.76rem;
    color: #94a3b8;
}

.versus-years-canvas-wrap {
    position: relative;
    min-height: 210px;
    height: 100%;
    width: 100%;
}

.versus-3col-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.versus-3col-layout.versus-wide-pb {
    grid-template-columns: minmax(0, 1fr);
}

.versus-3col-layout.versus-wide-pb .versus-span-2 {
    grid-column: span 1;
    order: 1;
}

.versus-3col-layout.versus-wide-pb .versus-right-stack {
    order: 2;
}

.versus-3col-layout.versus-wide-pb .versus-charts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.versus-3col-layout.versus-wide-pb #versus-pb-table {
    width: 100%;
}

.versus-span-2 {
    grid-column: span 2;
}

.versus-right-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.versus-col-card {
    min-width: 0;
}

.versus-col-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.versus-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.versus-chart-tile {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    min-width: 0;
}

.versus-chart-tile.collapsed {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.versus-chart-tile.collapsed .versus-chart-tile-head {
    margin-bottom: 0;
}

.versus-chart-tile.collapsed .versus-chart-canvas-wrap {
    display: none;
}

.versus-chart-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #f8fafc;
    cursor: pointer;
    user-select: none;
}

.versus-collapsible-head {
    cursor: pointer;
    user-select: none;
}

.versus-collapse-icon {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: auto;
    transition: transform 0.15s ease;
}

.versus-card.collapsed #versus-pb-body {
    display: none;
}

.versus-chart-canvas-wrap {
    position: relative;
    height: 220px;
    width: 100%;
}

.versus-pb-best {
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a !important;
    font-weight: 700;
}

.versus-h2h-winner {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7 !important;
    font-weight: 700;
}

.versus-h2h-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.versus-h2h-pill {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    color: #e2e8f0;
}

.versus-h2h-full-card {
    width: 100%;
}

.versus-h2h-filters {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding: 0.25rem 0 0.1rem;
}

.versus-h2h-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.versus-h2h-filter-item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.versus-h2h-select {
    background: #0b1120;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #f8fafc;
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
    min-width: 180px;
    max-width: 280px;
    outline: none;
    cursor: pointer;
}

.versus-h2h-select:focus {
    border-color: var(--accent-color);
}

.versus-h2h-table-wrap {
    max-height: none;
    overflow-y: visible;
    overflow-x: auto;
}

.versus-h2h-table {
    width: 100%;
    min-width: 680px;
}

.versus-h2h-table th,
.versus-h2h-table td {
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .versus-top-2col {
        grid-template-columns: 1fr;
    }
    .versus-3col-layout {
        grid-template-columns: 1fr;
    }
    .versus-span-2 {
        grid-column: span 1;
    }
    .versus-3col-layout.versus-wide-pb .versus-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .versus-charts-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================================
   Meetings Overview & Nested Modals
   ========================================================================= */
.meetings-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.5rem;
}

.meetings-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #0b1120;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 0.65rem;
    min-width: 280px;
}

.meetings-search-box input {
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 0.85rem;
    padding: 0.5rem 0.5rem;
    width: 100%;
    outline: none;
}

.meetings-table th.sortable-th {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.meetings-table th.sortable-th:hover {
    color: #38bdf8;
}

.meetings-table tbody tr.meeting-row-clickable {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.meetings-table tbody tr.meeting-row-clickable:hover {
    background-color: rgba(56, 189, 248, 0.12);
}

.meeting-modal-content {
    max-width: 960px;
    width: 94%;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
}

.meeting-modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.meeting-event-modal-top {
    z-index: 1150 !important;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding-top: 0.35rem;
}

.meetings-filters-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.meetings-group-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.meetings-group-switch:hover {
    border-color: rgba(56, 189, 248, 0.55);
}

.meetings-group-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.meetings-switch-slider {
    position: relative;
    width: 34px;
    height: 18px;
    background: #334155;
    border-radius: 999px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.meetings-switch-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: transform 0.2s ease, background 0.2s ease;
}

.meetings-group-switch input:checked + .meetings-switch-slider {
    background: #0284c7;
}

.meetings-group-switch input:checked + .meetings-switch-slider::after {
    transform: translateX(16px);
    background: #f8fafc;
}

.meetings-switch-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
}

.meetings-category-select {
    background: #0b1120;
    border: 1px solid var(--border-color);
    color: #f8fafc;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.meetings-category-select:focus {
    border-color: #38bdf8;
}

.mcat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}
.mcat-OH { background: rgba(251, 191, 36, 0.18); color: #fde047; border-color: rgba(251, 191, 36, 0.45); }
.mcat-WC { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.45); }
.mcat-EC { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border-color: rgba(59, 130, 246, 0.45); }
.mcat-DL { background: rgba(6, 182, 212, 0.2); color: #67e8f9; border-color: rgba(6, 182, 212, 0.45); }
.mcat-GL { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border-color: rgba(245, 158, 11, 0.45); }
.mcat-Other { background: rgba(100, 116, 139, 0.18); color: #94a3b8; border-color: rgba(100, 116, 139, 0.35); }

/* =========================================================
   MIND MAP EXPERIMENTAL VIEW
   ========================================================= */
.mindmap-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.mm-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.mm-title-row h1 {
    margin: 0;
    font-size: 1.32rem;
    font-weight: 700;
    background: linear-gradient(90deg, #38bdf8, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mm-title-row #mindmap-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.inline-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mm-exp-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(167, 139, 250, 0.18);
    color: #c4b5fd;
    border: 1px solid rgba(167, 139, 250, 0.42);
}

.mm-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mm-pill {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.65);
    color: #cbd5e1;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
    font-family: inherit;
}

.mm-pill:hover {
    border-color: rgba(56, 189, 248, 0.55);
    color: #f8fafc;
}

.mm-pill.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(139, 92, 246, 0.24));
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
}

.mm-search-inline input {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 0.8rem;
    width: 240px;
    max-width: 100%;
    outline: none;
    font-family: inherit;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.mm-search-inline input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Mobile-first stacked layout */
.mindmap-grid {
    --mm-split: 60%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.mm-splitter {
    display: none;
}

.mindmap-canvas-card {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: radial-gradient(circle at 35% 30%, rgba(30, 41, 59, 0.96), rgba(11, 17, 32, 0.98));
    border: 1px solid rgba(56, 189, 248, 0.18);
    overflow: hidden;
}

.mindmap-canvas-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.mm-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.mm-crumb-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: #cbd5e1;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.mm-crumb-btn:hover {
    border-color: #38bdf8;
    color: #fff;
}

.mm-crumb-btn.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #fff;
    cursor: default;
}

.mm-crumb-sep {
    color: #64748b;
    font-size: 0.75rem;
}

.mm-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.btn-ghost:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.mm-canvas-wrap {
    position: relative;
    border-radius: 10px;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.92) 0%, #060b16 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    overflow: hidden;
    min-height: 440px;
    display: flex;
    flex-direction: column;
}

#mindmap-svg {
    width: 100%;
    height: 100%;
    min-height: 440px;
    display: block;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

#mindmap-svg.is-panning {
    cursor: grabbing;
}

.mm-hint-bar {
    position: absolute;
    left: 10px;
    bottom: 8px;
    font-size: 0.72rem;
    color: rgba(148, 163, 184, 0.85);
    background: rgba(6, 11, 22, 0.72);
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    pointer-events: none;
}

.mindmap-right-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mindmap-bottom-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
}

.mindmap-detail-card,
.mm-stat-card {
    padding: 14px 16px;
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
}

.mm-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.mm-detail-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.25;
}

.mm-detail-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 12px;
}

.mm-kpi-box {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    padding: 7px 10px;
}

.mm-kpi-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.mm-kpi-val {
    font-size: 1.02rem;
    font-weight: 700;
    color: #f8fafc;
    margin-top: 1px;
}

.mm-section-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin: 10px 0 6px;
}

.mm-perf-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mm-perf-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.79rem;
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease;
}

.mm-perf-item:hover {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(30, 41, 59, 0.85);
}

.mm-perf-mark {
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}

.mm-perf-pts {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fde047;
    background: rgba(250, 204, 21, 0.12);
    padding: 1px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

.mm-actions-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* SVG Nodes & Edges */
.mm-node-group {
    cursor: pointer;
}

.mm-node-group text {
    pointer-events: none;
    user-select: none;
}

.mm-ath-info-badge {
    cursor: pointer;
}

.mm-ath-info-bg {
    fill: rgba(15, 23, 42, 0.92);
    stroke: #38bdf8;
    stroke-width: 1.4;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.mm-ath-info-txt {
    fill: #38bdf8;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    pointer-events: none;
}

.mm-ath-info-badge:hover .mm-ath-info-bg {
    fill: #0284c7;
    stroke: #f8fafc;
}

.mm-ath-info-badge:hover .mm-ath-info-txt {
    fill: #ffffff;
}

.mm-detail-head .mm-ath-info-btn {
    width: 24px;
    height: 24px;
    font-size: 0.84rem;
}

.mm-perf-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mm-perf-right .mm-ath-info-btn {
    margin-left: 0;
}

.mm-edge-path {
    fill: none;
    stroke-linecap: round;
    pointer-events: none;
}

/* Desktop full-viewport split-pane (100dvh) */
@media (min-width: 1024px) {
    body.mm-view-active {
        overflow: hidden;
    }

    body.mm-view-active .app-layout {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    body.mm-view-active .main-content {
        height: 100vh;
        height: 100dvh;
        flex: 1;
        min-height: 0;
        padding: 10px 18px 12px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body.mm-view-active #view-mindmap {
        flex: 1;
        min-height: 0;
        display: flex !important;
        flex-direction: column;
    }

    .mindmap-grid {
        flex: 1;
        min-height: 0;
        grid-template-columns: minmax(320px, var(--mm-split, 60%)) 12px minmax(280px, 1fr);
        gap: 0;
        align-items: stretch;
    }

    .mindmap-canvas-card,
    .mm-canvas-wrap {
        height: 100%;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #mindmap-svg {
        width: 100%;
        height: 100%;
        min-height: 0;
        flex: 1;
    }

    .mm-splitter {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: col-resize;
        user-select: none;
        touch-action: none;
    }

    .mm-splitter-handle {
        width: 4px;
        height: 48px;
        border-radius: 99px;
        background: rgba(147, 161, 184, 0.28);
        transition: background 0.15s ease, height 0.15s ease, width 0.15s ease;
    }

    .mm-splitter:hover .mm-splitter-handle,
    .mm-splitter.is-dragging .mm-splitter-handle {
        background: var(--accent-color);
        height: 76px;
        width: 5px;
    }

    .mindmap-right-col {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        padding-right: 4px;
        scrollbar-width: thin;
        scrollbar-color: rgba(147, 161, 184, 0.3) transparent;
    }

    .mindmap-right-col > .card,
    .mindmap-right-col .mindmap-bottom-grid > .card {
        flex-shrink: 0;
    }
}

/* Fullscreen mode */
body.mm-fullscreen {
    overflow: hidden !important;
}

body.mm-fullscreen #mindmap-canvas-card {
    position: fixed;
    inset: 0;
    z-index: 9990;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 12px 16px;
    border-radius: 0;
    border: 0;
    display: flex;
    flex-direction: column;
}

body.mm-fullscreen .mm-canvas-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.mm-fullscreen #mindmap-svg {
    width: 100%;
    height: 100%;
    flex: 1;
}

#mindmap-svg {
    touch-action: none;
}

/* Active Filters Bar (3C) */
.active-filters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 12px;
    margin-bottom: 8px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    font-size: 0.78rem;
}

.active-filters-label {
    color: #94a3b8;
    font-weight: 600;
    margin-right: 2px;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e0f2fe;
    font-weight: 500;
}

.active-filter-chip button {
    background: none;
    border: none;
    color: #7dd3fc;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.85rem;
    line-height: 1;
}

.active-filter-chip button:hover {
    color: #fff;
}

/* Mindmap H2H Mini Table (6C) */
.mm-h2h-card {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.mm-h2h-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.mm-h2h-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.mm-h2h-table th,
.mm-h2h-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    text-align: left;
}

.mm-h2h-table th {
    color: #94a3b8;
    font-weight: 600;
}

.mm-edge-clickable {
    cursor: pointer;
    pointer-events: stroke;
    transition: stroke-width 0.15s ease, opacity 0.15s ease;
}

.mm-edge-clickable:hover {
    stroke-width: 3.4 !important;
    opacity: 0.95 !important;
}

/* Mobile Top Menu Wrap (4C) */
@media (max-width: 640px) {
    .main-top-actions {
        width: 100%;
        gap: 0.45rem;
        flex-wrap: wrap;
    }

    .view-mode-segmented {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .view-mode-btn {
        flex: 1 1 auto;
        padding: 0.38rem 0.55rem;
        font-size: 0.76rem;
        white-space: nowrap;
        text-align: center;
    }
}
