/* Meet-day timing controls use the app's existing lime, navy, type and cards. */
/* Keep the race header independent of the scrolling content on mobile Safari. */
body.xc-race-screen #app>header{position:fixed!important;top:0!important;left:0;right:0;width:100%;max-width:760px;box-sizing:border-box;margin:0 auto;z-index:50!important;background:var(--header)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body.xc-race-screen #app{padding-top:var(--race-sticky-top)}
#race .clockbox .clock{font-size:48px!important;line-height:1.02!important;margin:3px 0 7px!important;font-variant-numeric:tabular-nums;min-height:49px;white-space:nowrap}
#xcTimerControls{margin-top:12px;text-align:left}
.xc-timing-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:7px;font-size:11px;letter-spacing:.07em}
.xc-timing-heading strong{font-weight:950}
.xc-timing-heading span{font-size:24px;line-height:1.1;font-weight:950;letter-spacing:0;text-transform:uppercase}
.xc-timing-slide{position:relative;height:80px;border-radius:40px;background:#071421;border:1px solid #50606b;overflow:hidden;isolation:isolate}
.xc-timing-slide input{position:absolute;inset:0;width:100%;height:100%;padding:0;margin:0;opacity:.01;z-index:3;cursor:grab;touch-action:none;appearance:none;-webkit-appearance:none;border:0;background:transparent}
.xc-timing-slide input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:80px;height:78px;border:0;background:transparent}
.xc-timing-slide input::-moz-range-thumb{width:80px;height:78px;border:0;background:transparent}
.xc-timing-slide:focus-within{outline:3px solid #8DC63F;outline-offset:3px}
.xc-timing-handle{position:absolute;left:5px;top:5px;width:68px;height:68px;display:grid;place-items:center;border-radius:50%;background:#8DC63F;color:#071421;font-size:34px;font-weight:950;pointer-events:none}
.xc-timing-slide-copy{position:absolute;left:83px;right:24px;top:0;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;color:#fff;font-size:20px;line-height:1.08;font-weight:900;letter-spacing:-.4px;pointer-events:none}
/* Approved beacon + double nudge. The text stays still and readable. */
.xc-timing-handle{animation:xc-activate-nudge 4s ease-in-out infinite}
.xc-timing-handle::before,.xc-timing-handle::after{content:"";position:absolute;inset:0;border:3px solid #b8f65f;border-radius:50%;opacity:0;animation:xc-activate-ring 4s ease-out infinite}
.xc-timing-handle::after{animation-name:xc-activate-ring-second}
/* Both ends are identical and motionless; reset invisible rings only after fading. */
@keyframes xc-activate-ring{0%,4%,65%,100%{transform:scale(.95);opacity:0}8%{transform:scale(1);opacity:1}32%,60%{transform:scale(1.85);opacity:0}}
@keyframes xc-activate-ring-second{0%,14%,75%,100%{transform:scale(.95);opacity:0}18%{transform:scale(1);opacity:1}42%,70%{transform:scale(1.85);opacity:0}}
@keyframes xc-activate-nudge{0%,25%,67%,100%{transform:translateX(0);box-shadow:0 0 0 transparent}39%,56%{transform:translateX(16px);box-shadow:-14px 0 0 #8dc63f40}47%{transform:translateX(4px);box-shadow:-4px 0 0 #8dc63f20}}
#xcTimerControls.is-interacting .xc-timing-handle,#xcTimerControls.is-interacting .xc-timing-handle::before,#xcTimerControls.is-interacting .xc-timing-handle::after{animation:none;box-shadow:none}
@media(prefers-reduced-motion:reduce){
 .xc-timing-handle,.xc-timing-handle::before,.xc-timing-handle::after{animation:none;box-shadow:none}
}
#xcTimerControls>.small{margin-top:7px;font-size:11px;color:inherit;opacity:.8;text-align:center}
#xcTimerControls.is-armed .xc-timing-heading strong{color:var(--green2)}
#xcTimerControls .xc-timing-lock{min-height:54px;background:#8DC63F;color:#071421;font-size:17px}
.xc-timing-toolbar{margin:12px 0}
.xc-timing-toolbar>.btn{min-height:46px}
#xcTimingStatus{padding:0 3px;margin:0 0 8px;line-height:1.35}
#xcTimingStatus:empty{display:none}
.xc-race-actions{display:flex;align-items:stretch;gap:8px;margin-top:10px}
.xc-race-actions>.btn{flex:1;min-height:44px;padding:9px 10px;font-size:13px}
.xc-race-actions>.btn.out{white-space:nowrap}
.xc-race-actions.xc-before-start{flex-direction:column}
.xc-race-actions.xc-before-start>.btn.green{min-height:60px;font-size:18px;font-weight:900}
#race>.coach-verification{flex-direction:row;align-items:center;gap:8px;margin-bottom:10px}
#race>.coach-verification>.notice{flex:1;padding:9px 11px;font-size:12px}
#race>.coach-verification>.btn{align-self:center;flex-shrink:0;font-size:12px}
#race .taprow[role=button]{cursor:pointer;-webkit-user-select:none;user-select:none}
#race .taprow[role=button]:focus-visible{outline:3px solid #8DC63F;outline-offset:2px}
.xc-history-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.xc-history-heading h2{margin:4px 0 0}
.sheet:has(#xcSplitHistory){overflow:hidden;box-sizing:border-box;height:min(93dvh,900px);max-height:93dvh;display:flex;flex-direction:column}
#xcSplitHistory{display:flex;flex-direction:column;min-height:0;flex:1}
.xc-history-fixed{flex:none;background:var(--card);z-index:1}
.xc-history-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;position:relative}
.xc-history-entry-actions{display:flex;flex-direction:column;align-items:stretch;gap:8px;flex-shrink:0}
.xc-history-entry-actions .btn{min-height:44px;font-size:12px;padding:8px 10px}
.xc-history-checkpoints{display:flex;gap:7px;margin-bottom:14px}
.xc-history-checkpoints button{flex:1;padding-left:5px;padding-right:5px;min-height:44px}
.xc-history-runner{border:1px solid var(--line);border-radius:17px;padding:12px;background:var(--card);margin:12px 0}
.xc-history-runner-name{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.xc-history-runner-name strong{font-size:16px;font-weight:900}
.xc-history-entry{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 8px;border-top:1px solid var(--line)}
.xc-history-entry>div{min-width:0}
.xc-history-entry .small{line-height:1.5}
.xc-history-entry.is-selected{background:color-mix(in srgb,#8DC63F 12%,var(--card));border:1px solid #8DC63F;border-radius:11px;margin-bottom:6px}
.xc-history-time{font-size:23px;letter-spacing:-.5px;font-weight:950;font-variant-numeric:tabular-nums}
.xc-history-entry>.btn{flex-shrink:0;min-height:44px;font-size:12px;padding:10px}
.xc-history-published{color:var(--ink);font-size:12px;font-weight:900;white-space:nowrap}
.xc-history-runner>[data-clear-entry]{width:100%;margin:8px 0 4px;min-height:44px}
.xc-history-runner details{margin-top:10px;border-top:1px solid var(--line);padding-top:8px}
.xc-history-runner summary{font-size:13px;font-weight:850;cursor:pointer;min-height:36px;padding:8px 0}
.xc-history-runner form{display:flex;align-items:flex-end;gap:8px;padding:4px 0}
.xc-history-runner label{flex:1;min-width:0;margin:0}
.xc-history-runner input{margin-top:6px;min-height:44px;font-variant-numeric:tabular-nums}
.xc-history-runner form .btn{min-height:44px;flex-shrink:0;font-size:12px}
#xcSplitHistory button:disabled{opacity:.45;cursor:default}
#xcSplitHistory [hidden]{display:none!important}
@media(max-width:360px){.xc-timing-slide-copy{font-size:18px;right:12px}.xc-history-entry{padding-left:5px;padding-right:5px;gap:6px}.xc-history-runner{padding:10px}.xc-history-entry>.btn{padding:8px}.xc-history-runner form{flex-wrap:wrap}.xc-history-runner form .btn{width:100%}}
.xc-offline-controls{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:14px;padding:10px 12px;margin:10px 0}
.xc-offline-status{flex:1;min-width:0}.xc-offline-status strong{display:block;font-size:12px}.xc-offline-status span{display:block;font-size:11px;color:var(--muted);margin-top:3px}
.xc-offline-controls button{font-size:11px;max-width:135px;min-height:44px}.xc-clock-state{font-size:11px;color:var(--muted);margin:6px 0}
.xc-local-ack{font-size:11px;font-weight:850;margin-top:6px;color:var(--green)}
#race .taprow.xc-tap-saved{border-color:var(--green);box-shadow:inset 4px 0 var(--green)}
#race .taprow.xc-tap-locked .xc-local-ack{color:#ff1744}
.xc-start-history{border:1px solid var(--line);border-radius:12px;padding:12px;margin:12px 0}.xc-start-history summary{font-weight:850;cursor:pointer}
.xc-track-primary{margin:10px 0;min-height:48px;font-size:16px}

.xc-timing-recovery{border:2px solid #b87800;border-radius:14px;background:var(--card);padding:12px;margin:10px 0;color:var(--text)}
.xc-timing-recovery[hidden]{display:none}
.xc-timing-recovery>div+div{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
.xc-timing-recovery .btn{min-height:44px;margin-top:8px;white-space:normal}
.xc-timing-recovery p{margin:6px 0;font-size:14px}
.xc-correction-help{margin-bottom:14px;font-size:14px;line-height:1.5}

#race .taprow{display:block}
.xc-runner-capture{display:flex;align-items:center;gap:12px;width:100%;min-width:0;box-sizing:border-box}
.xc-runner-capture>.grow{min-width:0}
.xc-runner-capture[role=button]{cursor:pointer;touch-action:manipulation}
.xc-runner-capture[role=button]:focus-visible{outline:3px solid var(--green);outline-offset:3px;border-radius:8px}
#race .taprow.done{border-color:var(--green)!important}
#race .taprow.xc-needs-review{position:relative;border:2px solid transparent!important;box-shadow:none;background:var(--card)}
#race .taprow.xc-needs-review::after{content:"";position:absolute;inset:-2px;border:2px solid #ff1744;border-radius:inherit;pointer-events:none;animation:xc-review-flash 1.6s step-end infinite}
@keyframes xc-review-flash{0%,100%{opacity:1}50%{opacity:0}}
@media(prefers-reduced-motion:reduce){#race .taprow.xc-needs-review::after{animation:none}}
.xc-runner-review{margin-top:10px;border-top:1px solid #ff174460;padding-top:10px}
.xc-runner-review[hidden]{display:none}
.xc-review-tap+.xc-review-tap{margin-top:12px;padding-top:10px;border-top:1px solid #ff174460}
.xc-review-buttons{display:flex;gap:8px;margin-top:8px}
.xc-review-buttons .btn{flex:1;min-height:44px;background:#ff1744;color:#fff;border:1px solid #ff1744;font-size:14px}
.xc-review-buttons .btn[data-confirm-tap]{background:var(--green);color:#0b1822;border-color:var(--green)}
.xc-review-buttons .btn:disabled{opacity:.5;cursor:default}
.xc-provisional-label{font-weight:700;line-height:1.4}

/* Fixed per-checkpoint heights: split capture does not reserve a finish award row.
   Never resize on a tap, sync, record improvement, or saved-tap review state. */
#race .taprow.xc-stable-card{position:relative;height:76px;min-height:76px;max-height:76px;box-sizing:border-box;padding:4px 8px!important;margin-bottom:6px;overflow:hidden}
#race .taprow.xc-stable-card.xc-timing-finish{height:96px;min-height:96px;max-height:96px}
#race .xc-stable-card .xc-runner-capture{height:64px;overflow:hidden;gap:6px}
#race .xc-stable-card .avatar{width:44px;height:44px}
#race .xc-stable-card .grow{min-width:0}
#race .xc-stable-card .runner-name{font-size:16px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#race .xc-stable-card .stats{white-space:nowrap;font-size:11px;line-height:12px;margin-top:0}
#race .xc-stable-card .live-splits{flex-wrap:nowrap;white-space:nowrap;gap:3px;font-size:10px;line-height:16px;margin-top:2px}
#race .xc-stable-card .live-splits>span:last-child{display:none}
#race .xc-stable-card.xc-timing-m1 .live-splits>span:not(:first-child){display:none}
#race .xc-stable-card .splittime{font-size:18px;line-height:22px;min-width:7.5ch;flex:0 0 7.5ch;align-self:flex-start;margin-top:0;text-align:right;white-space:nowrap;letter-spacing:0;color:var(--ink)!important}
#race .xc-stable-card .xc-local-ack{height:12px;line-height:12px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px}
#race .xc-stable-card .xc-outcome-slot{display:none}
#race .xc-stable-card.xc-timing-finish .xc-outcome-slot{display:block;position:absolute;left:8px;right:8px;bottom:6px;height:16px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#race .xc-stable-card .delta{font-size:11px;margin:0;white-space:nowrap;text-align:left}
#race .xc-stable-card .xc-provisional-label{display:none}
#race .xc-stable-card .xc-runner-review{position:absolute;right:8px;top:26px;width:81px;height:44px;margin:0;padding:0;border:0}
#race .xc-stable-card .xc-review-open{min-height:44px;height:44px;width:100%;padding:4px;font-size:11px;line-height:1.2;color:#ff1744}
#xcTimingStatus{height:18px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 0 8px}
#xcTimingStatus:empty{display:block}
.xc-race-actions.xc-before-start{flex-direction:row;flex-wrap:wrap}
.xc-race-actions.xc-before-start>.btn.green{flex-basis:100%}
/* Recovery prompts overlay the bottom of the screen instead of shifting targets. */
#xcTimingRecovery:not([hidden]){position:fixed;bottom:75px;left:12px;right:12px;max-width:700px;margin:0 auto;z-index:45;box-shadow:0 4px 20px #0005}
#xcNotesText{width:100%;box-sizing:border-box;resize:vertical;min-height:160px;font-size:16px;line-height:1.5}
#xcNotesName{font-size:16px}
#xcNotesStatus{min-height:24px;margin-top:10px}
#xcNotesMinePanel[hidden],#xcNotesTeamPanel[hidden]{display:none}
.xc-team-note{padding:12px 0;border-bottom:1px solid var(--line)}
.xc-team-note p{white-space:pre-wrap;overflow-wrap:anywhere}
#race .xc-stable-card .live-splits>span{font-size:10px;line-height:16px;padding:0 3px;gap:3px}
#race .taprow.xc-stable-card:active{transform:none}
@media(max-width:360px){#race .xc-stable-card .live-splits>span{font-size:9px;padding:0 2px;gap:2px}}

/* Active coach/Timer header: recover phone space without shrinking controls
   below a 44px target. Spectator and pre-start layouts keep existing sizing. */
#race .clockbox.active-timer:has(#xcTimerControls) .clock{font-size:40px!important;min-height:41px;margin:2px 0 5px!important}
#race .clockbox.active-timer #xcTimerControls{margin-top:8px}
#race .clockbox.active-timer .xc-timing-heading{margin-bottom:4px}
#race .clockbox.active-timer #xcTimerControls .xc-timing-lock{height:44px;min-height:44px;padding:8px}
#race .clockbox.active-timer:has(#xcTimerControls) .xc-race-actions{margin-top:6px}
