

html body .rb-rf-toggle[aria-checked="false"],
html body .rb-rf-toggle[aria-checked="false"] span {
    color: #929e94 !important;
}

html body .rb-rf-toggle[aria-checked="true"],
html body .rb-rf-toggle[aria-checked="true"] span {
    color: #b6ff38 !important;
}



/* RB_NAV_FIT_V1: room for BRAIN BOOKERS in the desktop menu. */
@media (min-width: 1367px) {
    html body .topbar nav.nav a {
        font-size: 12px !important;
    }
    html body .topbar nav.nav {
        column-gap: 0.62vw !important;
        gap: 0.62vw !important;
    }
}


/* RB_RACE_MARKET_TOGGLES_V1: Form Comments off/on colours match the
   other switches, and the switches sit in an even row on phones. */
html body .rb-fc-toggle[aria-checked="false"],
html body .rb-fc-toggle[aria-checked="false"] span {
    color: #929e94 !important;
}
html body .rb-fc-toggle[aria-checked="false"] .rb-rf-track {
    background: #414941 !important;
}
html body .rb-fc-toggle[aria-checked="false"] .rb-rf-thumb {
    transform: none !important;
    background: #b6bcb6 !important;
}
html body .rb-fc-toggle[aria-checked="true"],
html body .rb-fc-toggle[aria-checked="true"] span {
    color: #b6ff38 !important;
}

@media (max-width: 700px) {
    html body #racePageContent .race-panel-header:has(> .rb-hs-actions),
    html body #racePageContent .race-panel-header:has(.rb-hs-actions) {
        flex-wrap: wrap !important;
        row-gap: 10px !important;
    }
    html body #racePageContent .rb-hs-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        flex: 1 1 100% !important;
        margin: 0 !important;
        justify-content: stretch !important;
    }
    html body #racePageContent .rb-hs-actions > .rb-hs-toggle,
    html body #racePageContent .rb-hs-actions > .rb-rf-toggle,
    html body #racePageContent .rb-hs-actions > .rb-fc-toggle {
        display: grid !important;
        grid-template-columns: auto auto !important;
        justify-content: center !important;
        justify-items: center !important;
        align-items: center !important;
        column-gap: 5px !important;
        row-gap: 4px !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 48px !important;
        padding: 7px 4px !important;
        margin: 0 !important;
        border: 1px solid rgba(255,255,255,.09) !important;
        border-radius: 9px !important;
        background: rgba(255,255,255,.02) !important;
        font-size: 9px !important;
        letter-spacing: .3px !important;
        white-space: nowrap !important;
    }
    html body #racePageContent .rb-hs-actions > .rb-hs-toggle > :first-child,
    html body #racePageContent .rb-hs-actions > .rb-rf-toggle > :first-child,
    html body #racePageContent .rb-hs-actions > .rb-fc-toggle > :first-child {
        grid-column: 1 / -1 !important;
    }
    /* Free race card: the Brain Price column is empty on the name row,
       so let the horse name use it instead of wrapping early. */
    html body #racePage .market-wrap .market-table tr:not(:has(> td:nth-child(9))) > td:nth-child(2) {
        grid-column: 2 / -1 !important;
    }
    html body #racePage .market-wrap .market-table .rb-race-silks-horse-name,
    html body #racePage .market-wrap .market-table .rb-race-silks-horse-name .horse-link {
        width: auto !important;
        max-width: 100% !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: none !important;
    }
    html body #racePageContent .rb-hs-actions > #formWorksheetButton {
        grid-column: 1 / -1 !important;
        justify-self: center !important;
        border-left: 0 !important;
        padding: 4px 0 0 !important;
    }
}


/* RB_BET_PRICE_DISPLAY_V2 */

.daily-bets-now-price.rb-price-drift {
    color: #b6ff38 !important;
    font-weight: 750;
}

.daily-bets-now-price.rb-price-firm {
    color: #ff7777 !important;
    font-weight: 750;
}

.daily-bets-now-price strong {
    color: #a5afa5 !important;
    font-weight: 600;
}

.daily-bets-market-prices {
    column-gap: 14px !important;
    row-gap: 5px !important;
}

.daily-bets-market-prices > span {
    white-space: nowrap;
}

