:root { --cup-header-height: 4rem; }
html { scroll-padding-top: calc(var(--cup-header-height) + 1rem); }
.site-header { position: sticky; top: 0; z-index: 100; flex-wrap: wrap; gap: .6rem 1rem; padding-top: .6rem; padding-bottom: .6rem; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: .5rem .8rem; flex-wrap: wrap; margin-left: auto; }
.header-competitions > button { font-size: .8rem; padding: .4rem .6rem; color: var(--text); background: var(--surface); }
.site-header .account-nav { margin: 0; white-space: nowrap; }
.header-competitions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; width: 100%; min-width: 0; }
.site-header #competitions { display: flex; gap: .4rem; margin: 0; flex: 1 1 20rem; overflow-x: auto; min-width: 0; padding: .2rem 0; }
.site-header #competitions a { display: inline-block; padding: .35rem .7rem; border: 1px solid color-mix(in srgb,var(--on-primary) 45%,transparent); border-radius: .4rem; font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap; color: var(--on-primary); }
.site-header #competitions a[aria-current="location"] { color: var(--text); background: var(--surface); border-color: var(--surface); }
.site-header #competitions a:hover { text-decoration: underline; }
.site-header #competitions a:focus-visible { outline: 2px solid var(--on-primary); outline-offset: 1px; }
#admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
#admin-actions button { font-size: .85rem; min-height: 2.75rem; }
#validate { color: var(--text); background: var(--surface); }
#save { border-width: 2px; min-width: 8rem; }
#save[data-save-state="unsaved"] { background: #b42332; color: #fff; border-color: #b42332; }
#save[data-save-state="saving"] { background: #f4ca4f; color: #302300; border-color: #f4ca4f; }
#save[data-save-state="saved"] { background: #13733b; color: #fff; border-color: #13733b; }
#save:disabled { opacity: 1; }
.sheet-section, .sheet-host, .sheet-host td { scroll-margin-top: calc(var(--cup-header-height) + 1rem); }
#fixtures-plan th { top: var(--cup-thead-top, 0px); }
#validation-dialog { width: min(56rem, calc(100% - 2rem)); max-height: calc(100dvh - 3rem); overflow: auto; padding: 1.25rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; box-shadow: var(--shadow); }
#validation-dialog::backdrop { background: #0009; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { margin: 0; font-size: 1.3rem; }
#validation-dialog .issue-list { max-height: none; overflow: visible; }
@media (max-width: 44rem) {
  .site-header { gap: .5rem .8rem; padding: .6rem 1rem; }
  #org-name { font-size: .85rem; }
  .header-tools { flex: 1 1 auto; gap: .5rem; }
  .header-tools > .account-nav { font-size: .8rem; }
  #admin-actions { width: 100%; }
  #admin-actions button { flex: 1; }
  .header-competitions { gap: .4rem; }
  .site-header #competitions { flex-basis: 0; }
  .header-competitions .match-filter { width: 100%; }
  .match-filter input { flex: 0 1 18rem; }
}
