/* Shared tennis design contract. Original court colors and scoring hierarchy retained. */
:root{--radius:1rem;--small-radius:.5rem;--motion:180ms;--space:.75rem;--shadow:0 .125rem .5rem rgb(0 0 0 / .045);--hover:color-mix(in srgb,var(--court) 10%,var(--surface));--warning:var(--live);--chrome-height:5rem;--ganak-shell-max:72rem;--ganak-shell-gutter:clamp(.75rem,3vw,2rem);--ganak-journey-title:clamp(1.5rem,3.5vw,2.6rem);--ganak-choice-card-height:15.625rem;--body:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;--display:var(--body)}
:root{--muted:#425047;--warning:#923108}
:root[data-theme=dark]{--hover:color-mix(in srgb,var(--ball) 12%,var(--surface));--muted:#bccbc1;--warning:#ffb98a}
[hidden]{display:none!important}
html{height:auto;min-height:100%;scrollbar-gutter:stable;scroll-padding-top:calc(var(--chrome-height) + 1rem)}
body{height:auto;min-height:100dvh;font-size:1rem;line-height:1.5;overflow-wrap:normal;word-break:normal;hyphens:none}
button,input,select,a{touch-action:manipulation}
button,.navlink,.sitebar a{min-height:2.75rem;min-width:2.75rem;border-radius:var(--radius);font-size:1rem;transition:background var(--motion),border-color var(--motion),opacity var(--motion)}
button{padding:.625rem 1rem}
button:disabled{cursor:default;opacity:.55}
:is(button,a,input,select):focus-visible{outline:.1875rem solid var(--live);outline-offset:.1875rem}
.secondary,.newbtn,.primary{padding:.625rem 1rem;font-weight:600;box-shadow:var(--shadow)}
.secondary:hover:not(:disabled),.mrow:hover,.sitebar nav a:hover{background:var(--hover)}
.primary:hover:not(:disabled){background:var(--court);box-shadow:0 0 0 .125rem var(--ball)}
.navlink{color:var(--ink);text-decoration:none;display:inline-flex;align-items:center}
.sitebar{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.75rem max(var(--ganak-shell-gutter),calc((100% - var(--ganak-shell-max))/2));background:var(--surface);border-bottom:1px solid var(--line);box-shadow:var(--shadow)}
.sitebar .brand{font-family:var(--display);font-size:1.25rem;font-weight:700;display:flex;align-items:center;gap:.625rem;color:var(--ink);text-decoration:none;line-height:1.2}
.brand img{flex:none;width:2rem;height:2rem}
.sitebar nav{display:flex;gap:.25rem;flex-wrap:wrap}
.sitebar nav a{display:flex;align-items:center;padding:.5rem .875rem;color:var(--muted);text-decoration:none;font-weight:600}
.sitebar nav a[aria-current]{background:var(--chipS);color:var(--ink)}
.site-actions{display:flex;align-items:center;justify-content:flex-end;gap:.25rem;flex:none;flex-wrap:wrap;max-width:100%}
.site-actions .theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:3rem;height:3rem;min-width:3rem;padding:0;box-shadow:none;border-color:transparent;color:var(--muted)}
.theme-toggle svg{width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.site-actions .header-account{display:inline-flex;align-items:center;justify-content:center;min-width:5rem;white-space:nowrap;color:var(--ink);background:var(--surface);border:1px solid var(--line);text-decoration:none}
.site-actions .header-account:hover{background:var(--hover)}

@media(max-width:700px){.site-actions{order:2}.site-actions .header-account{font-size:.875rem;padding:.5rem}.sitebar .powered-brand{gap:.5rem}.sitebar .powered-brand img{width:1.75rem;height:1.75rem}.sitebar .powered-brand small{font-size:.75rem}.sitebar .powered-brand strong{font-size:1rem}}
#list{width:100%;max-width:75rem;padding:2rem 1.5rem 4rem;margin:0 auto;gap:1.25rem;grid-template-columns:minmax(0,1fr)}
.lhead{align-items:center;gap:1rem}
.lhead h1{font-size:2rem;line-height:1.15;font-weight:700;letter-spacing:0}
.lhead p{font-size:1rem;margin-top:.5rem;color:var(--muted)}
.connection,.sync{font-size:.875rem;line-height:1.5;min-height:1.5rem;overflow-wrap:normal}
.connection{margin:0;padding:.75rem 1rem;background:var(--chipS);color:var(--ink);border-left:.25rem solid var(--win);border-radius:var(--small-radius)}
.connection[data-state=error]{border-color:var(--warning);background:var(--surface);color:var(--warning)}
.organizer,.retrybar{display:flex;gap:.5rem;flex-wrap:wrap}
.match-organizer-tools,.stats-guidance{margin-block:.75rem}.match-organizer-tools>summary,.stats-guidance>summary,.record-controls>summary{display:flex;align-items:center;min-height:48px;cursor:pointer}.match-organizer-tools[open]>.organizer{margin-top:.75rem}
:is(.match-organizer-tools,.stats-guidance,.record-controls)>summary{gap:.75rem;justify-content:space-between}:is(.match-organizer-tools,.stats-guidance,.record-controls)>summary::after{content:"+";font-size:1.2em;flex:none}:is(.match-organizer-tools,.stats-guidance,.record-controls)[open]>summary::after{content:"−"}
.filters{gap:.5rem;align-items:center}
.filters button{font-size:1rem;padding:.5rem 1rem}
.note{font-size:1rem;padding:1rem;border-radius:var(--radius)}
.day h2{position:sticky;top:var(--chrome-height);z-index:1;background:var(--bg);font-size:.875rem;padding:.75rem 0;margin:0;letter-spacing:.075em}
.day+.day{margin-top:1.5rem}
.rows{border-radius:var(--radius);box-shadow:var(--shadow)}
.match-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
.match-entry+.match-entry{border-top:1px solid var(--line)}
.match-entry>.mrow{border-top:0}
.match-edit{min-height:3rem;margin-right:.5rem;padding:.5rem;font-size:.875rem}
.mrow{grid-template-columns:5.5rem minmax(0,1fr) auto;gap:1rem;padding:1rem;min-height:5rem;border-radius:0}
.mrow .when{font-size:1rem;line-height:1.4}
.mrow .when small,.mrow .lab{font-size:.875rem;letter-spacing:.025em;line-height:1.5}
.mrow .lab{flex-wrap:wrap;gap:.375rem}
.mrow .names{font-size:1rem;display:block;margin-top:.25rem}
.pill,.pill.up{font-family:var(--body);font-size:.875rem;font-weight:600;border-radius:var(--small-radius);white-space:normal;max-width:18rem}
.pill.live{background:var(--chipD);color:var(--ink)}
.ev{border-radius:.25rem}
#score{height:100dvh;overflow-y:auto;overscroll-behavior:contain;gap:.5rem}
.sbar{position:sticky;top:0;z-index:3;background:var(--court);gap:.5rem;padding:.5rem .75rem;flex-wrap:wrap}
.sbar .info{min-width:0;flex:1 1 10rem}
.sbar .info b{font-size:1.125rem;line-height:1.4;letter-spacing:.025em}
.sbar .info span{font-size:.875rem;opacity:1;display:block}
.sbar .back,.sbar .icon{font-size:1rem;border-radius:var(--radius);padding:.5rem .75rem}
.sync{padding:.25rem 1rem;text-align:center;flex-shrink:0}
.sync[data-state=error]{background:var(--ball);color:var(--ball-ink)}
.status{font-size:1.125rem;text-transform:none;letter-spacing:0;line-height:1.4;padding:.25rem .75rem;min-height:1.5rem;flex-shrink:0}
.panels{flex:1 0 auto;grid-auto-rows:1fr;grid-template-rows:1fr 1fr;gap:.75rem;padding:0 .75rem;min-height:20rem}
.panel{grid-template-rows:auto 1fr;padding:1rem;border-radius:var(--radius);min-height:10rem;gap:.5rem;overflow:visible}
.panel:disabled{opacity:1}
#score :is(button,a):focus-visible{outline-color:var(--ball)}
.panel .pn{font-size:clamp(1.25rem,4vw,2rem);line-height:1.2;padding-right:2rem}
.panel .nums{align-items:center;gap:1rem;flex-wrap:wrap}
.panel .g small{font-size:.875rem;opacity:1;line-height:1.4}
.panel .g b{font-size:clamp(3.5rem,12vw,8rem);line-height:1}
.panel .p{font-size:clamp(2.75rem,10vw,6rem);line-height:1;border-radius:var(--small-radius);padding:.25rem .75rem;min-width:1.6em}
.panel.won .p{font-size:2rem}
.lastpt{font-size:.875rem;opacity:1;line-height:1.5;padding:.25rem .75rem;min-height:1.5rem;flex-shrink:0}
.games-strip{font-size:.875rem;line-height:1.4;opacity:1;text-align:center;padding:.25rem 1rem;flex-shrink:0}
.controls{padding:.5rem .75rem .75rem;gap:.5rem;flex-shrink:0}
.controls button{font-size:1rem;min-width:8rem;min-height:2.75rem;padding:.625rem .75rem;flex:1}
.controls .undo{background:var(--surface);color:var(--ink)}
.retrybar{padding:.5rem .75rem;flex-shrink:0}
.retrybar button{background:var(--ball);color:var(--ball-ink);flex:1}
dialog{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--ink);padding:1.5rem;width:min(36rem,calc(100% - 2rem));max-height:90dvh;overflow:auto;box-shadow:0 1rem 4rem rgb(0 0 0 / .2)}
dialog::backdrop{background:rgb(0 0 0 / .6)}
dialog h2{font-size:1.5rem;margin-bottom:.75rem}
#dialogBody{display:grid;gap:1rem;margin:0}
#dialogBody p{margin:0}
.error{color:var(--warning);font-size:1rem;margin:.75rem 0;min-height:1.5rem}
.error:empty{min-height:0;margin:.5rem 0}
.field{min-width:0;gap:.375rem}
.field label{font-size:.875rem}
.field input,.field select{width:100%;min-width:0;min-height:3rem;font-size:1rem;border-radius:var(--small-radius);padding:.625rem}
label:has(input[type=checkbox]){display:flex;align-items:center;gap:.75rem;min-height:2.75rem}
input[type=checkbox]{width:1.25rem;height:1.25rem;flex:none;accent-color:var(--court)}
.btnrow{gap:.5rem}
.btnrow button{font-size:1rem;min-width:7rem;white-space:normal;padding:.75rem}
.hint{font-size:.875rem}
.two{gap:1rem}
table.stats{table-layout:fixed;font-size:.875rem}
table.stats th{font-size:1rem}table.stats th,table.stats td{padding:.5rem .25rem;overflow-wrap:normal}
.draw-summary{gap:.75rem}
.draw-summary div{min-width:7rem;border-radius:var(--radius);padding:1rem;box-shadow:var(--shadow)}
.draw-summary b{font-size:2rem}
.draw-summary span{font-size:.875rem}
.courts,.groups{gap:1rem}
.court,.group{padding:1.25rem;border-radius:var(--radius);box-shadow:var(--shadow);min-width:0}
.court h2,.group h2{font-size:1.375rem;margin-bottom:.75rem}
.court a{font-size:1rem;min-height:2.75rem;color:var(--ink);border-radius:var(--small-radius)}
.court .btnrow{margin-top:.75rem}
.players{gap:.5rem}
.player{font-size:.875rem;border-radius:var(--small-radius);padding:.5rem .625rem}
.player.out{opacity:1;color:var(--muted)}
.logrow{font-size:1rem;padding:1rem 0}
#drawLog{max-height:30rem;overflow:auto;scrollbar-width:thin;padding-right:.5rem}
@media(min-width:900px){.panels{grid-template-rows:1fr;grid-template-columns:1fr 1fr}}
@media(max-width:700px){.sitebar{flex-wrap:wrap;gap:.5rem;padding:.5rem 1rem}.sitebar nav{order:3;width:100%}.sitebar nav a{flex:1 0 auto;justify-content:center;white-space:nowrap}.sitebar .brand{font-size:1.125rem;flex:1 1 12rem;overflow-wrap:normal}.sitebar #theme{font-size:.875rem;padding:.5rem;flex:none}.courts,.groups{grid-template-columns:1fr}#list{padding:1.5rem 1rem 3rem}.mrow{grid-template-columns:4.75rem minmax(0,1fr);gap:.5rem;padding:.875rem}.mrow .pill{grid-column:2;justify-self:start}.two{grid-template-columns:1fr}.lhead{align-items:flex-start}.panel .g b{font-size:3.5rem}.panel .p{font-size:2.75rem}}
@media(prefers-reduced-motion:no-preference){dialog[open]{animation:arrive var(--motion) ease-out}@keyframes arrive{from{opacity:.5}to{opacity:1}}}
@media(max-width:700px){.brand-long{display:none}.sitebar .brand{flex:1 1 auto}.sitebar nav a{white-space:normal;overflow-wrap:normal;flex:1 1 auto;padding:.5rem}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Persistent context follows mobile platform guidance: compact chrome, native filter, 48px targets. */
button,.sitebar a,.navlink,input,select{min-height:3rem;min-width:3rem}
.context-anchor{height:1px;margin-bottom:-1px}
.tournament-context{position:sticky;top:var(--sitebar-height,5rem);z-index:5;display:grid;gap:.75rem;background:var(--bg);padding:.75rem 0;margin-bottom:var(--context-reserve,0px);border-bottom:1px solid var(--line)}
.tournament-context.compact .lhead h1{font-size:1.25rem}
.tournament-context.compact .lhead p{display:none}
.tournament-context.compact .connection{padding:.375rem .75rem}
.mobile-filter{display:none}
.lhead>div{min-width:0}.lhead button{flex:none}
.player-state{display:block;font-size:.875rem}
.log-region{position:relative}.log-hint{font-size:.875rem;color:var(--muted)}
#drawLog:focus-visible{outline:.1875rem solid var(--live);outline-offset:.25rem}
#drawLog{border-bottom:1px solid var(--line)}
textarea{font:inherit;width:100%;min-height:10rem;padding:.75rem;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--small-radius)}
@media(max-width:700px){.tournament-context{gap:.5rem}.tournament-context .filters{display:none}.mobile-filter{display:flex;align-items:center;gap:.75rem}.mobile-filter label{font-size:.875rem}.mobile-filter select{flex:1;min-width:0;font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:var(--small-radius);padding:.5rem}.lhead{flex-wrap:wrap}.lhead h1{overflow-wrap:normal}.tournament-context.compact .lhead{align-items:center;gap:.5rem}.tournament-context.compact .lhead>div{flex:1}.tournament-context.compact #account{font-size:.875rem;padding:.5rem}.tournament-context .connection{font-size:.875rem}.sitebar{padding-top:max(.5rem,env(safe-area-inset-top))}#score{padding-bottom:env(safe-area-inset-bottom)}}

.powered-by{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--line)}.powered-by a{display:inline-flex;align-items:center;gap:.75rem;min-height:3rem;color:var(--muted);font-size:.875rem;text-decoration:none;border-radius:var(--small-radius)}.powered-by img{flex:none;width:2rem;height:2rem}.powered-by strong{color:var(--ink)}.powered-by small{display:block;font-size:.875rem}.powered-by a:hover{text-decoration:underline;text-underline-offset:.2rem}

.sitebar .powered-brand{display:flex;align-items:center;gap:.625rem;color:var(--ink);text-decoration:none;line-height:1.2;min-height:3rem;font-family:var(--body)}.powered-brand img{width:2rem;height:2rem;flex:none}.powered-brand small{display:block;color:var(--muted);font-size:.875rem;font-weight:400}.powered-brand strong{display:block;font-size:1.125rem;font-weight:700}@media(max-width:700px){.sitebar .powered-brand{flex:1}}

.lhead h1{font-family:var(--body);font-weight:700;letter-spacing:-.025em}

:root{--body:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif}.lhead h1{font-weight:600}label:has(input[type=checkbox]){min-height:3rem}

.sitebar .powered-brand{flex:1 1 12rem;min-width:min-content;max-width:100%;overflow-wrap:normal}.powered-brand>span{min-width:0}.sitebar .powered-brand strong{font-size:1.25rem;white-space:nowrap}.sitebar .powered-brand small{font-size:.875rem;line-height:1.3}.powered-brand small span{white-space:nowrap}.context-short{display:none}.compact .context-long{display:none}.compact .context-short{display:inline}.sitebar nav{min-width:0}.tournament-context .lhead h1{line-height:1.2;overflow-wrap:anywhere}
@media(max-width:700px){.sitebar .powered-brand{flex-basis:8rem}}


@media(max-width:700px){.mobile-filter label{display:none}.mobile-filter select{width:100%}.mrow{display:flex;flex-wrap:wrap;align-items:center}.mrow .when{flex:0 0 4.75rem}.mrow .who{flex:1 1 12rem;min-width:0}.mrow .pill{flex:0 1 auto}.mrow .lab{text-transform:none;letter-spacing:0}}

/* Darker court panels preserve readable small labels in sunlight. */
.panel{background:rgb(0 0 0 / .12)}

.panel-heading{display:grid;gap:.375rem}.point-detail{display:block;font-family:var(--body);font-size:.875rem;line-height:1.4;font-weight:500;color:var(--court-ink)}.point-detail:empty{display:none}
.reason-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}.reason{min-height:3.5rem;font-size:1rem;line-height:1.25;padding:.5rem}.reason:active{background:var(--ball);color:var(--ball-ink)}


/* Scoring workspace: primary actions fit the viewport; secondary details live in Match Options. */
:root{--point-saved:color-mix(in srgb,var(--surface) 72%,var(--win));--point-gap:.75rem}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.score-options{position:relative;flex:none}
.score-options summary{display:flex;align-items:center;justify-content:center;min-height:3rem;padding:.5rem .75rem;max-width:7rem;border-radius:var(--radius);background:rgb(0 0 0 / .12);font-size:.875rem;line-height:1.3;font-weight:600;cursor:pointer;list-style:none}
.score-options summary::-webkit-details-marker{display:none}
.score-options summary:focus-visible{outline:.1875rem solid var(--ball);outline-offset:.125rem}
.score-options-menu{position:fixed;right:.5rem;top:calc(var(--scorebar-height,4rem) + env(safe-area-inset-top) + .5rem);z-index:5;display:grid;gap:.75rem;width:min(22rem,calc(100vw - 1rem));max-height:calc(100dvh - var(--scorebar-height,4rem) - env(safe-area-inset-top) - 1rem);overflow:auto;padding:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--court);box-shadow:0 .5rem 2rem rgb(0 0 0 / .25)}
.score-options-menu :is(.sync,.status,.games-strip){font-size:.875rem;line-height:1.5;padding:0;margin:0;min-height:0;text-align:left;display:block}
.sbar{flex:none}.sbar .info b,.sbar .info span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.panel{display:flex;flex-direction:column;gap:var(--point-gap);background:color-mix(in srgb,var(--court) 88%,black)}.panel:active{background:color-mix(in srgb,var(--court) 88%,black)}
.score-tap{position:relative;display:grid;gap:.5rem;flex:1;min-width:0;width:100%;padding:0;text-align:left;color:var(--court-ink);border-radius:var(--small-radius);background:none}
.score-tap:disabled{opacity:1}.score-tap .serve{top:0;right:0}
.point-detail{min-height:1.4em}.point-detail:empty{display:block}
.inline-reasons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--point-gap);flex:none}
.shot-button{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--small-radius);min-height:4rem;padding:.75rem;font-size:1rem;line-height:1.3;font-weight:600;transition:background 600ms ease-out,box-shadow var(--motion)}
.shot-button:disabled{opacity:1;cursor:default}.shot-button:active:not(:disabled){background:var(--hover)}@media(hover:hover) and (pointer:fine){.shot-button:hover:not(:disabled){box-shadow:inset 0 0 0 2px var(--ball)}}
.shot-button.saved-point,.score-tap.saved-point{background:var(--point-saved);color:var(--ink);box-shadow:inset 0 0 0 1px var(--win);transition:background 140ms ease-out}
.score-tap{transition:background 600ms ease-out}
.shot-button{position:relative}
.saving-point::after{content:"";position:absolute;top:.25rem;right:.25rem;width:.625rem;height:.625rem;border:.125rem solid currentColor;border-right-color:transparent;border-radius:50%;animation:saving-turn 900ms linear infinite}
@keyframes saving-turn{to{transform:rotate(360deg)}}
.point-only-hint{font-size:.875rem;line-height:1.4;text-align:right}
.with-stats .panels{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr;align-items:stretch;flex:1 0 auto;min-height:0}
.with-stats .panel{min-width:0;min-height:0}.with-stats .panel .g b,.with-stats .panel .p{font-size:2rem}
.with-stats .panel .pn{font-size:1rem;min-height:2.4em;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.is-scoring .point-detail,.is-scoring #lastPoint{display:none}
.with-stats .score-tap{flex:0 0 auto;z-index:1}.with-stats .inline-reasons{flex:1;grid-auto-rows:1fr}
.with-stats .controls{position:sticky;bottom:0;z-index:2;background:var(--court)}
.with-stats .controls button{min-height:3rem}
#scoreAlert{background:var(--ball);color:var(--ball-ink)}
@media(max-width:700px){
  #score.with-stats{gap:.25rem}
  .sbar{flex-wrap:nowrap;align-items:center;padding:.25rem .5rem;gap:.5rem}.sbar .info{flex:1;min-width:0;text-align:left}.sbar .info b,.sbar .info span{font-size:.875rem;line-height:1.25}.sbar .back{padding:.5rem;font-size:1.5rem;line-height:1}.back-label{display:none}
  .score-options summary{max-width:4.5rem;padding:.25rem .5rem;font-size:.875rem;text-align:center}
  .with-stats .panels{padding-inline:.5rem;gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr))}
  .with-stats .panel{padding:.5rem;border-radius:.75rem;gap:.5rem}
  .with-stats .score-tap{gap:.25rem}
  .with-stats .panel-heading{gap:0}
  .with-stats .panel .pn{font-size:.875rem;line-height:1.15;padding-right:1rem;min-height:2.3em}
  .with-stats .panel .g b,.with-stats .panel .p{font-size:1.75rem;line-height:1}
  .with-stats .panel .g{display:flex;flex-direction:row-reverse;align-items:baseline;gap:.25rem}
  .with-stats .panel .g small{font-size:.875rem;letter-spacing:0;text-transform:none}
  .with-stats .panel .nums{gap:.25rem;flex-wrap:nowrap}.with-stats .panel .p{padding:.125rem .375rem}
  .with-stats .score-tap .serve{width:.625rem;height:.625rem}
  .inline-reasons{grid-template-columns:1fr}
  .shot-button{min-height:3rem;font-size:.875rem;line-height:1.15;padding:.375rem .5rem}
  .with-stats .controls{padding:.25rem .5rem .5rem}
  .with-stats .controls button{min-width:5rem;font-size:1rem;padding:.5rem}
  .with-stats .point-only-hint{display:none}
}
/* Short phones retain 48px targets and all six reasons per side in reach. */
@media(max-width:700px) and (max-height:680px){
  :root{--point-gap:.5rem}
  #score.with-stats{gap:.25rem}
  .with-stats .sbar{padding:0 .25rem}
  .with-stats .panels{padding-inline:.25rem;gap:.5rem}
  .with-stats .panel{padding:.25rem;gap:.25rem}
  .with-stats .score-tap{gap:.125rem}
  .with-stats .panel .g b,.with-stats .panel .p{font-size:1.5rem}
  .with-stats .panel .p{padding:0 .25rem}
  .with-stats .controls{padding:0 .25rem .25rem}
}