@media (max-width: 700px) {
    .daily-bets-market-prices {
        font-size: 11px !important;
        column-gap: 9px !important;
    }
}


/* RB_HOME_NEXT_BET_PRICES_V4 */

html body #homeNextBet .rb-home-next-price-pair {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 24px !important;
}

html body #homeNextBet .rb-home-next-price-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    white-space: nowrap;
}

html body #homeNextBet
.rb-home-next-price-item .home-next-bet-price {
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1.15;
    font-weight: 850;
}

html body #homeNextBet
.rb-home-next-price-item .home-next-bet-price-label {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .05em;
    color: #929e94;
}

html body #homeNextBet .rb-bet-price-drift {
    color: #b6ff38 !important;
}

html body #homeNextBet .rb-bet-price-firm {
    color: #43d9e6 !important;
}

@media (max-width: 700px) {

    html body #homeNextBet .home-next-bet-main {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    html body #homeNextBet .rb-home-next-price-pair {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        justify-content: flex-end !important;
        gap: 20px !important;
    }

    html body #homeNextBet
    .rb-home-next-price-item .home-next-bet-price {
        font-size: 23px !important;
    }

    html body #homeNextBet
    .rb-home-next-price-item .home-next-bet-price-label {
        font-size: 10px !important;
    }
}


/* RB_BRAIN_BETS_COMPACT_V6 */

/* Scope changes to the upcoming Brain Bets table only. */

html body table.rb-v5-brain-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

html body table.rb-v5-brain-table th,
html body table.rb-v5-brain-table td {
    box-sizing: border-box !important;
    padding: 9px 10px !important;
    vertical-align: middle !important;
    font-variant-numeric: tabular-nums;
}

/* TIME */
html body table.rb-v5-brain-table tr > :nth-child(1) {
    width: 9% !important;
    text-align: left !important;
}

/* RACE */
html body table.rb-v5-brain-table tr > :nth-child(2) {
    width: 18% !important;
    text-align: left !important;
    white-space: normal !important;
}

/* RUNNER NUMBER */
html body table.rb-v5-brain-table tr > :nth-child(3) {
    width: 4% !important;
    text-align: center !important;
}

/* RUNNER NAME */
html body table.rb-v5-brain-table tr > :nth-child(4) {
    width: 24% !important;
    text-align: left !important;
    white-space: normal !important;
}

/* BET TYPE */
html body table.rb-v5-brain-table tr > :nth-child(5) {
    width: 9% !important;
    text-align: center !important;
}

/* BRAIN PRICE */
html body table.rb-v5-brain-table tr > :nth-child(6) {
    width: 9% !important;
    text-align: right !important;
}

/* ORIGINAL BET PRICE */
html body table.rb-v5-brain-table tr > :nth-child(7) {
    width: 9% !important;
    text-align: right !important;
}

/* CURRENT TAB PRICE */
html body table.rb-v5-brain-table tr > :nth-child(8) {
    width: 9% !important;
    text-align: right !important;
}

/* RESTORE EDGE COLUMN */
html body table.rb-v5-brain-table tr > :nth-child(9) {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 9% !important;
    text-align: right !important;
    white-space: nowrap !important;
}

/* Override legacy eight-column sizing rules. */
html body table.rb-v5-brain-table th,
html body table.rb-v5-brain-table td {
    min-width: 0 !important;
    max-width: none !important;
}

/* Keep numerical columns close together. */
html body table.rb-v5-brain-table tr > :nth-child(n+6) {
    padding-left: 6px !important;
    padding-right: 10px !important;
    white-space: nowrap !important;
}

html body table.rb-v5-brain-table th {
    font-size: 11px !important;
    letter-spacing: .04em !important;
}

html body table.rb-v5-brain-table td {
    font-size: 13px !important;
}

/* Preserve price movement colours. */
html body table.rb-v5-brain-table .rb-bet-price-firm {
    color: #43d9e6 !important;
}

html body table.rb-v5-brain-table .rb-bet-price-drift {
    color: #b6ff38 !important;
}

