/* =========================================================================
   CONSOLIDATED LEADERBOARDS (JOCKEYS, TRAINERS, OWNERS, BREEDERS)
   ========================================================================= */

.lb-page-container {
    width: 94% !important;
    max-width: 1320px !important;
    margin: 0 auto !important;
    padding: 0 16px 2.5rem 16px !important;
    box-sizing: border-box;
}

/* --- 1. Header Banner, Category Tabs & Filters --- */
.lb-header-card {
    background: linear-gradient(135deg, var(--color-primary, #1a472a) 0%, #0d2b18 100%);
    color: #ffffff;
    padding: 1.5rem 1.75rem;
    border-radius: 12px;
    border-bottom: 4px solid var(--color-secondary-dark, #B5882A);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.lb-header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
}

.lb-header-title-group {
    flex: 1 1 auto;
    min-width: 0;
}

.lb-header-brand-lockup {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lb-pjc-logo-hero {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.lb-header-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--color-secondary, #f6bc3f);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.3rem 0;
    line-height: 1.2;
}

.lb-header-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.lb-controls-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.lb-search-box {
    position: relative;
    width: 220px;
    height: 40px;
    flex: 0 0 auto;
}

.lb-search-box > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.lb-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.lb-search-clear:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.lb-search-clear.hidden {
    display: none;
}

.lb-search-input {
    width: 100%;
    height: 40px;
    padding: 0 34px 0 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background-color: #ffffff;
    color: #1e293b;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    display: block;
}

.lb-search-input:focus {
    border-color: var(--color-secondary, #f6bc3f);
    box-shadow: 0 0 0 3px rgba(246, 188, 63, 0.25);
}

.lb-select-wrap {
    position: relative;
    height: 40px;
    flex: 0 0 auto;
}

.lb-select {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    line-height: 1.35;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background-color: #ffffff;
    color: #1e293b;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lb-select:focus {
    border-color: var(--color-secondary, #f6bc3f);
    box-shadow: 0 0 0 3px rgba(246, 188, 63, 0.25);
}

/* Category Navigation Strip inside Header */
.lb-category-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 1.15rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.lb-cat-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 10px 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.lb-cat-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.lb-cat-btn.active {
    background: linear-gradient(135deg, #f6bc3f 0%, #d4af37 100%);
    color: #143620;
    border-color: #f6bc3f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

/* --- 2. Dual Champion Spotlight Cards (PJC Only | Combined Tracks) --- */
.lb-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.5rem;
}

.lb-spotlight-card {
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.lb-spotlight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

.lb-spotlight-card.is-pjc {
    background: linear-gradient(135deg, #1a472a 0%, #0f2d1a 100%);
    color: #ffffff;
    border-color: rgba(212, 175, 55, 0.4);
}

.lb-spotlight-card.is-mmtci {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    color: #1e293b;
    border-color: #fecaca;
    box-shadow: 0 4px 15px rgba(185, 28, 28, 0.05);
}

.lb-spotlight-card.is-combined {
    background: #ffffff;
    color: #1e293b;
    border-color: #cbd5e1;
}

.lb-spotlight-card.active-card {
    border-color: #d4af37 !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.lb-spotlight-card.is-mmtci.active-card {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25), 0 8px 24px rgba(185, 28, 28, 0.1);
}

.lb-spotlight-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.lb-spotlight-brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.lb-pjc-logo-card {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.lb-spotlight-info {
    min-width: 0;
    flex: 1;
}

.lb-pjc-logo-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
}

.lb-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.lb-spotlight-card.is-pjc .lb-badge-pill {
    background: rgba(212, 175, 55, 0.2);
    color: #fde68a;
    border: 1px solid rgba(212, 175, 55, 0.45);
}

.lb-spotlight-card.is-mmtci .lb-badge-pill {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.lb-spotlight-card.is-combined .lb-badge-pill {
    background: rgba(26, 71, 42, 0.1);
    color: #1a472a;
    border: 1px solid rgba(26, 71, 42, 0.2);
}

.lb-spotlight-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0.5rem 0 0.15rem 0;
    line-height: 1.25;
    word-break: break-word;
    white-space: normal;
}

.lb-spotlight-card.is-mmtci .lb-spotlight-title {
    color: #0f172a;
}

.lb-spotlight-sub {
    font-size: 0.75rem;
    opacity: 0.82;
    margin: 0;
    line-height: 1.35;
    word-break: break-word;
}

.lb-spotlight-card.is-mmtci .lb-spotlight-sub {
    color: #64748b;
    opacity: 1;
}

.lb-spotlight-metric {
    text-align: right;
    flex-shrink: 0;
}

.lb-spotlight-metric-val {
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
}

.lb-spotlight-card.is-pjc .lb-spotlight-metric-val {
    color: #fde68a;
}

.lb-spotlight-card.is-mmtci .lb-spotlight-metric-val {
    color: #991b1b;
}

.lb-spotlight-card.is-combined .lb-spotlight-metric-val {
    color: #1a472a;
}

.lb-spotlight-metric-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
    margin-top: 3px;
}

.lb-spotlight-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    text-align: center;
}

.lb-spotlight-stat-num {
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}

.lb-spotlight-card.is-mmtci .lb-spotlight-stat-num {
    color: #0f172a;
}

.lb-spotlight-stat-label {
    font-size: 0.65rem;
    opacity: 0.8;
    margin-top: 2px;
}

.lb-spotlight-card.is-mmtci .lb-spotlight-stat-label {
    color: #64748b;
    opacity: 1;
}

/* Country Selection Controls */
.lb-country-select-wrap.hidden {
    display: none !important;
}

.lb-country-pills-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
    margin-bottom: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.lb-country-pills-bar.hidden {
    display: none !important;
}

.lb-country-pills-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lb-country-pills-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.lb-country-pill {
    padding: 4px 12px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1.2;
}

.lb-country-pill:hover {
    border-color: #1a472a;
    color: #1a472a;
    background: #f0fdf4;
}

.lb-country-pill.active {
    background: #1a472a;
    color: #ffffff;
    border-color: #1a472a;
    box-shadow: 0 2px 6px rgba(26, 71, 42, 0.2);
}

/* Drawer Bred Country Filter Bar */
.lb-drawer-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 8px 0 12px 0;
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.lb-drawer-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.lb-drawer-pill {
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.2;
}

.lb-drawer-pill:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.lb-drawer-pill.active {
    background: #1a472a;
    color: #ffffff;
    border-color: #1a472a;
}

/* Country Badges */
.country-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.3;
    vertical-align: middle;
    margin-left: 6px;
}

.country-badge.country-phi {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.country-badge.country-foreign {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* --- 3. Leaderboard Card & Left (PJC) / Right (All Season Record) Switcher --- */
.lb-board-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.lb-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.lb-scope-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 420px;
}

.lb-scope-tabs {
    display: inline-flex;
    background-color: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    gap: 4px;
}

.lb-scope-btn {
    background: transparent;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.2;
    white-space: nowrap;
}

.lb-scope-btn:hover {
    color: #1a472a;
    background-color: rgba(255, 255, 255, 0.65);
}

.lb-scope-btn.active {
    background-color: #1a472a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(26, 71, 42, 0.25);
}

.lb-scope-btn.active i {
    color: #f6bc3f;
}

.lb-scope-btn#lb-btn-scope-mmtci:hover {
    color: #991b1b;
}

.lb-scope-btn#lb-btn-scope-mmtci.active {
    background-color: #7f1d1d;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(127, 29, 29, 0.3);
}

.lb-scope-btn#lb-btn-scope-mmtci.active i {
    color: #fca5a5;
}

.lb-helper-note {
    font-size: 0.8rem;
    color: #64748b;
}

/* --- 4. Standings Table (Desktop) --- */
.lb-table-scroll {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lb-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Montserrat', sans-serif;
    background: #ffffff;
}

.lb-standings-table thead th {
    background-color: #1a472a;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.4px;
    padding: 0.85rem 0.65rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 3px solid #B5882A;
}

.lb-standings-table tbody td {
    padding: 0.85rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.86rem;
    color: #334155;
    vertical-align: middle;
}

.lb-standings-table tbody tr.lb-main-row:hover td {
    background-color: #f8fafc;
}

.lb-standings-table .cell-rank {
    width: 64px;
    text-align: center;
    font-weight: 800;
    color: #1a472a;
}

.lb-standings-table .cell-earnings {
    font-weight: 700;
    color: #166534;
    text-align: right;
    white-space: nowrap;
}

.lb-spotlight-metric-val.is-currency {
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.lb-rank-badge-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f6bc3f 0%, #b5882a 100%);
    color: #1a472a;
    font-weight: 900;
    font-size: 0.82rem;
}

.lb-entity-wrap {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    color: #0f172a;
}

.lb-entity-link {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.15s;
}

.lb-entity-link:hover {
    color: #1a472a;
    text-decoration: underline;
}

.lb-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a472a;
    font-size: 0.85rem;
    flex-shrink: 0;
    overflow: hidden;
}

.lb-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.lb-leading-tag {
    font-size: 0.68rem;
    color: #b5882a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

.btn-lb-drawer {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #1a472a;
    border-radius: 6px;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-lb-drawer:hover,
.btn-lb-drawer.is-open {
    background: #1a472a;
    color: #ffffff;
    border-color: #1a472a;
}

/* --- 5. Expandable Winning Horses Drawer --- */
.lb-drawer-row td {
    background: #f8fafc !important;
    padding: 1rem 1.25rem !important;
}

.lb-drawer-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #1a472a;
    border-radius: 8px;
    padding: 1rem 1.15rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.lb-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 10px;
}

.lb-drawer-title {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1a472a;
}

.lb-drawer-count {
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
}

.lb-drawer-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.btn-drawer-more {
    background: #1a472a;
    color: #ffffff;
    border: 1px solid #1a472a;
    border-radius: 6px;
    padding: 6px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.btn-drawer-more:hover {
    background: #0f2d1a;
}

.btn-drawer-all {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-drawer-all:hover {
    border-color: #1a472a;
    color: #1a472a;
}

.lb-subtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.lb-subtable thead th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    padding: 8px 10px !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

.lb-subtable tbody td {
    background: #ffffff !important;
    padding: 8px 10px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 0.82rem !important;
}

.lb-subtable tbody tr:last-child td {
    border-bottom: none !important;
}

.track-split-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.track-split-pjc {
    background: #dcfce7;
    color: #166534;
}

.track-split-mmtci {
    background: #fee2e2;
    color: #991b1b;
}

.lb-venue-pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.lb-venue-pill.is-pjc {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.lb-venue-pill.is-mmtci {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.btn-race-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #1a472a;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-race-link:hover {
    background: #1a472a;
    color: #ffffff;
    border-color: #1a472a;
}

/* --- 6. Responsive Breakpoints --- */
@media (max-width: 1080px) {
    .lb-header-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .lb-header-title-group {
        flex: none;
        width: 100%;
    }

    .lb-category-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lb-controls-bar {
        display: grid;
        grid-template-columns: 1.2fr 1fr 1fr 0.8fr;
        gap: 0.65rem;
        width: 100%;
    }

    .lb-search-box,
    .lb-select-wrap {
        width: 100%;
        height: 42px;
        flex: none;
    }

    .lb-search-input,
    .lb-select {
        height: 42px;
        line-height: 42px;
    }
}

@media (max-width: 992px) {
    .lb-spotlight-grid {
        grid-template-columns: 1fr;
    }

    .lb-controls-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .lb-table-scroll {
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    .lb-standings-table,
    .lb-standings-table tbody {
        display: block;
        width: 100%;
    }

    .lb-standings-table thead {
        display: none;
    }

    .lb-standings-table tbody tr.lb-main-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 12px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    }

    .lb-standings-table tbody tr.lb-main-row td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 8px !important;
        border-bottom: none !important;
        background: #f8fafc;
        border-radius: 6px;
        font-size: 0.8rem;
        text-align: right !important;
    }

    .lb-standings-table tbody tr.lb-main-row td::before {
        content: attr(data-label);
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        color: #64748b;
        text-align: left;
        margin-right: 8px;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-rank {
        display: none;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-entity {
        grid-column: 1 / -1;
        background: transparent;
        padding: 0 0 8px 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        border-radius: 0;
        text-align: left !important;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-entity::before {
        display: none;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-wins {
        grid-column: 1 / -1;
        background: #f0fdf4;
        border: 1px solid #bbf7d0;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-earnings {
        grid-column: 1 / -1;
        background: #f0fdf4;
        border: 1px solid #bbf7d0;
        font-weight: 800;
        color: #166534;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-split {
        grid-column: 1 / -1;
    }

    .lb-standings-table tbody tr.lb-main-row td[data-label="Pedigree"] {
        grid-column: 1 / -1;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-action {
        grid-column: 1 / -1;
        background: transparent;
        padding: 4px 0 0 0 !important;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-action::before {
        display: none;
    }

    .lb-standings-table tbody tr.lb-main-row td.cell-action .btn-lb-drawer {
        width: 100%;
        padding: 9px 12px;
    }

    .lb-mobile-rank-pill {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 26px;
        height: 26px;
        padding: 0 7px;
        border-radius: 50px;
        background: #1a472a;
        color: #ffffff;
        font-size: 0.75rem;
        font-weight: 800;
        flex-shrink: 0;
    }

    .lb-mobile-rank-pill.is-top {
        background: linear-gradient(135deg, #f6bc3f 0%, #b5882a 100%);
        color: #1a472a;
    }

    /* Drawer on Mobile/Tablet */
    .lb-standings-table tbody tr.lb-drawer-row {
        display: block;
        width: 100%;
        margin-top: -8px;
        margin-bottom: 14px;
    }

    .lb-standings-table tbody tr.lb-drawer-row > td {
        display: block;
        width: 100%;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }

    .lb-subtable thead {
        display: none;
    }

    .lb-subtable,
    .lb-subtable tbody {
        display: block;
        width: 100%;
    }

    .lb-subtable tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 10px;
        padding: 10px 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .lb-subtable tbody tr:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .lb-subtable tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 2px 4px !important;
        border: none !important;
        font-size: 0.78rem !important;
    }

    .lb-subtable tbody td::before {
        content: attr(data-label);
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        color: #64748b;
        margin-right: 6px;
    }

    .lb-subtable tbody td.sub-cell-horse {
        grid-column: 1 / -1;
        font-size: 0.88rem !important;
        padding-bottom: 4px !important;
    }

    .lb-subtable tbody td.sub-cell-horse::before {
        display: none;
    }

    .lb-subtable tbody td.sub-cell-split {
        grid-column: 1 / -1;
    }
}

@media (min-width: 901px) {
    .lb-mobile-rank-pill {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .lb-page-container {
        width: 100% !important;
        padding: 0 12px 2rem 12px !important;
    }

    .lb-header-card {
        padding: 1.15rem 1.25rem;
    }

    .lb-pjc-logo-hero {
        width: 54px;
        height: 54px;
    }

    .lb-pjc-logo-card {
        width: 48px;
        height: 48px;
    }

    .lb-header-title {
        font-size: 1.3rem;
    }

    .lb-header-subtitle {
        font-size: 0.8rem;
    }

    .lb-controls-bar {
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        gap: 0.6rem;
        width: 100%;
    }

    .lb-search-box {
        grid-column: 1 / -1;
        width: 100%;
        height: 42px;
        flex: none;
    }

    .lb-select-wrap {
        width: 100%;
        height: 42px;
        flex: none;
    }

    .lb-category-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lb-cat-btn {
        font-size: 0.78rem;
        padding: 9px 10px;
    }

    .lb-spotlight-card {
        padding: 1.15rem;
    }

    .lb-spotlight-title {
        font-size: 1.1rem;
    }

    .lb-spotlight-metric-val {
        font-size: 1.65rem;
    }

    .lb-spotlight-metric-val.is-currency {
        font-size: 1.25rem;
    }

    .lb-board-card {
        padding: 1rem;
    }

    .lb-toolbar-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .lb-scope-tabs {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .lb-scope-btn {
        width: 100%;
        padding: 10px 12px;
    }

    .lb-helper-note {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .lb-controls-bar {
        grid-template-columns: 1fr;
    }

    .lb-spotlight-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
}

/* --- Floating Back to Top Button --- */
.floating-top-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 50px;
    background: linear-gradient(135deg, #1a472a 0%, #0f2d1a 100%);
    color: #ffffff;
    border: 2px solid #d4af37;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
}

.floating-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-top-btn:hover {
    background: #0f2d1a;
    transform: translateY(-2px);
}

.floating-top-btn i {
    color: #f6bc3f;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .floating-top-btn {
        right: 16px;
        bottom: 18px;
        width: 46px;
        height: 46px;
        padding: 0;
        justify-content: center;
    }

    .floating-top-btn span {
        display: none;
    }
}