/* Shared discovery and insight surfaces. Live updates retain their existing nodes. */
.player-search input{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.mrow:has(.spectator-match){display:block;white-space:normal}
.spectator-match{display:block;width:100%;min-width:0}
.spectator-meta{display:block;font-size:.875rem;line-height:1.5;color:var(--muted);font-weight:400}
.spectator-match-body{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-top:.5rem}
.spectator-match-body .names{flex:1;min-width:0;margin:0;font-size:1rem;line-height:1.5}
.spectator-player{display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap;overflow-wrap:anywhere}
.spectator-winner{color:var(--accent-text);font-size:.875rem;font-weight:600}
.spectator-predictions{margin:0 .875rem .5rem}
.spectator-predictions>summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;cursor:pointer;color:var(--muted);font-size:.875rem;font-weight:500;list-style:none}
.spectator-predictions>summary::-webkit-details-marker{display:none}
.spectator-predictions>summary::after{content:'+';font-size:1.25rem}
.spectator-predictions[open]>summary::after{content:'−'}
.spectator-predictions .match-prediction{padding:.5rem 0}
.spectator-match-body .pill{flex:none;font-size:1rem;font-variant-numeric:tabular-nums}
.match-entry-actions .report-link-compact{min-height:44px;border:0;background:none;padding:.25rem 0;flex:none;color:var(--accent-text);box-shadow:none}
.report-link-compact strong{font-weight:500}
.spectator-list .connection[data-state=ok]{background:none;border:0;padding:0;color:var(--muted)}
.has-context #list>.connection[data-state=ok]{background:none;border:0;padding:0;color:var(--muted)}
.has-context #list{gap:.75rem;padding-top:1rem}.has-context #list>.lhead h1{font-size:1.65rem}
.spectator-list .tournament-context{position:sticky;margin-bottom:0;grid-template-columns:minmax(0,1fr)}
.spectator-list .tournament-context.compact .lhead p{display:block}
.spectator-list .tournament-context.compact .context-long{display:inline}
.spectator-list .tournament-context.compact .context-short{display:none}
.spectator-list .tournament-context .lhead h1,.spectator-list .tournament-context.compact .lhead h1{font-size:1.65rem}
@media(max-width:700px){
 .spectator-list .tournament-context{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:.5rem .75rem}
 .spectator-list .tournament-context>:not(.mobile-filter):not(.player-search){grid-column:1/-1}
 .spectator-list .mobile-filter select,.spectator-list .player-search input{min-height:48px;width:100%;margin:0}
 .spectator-list .player-search{margin:0;min-width:0;align-self:end}
 .spectator-list .match-entry-actions:has(.report-link-compact){padding:0 .875rem .5rem}
}
.player-search label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.standings-grid,.player-tables{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,20rem),1fr));gap:var(--space);margin-top:var(--space)}
.standing-group,.player-stat-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:var(--space)}
.standing-group h3,.player-stat-card h2{font:600 1.125rem/1.4 var(--body);margin-bottom:.5rem}
.standing-group table th,.standing-group table td{font-size:.875rem}.standing-group th:first-child{width:auto;text-align:left}
.standing-rank{font-variant-numeric:tabular-nums;color:var(--muted)}.live-standing{display:block;font-size:.875rem;font-weight:400;color:var(--muted)}
.player-filters{display:grid;grid-template-columns:1fr 2fr;gap:var(--space)}
.player-stat-card .stats th{text-align:left;font-size:.875rem;font-weight:500;width:72%}.player-stat-card .stats td{font-variant-numeric:tabular-nums;text-align:right}.player-stat-card>.hint{margin-top:.5rem}
.insights-dialog{width:min(42rem,calc(100% - 1rem));max-height:calc(100dvh - 1rem);padding:.75rem}
.insights-dialog form{position:relative}.insights-dialog #dialogBody{gap:.375rem}
.insights-dialog #dialogTitle{display:flex;align-items:center;min-height:3rem;padding-right:5rem;margin:0;font-size:1.25rem}
.insights-dialog .btnrow{position:absolute;top:0;right:0}.insights-dialog .btnrow button{min-width:4.5rem;padding:.5rem}
.insight-tabs{display:flex;gap:.5rem}.insight-tabs button{flex:1;padding:.5rem;font-size:.875rem;line-height:1.2}
.insight-tabs button[aria-pressed=true]{background:var(--chipS);border-color:var(--win);color:var(--ink)}
.insights-dialog table.stats{font-size:.875rem;margin:0}.insights-dialog table.stats th{font-size:.875rem;line-height:1.2}.insights-dialog table.stats th:first-child{width:42%}
.insights-dialog table.stats td,.insights-dialog table.stats th{padding:.375rem .25rem}
.insights-dialog [data-stats-player]{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;white-space:normal;overflow-wrap:normal}
.insights-dialog #statsModeNote{font-size:.875rem;line-height:1.25;margin-bottom:.375rem}
#summaryPanel,#matchSummary{display:grid;gap:var(--space)}
#matchCommentary{padding-left:1.5rem;display:grid;gap:.5rem}.share-actions{display:flex;gap:.5rem;flex-wrap:wrap}
@media(max-width:700px){.sitebar nav a{font-size:.875rem;padding:.5rem}.standings-grid{grid-template-columns:1fr}.player-filters{grid-template-columns:1fr}}
@media(max-height:650px){.insights-dialog table.stats td,.insights-dialog table.stats th{padding:.25rem}.insights-dialog #dialogBody{gap:.25rem}}
@media(orientation:landscape) and (max-height:500px){.insights-dialog{width:min(56rem,calc(100% - 1rem));padding:.5rem}.insights-dialog #dialogTitle{font-size:1rem;min-height:3rem;max-width:30%;padding-right:0}.insights-dialog .insight-tabs{position:absolute;top:0;left:30%;right:5rem}.insights-dialog #statsLive{position:absolute;top:3rem;right:0}.insights-dialog table.stats th:first-child{width:40%}.insights-dialog table.stats td,.insights-dialog table.stats th{padding:.125rem .25rem}.insights-dialog #statisticsPanel{padding-top:1.25rem}}
@media(orientation:landscape) and (max-height:500px){
  :root{--point-gap:.5rem}
  #score.with-stats{gap:.25rem}
  .with-stats .sbar{padding:0 .25rem;flex-wrap:nowrap}.with-stats .sbar .back{line-height:1;padding:.5rem}
  .with-stats .sbar .info b,.with-stats .sbar .info span{font-size:.875rem;line-height:1.2}
  .with-stats .score-options summary{padding:.25rem .5rem;max-width:7rem}
  .with-stats .panels{padding-inline:.25rem;gap:.5rem;grid-template-columns:repeat(2,minmax(0,1fr))}
  .with-stats .panel{padding:.25rem;gap:.25rem}
  .with-stats .score-tap{grid-template-columns:minmax(0,1fr) auto;gap:.5rem;align-items:center;min-height:48px;padding-right:1rem}
  .with-stats .panel .pn{font-size:.875rem;line-height:1.15;min-height:0;padding-right:0}
  .with-stats .panel .g{display:flex;flex-direction:row-reverse;align-items:baseline;gap:.25rem}
  .with-stats .panel .g small{font-size:.875rem;letter-spacing:0;text-transform:none}
  .with-stats .panel .g b,.with-stats .panel .p{font-size:1.5rem;line-height:1}.with-stats .panel .p{padding:0 .25rem}
  .with-stats .panel .nums{gap:.5rem;flex-wrap:nowrap}.with-stats .score-tap .serve{width:.625rem;height:.625rem}
  .with-stats .point-only-hint{display:none}
  .with-stats .inline-reasons{grid-template-columns:repeat(2,minmax(0,1fr))}
  .with-stats .shot-button{min-height:3rem;padding:.375rem .5rem;font-size:.875rem;line-height:1.15}
  .with-stats .controls{padding:0 .25rem .25rem}.with-stats .controls button{padding:.5rem}
}

.standings-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space);flex-wrap:wrap}.standings-header h2{font:600 1.25rem/1.3 var(--body)}.standings-header .field{flex:none}.standings-grid{grid-template-columns:1fr}.standings-grid .standing-group{max-width:48rem}
@media(orientation:landscape) and (max-height:500px){.insights-dialog [data-stats-player]{-webkit-line-clamp:1}}

