/* Own country/league preferences; all rules are scoped to the RF scoreboard. */
#rfp-preview #rfp-preferences {
    box-sizing: border-box;
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 7px 8px;
    min-width: 0;
    max-width: 100%;
    margin: 8px 0 10px;
    color: #b9c8cf;
    font: 400 12px/1.45 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color-scheme: dark;
}

#rfp-preview .rfp-preference-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

#rfp-preview .rfp-preference {
    box-sizing: border-box;
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

#rfp-preview .rfp-preference[open] {
    z-index: 1;
}

#rfp-preview .rfp-preference-summary {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid #2b4a56;
    border-radius: 5px;
    background: #001e28;
    color: #fff;
    font: 600 12px/1.4 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: normal;
    text-transform: none;
    list-style: none;
    overflow-wrap: anywhere;
    cursor: pointer;
    pointer-events: auto;
}

#rfp-preview .rfp-preference-summary::-webkit-details-marker {
    display: none;
}

#rfp-preview .rfp-preference-summary::marker {
    content: '';
}

#rfp-preview .rfp-preference-summary::after {
    content: '';
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    margin: -3px 2px 0 2px;
    border-right: 1.5px solid #b9c8cf;
    border-bottom: 1.5px solid #b9c8cf;
    transform: rotate(45deg);
    transition: transform .12s ease;
}

#rfp-preview .rfp-preference[open] > .rfp-preference-summary {
    border-color: #52717e;
    background: #010a0f;
}

#rfp-preview .rfp-preference[open] > .rfp-preference-summary::after {
    margin-top: 3px;
    transform: rotate(225deg);
}

#rfp-preview .rfp-preference-count {
    flex: 0 0 auto;
    margin-left: auto;
    color: #b9c8cf;
    font-size: 11px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#rfp-preview .rfp-preference-panel {
    box-sizing: border-box;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 360px;
    min-width: 100%;
    max-width: calc(100vw - 40px);
    max-height: min(460px, calc(100vh - 96px));
    max-height: min(460px, calc(100dvh - 96px));
    margin: 0;
    padding: 10px;
    border: 1px solid #2b4a56;
    border-radius: 5px;
    background: #001e28;
    color: #b9c8cf;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
    overflow: hidden;
}

#rfp-preview .rfp-preference:last-child > .rfp-preference-panel {
    right: 0;
    left: auto;
}

#rfp-preview .rfp-preference:not([open]) > .rfp-preference-panel {
    display: none;
}

#rfp-preview .rfp-preference-search-label {
    display: block;
    flex: 0 0 auto;
    margin: 0;
    color: #b9c8cf;
    font: 600 11px/1.4 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#rfp-preview .rfp-preference-search {
    box-sizing: border-box;
    display: block;
    flex: 0 0 auto;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 9px 11px !important;
    border: 1px solid #2b4a56 !important;
    border-radius: 4px !important;
    background: #010a0f !important;
    color: #fff !important;
    box-shadow: none !important;
    font: 400 13px/1.4 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    pointer-events: auto !important;
}

#rfp-preview .rfp-preference-search::placeholder {
    color: #9eafb7;
    opacity: 1;
}

#rfp-preview .rfp-preference-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

#rfp-preview .rfp-preference-actions button,
#rfp-preview .rfp-preference-reset {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8px 11px !important;
    border: 1px solid #2b4a56 !important;
    border-radius: 5px !important;
    background: #010a0f !important;
    color: #b9c8cf !important;
    box-shadow: none !important;
    font: 600 11px/1.4 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    letter-spacing: normal !important;
    text-align: center !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    cursor: pointer !important;
    pointer-events: auto !important;
    appearance: none;
}

#rfp-preview .rfp-preference-actions button {
    flex: 1 1 120px;
}

#rfp-preview .rfp-preference-reset {
    align-self: start;
    max-width: 180px;
}

#rfp-preview .rfp-preference-options {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    max-height: 260px;
    margin: 0;
    padding: 0;
    border: 1px solid #2b4a56;
    border-radius: 4px;
    background: #010a0f;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #47616d #010a0f;
    -webkit-overflow-scrolling: touch;
}

#rfp-preview .rfp-preference-option {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 8px 10px;
    border-bottom: 1px solid #1c3540;
    color: #b9c8cf;
    font: 400 12px/1.45 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: left;
    cursor: pointer;
    pointer-events: auto;
}

#rfp-preview .rfp-preference-option:last-child {
    border-bottom: 0;
}

#rfp-preview .rfp-preference-option input[type='checkbox'] {
    box-sizing: border-box;
    position: static !important;
    flex: 0 0 18px;
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 3px;
    opacity: 1 !important;
    accent-color: #39ff14;
    cursor: pointer;
    pointer-events: auto !important;
    appearance: auto !important;
}

#rfp-preview .rfp-preference-option span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

#rfp-preview .rfp-preference-option:has(input:checked) {
    background: #082730;
    color: #fff;
}

#rfp-preview .rfp-preference-summary:hover,
#rfp-preview .rfp-preference-option:hover {
    background: #0a2b36;
    color: #fff;
}

#rfp-preview .rfp-preference-actions button:hover,
#rfp-preview .rfp-preference-reset:hover {
    border-color: #52717e !important;
    background: #0a2b36 !important;
    color: #fff !important;
}

#rfp-preview .rfp-preference-summary:focus-visible,
#rfp-preview .rfp-preference-search:focus-visible,
#rfp-preview .rfp-preference-actions button:focus-visible,
#rfp-preview .rfp-preference-reset:focus-visible {
    outline: 2px solid #39ff14 !important;
    outline-offset: 2px;
}

#rfp-preview .rfp-preference-option input:focus-visible {
    outline: 2px solid #39ff14 !important;
    outline-offset: 3px;
}

#rfp-preview .rfp-preference-option:focus-within {
    box-shadow: inset 0 0 0 1px #39ff14;
}

#rfp-preview .rfp-preference-actions button:disabled,
#rfp-preview .rfp-preference-reset:disabled {
    opacity: .55;
    cursor: default !important;
}

#rfp-preview .rfp-preference-note {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0;
    padding: 0 2px;
    color: #b9c8cf;
    font: 400 11px/1.5 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-wrap: anywhere;
}

#rfp-preview .rfp-preference-note:empty {
    display: none;
}

#rfp-preview .rfp-preference-note[data-state='error'] {
    color: #efbd9f;
}

#rfp-preview .rfp-preference-empty {
    margin: 0;
    padding: 14px 10px;
    color: #b9c8cf;
    font: 400 12px/1.5 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-wrap: anywhere;
}

#rfp-preview #rfp-preferences[hidden],
#rfp-preview #rfp-preferences [hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    #rfp-preview #rfp-preferences {
        grid-template-columns: minmax(0, 1fr);
    }
    #rfp-preview .rfp-preference-reset {
        justify-self: start;
        max-width: 100%;
    }
    #rfp-preview .rfp-preference-search {
        font-size: 16px !important;
    }
    #rfp-preview .rfp-preference-panel {
        /* Two equal tracks plus their 8px gap equal the controls' actual width. */
        width: calc(200% + 8px);
        min-width: 0;
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 380px) {
    #rfp-preview .rfp-preference-controls {
        grid-template-columns: minmax(0, 1fr);
    }
    #rfp-preview .rfp-preference-panel {
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    #rfp-preview .rfp-preference-summary::after {
        transition: none;
    }
}
