/* One consistent eight-pixel rhythm. Tools float above the working surface. */
html.score-desk-standalone-root,body.score-desk-standalone{height:100%;min-height:0}
body.score-desk-standalone #app{display:block!important;box-sizing:border-box;height:100dvh;min-height:0;padding:0;overflow:hidden}
body.score-desk-standalone #app>#scoreDeskStandaloneHeader{position:fixed!important;inset:0 0 auto;z-index:140;box-sizing:border-box;min-height:52px;height:auto;padding:8px 16px;border:0;box-shadow:0 8px 24px #0004!important;transform:translateY(-105%);opacity:0;pointer-events:none;transition:transform 220ms cubic-bezier(.2,.7,.2,1),opacity 180ms ease}
body.score-desk-standalone #app>#scoreDeskStandaloneHeader.is-toolbar-visible{transform:translateY(0);opacity:1;pointer-events:auto}
body.score-desk-standalone .scorer-toolbar-reveal{position:fixed;z-index:139;top:0;left:50%;transform:translateX(-50%);display:grid;place-items:center;width:44px;height:18px;min-height:18px;margin:0;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#C5D5CF;opacity:0;transition:opacity 160ms;touch-action:manipulation}
body.score-desk-standalone .scorer-toolbar-reveal:is(:hover,:focus-visible){opacity:1}
body.score-desk-standalone .scorer-toolbar-reveal svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5}
body.score-desk-standalone :is(#browserWorkspaceFeedback,#eventConnectionStatus){position:fixed!important;z-index:145;top:62px;left:50%;transform:translateX(-50%);box-sizing:border-box;width:max-content;max-width:min(760px,calc(100vw - 32px));min-height:0;margin:0!important;padding:10px 14px!important;border:1px solid #484848;border-radius:10px;background:#242424!important;color:#EEE;box-shadow:0 8px 28px #0005}
body.score-desk-standalone :is(#browserWorkspaceFeedback,#eventConnectionStatus)[hidden]{display:none!important}
body.score-desk-standalone #scoreboardView{box-sizing:border-box;display:grid!important;grid-template-columns:minmax(0,var(--scorer-left-width,1.75fr)) minmax(380px,1fr)!important;gap:8px!important;height:100dvh;min-height:0;max-height:100dvh;margin:0;padding:8px!important;overflow:hidden;align-items:start}
body.score-desk-standalone #scoreboardView>.preview-panel{position:relative;top:auto;container-type:inline-size;container-name:scorer-main;display:flex;flex-direction:column;box-sizing:border-box;gap:8px!important;height:100%;min-height:0;max-height:100%;margin:0;padding:0!important;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}
body.score-desk-standalone #scoreboardView>.control-stack{box-sizing:border-box;display:flex;flex-direction:column;gap:8px!important;height:100%;min-height:0;max-height:100%;margin:0;padding:0!important;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}
body.score-desk-standalone #scoreboardView .scoreboard-frame{width:100%;margin:0;flex:none;aspect-ratio:16/9}
body.score-desk-standalone #scoreboardView .pinned-controls{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)!important;gap:8px!important;min-width:0;margin:0;padding:0;align-items:stretch;flex:none}
body.score-desk-standalone #scoreboardView .pinned-controls>.control-panel{box-sizing:border-box;min-width:0;margin:0;padding:12px!important}
body.score-desk-standalone #scoreboardView .pinned-controls .panel-header{min-height:28px;margin:0 0 8px;gap:8px}
body.score-desk-standalone #scoreboardView .pinned-controls .panel-header h2{margin:0}
body.score-desk-standalone #scoreboardView .score-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important;margin:0}
body.score-desk-standalone #scoreboardView .score-control{padding:10px 8px!important}
body.score-desk-standalone #scoreboardView .score-control-grid{gap:6px!important}
body.score-desk-standalone #scoreboardView .score-control .simple-counter-grid{margin-top:10px;gap:6px}
body.score-desk-standalone #scoreboardView .simple-counter label{line-height:18px;margin-bottom:4px;font-size:12px}
body.score-desk-standalone #scoreboardView .simple-counter-input input{height:42px;min-height:42px}
body.score-desk-standalone #scoreboardView .score-actions-footer{gap:8px;margin-top:10px;padding-top:10px}
body.score-desk-standalone #scoreboardView :is(.score-control-panel,.timer-control-panel,.scoreboard-frame,.match-settings-panel,.result-history-panel){border-radius:12px}
body.score-desk-standalone #scoreboardView .timer-control-panel #matchStageSelector{margin:0 0 8px}
body.score-desk-standalone #scoreboardView .timer-control-panel .timer-type-toggle{margin:8px 0}
body.score-desk-standalone #scoreboardView .timer-control-panel .timer-controls{margin-bottom:8px}
body.score-desk-standalone #scoreboardView .timer-control-panel .timer-prestart-options{margin:8px 0 0}
@container scorer-main (max-width:850px){body.score-desk-standalone #scoreboardView .pinned-controls{grid-template-columns:minmax(0,1fr)!important}body.score-desk-standalone #scoreboardView .timer-control-panel .timer-controls{grid-template-columns:minmax(0,1fr) auto}}
@media(max-width:1099px){body.score-desk-standalone #scoreboardView{grid-template-columns:minmax(0,1fr)!important;height:auto;max-height:none;overflow:visible}body.score-desk-standalone #app{height:auto;min-height:100dvh;overflow:visible}body.score-desk-standalone #scoreboardView>.preview-panel,body.score-desk-standalone #scoreboardView>.control-stack{height:auto;max-height:none;overflow:visible}body.score-desk-standalone #scoreboardView .pinned-controls{grid-template-columns:minmax(0,1fr)!important}}
@media(prefers-reduced-motion:reduce){body.score-desk-standalone #app>#scoreDeskStandaloneHeader,body.score-desk-standalone .scorer-toolbar-reveal{transition:none}}

/* 070: actionable errors stay legible in the middle, with the existing Ignore action. */
body.score-desk-standalone #browserWorkspaceFeedback[data-error="true"]{top:50%;transform:translate(-50%,-50%);max-width:min(560px,calc(100vw - 32px));padding:18px 20px!important;line-height:1.6}

/* The board keeps its output ratio; the remaining controls row reserves BO3 space. */
@media(min-width:1100px){
 body.score-desk-standalone #scoreboardView>.preview-panel{display:grid!important;grid-template-rows:auto 40px minmax(0,1fr);align-content:stretch;overflow:hidden}
 body.score-desk-standalone #scoreboardView>.preview-panel>.scoreboard-frame{container-type:inline-size;container-name:scorer-board-space;align-self:start;justify-self:stretch;width:100%;height:auto;min-height:0;aspect-ratio:16/9;background:transparent}
 body.score-desk-standalone #scoreboardView>.preview-panel>.scoreboard-frame>.scoreboard-stage{width:100%;height:auto;max-width:100%;max-height:none;aspect-ratio:16/9}
 body.score-desk-standalone #scoreboardView #eventMatchNav{align-self:stretch;height:40px;min-height:40px;margin:0}
 body.score-desk-standalone #scoreboardView .pinned-controls{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)!important;align-items:stretch}
 body.score-desk-standalone #scoreboardView .pinned-controls>.control-panel{min-height:0}
 @container scorer-main (max-width:950px){
  body.score-desk-standalone #scoreboardView .pinned-controls>.control-panel{padding:10px!important}
  body.score-desk-standalone #scoreboardView .pinned-controls .panel-header h2{font-size:16px}
  body.score-desk-standalone #scoreboardView .score-control{padding:8px 6px!important}
  body.score-desk-standalone #scoreboardView .score-control-grid{grid-template-columns:max-content minmax(48px,1fr) max-content!important;gap:4px!important}
  body.score-desk-standalone #scoreboardView .score-action-pair{gap:2px}
  body.score-desk-standalone #scoreboardView .score-action-pair .score-button{width:28px;min-width:28px;height:36px;min-height:36px;padding:0;font-size:20px}
  body.score-desk-standalone #scoreboardView .score-action-pair .hotkey-input{width:26px!important;min-width:0!important;max-width:26px!important;height:30px;min-height:30px;padding:0 2px;font-size:12px}
  body.score-desk-standalone #scoreboardView .score-control .score-edit-input{width:100%;min-width:0;height:40px;min-height:40px;padding:0 2px;font-size:28px!important}
  body.score-desk-standalone #scoreboardView .score-control .simple-counter-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:8px;gap:6px}
  body.score-desk-standalone #scoreboardView .simple-counter label{font-size:12px;line-height:16px;margin-bottom:3px}
  body.score-desk-standalone #scoreboardView .simple-counter-input input{height:32px;min-height:32px;padding:0 22px 0 6px!important;font-size:14px}
  body.score-desk-standalone #scoreboardView .simple-counter-arrows{width:20px}
  body.score-desk-standalone #scoreboardView .game-win-control{margin:6px 0 0;gap:6px}
  body.score-desk-standalone #scoreboardView .game-win-side{grid-template-columns:28px minmax(0,1fr) 28px;padding:5px;gap:4px}
  body.score-desk-standalone #scoreboardView .game-win-side :is(button,input){height:30px;min-height:30px;padding-block:0}
  body.score-desk-standalone #scoreboardView .timer-control-panel .timer-type-toggle{gap:5px;margin-bottom:0}
  body.score-desk-standalone #scoreboardView .timer-control-panel .timer-type-toggle>button{display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:48px;padding:4px!important}
  body.score-desk-standalone #scoreboardView .timer-control-panel .timer-type-toggle>button span{font-size:12px;line-height:16px}
  body.score-desk-standalone #scoreboardView .timer-control-panel .timer-type-toggle>button b{font-size:14px;line-height:18px}
 }
}

/* The right workspace shares the same bottom edge; only its inner content scrolls. */
@media(min-width:1100px){
 body.score-desk-standalone #scoreboardView>.control-stack{overflow:hidden}
 body.score-desk-standalone #scoreboardView>.control-stack>.match-settings-panel{display:flex;flex-direction:column;flex:0 0 auto;min-height:0;max-height:100%;overflow:hidden}
 body.score-desk-standalone #scoreboardView>.control-stack>.match-settings-panel>#scoreDeskStandaloneHeader{flex:0 0 auto}
 body.score-desk-standalone #scoreboardView>.control-stack>.match-settings-panel>#matchSettingsPanel[open]{flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
 /* Expanded settings use their actual content height, capped by the workspace.
    The list fills any remainder; measured-height motion still pushes it in normal flow. */
 body.score-desk-standalone #scoreboardView>.control-stack.has-event-match-list>.match-settings-panel:has(>#matchSettingsPanel[open] #moreMatchSettings[open]){height:auto;max-height:100%;flex:0 0 auto}
 body.score-desk-standalone #scoreboardView>.control-stack:not(.has-event-match-list)>.match-settings-panel:has(>#matchSettingsPanel[open]){height:100%;max-height:100%;flex:0 0 auto}
 body.score-desk-standalone #scoreboardView>.control-stack>.result-history-panel:not([hidden]){display:flex!important;flex-direction:column;flex:1 1 0;min-height:0;max-height:none;overflow:hidden;margin:0}
 body.score-desk-standalone #scoreboardView>.control-stack>.result-history-panel>.panel-header{flex:0 0 auto}
 html body.score-desk-standalone #scoreboardView>.control-stack>.result-history-panel>.result-table-wrap{flex:1 1 0;min-height:0;height:auto;max-height:none;overflow:auto!important}
 body.score-desk-standalone #scoreboardView>.control-stack .match-settings-panel .text-style-popover.is-open{position:relative;left:auto;right:auto;top:auto;bottom:auto;margin-top:8px;transform:none}
}

/* In-flow style drawers push their neighbours rather than popping over the scroll edge. */
@media(min-width:1100px){
 body.score-desk-standalone #scoreboardView>.control-stack .match-settings-panel .text-style-popover[data-text-style-panel]{position:relative;inset:auto;display:grid!important;grid-template-rows:0fr;width:100%;margin-top:0;padding:0 12px;border-width:0;overflow:hidden;transform:none;translate:0 0;transition:grid-template-rows 220ms cubic-bezier(.2,.7,.2,1),padding-block 220ms cubic-bezier(.2,.7,.2,1),margin-top 220ms cubic-bezier(.2,.7,.2,1),border-width 220ms ease,opacity 160ms ease,visibility 0s linear 220ms}
 body.score-desk-standalone #scoreboardView>.control-stack .match-settings-panel .text-style-popover[data-text-style-panel]>.text-style-drawer-content{min-height:0;overflow:hidden}
 body.score-desk-standalone #scoreboardView>.control-stack .match-settings-panel .text-style-popover[data-text-style-panel].is-open{grid-template-rows:1fr;margin-top:8px;padding-block:12px;border-width:1px;visibility:visible;opacity:1;transition-delay:0s}
 body.score-desk-standalone #scoreboardView>.control-stack .match-settings-panel .text-style-popover[data-text-style-panel]::before{display:none}
}
@media(min-width:1100px) and (prefers-reduced-motion:reduce){
 body.score-desk-standalone #scoreboardView>.control-stack .match-settings-panel .text-style-popover[data-text-style-panel]{transition:none}
}

@media(min-width:1100px){body.score-desk-standalone #scoreboardView>.control-stack,body.score-desk-standalone #scoreboardView #matchSettingsPanel,body.score-desk-standalone #scoreboardView .result-table-wrap{overflow-anchor:none}}

/* Count the inner drawer gap inside its animated height, including the last closing frame. */
body.score-desk-standalone #scoreboardView .match-settings-panel #moreMatchSettings{margin-top:0}
body.score-desk-standalone #scoreboardView .match-settings-panel #moreMatchSettings>.setting-list{padding-top:10px}

/* On a very short desktop window preserve the board ratio and allow the controls
   to continue below it instead of squeezing either surface to zero height. */
@media(min-width:1100px) and (max-height:649px){
 body.score-desk-standalone #scoreboardView>.preview-panel{display:flex!important;overflow-y:auto}
 body.score-desk-standalone #scoreboardView>.preview-panel>.scoreboard-frame{flex:0 0 auto}
 body.score-desk-standalone #scoreboardView #eventMatchNav{flex:0 0 40px}
 body.score-desk-standalone #scoreboardView .pinned-controls{flex:0 0 auto}
}

/* One shared, read-only event ranking surface beside the scorer's match list. */
body.score-desk-standalone #scoreboardView .result-history-panel>.panel-header>div:first-child{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
body.score-desk-standalone #scoreboardView .result-history-panel>.panel-header>div:first-child>h2{margin:0}
body.score-desk-standalone #scoreboardView .scorer-standings-button{display:inline-grid;place-items:center;flex:0 0 32px;width:32px;height:32px;min-height:32px;margin:0;padding:5px!important;border:0!important;background:transparent!important;color:#D7DBDD!important;box-shadow:none!important}
body.score-desk-standalone #scoreboardView .scorer-standings-button[hidden]{display:none!important}
body.score-desk-standalone .scorer-standings-button svg{width:21px;height:21px}
body.score-desk-standalone #scorerStandingsDialog{box-sizing:border-box;width:min(1080px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:0;border:1px solid #4B4B4B;border-radius:14px;background:#1F1F1F;color:#F2F2F2;overflow:hidden;font-family:'MiSans VF',sans-serif}
body.score-desk-standalone #scorerStandingsDialog[open]{display:flex;flex-direction:column}
body.score-desk-standalone #scorerStandingsDialog>header{position:relative;display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;gap:12px;margin:0;padding:18px 22px;border:0;border-bottom:1px solid #3A3A3A;background:#242424;color:inherit}
body.score-desk-standalone #scorerStandingsDialog>header>h2{margin:0;font-size:18px;font-weight:700;color:inherit}
body.score-desk-standalone #scorerStandingsDialog [data-scorer-standings-close]{display:grid;place-items:center;width:32px;height:32px;min-height:32px;margin:0;padding:5px!important;border:0!important;background:transparent!important;color:#F2F2F2!important;box-shadow:none!important}
body.score-desk-standalone #scorerStandingsDialog [data-scorer-standings-close] svg{width:20px;height:20px}
body.score-desk-standalone #scorerStandingsContent{min-height:0;min-width:0;max-width:100%;overflow:auto;overscroll-behavior:contain;padding:16px 20px 24px;scrollbar-width:thin}
body.score-desk-standalone #scorerStandingsContent .design-results-toolbar{min-height:36px;justify-content:flex-end;margin:0 0 8px}
body.score-desk-standalone #scorerStandingsContent .design-stage-picker{max-width:100%}
body.score-desk-standalone #scorerStandingsContent .design-stage-picker select{height:36px;min-height:36px;padding:5px 30px 5px 10px!important;font-size:14px;border:1px solid #505050!important;border-radius:7px;background:#242424!important;color:#F2F2F2!important}
body.score-desk-standalone #scorerStandingsContent :is(.design-rank-section,.design-data-table){background:#1F1F1F!important}
body.score-desk-standalone #scorerStandingsContent .design-ranking{table-layout:fixed;font-family:inherit}
body.score-desk-standalone #scorerStandingsContent .design-ranking :is(th,td){box-sizing:border-box;height:auto;min-width:0;padding:10px 8px;font-size:13px;line-height:1.5;font-weight:650;vertical-align:middle}
body.score-desk-standalone #scorerStandingsContent .design-ranking thead :is(tr,th){background:#292929!important;color:#D5D5D5!important}
body.score-desk-standalone #scorerStandingsContent .design-ranking tbody tr:not([data-advancement]){background:#1F1F1F!important}
body.score-desk-standalone #scorerStandingsContent .design-ranking td:first-child{font-size:14px;text-align:center}
body.score-desk-standalone #scorerStandingsContent .design-ranking .standings-team-readonly{display:block;overflow:auto;white-space:nowrap;scrollbar-width:thin;font:inherit}
body.score-desk-standalone #scorerStandingsContent .dt-heading{padding:8px 0;color:#F2F2F2}
body.score-desk-standalone #scorerStandingsContent .dt-heading h2{font-size:15px}
body.score-desk-standalone #scorerStandingsContent .design-bracket-match{background:#242424;border-color:#444}
body.score-desk-standalone #scorerStandingsContent .design-bracket-match>header{background:#292929}
body.score-desk-standalone #scorerStandingsContent .design-group-nav{margin:0 0 8px}
body.score-desk-standalone #scorerStandingsContent .design-group-nav strong{font-size:14px}
body.score-desk-standalone #scorerStandingsContent :is(select,button,[tabindex]):focus-visible{outline:2px solid #00D6B5;outline-offset:2px}
@media(max-width:600px){body.score-desk-standalone #scorerStandingsDialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}body.score-desk-standalone #scorerStandingsDialog>header{padding:12px 14px}body.score-desk-standalone #scorerStandingsContent{padding:12px 10px 18px}body.score-desk-standalone #scorerStandingsContent .design-ranking :is(th,td){padding:8px 3px;font-size:11px}body.score-desk-standalone #scorerStandingsContent .design-ranking td:first-child{font-size:12px}}

body.score-desk-standalone #scorerStandingsContent .design-results{font-family:inherit}
body.score-desk-standalone #scorerStandingsContent .design-ranking tbody tr:not([data-advancement])>td:first-child{color:#F2F2F2!important}