/* Tablet and mobile: horizontal scrolling. */
@media (max-width: 1000px) {

    html body table.rb-v5-brain-table {
        min-width: 860px !important;
    }

    html body table.rb-v5-brain-table th,
    html body table.rb-v5-brain-table td {
        padding: 8px 7px !important;
        font-size: 12px !important;
    }

    html body div:has(> table.rb-v5-brain-table) {
        overflow-x: auto !important;
        max-width: 100% !important;
        -webkit-overflow-scrolling: touch;
    }
}



/* RB_BRAIN_BETS_SPACING_V7 */

html body table.rb-v5-brain-table {
    table-layout: fixed !important;
}

/* TIME */
html body table.rb-v5-brain-table tr > :nth-child(1) {
    width: 10% !important;
}

/* RACE */
html body table.rb-v5-brain-table tr > :nth-child(2) {
    width: 20% !important;
}

/* NUMBER */
html body table.rb-v5-brain-table tr > :nth-child(3) {
    width: 5% !important;
}

/* RUNNER */
html body table.rb-v5-brain-table tr > :nth-child(4) {
    width: 27% !important;
}

/* TYPE */
html body table.rb-v5-brain-table tr > :nth-child(5) {
    width: 10% !important;
}

/* COMPACT NUMERICAL COLUMNS */
html body table.rb-v5-brain-table tr > :nth-child(6),
html body table.rb-v5-brain-table tr > :nth-child(7),
html body table.rb-v5-brain-table tr > :nth-child(8),
html body table.rb-v5-brain-table tr > :nth-child(9) {
    width: 7% !important;
    text-align: right !important;
    padding-left: 4px !important;
    padding-right: 10px !important;
    white-space: nowrap !important;
}

/* Override legacy Brain price alignment */
html body table.rb-v5-brain-table tr > :nth-child(6) *,
html body table.rb-v5-brain-table tr > :nth-child(7) *,
html body table.rb-v5-brain-table tr > :nth-child(8) *,
html body table.rb-v5-brain-table tr > :nth-child(9) * {
    text-align: right !important;
}

/* Keep the Edge help icon visible */
html body table.rb-v5-brain-table tr > :nth-child(9) {
    overflow: visible !important;
}

@media (max-width: 1000px) {

    html body table.rb-v5-brain-table {
        min-width: 960px !important;
    }

    html body table.rb-v5-brain-table tr > :nth-child(n+6) {
        padding-left: 4px !important;
        padding-right: 7px !important;
    }
}



/* RB_UNIFIED_BET_PRICES_V8 */

/* Override the original ID-scoped column rules. */
html body #strategyHubProduct
table.strategy-v21-brain-table.rb-v5-brain-table {
    table-layout: fixed !important;
    width: 100% !important;
}

/* TIME */
html body #strategyHubProduct
table.rb-v5-brain-table tr > :nth-child(1) {
    width: 10% !important;
    text-align: left !important;
}

/* RACE */
html body #strategyHubProduct
table.rb-v5-brain-table tr > :nth-child(2) {
    width: 21% !important;
    text-align: left !important;
}

/* NUMBER */
html body #strategyHubProduct
table.rb-v5-brain-table tr > :nth-child(3) {
    width: 5% !important;
    text-align: center !important;
}

/* RUNNER */
html body #strategyHubProduct
table.rb-v5-brain-table tr > :nth-child(4) {
    width: 28% !important;
    text-align: left !important;
}

/* TYPE */
html body #strategyHubProduct
table.rb-v5-brain-table tr > :nth-child(5) {
    width: 8% !important;
    text-align: center !important;
}

/* All four numerical columns grouped together. */
html body #strategyHubProduct
table.rb-v5-brain-table tr > :nth-child(n+6) {
    width: 7% !important;
    text-align: right !important;
    padding-left: 4px !important;
    padding-right: 10px !important;
    white-space: nowrap !important;
    min-width: 0 !important;
}

