/* Cup-only jSpreadsheet/jSuites theme, including their floating editors. */
.cup-admin-open .page-shell { width: calc(100% - 2rem); max-width: none; }
.cup-admin-open .admin-panel { padding: 1rem; }
.team-counts { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 .75rem; list-style: none; }
.team-counts .pill { white-space: normal; overflow-wrap: anywhere; }
:root {
  --cup-sheet-bg: #ffffff;
  --cup-sheet-head: #eef2f8;
  --cup-sheet-text: #17253a;
  --cup-sheet-muted: #49576b;
  --cup-sheet-line: #b8c5d6;
  --cup-sheet-selected: #dce8fb;
  --cup-sheet-on-selected: #17253a;
  --cup-sheet-focus: #315d9e;
  --cup-sheet-editor: #ffffff;
  --cup-sheet-error: #ffe0e4;
  --cup-sheet-on-error: #671426;
  --cup-sheet-error-line: #bd233b;
  --cup-sheet-warning: #fff0bb;
  --cup-sheet-on-warning: #563b00;
  --cup-sheet-warning-line: #986c0f;
}
.sheet-host { background: var(--cup-sheet-bg); color: var(--cup-sheet-text); color-scheme: inherit; }
.sheet-host .jexcel > thead { position: sticky; top: var(--cup-thead-top, 0px); z-index: 4; background: var(--cup-sheet-head); }
.sheet-host .jexcel > thead > tr > td { top: 0; white-space: normal; overflow-wrap: normal; font-size: .75rem; line-height: 1.15; vertical-align: middle; }
.sheet-host .jexcel_filter { background: var(--cup-sheet-head); color: var(--cup-sheet-text); padding: .4rem; gap: .5rem; }
.sheet-host .jexcel_filter input { min-width: 0; }
.qualifier-rankings { margin: 1rem 0; }
.sheet-host .jexcel,
.sheet-host .jexcel > tbody > tr > td {
  background-color: var(--cup-sheet-bg);
  color: var(--cup-sheet-text);
  border-color: var(--cup-sheet-line);
}
.sheet-host .jexcel > thead > tr > td,
.sheet-host .jexcel > tfoot > tr > td,
.sheet-host .jexcel > tbody > tr > td:first-child,
.sheet-host .jexcel > tbody > tr > td.readonly {
  background-color: var(--cup-sheet-head);
  color: var(--cup-sheet-text);
  border-color: var(--cup-sheet-line);
}
.sheet-host .jexcel > tbody > tr > td.readonly { color: var(--cup-sheet-muted); }
.sheet-host .jexcel > thead > tr > td.selected,
.sheet-host .jexcel > tbody > tr.selected > td:first-child,
.sheet-host .jexcel > tbody > tr > td:is(.highlight, .highlight-selected, .selected, .selection) {
  background-color: var(--cup-sheet-selected);
  color: var(--cup-sheet-on-selected);
}
.sheet-host .jexcel td:is(.highlight-top, .highlight-bottom, .highlight-left, .highlight-right, .selection-top, .selection-bottom, .selection-left, .selection-right) {
  border-color: var(--cup-sheet-focus);
  box-shadow: none;
}
.sheet-host .jexcel_corner { background: var(--cup-sheet-focus); border-color: var(--cup-sheet-bg); }
.sheet-host .jexcel td.invalid-cell {
  background: var(--cup-sheet-error) !important;
  color: var(--cup-sheet-on-error);
  box-shadow: inset 0 0 0 2px var(--cup-sheet-error-line);
}
.sheet-host .jexcel td.warning-cell {
  background: var(--cup-sheet-warning) !important;
  color: var(--cup-sheet-on-warning);
  box-shadow: inset 0 0 0 2px var(--cup-sheet-warning-line);
}
.sheet-host input:not([type=checkbox]),
.sheet-host select,
.sheet-host textarea,
.sheet-host [contenteditable=true] {
  background-color: var(--cup-sheet-editor);
  color: var(--cup-sheet-text);
  caret-color: var(--cup-sheet-text);
  border-color: var(--cup-sheet-line);
}
.sheet-host input[type=checkbox] { accent-color: var(--cup-sheet-focus); }
.sheet-host input::placeholder,
.sheet-host textarea::placeholder { color: var(--cup-sheet-muted); opacity: 1; }
.sheet-host .jexcel_content { scrollbar-color: var(--cup-sheet-muted) var(--cup-sheet-head); }
.sheet-host .jexcel_content::-webkit-scrollbar-track { background: var(--cup-sheet-head); }
.sheet-host .jexcel_content::-webkit-scrollbar-thumb { background: var(--cup-sheet-muted); }

/* jSuites can place these popups outside the spreadsheet's table element. */
.jdropdown-default .jdropdown-container,
.jdropdown-default .jdropdown-content,
.jdropdown-default .jdropdown-header,
.jcalendar .jcalendar-content,
.jcalendar .jcalendar-table > table,
.jcontextmenu {
  background-color: var(--cup-sheet-bg);
  color: var(--cup-sheet-text);
  border-color: var(--cup-sheet-line);
}
.jdropdown-default .jdropdown-item,
.jcalendar .jcalendar-table td,
.jcontextmenu > div a { color: var(--cup-sheet-text); }
.jdropdown-default .jdropdown-item:is(:hover, .jdropdown-cursor, .jdropdown-selected),
.jcalendar .jcalendar-table td:is(:hover, .jcalendar-selected),
.jcontextmenu > div:hover {
  background-color: var(--cup-sheet-selected);
  color: var(--cup-sheet-on-selected);
}
.jcontextmenu > div:hover a { color: var(--cup-sheet-on-selected); }
.jdropdown-default .jdropdown-selected { background-image: none; font-weight: 750; }
.jcalendar .jcalendar-weekday { background-color: var(--cup-sheet-head); color: var(--cup-sheet-text); }
.jcalendar .jcalendar-update,
.jcalendar .jcalendar-container select {
  background: var(--cup-sheet-editor);
  color: var(--cup-sheet-text);
  border-color: var(--cup-sheet-line);
}
.jcalendar .jcalendar-confirm,
.jcalendar .jcalendar-reset { color: var(--cup-sheet-text); }
.jcontextmenu .jcontextmenu-disabled a,
.jcontextmenu .jcontextmenu-disabled::before { color: var(--cup-sheet-muted); }
.jcontextmenu hr { border-color: var(--cup-sheet-line); }

@media (prefers-color-scheme: dark) {
  :root {
    --cup-sheet-bg: #1a2636;
    --cup-sheet-head: #24344a;
    --cup-sheet-text: #e8eef8;
    --cup-sheet-muted: #b6c5d9;
    --cup-sheet-line: #4c607a;
    --cup-sheet-selected: #31527a;
    --cup-sheet-on-selected: #ffffff;
    --cup-sheet-focus: #96beff;
    --cup-sheet-editor: #111c2b;
    --cup-sheet-error: #4a2431;
    --cup-sheet-on-error: #ffe7ed;
    --cup-sheet-error-line: #ff879e;
    --cup-sheet-warning: #4b391d;
    --cup-sheet-on-warning: #ffedbf;
    --cup-sheet-warning-line: #e3b85c;
  }
  .jcalendar .jcalendar-prev,
  .jcalendar .jcalendar-next { filter: invert(1); }
  .eyebrow,
  a { color: color-mix(in srgb, var(--text) 88%, var(--primary)); }
}