.share-summary{display:inline-flex;align-items:center;justify-content:center;min-height:3rem;min-width:3rem;padding:.5rem .75rem;border-radius:var(--radius);font:600 1rem/1.3 var(--body);color:var(--ink);background:var(--surface);border:1px solid var(--line);text-decoration:none;touch-action:manipulation}
.share-summary:hover{background:var(--hover)}.share-summary:focus-visible{outline:.1875rem solid var(--live);outline-offset:.1875rem}
.controls .share-summary{flex:1 1 auto;min-width:5rem;max-width:100%;white-space:nowrap}
.final-summary{display:grid;gap:.75rem;padding:1rem;margin:0 .75rem;color:var(--court-ink);border:1px solid rgb(255 255 255 / .25);border-radius:var(--radius);background:rgb(0 0 0 / .12)}
.final-summary h2{font:600 1.25rem/1.3 var(--body)}.final-summary p{margin:0;line-height:1.4}.final-summary #finalScoreline{white-space:pre-line;font-weight:600}.final-summary .hint{color:var(--court-ink)}
#score.is-complete .panels{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto;flex:0 0 auto;min-height:0}
#score.is-complete .panel{min-width:0;min-height:0;padding:.75rem}
#score.is-complete .panel .pn{font-size:1rem;padding-right:0}#score.is-complete .panel .g b{font-size:2.5rem}#score.is-complete .panel .p{font-size:1.125rem}
#score.is-complete .panel .nums{gap:.5rem;flex-wrap:nowrap}#score.is-complete .point-detail,#score.is-complete #lastPoint{display:none}
#score.is-complete .controls{position:sticky;bottom:0;background:var(--court);z-index:2}
@media(max-width:700px){.controls .share-summary{font-size:1rem;padding:.5rem}.final-summary{padding:.75rem;margin-inline:.5rem;gap:.5rem}.final-summary p{font-size:.875rem}#score.is-complete .panels{gap:.5rem;padding-inline:.5rem}#score.is-complete .panel .g small{font-size:.875rem}}

/* Whole words remain intact. Narrow standings reflow into labeled metric rows. */
.standing-group{container-type:inline-size;min-width:0}
.standing-group table{table-layout:auto}.metric-label{display:none}
.standing-group table th:not(:first-child){white-space:nowrap}
.qualification-panel{margin-top:var(--space);max-width:48rem}.qualification-panel h2{font:600 1.25rem/1.4 var(--body)}
.qualification-status{font-weight:600;margin:.75rem 0}.qualification-winners{list-style:none;padding:0;display:grid;gap:.75rem;margin:1rem 0}
.qualification-winners li{display:grid;gap:.25rem}.qualification-winners span{color:var(--muted);font-variant-numeric:tabular-nums}
.toss-controls{display:grid;gap:.75rem;margin-top:1rem}.toss-choices{display:flex;gap:.75rem;flex-wrap:wrap}.toss-choices button{min-height:44px}
@container(max-width:26rem){
  .standing-group table,.standing-group tbody{display:block}
  .standing-group thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .standing-group tr{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:.5rem 0;border-bottom:1px solid var(--line)}
  .standing-group table td{border:0;padding:.25rem;text-align:center}
  .standing-group th[scope=row]{grid-column:1/-1;text-align:left;border:0}
  .standing-group .metric-label{display:block;color:var(--muted);font-weight:500;white-space:nowrap}
}
@container(max-width:16rem){
  .standing-group tr{grid-template-columns:minmax(0,1fr)}
  .standing-group td[data-label]{display:flex;justify-content:space-between;gap:.5rem}
}
@media(max-width:26rem){.context-long{display:none}.context-short{display:inline}}

/* One shared, keyboard-accessible tap-choice primitive for match setup and outcomes. */
.choice-dialog{padding:1rem;width:min(36rem,calc(100% - 1rem));max-height:calc(100dvh - 1rem);container-type:inline-size}
.choice-group{border:0;padding:0;margin:0;min-width:0}
.choice-group legend{font-weight:600;font-size:1rem;margin-bottom:.5rem;padding:0}
.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space)}
.tap-choice{position:relative;display:flex;min-width:0;cursor:pointer}
.tap-choice input{position:absolute;width:1px;height:1px;min-width:0;min-height:0;padding:0;margin:0;clip-path:inset(50%);overflow:hidden}
.choice-face{display:flex;align-items:center;gap:.5rem;min-height:3.5rem;width:100%;padding:.75rem;border:2px solid var(--line);border-radius:var(--small-radius);background:var(--bg);transition:background var(--motion),border-color var(--motion)}
.choice-mark{display:flex;align-items:center;justify-content:center;flex:none;width:1.25rem;height:1.25rem;border:1px solid var(--muted);border-radius:50%;font-size:.875rem;color:transparent}
.choice-copy{min-width:0;display:grid;gap:.125rem}
.choice-copy strong{font-size:1rem;line-height:1.3;font-weight:600}
.choice-copy small{font-size:.875rem;line-height:1.3;color:var(--muted)}
.tap-choice input:checked + .choice-face{border-color:var(--win);background:var(--chipS)}
.tap-choice input:checked + .choice-face .choice-mark{background:var(--win);border-color:var(--win);color:var(--surface)}
.tap-choice input:focus-visible + .choice-face{outline:.1875rem solid var(--live);outline-offset:.125rem}
.tap-choice:has(input:disabled){cursor:default}
.tap-choice input:disabled + .choice-face{opacity:.55}
.choice-group:disabled input:checked + .choice-face{opacity:1}
.choice-help{padding-top:.5rem}
.outcome-preview{min-height:3rem;padding:.75rem;background:var(--chipS);border-radius:var(--small-radius)}
@media(hover:hover){.tap-choice:hover input:not(:disabled):not(:checked) + .choice-face{background:var(--hover)}}
@container(max-width:17rem){.choice-grid{grid-template-columns:1fr}.choice-face{padding:.5rem .75rem}}