/* Automatic strategy tables. */
html body #strategyHubProduct
table.rb-v8-auto-table {
    table-layout: fixed !important;
    width: 100% !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(1) {
    width: 10% !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(2) {
    width: 21% !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(3) {
    width: 5% !important;
    text-align: center !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(4) {
    width: 28% !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(5),
html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(6) {
    width: 9% !important;
    text-align: right !important;
    white-space: nowrap !important;
    font-weight: 750 !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(7) {
    width: 10% !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table tr > :nth-child(8) {
    width: 8% !important;
    display: table-cell !important;
    text-align: right !important;
}

html body #strategyHubProduct
table.rb-v8-auto-table th,
html body #strategyHubProduct
table.rb-v8-auto-table td {
    box-sizing: border-box !important;
    padding: 9px 8px !important;
    font-size: 13px !important;
    vertical-align: middle !important;
}

html body .rb-v8-auto-now.rb-bet-price-firm {
    color: #43d9e6 !important;
}

html body .rb-v8-auto-now.rb-bet-price-drift {
    color: #b6ff38 !important;
}

/* Printable tipsheet prices remain legible in monochrome. */
#rbTipsheetPaper .rb-v8-tipsheet-now {
    color: #26382e !important;
    font-weight: 650;
    white-space: nowrap;
}

#rbTipsheetPaper table th:nth-last-child(-n+2),
#rbTipsheetPaper table td:nth-last-child(-n+2) {
    text-align: right;
    white-space: nowrap;
}

#rbTipsheetPaper table {
    width: 100% !important;
}

@media (max-width: 1000px) {

    html body #strategyHubProduct
    table.rb-v5-brain-table,
    html body #strategyHubProduct
    table.rb-v8-auto-table {
        min-width: 900px !important;
    }

    html body #strategyHubProduct
    .strategy-v21-table-wrap {
        overflow-x: auto !important;
        max-width: 100% !important;
    }
}

@media print {

    #rbTipsheetPaper table th,
    #rbTipsheetPaper table td {
        padding: 6px !important;
        font-size: 10px !important;
    }

    #rbTipsheetPaper .rb-v8-tipsheet-now {
        color: #000 !important;
    }
}




/* Shortening - cyan */
html body .rb-bet-price-firm,
html body .rb-bet-price-firm *,
html body [class*="price-firm"],
html body [class*="price-shortening"],
html body [class*="price-shorten"] {
    color: #40d9eb !important;
}

/* Drifting - lime */
html body .rb-bet-price-drift,
html body .rb-bet-price-drift *,
html body [class*="price-drift"] {
    color: #b6ff38 !important;
}



#rbRemoteDialog {
    width: min(1150px, 96vw);
    max-height: 90vh;
    overflow: auto;
    background: #111810;
    color: #eef4ee;
    border: 1px solid #344332;
    border-radius: 14px;
    padding: 22px;
    box-sizing: border-box;
}
#rbRemoteDialog::backdrop {
    background: rgba(0,0,0,.82);
}
#rbRemoteDialog h2 {
    color: #b6ff38;
    margin: 0;
    font-size: 22px;
}
#rbRemoteDialog .rr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#rbRemoteDialog .rr-notice {
    background: #202b19;
    border: 1px solid #394b2b;
    padding: 12px;
    border-radius: 8px;
    margin: 16px 0;
    color: #b6ff38;
    font-size: 13px;
}
#rbRemoteDialog .rr-panel {
    background: #182018;
    border: 1px solid #303d30;
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
}
#rbRemoteDialog .rr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
    gap: 12px;
}
#rbRemoteDialog label {
    display: block;
    color: #a6b3a6;
    font-size: 12px;
}
#rbRemoteDialog input:not([type="checkbox"]),
#rbRemoteDialog select {
    display: block;
    width: 100%;
    margin-top: 6px;
    background: #101610;
    color: #fff;
    border: 1px solid #405040;
    border-radius: 6px;
    padding: 10px;
    box-sizing: border-box;
}
#rbRemoteDialog button {
    background: #253322;
    color: #eef4ee;
    border: 1px solid #42543b;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
}
#rbRemoteDialog button:disabled {
    opacity: .5;
    cursor: not-allowed;
}
#rbRemoteDialog .rr-primary {
    background: #b6ff38;
    color: #14200b;
}
#rbRemoteDialog .rr-status {
    white-space: pre-wrap;
    color: #43d9e6;
    font-size: 13px;
    margin: 12px 0;
}
#rbRemoteDialog .rr-strategy-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
#rbRemoteDialog input[type="checkbox"] {
    accent-color: #b6ff38;
}
@media(max-width:700px) {
    #rbRemoteDialog {
        padding: 12px;
    }
    #rbRemoteDialog .rr-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}
