/* Post-race entry, all four layouts. Keep original table controls and modal scroll owner. */
html[data-app-layout] #modal-root .modal:has(.tournament-results-panel){overflow:auto;scroll-padding-top:5rem;max-height:calc(100dvh - 1.5rem);max-width:calc(100vw - 1.5rem)}
html[data-app-layout="balanced"] #modal-root .modal:has(.tournament-results-panel){width:min(70rem,calc(100vw - 1.5rem))}
#modal-root .modal:has(.tournament-results-panel)>.modal-head{position:sticky;top:0;z-index:5;gap:.7rem;padding:.55rem .85rem;background:var(--surface)}
#modal-root .modal:has(.tournament-results-panel)>.modal-head h2{min-width:0;font-size:1rem;line-height:1.4;overflow-wrap:anywhere}
#modal-root .modal:has(.tournament-results-panel)>.modal-head button{flex:none;min-width:44px;min-height:44px}
#modal-root .modal:has(.tournament-results-panel)>.modal-body{min-width:0;overflow:visible;flex:none;padding:.85rem}
#modal-root .modal:has(.tournament-results-panel) .detail-head{gap:.65rem;margin-block:.65rem}
#modal-root .modal:has(.tournament-results-panel) .detail-head>div{min-width:0}
#modal-root .modal:has(.tournament-results-panel) .detail-head h2{font-size:1.25rem;line-height:1.4;overflow-wrap:anywhere}
#modal-root .modal:has(.tournament-results-panel) .tournament-summary-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.55rem;margin:.65rem 0!important}
#modal-root .modal:has(.tournament-results-panel) .tournament-summary-stats .stat-card{min-width:0;min-height:0;padding:.55rem .7rem;border:1px solid var(--club-border);background:var(--club-subtle-gradient);box-shadow:none}
#modal-root .modal:has(.tournament-results-panel) .tournament-summary-stats .stat-card>strong{font-size:1.25rem;margin:.15rem 0;line-height:1.3;color:var(--club-text)}
#modal-root .tournament-results-context{margin:.7rem 0;border:1px solid var(--club-border);border-radius:.75rem;background:var(--surface)}
#modal-root .tournament-results-context>summary{min-height:44px;padding:.7rem .8rem;color:var(--club-text);font-size:.8rem;font-weight:700;cursor:pointer}
#modal-root .tournament-results-context[open]>summary{border-bottom:1px solid var(--club-border)}
#modal-root .tournament-results-context>.tournament-detail-metadata{min-width:0;padding:0 .65rem .65rem;gap:.65rem}
#modal-root .tournament-results-context>p,#modal-root .tournament-results-context>.notice{margin:.65rem}
#modal-root .tournament-results-classification{display:flex;flex-wrap:wrap;gap:.4rem 1rem;font-size:.78rem;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
#modal-root .tournament-results-context .stat-highlight{min-width:0;padding:.55rem}
#modal-root .tournament-results-context .stat-highlight>strong{font-size:.73rem;color:var(--muted)}
#modal-root .tournament-results-context .stat-highlight>span{font-size:.85rem;line-height:1.4;overflow-wrap:anywhere}
#modal-root .modal:has(.tournament-results-panel) .detail-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem;overflow:visible;margin:.7rem 0}
#modal-root .modal:has(.tournament-results-panel) .detail-tab{min-width:0;min-height:44px;padding:.55rem .6rem;white-space:normal;font-size:.8rem;line-height:1.4;text-align:center}
#modal-root .tournament-results-panel{min-width:0;padding:.85rem;border-color:var(--club-border);background:var(--surface)}
#modal-root .tournament-results-panel>.panel-header{align-items:start;flex-wrap:wrap;gap:.5rem;margin-bottom:.7rem}
#modal-root .tournament-results-panel>.panel-header>div{min-width:0;flex:1 1 18rem}
#modal-root .tournament-results-panel>.panel-header h3{font-size:1rem;line-height:1.4}
#modal-root .tournament-results-panel>.panel-header p{margin:.25rem 0 0;font-size:.78rem;line-height:1.5}
#modal-root .tournament-results-panel>.panel-header>.badge{flex:none}
#modal-root .tournament-results-scroll{width:100%;max-width:100%;min-width:0;overflow:auto;border:1px solid var(--club-border);border-radius:.75rem;background:var(--surface)}
#modal-root .tournament-results-table{width:100%;min-width:40rem;table-layout:fixed;border-collapse:collapse}
#modal-root .tournament-results-table th{padding:.6rem .55rem;background:var(--club-subtle-gradient);font-size:.73rem;line-height:1.45;white-space:normal}
#modal-root .tournament-results-table td{min-width:0;padding:.55rem;vertical-align:middle;border-bottom:1px solid var(--line);border-left:0;overflow-wrap:anywhere}
#modal-root .tournament-results-table td:first-child strong{display:block;font-size:.85rem;line-height:1.4}
#modal-root .tournament-results-table td:first-child small{display:block;margin:.15rem 0 0;font-size:.72rem;line-height:1.45;color:var(--muted)}
#modal-root .tournament-results-table .table-input{display:block;box-sizing:border-box;width:100%;min-width:0;max-width:none;min-height:40px;padding:.5rem .55rem;border:1px solid var(--club-control-border);border-radius:.6rem;background:var(--surface);color:var(--ink);font-size:.875rem;line-height:1.3;font-variant-numeric:tabular-nums}
#modal-root .tournament-results-table .table-input:focus-visible{outline:2px solid var(--club-control-border);outline-offset:2px;box-shadow:none}
#modal-root .tournament-results-table input:disabled{cursor:default;background:var(--surface-muted);color:var(--muted)}
#modal-root .tournament-result-participation{display:flex;align-items:center;justify-content:center;gap:.4rem;min-width:0;min-height:44px;cursor:pointer;font-size:.72rem;font-weight:650;color:var(--ink)}
#modal-root .tournament-result-participation>input{flex:none;width:20px;height:20px;margin:0;accent-color:var(--primary-dark)}
#modal-root .tournament-result-participation>span{display:none}
#modal-root .tournament-result-participation:has(input:disabled){cursor:default}
#modal-root .tournament-results-actions{position:sticky;bottom:0;z-index:3;display:flex;justify-content:flex-end;gap:.65rem;margin-top:.75rem;padding:.65rem 0 .1rem;border-top:1px solid var(--club-border);background:var(--surface)}
#modal-root .tournament-results-actions .button{min-height:44px;min-width:10rem;padding:.65rem 1rem;white-space:normal}
#modal-root .modal:has(.tournament-results-panel) .tournament-attachment-list{min-width:0;max-width:100%}
#modal-root .modal:has(.tournament-results-panel) .tournament-attachment-link{min-width:0;width:100%;max-width:100%;align-items:start}
#modal-root .modal:has(.tournament-results-panel) .tournament-attachment-link>span:nth-child(2){min-width:0;flex:1 1 0}
#modal-root .modal:has(.tournament-results-panel) .tournament-attachment-link :is(strong,small){white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
#modal-root .modal:has(.tournament-results-panel) .tournament-attachment-link>.notice-icon,#modal-root .modal:has(.tournament-results-panel) .tournament-attachment-link>span:last-child{flex:none}
/* Classic and working layouts retain table alignment on wide screens. */
@media(min-width:901px){
 html[data-app-layout="compact"] #modal-root .tournament-results-table td{padding:.45rem .5rem}
 html[data-app-layout="cards"] #modal-root .tournament-results-table td:first-child{border-left:3px solid var(--club-border);background:var(--club-subtle-gradient)}
 html[data-app-layout="cards"] #modal-root .tournament-results-table tr:has([data-tournament-participated]:checked) td:first-child{border-left-color:var(--club-control-border)}
}
/* Modular desktop and all narrow screens present the same original rows as field groups. */
@media(min-width:901px){
 html[data-app-layout="focus"] #modal-root .tournament-results-scroll{border:0;background:transparent;overflow:visible}
 html[data-app-layout="focus"] #modal-root .tournament-results-table{display:block;min-width:0}
 html[data-app-layout="focus"] #modal-root .tournament-results-table thead{display:none}
 html[data-app-layout="focus"] #modal-root .tournament-results-table tbody{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
 html[data-app-layout="focus"] #modal-root .tournament-results-table tr{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.5rem .65rem;padding:.75rem;border:1px solid var(--club-border);border-radius:.85rem;background:var(--surface)}
 html[data-app-layout="focus"] #modal-root .tournament-results-table td{display:grid;align-content:start;gap:.25rem;grid-column:span 2;padding:0;border:0;background:transparent}
 html[data-app-layout="focus"] #modal-root .tournament-results-table td::before{content:attr(data-label);font-size:.72rem;font-weight:650;color:var(--muted)}
 html[data-app-layout="focus"] #modal-root .tournament-results-table td:first-child{grid-column:1/-1;padding-bottom:.4rem;border-bottom:1px solid var(--club-border)}
 html[data-app-layout="focus"] #modal-root .tournament-results-table td:first-child::before,html[data-app-layout="focus"] #modal-root .tournament-results-table td:nth-child(2)::before{display:none}
 html[data-app-layout="focus"] #modal-root .tournament-results-table td:nth-child(2),html[data-app-layout="focus"] #modal-root .tournament-results-table td:nth-child(3){grid-column:span 3}
 html[data-app-layout="focus"] #modal-root .tournament-result-participation{justify-content:flex-start;align-self:end}
 html[data-app-layout="focus"] #modal-root .tournament-result-participation>span{display:inline}
}
@media(max-width:900px){
 html[data-app-layout] #modal-root .modal:has(.tournament-results-panel){width:calc(100vw - .75rem);max-width:calc(100vw - .75rem);max-height:calc(100dvh - .75rem)}
 #modal-root .modal:has(.tournament-results-panel)>.modal-head{padding:.4rem .65rem}
 #modal-root .modal:has(.tournament-results-panel)>.modal-body{padding:.65rem}
 #modal-root .modal:has(.tournament-results-panel) .modal-tournament-actions{gap:.4rem;margin:0 0 .6rem}
 #modal-root .modal:has(.tournament-results-panel) .modal-tournament-actions .back{grid-column:auto}
 #modal-root .modal:has(.tournament-results-panel) .detail-action-button{min-height:44px;padding:.45rem .5rem}
 #modal-root .modal:has(.tournament-results-panel) .detail-action-button b{font-size:.74rem}
 #modal-root .modal:has(.tournament-results-panel) .detail-head h2{font-size:1.12rem}
 #modal-root .modal:has(.tournament-results-panel) .detail-tabs{gap:.3rem}
 #modal-root .modal:has(.tournament-results-panel) .detail-tab{padding:.45rem .3rem;font-size:.72rem}
 #modal-root .tournament-results-context>.tournament-detail-metadata{grid-template-columns:minmax(0,1fr)}
 #modal-root .tournament-results-context .tournament-detail-metadata>.panel>.grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.4rem}
 #modal-root .tournament-results-panel{padding:.65rem}
 #modal-root .tournament-results-panel>.panel-header>div{flex-basis:100%}
 #modal-root .tournament-results-scroll{border:0;overflow:visible;background:transparent}
 #modal-root .tournament-results-table{display:block;min-width:0;max-width:100%}
 #modal-root .tournament-results-table thead{display:none}
 #modal-root .tournament-results-table tbody{display:grid;gap:.6rem}
 #modal-root .tournament-results-table tr{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.4rem .5rem;min-width:0;padding:.65rem;border:1px solid var(--club-border);border-radius:.75rem;background:var(--surface)}
 #modal-root .tournament-results-table td{display:grid;grid-column:span 2;align-content:start;min-width:0;gap:.2rem;padding:0;border:0;background:transparent!important}
 #modal-root .tournament-results-table td::before{content:attr(data-label);margin:0;font-size:.68rem;font-weight:650;line-height:1.4;text-transform:none;letter-spacing:0;color:var(--muted)}
 #modal-root .tournament-results-table td:first-child{grid-column:1/-1;display:block;padding:0 0 .3rem;border-bottom:1px solid var(--club-border);border-left:0}
 #modal-root .tournament-results-table td:first-child::before,#modal-root .tournament-results-table td:nth-child(2)::before{display:none}
 #modal-root .tournament-results-table td:first-child strong{font-size:.9rem}
 #modal-root .tournament-results-table td:first-child small{font-size:.73rem}
 #modal-root .tournament-results-table td:nth-child(2),#modal-root .tournament-results-table td:nth-child(3){grid-column:span 3}
 #modal-root .tournament-results-table .table-input{min-height:44px;padding:.5rem .4rem;font-size:16px}
 #modal-root .tournament-result-participation{justify-content:flex-start;align-self:end;font-size:.73rem}
 #modal-root .tournament-result-participation>span{display:inline}
 #modal-root .tournament-results-actions{padding:.6rem 0 0;margin-top:.6rem}
 #modal-root .tournament-results-actions .button{width:100%;min-width:0}
 html[data-app-layout="compact"] #modal-root .tournament-results-table tbody{gap:0;border:1px solid var(--club-border);border-radius:.75rem;overflow:hidden}
 html[data-app-layout="compact"] #modal-root .tournament-results-table tr{border:0;border-bottom:1px solid var(--line);border-radius:0}
 html[data-app-layout="compact"] #modal-root .tournament-results-table tr:last-child{border-bottom:0}
 html[data-app-layout="cards"] #modal-root .tournament-results-table tr{border-left:3px solid var(--club-control-border);border-radius:.45rem}
 html[data-app-layout="cards"] #modal-root .tournament-results-table td:first-child{grid-column:span 4;border:0}
 html[data-app-layout="cards"] #modal-root .tournament-results-table td:nth-child(2){grid-column:span 2;align-self:start}
 html[data-app-layout="cards"] #modal-root .tournament-result-participation{flex-direction:column;gap:.1rem;justify-content:center;align-items:center}
 html[data-app-layout="cards"] #modal-root .tournament-results-table td:nth-child(n+3){grid-column:span 3}
 html[data-app-layout="focus"] #modal-root .tournament-results-table tr{border-radius:1rem;background:var(--club-subtle-gradient)}
 html[data-app-layout="focus"] #modal-root .tournament-results-table td:first-child{padding-bottom:.45rem}
}
@media(max-width:900px){
 #modal-root .modal:has(.tournament-results-panel) .modal-tournament-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
 #modal-root .modal:has(.tournament-results-panel) .modal-tournament-actions:not(:has(.delete)){grid-template-columns:repeat(2,minmax(0,1fr))}
 #modal-root .modal:has(.tournament-results-panel) .modal-tournament-actions .detail-action-button{flex-direction:column;gap:.1rem;padding:.35rem .25rem;line-height:1.3}
 #modal-root .modal:has(.tournament-results-panel) .modal-tournament-actions .detail-action-button b{white-space:normal;line-height:1.3}
}

#modal-root .modal:has(.tournament-results-panel) .tournament-summary-stats .stat-card>:is(.label,small){display:block;font-size:.72rem;line-height:1.4}
#modal-root .tournament-results-panel{scroll-margin-top:5.5rem}
#modal-root .tournament-results-actions:empty{display:none}