.clipboard-buffer{position:fixed;top:0;left:0;width:1px;height:1px;min-height:0;padding:0;border:0;opacity:0;font-size:16px}
.app-update{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:var(--space);padding:var(--space);border:1px solid var(--line);border-radius:var(--small-radius);background:var(--surface);color:var(--ink);font-size:.875rem}

.choice-dialog .btnrow button{min-width:min(100%,7rem)}
@container(max-width:12rem){.choice-face{position:relative;display:block;padding:.75rem .5rem}.choice-mark{position:absolute;right:.25rem;top:.125rem;width:.75rem;height:.75rem;font-size:.625rem}.choice-copy{padding-top:.5rem}}

@media(max-width:700px){
  .sitebar{container-type:inline-size}
  .sitebar nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .sitebar nav a{padding:.375rem .25rem;text-align:center}
  @container(min-width:28rem){.sitebar nav{grid-template-columns:repeat(3,minmax(0,1fr))}}
}

/* Five parallel rankings reflow into readable columns on small screens. */
#leaderboard{margin-block:var(--space)}
.leaderboard-page{container:leaderboard-page / inline-size}
.leaderboard-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:var(--space);align-items:start}
.leaderboard-column{container:leaderboard-card / inline-size;min-width:0;padding:var(--space);border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.leaderboard-column :is(h2,h3){font-size:1rem;line-height:1.4;margin-bottom:var(--space);word-break:normal;overflow-wrap:normal}
.leaderboard-column ol{list-style:none;margin:0;padding:0}
.leaderboard-column li{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:.5rem;padding-block:.75rem;border-top:1px solid var(--line);font-size:.9375rem}
.leaderboard-name{word-break:normal;overflow-wrap:normal;min-width:0}
.leaderboard-rank{color:var(--muted);font-variant-numeric:tabular-nums}
.leaderboard-value{font-variant-numeric:tabular-nums;color:var(--ink)}
.leaderboard-column li.leaderboard-empty{display:block;color:var(--muted)}
.leaderboard-toggle{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;min-height:3rem;margin-block:.25rem;padding:.625rem .75rem;font-size:.9375rem;white-space:nowrap}
.leaderboard-chevron{flex:none;width:1rem;height:1rem;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform var(--motion) ease}
.leaderboard-toggle[aria-expanded=true] .leaderboard-chevron{transform:rotate(180deg)}
.leaderboard-more{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows 240ms ease,opacity var(--motion) ease}
.leaderboard-more[data-expanded=true]{grid-template-rows:1fr;opacity:1}
.leaderboard-more>div{min-height:0;overflow:hidden}
@container leaderboard-page (max-width:16rem){.leaderboard-page .lhead h1{font-size:1.375rem}}
@container leaderboard-card (max-width:12rem){
  .leaderboard-column li{grid-template-columns:minmax(0,1fr) auto;gap:.25rem .5rem}
  .leaderboard-rank{grid-area:1 / 1}.leaderboard-value{grid-area:1 / 2;text-align:right}.leaderboard-name{grid-area:2 / 1 / 3 / -1}
  .leaderboard-toggle{padding-inline:.25rem;gap:.25rem}.leaderboard-chevron{width:.75rem;height:.75rem}
}

.choice-dialog .btnrow button{flex:1 1 8rem}
.choice-dialog .field{min-width:0}

.choice-dialog .field select{max-width:100%;overflow:hidden;text-overflow:ellipsis}

.leaderboard-value small{display:block;color:var(--muted);font-size:.875rem;font-weight:400}
.leaderboard-column h2 a{color:inherit;text-underline-offset:.2em}
.leaderboard-caption{font-size:.875rem;line-height:1.4;color:var(--muted);margin:-.5rem 0 .75rem}
.leaderboard-column[data-leaderboard=gold]>.leaderboard-top{min-height:9rem}
#scoreLockStatus{text-align:center;margin:0}

.analysis-report{white-space:pre-wrap;line-height:1.65;overflow-wrap:break-word;padding-block:var(--space);border-top:1px solid var(--line)}

/* A report is a separate action, never an interactive element nested inside a match button. */
.match-entry-actions{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem .5rem 0}
.match-entry-actions:empty{display:none}
.match-entry-actions .match-edit{margin:0}
.report-link{display:inline-flex;align-items:center;justify-content:space-between;gap:1rem;min-height:3rem;padding:.625rem .875rem;border:1px solid var(--line);border-radius:var(--small-radius);background:var(--chipS);color:var(--ink);text-decoration:none;transition:background var(--motion),border-color var(--motion);touch-action:manipulation}
.report-link-copy{display:grid;gap:.125rem;min-width:0}.report-link strong{font:600 1rem/1.3 var(--body)}.report-link small{font:.875rem/1.3 var(--body);color:var(--muted)}
.report-link-icon{width:1.125rem;height:1.125rem;flex:none;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.report-link:hover{background:var(--hover);border-color:var(--win)}
.match-report-callout{display:flex;align-items:center;justify-content:space-between;gap:var(--space);padding:.75rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--ink)}
#score>.match-report-callout{margin:0 .75rem;flex-shrink:0}
.report-caption{font:600 1rem/1.4 var(--body)}.report-caption span{display:block;font:.875rem/1.4 var(--body);color:var(--muted);margin-top:.125rem}
.match-report-callout .report-link{flex:none}
#score .match-report-callout a:focus-visible{outline-color:var(--live)}
@media(max-width:700px){.match-entry:has(.report-link){grid-template-columns:minmax(0,1fr)}.match-entry:has(.report-link) .match-entry-actions{padding:0 .875rem .875rem;justify-content:space-between}.match-entry-actions .report-link{flex:1}.match-report-callout{flex-wrap:wrap}.match-report-callout .report-link{flex:1 1 12rem}#score>.match-report-callout{margin-inline:.5rem}}

/* Links used as actions share the button primitive across app pages. */
a.primary,a.secondary{display:inline-flex;align-items:center;justify-content:center;min-height:3rem;border-radius:var(--radius);font-size:1rem;text-decoration:none;transition:background var(--motion),border-color var(--motion),opacity var(--motion)}
a.secondary{color:var(--ink)}

.sport-service{flex:none;min-height:2.5rem;margin:0 .75rem;font-size:.8125rem;line-height:1.2;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--court-ink);overflow-wrap:normal}

/* Recovery stays reachable without displacing point controls on short phones. */
.score-options-menu .retrybar{display:grid;padding:0;gap:.5rem}
.score-options-menu .retrybar button{min-height:3rem}

/* Shared, accessible club context for GOLD and Leaderboard. */
.ranking-context{margin-block:16px 24px}.ranking-selectors{display:flex;flex-wrap:wrap;gap:16px}.ranking-selectors .field{flex:1 1 220px;min-width:0}.ranking-selectors select{width:100%;min-height:3rem;font:inherit}.ranking-context h2{font-size:1.25rem}.ranking-context [hidden],.ranking-selectors[hidden],#rankingContent[hidden]{display:none!important}

.ranking-selectors select,#leaderboardEvent{overflow:hidden;text-overflow:ellipsis;appearance:none;-webkit-appearance:none;max-width:100%;padding-right:2.25rem;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:right 1.3125rem center,right 1rem center;background-size:.3125rem .3125rem;background-repeat:no-repeat}

/* Keep the winner label readable during the saved-point feedback state too. */
.panel.won .p{color:inherit}

/* Preserve whole title words at narrow widths, including enlarged text. */
@media(max-width:420px){.leaderboard-page>.lhead h1{font-size:1.5rem}}

/* WebKit's native popup style ignores control height; use the shared theme. */
:root body select{appearance:none;-webkit-appearance:none;min-height:48px;min-width:0;max-width:100%;padding-right:2rem;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:right 13px center,right 9px center;background-size:4px 4px;background-repeat:no-repeat}
:root body .clubhouse label:has(>select)::after{display:none}
.sbar .back{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
.sbar .info h1{display:block;font:inherit;font-size:.875rem;font-weight:700;line-height:1.25;margin:0}

/* Rankings precede optional context controls and explanatory copy. */
#list.leaderboard-page{padding-top:1rem}
.leaderboard-page .ranking-context{margin-block:.75rem}
#rankingFilters>summary{display:flex;align-items:center;justify-content:space-between;gap:.75rem;min-height:48px;cursor:pointer;font-size:.875rem}
#rankingFilters>summary #rankingMessage{min-width:0;line-height:1.5}
.ranking-change{flex-shrink:0;color:var(--accent-text);font-weight:600}
.leaderboard-toolbar{display:flex;align-items:flex-end;gap:.75rem}
.leaderboard-toolbar .field{flex:1;min-width:0;order:-1;margin:0}
.leaderboard-toolbar .connection{align-self:center;padding:.3rem .5rem;margin:0;border:0;background:none;font-size:.875rem;flex:0 1 auto;max-width:40%}
.leaderboard-toolbar select{width:100%;min-height:48px}
.leaderboard-notes{margin:.5rem 0}
.leaderboard-notes>summary{min-height:44px;align-content:center;cursor:pointer;font-size:.875rem;color:var(--accent-text)}
.leaderboard-notes[open]{padding-bottom:.5rem}

/* Shared secondary affordance for disclosure summaries and review edits. */
.disclosure-action,.planner-edit-action{display:inline-flex;align-items:center;justify-content:center;align-self:center;min-height:48px;min-width:66px;border-radius:var(--radius);font-size:1rem;line-height:1.4;color:var(--ink);font-weight:600;text-decoration:none}
.club-join-link{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:.65rem 1rem;line-height:1.4;text-decoration:none}
.club-membership-field{display:grid;gap:.5rem;align-content:start}
.club-membership-field .club-join-link{justify-self:start}
/* A shared match recap and image studio, using Home's existing design tokens. */
.insights-dialog{width:min(46rem,calc(100% - 1rem));padding:1rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);color:var(--ink);overflow:auto;overscroll-behavior:contain}
.insights-dialog #dialogTitle{font-size:1.35rem;letter-spacing:-.025em;min-height:48px;margin-bottom:.65rem;max-width:none;padding-right:5rem}
.insights-dialog .insight-tabs{position:static;display:flex;padding:.25rem;border:1px solid var(--line);border-radius:var(--small-radius);background:var(--bg);margin-bottom:.65rem}
.insights-dialog .insight-tabs button{min-height:44px;margin:0;border:0;box-shadow:none;background:transparent;color:var(--muted)}
.insights-dialog .insight-tabs button[aria-pressed=true]{background:var(--surface);color:var(--ink);box-shadow:0 2px 5px color-mix(in srgb,var(--ink) 7%,transparent)}
.insights-dialog #statisticsPanel{padding-top:0}
.insights-dialog #statsLive{position:static}
.insights-dialog table.stats{border-collapse:separate;border-spacing:0;width:100%;font-variant-numeric:tabular-nums}
.insights-dialog table.stats th{padding:.85rem .5rem;background:var(--bg);font-weight:650}
.insights-dialog table.stats td{padding:.65rem .5rem;border-bottom:1px solid var(--line)}
.insights-dialog table.stats td:not(:first-child){font-size:1.05rem;font-weight:700}
.insights-dialog table.stats tr:last-child td{border-bottom:0}
.insights-dialog [data-stats-player]{display:block;-webkit-line-clamp:unset;overflow:visible;overflow-wrap:anywhere}
.match-share-studio{display:grid;gap:.65rem;min-width:0}
.match-share-preview{display:flex;align-items:center;justify-content:center;min-height:12rem;background:var(--bg);border:1px solid var(--line);border-radius:var(--small-radius);padding:.5rem}
.match-share-preview img{display:block;max-height:min(44dvh,29rem);width:auto;max-width:100%;height:auto;object-fit:contain;border-radius:.5rem}
.match-share-preview [hidden],.match-share-studio [hidden]{display:none!important}
.match-share-preview p{color:var(--muted);font-size:.95rem;padding:1rem}
.match-share-actions{display:flex;gap:.65rem}.match-share-actions>*{flex:1;min-height:48px;margin:0;text-align:center;text-decoration:none;display:flex;align-items:center;justify-content:center}
.match-share-customize{border-top:1px solid var(--line)}
.match-share-customize>summary,.recap-details>summary{min-height:48px;display:flex;align-items:center;cursor:pointer;font-weight:600}
.match-share-options{display:grid;grid-template-columns:1fr 1fr;gap:.65rem;padding:.5rem 0}
.match-share-formats{grid-column:1/-1;display:flex;gap:.5rem}.match-share-formats button{flex:1;min-height:48px;margin:0}
.match-share-formats [aria-pressed=true]{background:var(--hover);border-color:var(--court2);color:var(--ink)}
.match-photo-label{position:relative;display:flex;align-items:center;justify-content:center;min-height:48px;cursor:pointer;overflow:hidden;margin:0}
.match-photo-label:focus-within{outline:2px solid var(--court2);outline-offset:3px}
.match-photo-label input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
.match-share-options>.hint{margin:0;align-self:center;font-size:.875rem;line-height:1.5}
.match-photo-position{display:grid;gap:.5rem;color:var(--muted);font-size:.875rem}.match-photo-position select{min-height:48px;margin:0}
.match-share-status{margin:0;color:var(--muted);font-size:.875rem;line-height:1.4;min-height:2.8em}
.recap-details{margin-top:.5rem;border-top:1px solid var(--line)}
.recap-details h3{font-size:1rem}.recap-details ol{margin:1rem 0;padding-left:1.5rem}.recap-details li{padding:.35rem 0}
@media(max-width:380px){.insights-dialog{padding:.75rem}.match-share-options{grid-template-columns:1fr}.match-share-formats{grid-column:auto}.match-share-preview img{max-height:38dvh}.insights-dialog table.stats td,.insights-dialog table.stats th{padding:.5rem .3rem}}
@media(orientation:landscape) and (max-height:500px){.insights-dialog .insight-tabs{position:static}.match-share-preview img{max-height:50dvh}.insights-dialog #dialogTitle{max-width:none;padding-right:5rem}.insights-dialog #statsLive{position:static}}

/* Destination sharing keeps every app choice visible and within the Home theme. */
.match-share-destinations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
.match-share-destination{display:flex;align-items:center;justify-content:center;gap:.5rem;min-height:48px;margin:0;padding:.6rem .5rem;font-size:.9375rem}
.match-share-destination svg{width:20px;height:20px;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.match-share-destination img{width:40px;height:32px;object-fit:contain;flex-shrink:0}
.match-share-status:empty{display:none}.match-share-open{display:flex;align-items:center;justify-content:center;min-height:48px;text-decoration:none}
@media(min-width:700px){.match-share-destinations{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:699px){.match-share-preview img{max-height:36dvh}}

@media(max-width:380px){.match-share-destination{flex-direction:column;gap:.125rem;padding:.375rem .25rem}}

/* Shared motion contract: retain geometry; never make whole pages slide or scale. */
html{scrollbar-gutter:stable}
.ui-skeleton{display:block;background:var(--line);border-radius:var(--small-radius);opacity:.55}
.ui-skeleton-action{width:14rem;max-width:75%;height:3rem}
.ui-skeleton-line{width:80%;height:1rem;margin-top:1rem}
.ui-skeleton-line:last-child{width:55%}
.ui-skeleton-art{width:6rem;height:6rem}
@media(prefers-reduced-motion:no-preference){
 body>main:not(#score):not(#list){animation:ganak-content-in 140ms ease-out}
 @keyframes ganak-content-in{from{opacity:.8}to{opacity:1}}
}
/* Native disclosure geometry settles immediately. Animating height while content
   is visible lets following actions overlap sign-in/validation controls. */

/* A theme changes as one palette; mixed old backgrounds/new text lose contrast. */
html.theme-changing *,html.theme-changing *::before,html.theme-changing *::after{transition:none!important}

/* Primary viewing action and optional management share one compact row. */
.match-list-tools{display:flex;align-items:flex-start;flex-wrap:wrap;gap:.5rem}.match-list-tools>*{flex:1 1 8rem;min-width:0;max-width:100%}.match-list-tools>.match-organizer-tools{margin:0}.match-list-tools>button{justify-content:center}.match-list-tools:has(details[open]){display:grid;grid-template-columns:minmax(0,1fr)}
.match-list-tools>.court-home-action{padding-inline:.625rem;gap:.375rem}

/* Long tournament titles reflow at enlarged text; never widen the document. */
.context-short{overflow-wrap:anywhere}

/* Ranking explanations stay secondary to the table while remaining readable on demand. */
.ranking-why{margin-top:.35rem;font-weight:400;color:var(--muted);max-width:42rem}.ranking-why>summary{min-height:44px;width:fit-content;align-content:center;color:var(--accent-text);font-weight:700;cursor:pointer}.ranking-why>strong{display:block;color:var(--ink);font-size:.875rem}.ranking-why>p{margin:.25rem 0 0;font-size:.8125rem;line-height:1.5;color:var(--muted)}.stats .ranking-why{text-align:left}
