.app-header.workspace-header {
  position: relative;
  z-index: 40;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  grid-template-areas: "brand picker system account" "sections sections sections sections";
  gap: 8px 14px;
}
.skip-link:focus { z-index: 50; }
.workspace-main, .workspace-mobile-sections:empty { display: none; }
.workspace-mobile-sections { grid-area: sections; }
.workspace-header .brand-link { justify-self: start; }
.workspace-header .workspace-icon-control {
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  border-color: transparent;
}
.workspace-header .workspace-icon-control .icon { width: 21px; height: 21px; }
.workspace-control-label { display: grid; justify-items: center; gap: 3px; }
.workspace-control-label small { font-size: 10px; font-weight: 600; line-height: 1; }
.workspace-picker { grid-area: picker; }
.workspace-system { grid-area: system; }
.workspace-utilities { grid-area: account; display: flex; align-items: center; justify-self: end; gap: 2px; }
.workspace-main, .workspace-picker, .workspace-system, .enroll-category-picker, .theme-menu { position: relative; }
.workspace-header details > summary, .enroll-category-picker > summary { list-style: none; }
.workspace-header details > summary::-webkit-details-marker,
.enroll-category-picker > summary::-webkit-details-marker { display: none; }
.workspace-header::before {
  position: fixed;
  inset: 0;
  z-index: 42;
  background: var(--color-overlay);
}
.workspace-header:has([data-header-disclosure][open] > :is(.workspace-popover, .account-popover):not([data-dropdown-offscreen]))::before { content: ""; }
.workspace-header [data-header-disclosure][open] > summary {
  position: relative;
  z-index: 44;
  background: var(--color-primary-surface-raised);
}
.workspace-header .account-popover { z-index: 45; }
.workspace-header .account-action { justify-content: flex-start; gap: 8px; }
.workspace-popover {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 45;
  width: min(340px, calc(100vw - 24px));
  --dropdown-max-height: min(55vh, 420px);
  max-height: var(--dropdown-max-height);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--color-text) 14%, transparent);
}
.workspace-picker > .workspace-popover,
.workspace-system > .workspace-popover,
.enroll-category-picker .workspace-popover { right: 0; }
.workspace-popover p { margin: 6px 10px; font-size: 12px; color: var(--color-muted); }
.workspace-popover .workspace-tournament-caption { margin: 4px 10px 6px; font-size: 11px; font-weight: 600; }
:is(.workspace-popover, .workspace-drawer) a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--color-primary);
  font-size: 14px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.workspace-header :is(.workspace-popover, .workspace-drawer) a,
