/* Explicit palettes, independent of the operating-system dark-mode preference.
   Do not disable accessibility forced colours or apply page-wide colour filters. */
:root,[data-rr-theme="light"]{color-scheme:only light;--rr-bg:#f3f5f6;--rr-surface:#ffffff;--rr-soft:#e8eef3;--rr-text:#10233a;--rr-muted:#465c72;--rr-border:#8093a5;--rr-accent:#c7f000;--rr-button:#071b33;--rr-button-text:#c7f000;--rr-link:#174f87;--rr-danger:#a11d2b;--rr-header:#071b33}
[data-rr-theme="dark"]{color-scheme:only dark;--rr-bg:#071421;--rr-surface:#10263a;--rr-soft:#1b354b;--rr-text:#f1f5f9;--rr-muted:#c1ceda;--rr-border:#73899c;--rr-accent:#c7f000;--rr-button:#c7f000;--rr-button-text:#071b33;--rr-link:#a9d4ff;--rr-danger:#ffafb6;--rr-header:#071b33}
[data-rr-theme="contrast"]{color-scheme:only dark;--rr-bg:#000000;--rr-surface:#000000;--rr-soft:#171717;--rr-text:#ffffff;--rr-muted:#ffffff;--rr-border:#ffffff;--rr-accent:#ffff00;--rr-button:#ffff00;--rr-button-text:#000000;--rr-link:#80e5ff;--rr-danger:#ffbfc4;--rr-header:#000000}
html[data-rr-theme]{--paper:var(--rr-bg);--ink:var(--rr-text);--muted:var(--rr-muted);--line:var(--rr-border)}
html[data-rr-theme] body{background:var(--rr-bg);color:var(--rr-text)}
html[data-rr-theme] :is(.card,.round,.tableWrap,.memberRow,.memberRow:nth-child(even),.displaySettingsPanel,.scoreSheet,.scorePanel,.scoreTop,.modalBox,.rallyDialog,.tournamentPairCard,.runnerCallout,.empty){background:var(--rr-surface);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme] :is(main,.displaySettingsPanel,.scoreSheet) :is(h1,h2,h3,h4,label,strong,b,td){color:var(--rr-text)}
html[data-rr-theme] :is(.hint,.themeHelp,.hero p,.title p,.hero>small,.title>small,.court,.vs,.memberLevelHelp,.memberRow small,.tick small,#notice,.displaySettingsHead){color:var(--rr-muted)!important}
html[data-rr-theme] :is(input,select,textarea){background:var(--rr-surface);color:var(--rr-text);border-color:var(--rr-border);-webkit-text-fill-color:var(--rr-text)}
html[data-rr-theme] input[type="checkbox"]{accent-color:var(--rr-accent)}
html[data-rr-theme] input::placeholder{color:var(--rr-muted);opacity:1}
html[data-rr-theme] :is(.tick,.sit,.matchScored,th,.duprCode,.keypad button,.secondary,.importButton,.player button,.displaySettingsHead button,.matchDisplaySize button,.tournamentTableSize button){background:var(--rr-soft);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme] :is(.bigScore,.tapMatch .teams strong,td:last-child){color:var(--rr-text)}
html[data-rr-theme] :is(header,.roundHead){background:var(--rr-header);color:#ffffff}
html[data-rr-theme] .roundHead :is(b,span,strong){color:var(--rr-accent)}
html[data-rr-theme] :is(.primary,button.primary){background:var(--rr-button);color:var(--rr-button-text);border:1px solid var(--rr-border)}
html[data-rr-theme] .primary :is(b,strong,span){color:inherit}
html[data-rr-theme] header nav :is(a,button){color:#dce5ed}
html[data-rr-theme] header nav .active{background:var(--rr-accent);color:#071b33}
html[data-rr-theme] main a{color:var(--rr-link)}
html[data-rr-theme] :is(.dangerSecondary,.error){color:var(--rr-danger)}
html[data-rr-theme] :focus-visible{outline:3px solid var(--rr-link);outline-offset:3px}
html[data-rr-theme] :is(.matchDisplaySize,.tournamentTableSize) button.active{background:var(--rr-accent);color:#071b33}
html[data-rr-theme] .displaySettingsToggle{display:grid!important;place-items:center;flex:0 0 44px;width:44px;height:44px;background:#173550;color:#ffffff;border:1px solid #a5b6c7;font-size:25px;line-height:1}
.displaySettingsPanel{max-height:calc(100dvh - 85px);overflow-y:auto}
.themeChoice{display:block;font-size:16px;font-weight:700;margin:8px 0}
.sessionDetailsSummary{margin:8px 0 12px;line-height:1.6;font-size:16px;color:var(--rr-text);overflow-wrap:anywhere}
.sessionPlayOptions #partnerOptions{margin-bottom:16px}
.sessionPlayOptions label{display:block}
.sessionPlayOptions .clubScoreOption{margin-bottom:0}
.runnerAwaitingSelection #sessionPlayOptions{display:none!important}
/* Match buttons and picker rows have their own legacy white backgrounds. */
html[data-rr-theme] :is(.tapMatch,.match,.readySession,.memberChoice,.sessionMemberChoices label){background:var(--rr-surface);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme] .matchScored{background:var(--rr-soft)}
html[data-rr-theme="contrast"] body,html[data-rr-theme="contrast"] :is(input,select,textarea,button,span,p,label,small,td,th){font-weight:800!important}
body.matchSizeLarge #session{--session-font:19px;--session-name:20px}
body.matchSizeXLarge #session{--session-font:22px;--session-name:24px}
body:is(.matchSizeLarge,.matchSizeXLarge) #session :is(label,p,.hint,.sessionDetailsSummary,.readySummary,.readySummary span){font-size:var(--session-font)!important;line-height:1.4}
body:is(.matchSizeLarge,.matchSizeXLarge) #session :is(input,select,.player button){font-size:var(--session-name)!important;line-height:1.3}
.populatedImportHidden{display:none!important}
#rounds>.title{display:none!important}
#roundList .insertManual{display:none!important}
#roundList .roundScreen.phoneRoundActive{min-height:160px!important;overflow:auto}
#rounds .roundActions #downloadRunningOrder{position:static;width:auto;margin:0;padding:11px 14px;display:inline-flex;gap:8px;align-items:center}
#rounds .roundActions{align-items:stretch;gap:8px}
#rounds .roundActions>button{flex:0 1 auto;width:auto}
html[data-rr-theme="contrast"] #withdrawPlayer{background:#b00000!important;color:#fff!important;border:2px solid #fff}
html[data-rr-theme="contrast"] .editRoundPlayers{background:#ffff00!important;color:#000!important;border:2px solid #000;font-weight:900}
@media(max-width:600px){#rounds .roundActions>button{width:100%}}
body[data-members-access="denied"] #members{display:none!important}
#memberPickerModal .scoreTop h2{font-size:18px;margin:0 0 8px}
#memberPickerModal .memberPickerSheet{max-height:calc(100dvh - 20px);overflow:auto}
#memberPickerModal .scoreTop{margin:0;padding:0}
#memberPickerModal #sessionMemberSearch{font-size:16px;margin-top:0}
.phoneRoundNav{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;gap:8px;align-items:center;margin:12px 0}
.phoneRoundNav>button{min-height:44px;border:1px solid var(--rr-border);border-radius:8px;background:var(--rr-soft);color:var(--rr-text);font-size:24px}
.phoneRoundNav>b{text-align:center;color:var(--rr-text)}
.phoneRoundNav>#phoneRoundTools{grid-column:1/4;font-size:14px}
#roundList .roundScreen{display:none!important}
#roundList .roundScreen.phoneRoundActive{display:flex!important;flex-direction:column}
@media(min-width:601px){
 #rounds>.title{margin-bottom:8px}#rounds>.title h1{font-size:28px;margin:0}
 #rounds>.title>p,#rounds>.title>small{display:none}
 #roundList .roundScreen.phoneRoundActive{margin:8px 0;min-height:320px;overflow:auto}
 #roundList .roundScreen .match{min-height:72px;flex:1 0 auto;padding:12px 18px}
 .roundActions{display:none}#rounds.phoneToolsOpen .roundActions{display:flex;flex-wrap:wrap}
}
.themeChoice select{display:block;width:100%;min-height:44px;font-size:16px}
.themeHelp{font-size:14px;line-height:1.45;margin:8px 0 16px}
/* Clear, consistent close targets in every dialog and display-settings panel. */
html[data-rr-theme] :is(.scoreTop>button,.displaySettingsHead>button){background:#071b33!important;color:#fff!important;-webkit-text-fill-color:#fff!important;border:2px solid #fff;opacity:1;min-width:44px;min-height:44px;flex-shrink:0;display:grid;place-items:center;padding:0;line-height:1;font-size:28px;font-weight:900}
html[data-rr-theme="contrast"] :is(.scoreTop>button,.displaySettingsHead>button){background:#ffff00!important;color:#000!important;-webkit-text-fill-color:#000!important;border-color:#000}
html[data-rr-theme] :is(.scoreTop>button,.displaySettingsHead>button):hover{box-shadow:0 0 0 2px var(--rr-link)}
/* One tool row with uniform touch targets; narrow screens can swipe the row. */
#rounds.phoneToolsOpen .roundActions{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(150px,1fr);justify-content:stretch;gap:8px;overflow-x:auto;max-width:100%;padding:2px 0 6px;margin:0 0 8px}
#rounds .roundActions>button,#rounds .roundActions #downloadRunningOrder{box-sizing:border-box;display:flex;justify-content:center;align-items:center;gap:5px;width:100%;height:56px;min-height:56px;max-height:56px;margin:0;padding:8px 10px;font-size:13px;line-height:1.2;white-space:normal;border-radius:9px;flex:none}
#roundList .roundScreen .editRoundPlayers{box-sizing:border-box;flex-shrink:0;margin-bottom:5px!important}
html[data-rr-theme] #rounds .roundActions>button{background:var(--rr-soft);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme] .editRoundPlayers{background:var(--rr-soft);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme] .sitToggle span{background:var(--rr-surface);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme="contrast"] .sitToggle span{background:#ffff00;color:#000;border-color:#ffff00}
html[data-rr-theme] #manualModal :is(.manualSheet,.manualCourt,.playerPicker){background:var(--rr-surface);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme] #manualModal :is(h2,.playerPicker h3){color:var(--rr-text)}
html[data-rr-theme] #manualModal :is(small,p,.manualVs,.manualCourtOff){color:var(--rr-muted)}
html[data-rr-theme] #manualModal :is(.manualSlot,.manualSlot.filled,.manualPlayer,.manualCourtType){background:var(--rr-soft);color:var(--rr-text);border-color:var(--rr-border);-webkit-text-fill-color:var(--rr-text)}
html[data-rr-theme] #manualModal :is(.manualCourtHead,.manualCourt h3){background:var(--rr-header);color:var(--rr-accent)}
html[data-rr-theme] #manualModal .manualPlayer.selected{background:var(--rr-accent);color:#071b33;-webkit-text-fill-color:#071b33;border-color:var(--rr-accent)}
html[data-rr-theme] #manualModal .manualSlot.selectedTarget{outline:3px solid var(--rr-accent);outline-offset:1px}
html[data-rr-theme="contrast"] #manualModal :is(.manualCourt,.playerPicker,.manualSlot){border-width:2px}
html[data-rr-theme] :is(.confirmSheet,.attendanceSheet,.memberPickerSheet,.matchDisplaySize,.tournamentTableSize){background:var(--rr-surface);color:var(--rr-text);border-color:var(--rr-border)}
html[data-rr-theme] :is(.matchDisplaySize,.tournamentTableSize) span{color:var(--rr-muted)}
html[data-rr-theme] :is(.matchDisplaySize,.tournamentTableSize) button[aria-pressed="true"]{background:var(--rr-accent);color:#071b33}
html[data-rr-theme] .collapsibleSit{background:var(--rr-soft)!important;color:var(--rr-text)}
html[data-rr-theme] .sitToggle{background:var(--rr-soft);color:var(--rr-text)}
.importedDetailsNotice{font-size:14px;line-height:1.5;padding:12px;border:1px solid var(--rr-border);border-radius:8px;color:var(--rr-text);background:var(--rr-soft)}
.picklebookDetailsLocked :disabled{opacity:1;cursor:default;-webkit-text-fill-color:var(--rr-text)}
html[data-rr-theme="contrast"] :is(.roundDone,.roundUpcoming,.player.away){opacity:1;filter:none}
html[data-rr-theme="contrast"] :is(.round,.card,.scoreSheet){border:2px solid #fff;box-shadow:none}
@media(max-width:1000px){header{flex-wrap:wrap}.headerTools{flex-wrap:wrap;gap:6px}.displaySettingsPanel{top:80px;z-index:1000}}
@media(max-width:600px){html[data-rr-theme] .displaySettingsToggle{width:38px;height:38px;flex-basis:38px}.displaySettingsPanel{top:95px;max-height:calc(100dvh - 105px)}}