.workspace-sections a { gap: 8px; }
.workspace-header :is(.workspace-popover, .workspace-drawer) a > .icon,
.workspace-header .account-action > .icon,
.workspace-sections a > .icon { width: 17px; height: 17px; }
:is(.workspace-popover, .workspace-drawer) a:is(:hover, [aria-current]) { background: var(--color-soft); }
.workspace-header :is(.workspace-popover, .workspace-drawer) a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.workspace-popover .workspace-all { margin-top: 4px; border-top: 1px solid var(--color-border); font-weight: 600; }
.workspace-header .theme-menu > summary { padding-inline: 5px; }
:root:has(.workspace-drawer[open]) { overflow: hidden; }
.workspace-drawer {
  --drawer-offset: -100%;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 45;
  width: min(340px, calc(100% - 48px));
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-inline-end: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 8px 0 28px color-mix(in srgb, var(--color-text) 18%, transparent);
}
.workspace-drawer::backdrop { background: var(--color-overlay); }
.workspace-drawer h2 { margin: 0 10px 8px; font-size: 18px; }
.workspace-drawer.theme-drawer {
  --drawer-offset: 100%;
  inset: 0 0 0 auto;
  width: min(264px, calc(100% - 32px));
  border-inline-start: 1px solid var(--color-border);
  border-inline-end: 0;
  box-shadow: -8px 0 28px color-mix(in srgb, var(--color-text) 18%, transparent);
}
.workspace-drawer-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
}
.workspace-drawer-heading h2 { margin-block: 0; }
.workspace-drawer-heading .icon-button { width: 44px; height: 44px; }
:root:not(.enhanced) .workspace-drawer:not([open]) .workspace-drawer-heading .icon-button { display: none; }
.theme-group { border-top: 1px solid var(--color-border); margin-top: 4px; padding-top: 4px; }
.theme-group-label { margin: 4px 8px 2px; color: var(--color-muted); font-size: 12px; font-weight: 600; }
.theme-swatches { display: inline-flex; align-items: center; gap: 3px; }
.theme-swatches > span {
  width: 10px;
  height: 10px;
  border: 1px solid color-mix(in srgb, var(--court-dark) 46%, transparent);
  border-radius: 50%;
  background: var(--court-dark);
}
.theme-swatches > span:nth-child(2) { background: var(--court-bright); }
.theme-swatches > span:nth-child(3) { background: var(--court-pastel); }
.theme-swatches > span:nth-child(4) { background: var(--court-white); }
@media screen {
  :where([data-court-theme^='dark-']) .theme-drawer .theme-swatches > :first-child {
    border-color: var(--color-border-strong);
  }
}
.theme-menu > summary .theme-swatches { min-height: 21px; }
.theme-menu > summary .theme-swatches > span {
  width: 9px;
  height: 9px;
  border-color: color-mix(in srgb, var(--court-white) 70%, transparent);
}
.theme-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-primary);
  text-align: start;
}
.theme-option:is(:hover, [aria-pressed="true"]) { background: var(--color-soft); }
.theme-option:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.theme-option > .icon { width: 16px; height: 16px; }
.theme-option[aria-pressed="false"] > .icon { visibility: hidden; }
.workspace-sections {
  grid-area: sections;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #ffffff33;
}
.workspace-sections a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px;
  border-radius: 7px;
  color: var(--color-on-primary);
  text-align: center;
  text-decoration: none;
  font-size: 13px;
}
.workspace-sections a:hover { background: #ffffff18; }
.workspace-sections a[aria-current] { background: var(--color-accent); color: var(--color-on-accent); font-weight: 700; }
.section-tabs {
  display: flex;
  gap: 6px;
  min-inline-size: 0;
  margin: 0 0 22px;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-soft);
}
.section-tabs > :is(a, label) { flex: 1; min-width: 0; }
.section-tabs > label { position: relative; display: grid; cursor: pointer; }
.section-tab {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}
.section-tab .icon { width: 20px; height: 20px; }
.section-tab-short { display: none; }
.section-tab:hover { background: #ffffff80; color: var(--color-primary); }
@media screen {
  :where([data-court-theme^='dark-']) .section-tab:hover { background: var(--color-surface-tint); }
}
:is(.section-tab[aria-selected="true"], .section-tabs input:checked + .section-tab) {
  border-color: var(--color-border-accent);
  background: var(--color-tab-selected);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--color-text) 5%, transparent);
  color: var(--color-primary);
  font-weight: 600;
}
.section-tabs input:focus-visible + .section-tab {
  outline: 2px solid var(--color-primary);
  outline-offset: -3px;
}
@media print { .section-tabs { display: none !important; } }
.tournament-player-panel .tournament-player-toolbar { align-items: center; }
.tournament-player-filters { flex: 1; margin: 0; }
.tournament-player-toolbar .enroll-category-picker { margin-inline-start: auto; }
.roster-results-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0; font-size: 13px; }
.roster-results-summary p { margin: 0; color: var(--color-muted); }
.roster-results-summary strong { color: var(--color-text); }
.roster-pagination { padding-top: 10px; }
.tournament-player-table th:first-child { width: 32%; }
.tournament-player-table th:nth-child(2) { width: 37%; }
.sport-table.tournament-player-table td { vertical-align: middle; }
.roster-player-actions { position: relative; display: flex; align-items: center; gap: 2px; }
.roster-player-actions .favorite-icon-control { position: static; }
.roster-player .roster-player-actions .favorite-feedback { inset-inline: 0 auto; }
.roster-player .participant-results-link {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 700;
}
.roster-categories { display: flex; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0; padding: 0; }
.roster-categories li { max-width: 100%; }
.roster-categories a {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--color-soft);
  color: var(--color-primary);
  font-size: 12px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.roster-categories a:hover { text-decoration: underline; }
.roster-encounter { overflow-wrap: anywhere; }
.roster-encounter-status { color: var(--color-muted); }
.roster-match-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: fit-content;
  max-width: min(100%, 13rem);
  min-height: 44px;
  padding: 7px 10px;
  color: var(--color-primary);
}
.roster-match-card:hover, .roster-match-card:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-soft);
}
.roster-match-content { display: grid; gap: 2px; line-height: 1.35; }
.roster-match-title { font-weight: 600; }
time.roster-match-title { display: flex; align-items: baseline; gap: 0.35em; }
time.roster-match-title > :last-child { white-space: nowrap; }
.roster-match-content small { margin: 0; }
.roster-match-state {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.roster-match-state--called { color: #543673; background: #f1e8f8; }
.roster-match-state--live { color: #1c5238; background: #e0f2e8; }
@media screen {
  :root[data-court-theme^='dark-'] .roster-match-state--called { color: var(--color-called-text); background: var(--color-called-bg); }
  :root[data-court-theme^='dark-'] .roster-match-state--live { color: var(--color-success-text); background: var(--color-success-bg); }
}
@media (max-width: 768px) {
  .app-header.workspace-header {
    grid-template-columns: minmax(44px, 1fr) auto minmax(max-content, 1fr);
    grid-template-areas: "menu brand account" "category category category";
    gap: 0 8px;
    align-items: center;
  }
  .workspace-main { display: block; grid-area: menu; justify-self: start; }
  .workspace-main > .workspace-drawer > nav { display: grid; row-gap: 8px; }
  .workspace-header .brand-link { justify-self: center; }
  .workspace-picker, .workspace-system, .workspace-sections { display: none; }
  :root:not(.enhanced) .workspace-header:has(.workspace-main[open])::before { content: ""; }
  :root:not(.enhanced):has(.workspace-main[open]) { overflow: hidden; }
  :root:not(.enhanced) .workspace-main[open] > .workspace-drawer {
    display: block;
    padding-top: max(64px, calc(env(safe-area-inset-top) + 56px));
  }
  :root:not(.enhanced) .workspace-main[open] > summary {
    position: fixed;
    inset: max(8px, env(safe-area-inset-top)) auto auto 12px;
    z-index: 46;
  }
  .workspace-submenu { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--color-border); }
  .workspace-submenu > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .workspace-submenu > summary .icon { width: 17px; height: 17px; flex: none; }
  .workspace-submenu > summary .icon:last-child { margin-inline-start: auto; }
  .workspace-submenu[open] > summary .icon:last-child { transform: rotate(180deg); }
  .workspace-submenu > summary:is(:hover, :focus-visible),
  .workspace-submenu[open] > summary { background: var(--color-soft); }
  .workspace-submenu > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
  .workspace-submenu > .workspace-popover {
    position: static;
    width: 100%;
    max-height: none;
    box-shadow: none;
  }
  .workspace-drawer a[aria-current] {
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-weight: 700;
  }
  .workspace-mobile-sections { grid-area: category; }
  .section-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(44px, 1fr);
    gap: 3px;
    margin-bottom: 14px;
    padding: 3px;
    overflow-x: auto;
  }
  .section-tab {
    padding: 4px 2px;
    font-size: .6875rem;
    white-space: nowrap;
  }
  .section-tab-short { display: block; }
  .section-tab-label:has(+ .section-tab-short) { display: none; }
  .section-tab .icon { width: 17px; height: 17px; }
  .workspace-mobile-sections .section-tabs {
    margin: 5px 0 0;
    border: 0;
    border-top: 1px solid #ffffff33;
    border-radius: 0;
    padding: 5px 0 0;
    background: transparent;
  }
  .workspace-mobile-sections .section-tab { color: var(--color-on-primary); }
  .workspace-mobile-sections .section-tab:hover { background: #ffffff18; }
  .workspace-mobile-sections :is(.section-tab[aria-selected="true"], input:checked + .section-tab) {
    border-color: transparent;
    background: var(--color-accent);
    color: var(--color-on-accent);
  }
  .workspace-mobile-sections :is(.section-tab:focus-visible, input:focus-visible + .section-tab) {
    outline-color: var(--color-on-primary);
    outline-offset: -3px;
  }
  .workspace-mobile-sections :is(.section-tab[aria-selected="true"]:focus-visible, input:checked:focus-visible + .section-tab) {
    outline-color: var(--color-on-accent);
  }
  .sport-table.tournament-player-table { display: block; min-width: 0; border-top: 1px solid var(--color-border); }
  .tournament-player-table :is(thead, tbody) { display: block; }
  .tournament-player-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(48%, 16rem);
    column-gap: 10px;
    padding-inline: 6px;
  }
  .tournament-player-table thead tr { background: var(--color-bg); border-bottom: 1px solid var(--collection-rule); }
  .tournament-player-table.collection-table thead th { width: auto; padding: 6px 0; border: 0; white-space: normal; }
  .tournament-player-table.collection-table thead th:nth-child(2) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .tournament-player-table thead th:last-child { grid-column: 2; }
  .tournament-player-table tbody tr {
    grid-template-rows: auto 1fr;
    align-items: start;
    row-gap: 3px;
    padding-block: 8px;
    border-bottom: 1px solid var(--color-border);
  }
  .tournament-player-table tbody tr:last-child { border-bottom: 0; }
  .sport-table.tournament-player-table td:not(.empty-cell) { padding: 0; border: 0; }
  .roster-player .participant-results-link { padding-block: 4px; }
  .tournament-player-table .roster-encounter { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .roster-match-card { padding-inline: 7px; }
}

