/* Base styles */
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  color: #333;
  background-color: #f8f8f8;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

html.dark-mode body,
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Headers */
h1,
h2,
h3 {
  color: #326295;
  transition: color 0.3s ease;
}

html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: #5b96d6;
}

/* Shared application header: branding is anchored independently of title length. */
.app-header {
  --header-surface: #fff;
  --header-text: #243b50;
  --header-muted: #647583;
  --header-border: #dfe6ec;
  --header-hover: #edf4fb;
  --header-accent: #326295;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  margin-bottom: 18px;
  color: var(--header-text);
  background: var(--header-surface);
  border: 1px solid var(--header-border);
  border-radius: 14px;
  box-shadow: 0 7px 22px rgba(29, 45, 61, 0.05);
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  text-align: left;
}

.app-header .logo-nav {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 18px;
  min-width: 0;
}

.app-header .app-logo {
  width: 64px;
  height: 64px;
  margin: 0;
  flex: 0 0 64px;
}

.app-header .brand-heading {
  min-width: 0;
  padding: 5px 0;
  text-align: left;
}

.app-header .brand-heading h1 {
  margin: 0;
  color: var(--header-text);
  font-size: clamp(1.3rem, 2.3vw, 1.7rem);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.035em;
  text-align: left;
  overflow-wrap: anywhere;
}

.header-club {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.app-header .club-brand {
  min-width: 0;
  color: var(--header-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.header-club__logo {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-align: left;
}

.header-competition {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 16px;
  margin-right: 4px;
  border-right: 1px solid var(--header-border);
}

.app-header .pennant-selector-label,
.header-account__caption {
  color: var(--header-muted);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header .header-competition .pennant-selector {
  min-width: 145px;
  max-width: 200px;
  min-height: 34px;
  box-sizing: border-box;
  padding: 5px 28px 5px 10px;
  color: var(--header-text);
  background: var(--header-surface);
  border: 1px solid var(--header-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.header-theme {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--header-muted);
  border-radius: 9px;
  cursor: pointer;
}

.header-theme input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.header-theme__icon {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: inherit;
  pointer-events: none;
}

.app-header svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-theme .header-theme__sun,
.header-theme input:checked + .header-theme__icon .header-theme__moon {
  display: none;
}

.header-theme input:checked + .header-theme__icon .header-theme__sun {
  display: block;
}

.header-theme:hover .header-theme__icon,
.header-account__trigger:hover,
.header-account[open] .header-account__trigger,
.header-account__action:hover {
  color: var(--header-accent);
  background: var(--header-hover);
}

.header-theme input:focus-visible + .header-theme__icon,
.app-header .pennant-selector:focus-visible,
.header-account__trigger:focus-visible,
.header-account__action:focus-visible {
  outline: 3px solid #7897b5;
  outline-offset: 3px;
}

.header-account {
  position: relative;
  flex-shrink: 0;
}

.header-account__trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 5px 9px 5px 5px;
  color: var(--header-text);
  border: 1px solid var(--header-border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.header-account__trigger::-webkit-details-marker {
  display: none;
}

.header-account__avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--header-accent);
  background: var(--header-hover);
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 700;
}

.app-header .header-account__chevron {
  width: 14px;
  height: 14px;
}

.header-account[open] .header-account__chevron {
  transform: rotate(180deg);
}

.header-account__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1000;
  width: 250px;
  max-width: calc(100vw - 72px);
  box-sizing: border-box;
  padding: 6px;
  color: var(--header-text);
  background: var(--header-surface);
  border: 1px solid var(--header-border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(20, 38, 56, 0.16);
}

.header-account__identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 12px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--header-border);
  overflow-wrap: anywhere;
}

.header-account .current-user {
  max-width: 100%;
  font-size: 0.9rem;
  line-height: 1.4;
}

.header-account__role {
  color: var(--header-muted);
  font-size: 0.75rem;
}

.header-account__action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 10px 12px;
  color: var(--header-text);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.header-account__logout {
  margin: 0;
}

.header-account__action--logout {
  color: var(--header-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html.dark-mode .app-header,
body.dark-mode .app-header {
  --header-surface: #252c33;
  --header-text: #e4e8eb;
  --header-muted: #a9b7c3;
  --header-border: #414c57;
  --header-hover: #34495e;
  --header-accent: #a9cff5;
}

@media (max-width: 800px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .header-tools {
    padding-top: 12px;
    border-top: 1px solid var(--header-border);
  }

  .header-competition {
    flex: 1;
    padding-right: 0;
    margin-right: auto;
    border-right: 0;
    min-width: 0;
  }

  .app-header .header-competition .pennant-selector {
    width: 100%;
    min-width: 0;
  }

  .header-theme {
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .header-account__trigger > span:not(.header-account__avatar) {
    display: none;
  }
}

@media (max-width: 380px) {
  .app-header {
    padding: 12px;
  }

  .app-header .logo-nav {
    gap: 12px;
  }

  .header-tools {
    gap: 6px;
  }
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  font-size: 0.9em;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

html.dark-mode table,
body.dark-mode table {
  background-color: #2d2d2d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

th,
td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease;
}

html.dark-mode th,
html.dark-mode td,
body.dark-mode th,
body.dark-mode td {
  border-color: #444;
}

th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
  transition: background-color 0.3s ease;
}

html.dark-mode th,
body.dark-mode th {
  background-color: #3a3a3a;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
  transition: background-color 0.3s ease;
}

html.dark-mode tr:nth-child(even),
body.dark-mode tr:nth-child(even) {
  background-color: #333333;
}

tr:hover {
  background-color: #f0f0f0;
  transition: background-color 0.3s ease;
}

html.dark-mode tr:hover,
body.dark-mode tr:hover {
  background-color: #444444;
}

/* Content sections */
.content-section {
  padding: 20px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

html.dark-mode .content-section,
body.dark-mode .content-section {
  background-color: #2d2d2d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Error messages */
.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

html.dark-mode .error-message,
body.dark-mode .error-message {
  background-color: #542a2e;
  color: #f8d7da;
}

/* Dark mode toggle */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: 15px;
}

.mode-toggle label {
  margin-right: 8px;
  cursor: pointer;
}

.pennant-selector {
  min-width: 155px;
  padding: 7px 30px 7px 10px;
  border: 1px solid #326295;
  border-radius: 4px;
  background-color: #fff;
  color: #20466e;
  font-weight: 700;
}

html.dark-mode .pennant-selector,
body.dark-mode .pennant-selector {
  border-color: #5b96d6;
  background-color: #333;
  color: #e0e0e0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #326295;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 5px;
  background-color: #326295;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #2a5280;
}

.btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

html.dark-mode .btn,
body.dark-mode .btn {
  background-color: #5b96d6;
}

html.dark-mode .btn:hover,
body.dark-mode .btn:hover {
  background-color: #4a85c5;
}

/* Forms */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-control {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition:
    border-color 0.3s ease,
    background-color 0.3s ease;
}

html.dark-mode .form-control,
body.dark-mode .form-control {
  background-color: #3a3a3a;
  border-color: #555;
  color: #e0e0e0;
}

.form-control:focus {
  outline: none;
  border-color: #326295;
}

/* Navigation */
.nav {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.nav-link {
  color: #326295;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background-color: #f0f0f0;
}

html.dark-mode .nav-link,
body.dark-mode .nav-link {
  color: #5b96d6;
}

html.dark-mode .nav-link:hover,
body.dark-mode .nav-link:hover {
  background-color: #444;
}

.nav-link.active {
  background-color: #326295;
  color: white;
}

html.dark-mode .nav-link.active,
body.dark-mode .nav-link.active {
  background-color: #5b96d6;
}

/* Progress bars */
.progress {
  width: 100%;
  height: 20px;
  background-color: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background-color: #326295;
  transition: width 0.3s ease;
}

html.dark-mode .progress,
body.dark-mode .progress {
  background-color: #444;
}

html.dark-mode .progress-bar,
body.dark-mode .progress-bar {
  background-color: #5b96d6;
}

/* Loading states */
.loading {
  text-align: center;
  padding: 20px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #326295;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header-container {
    flex-direction: column;
    text-align: center;
  }

  .mode-toggle {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
  }

  .logo-nav {
    flex-direction: column;
  }

  .nav {
    flex-direction: column;
    gap: 10px;
  }

  table {
    font-size: 0.8em;
  }

  th,
  td {
    padding: 6px;
  }
}

/* Navigation and Controls */
.controls-container {
  margin: 15px 0 25px 0;
}

.controls-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

html.dark-mode .controls-table,
body.dark-mode .controls-table {
  background-color: #2d2d2d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-cell {
  padding: 15px;
  vertical-align: middle;
  border: none;
}

/* Title button styling */
.title-button {
  display: inline-block;
  font-size: 1.2em;
  font-weight: bold;
  color: #326295;
  text-decoration: none;
  padding: 8px 16px;
  background-color: #f2f2f2;
  border-radius: 5px;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  border: none;
  outline: none;
  cursor: pointer;
  margin-right: 10px;
}

.title-button:hover {
  background-color: #326295;
  color: white;
  text-decoration: none;
}

html.dark-mode .title-button,
body.dark-mode .title-button {
  color: #5b96d6;
  background-color: #3a3a3a;
}

html.dark-mode .title-button:hover,
body.dark-mode .title-button:hover {
  background-color: #5b96d6;
  color: #1a1a1a;
}

.title-button.active {
  background-color: #326295;
  color: white;
  font-weight: bold;
}

html.dark-mode .title-button.active,
body.dark-mode .title-button.active {
  background-color: #5b96d6;
  color: #1a1a1a;
}

/* Utility classes */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.mb-10 {
  margin-bottom: 10px;
}
.mb-20 {
  margin-bottom: 20px;
}
.mt-10 {
  margin-top: 10px;
}
.mt-20 {
  margin-top: 20px;
}
.hidden {
  display: none;
}
.visible {
  display: block;
}

/* Settings button */
.settings-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  text-decoration: none;
  color: #326295;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-button:hover {
  background-color: rgba(50, 98, 149, 0.1);
  color: #326295;
  text-decoration: none;
}

html.dark-mode .settings-button,
body.dark-mode .settings-button {
  color: #5b96d6;
}

html.dark-mode .settings-button:hover,
body.dark-mode .settings-button:hover {
  background-color: rgba(91, 150, 214, 0.1);
  color: #5b96d6;
}

/* Cog wheel icon using CSS */
.settings-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  position: relative;
}

.settings-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.settings-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background:
    radial-gradient(
      circle at center,
      transparent 4px,
      currentColor 4px,
      currentColor 6px,
      transparent 6px
    ),
    conic-gradient(
      from 0deg,
      transparent 30deg,
      currentColor 30deg,
      currentColor 60deg,
      transparent 60deg,
      transparent 90deg,
      currentColor 90deg,
      currentColor 120deg,
      transparent 120deg,
      transparent 150deg,
      currentColor 150deg,
      currentColor 180deg,
      transparent 180deg,
      transparent 210deg,
      currentColor 210deg,
      currentColor 240deg,
      transparent 240deg,
      transparent 270deg,
      currentColor 270deg,
      currentColor 300deg,
      transparent 300deg,
      transparent 330deg,
      currentColor 330deg,
      currentColor 360deg,
      transparent 360deg
    );
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

/* Simplified cog icon using Unicode */
.settings-icon-simple {
  font-size: 18px;
  line-height: 1;
}

.settings-icon-simple::before {
  content: '⚙';
}

/* Dark mode toggle labels */
.mode-toggle label {
  margin-right: 8px;
  cursor: pointer;
}
/* Global status shown while scheduled or manually requested data updates run. */
.background-sync-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 10000;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: #173f67;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  font-weight: 600;
}

.brand-heading {
  min-width: 0;
  text-align: center;
}

.brand-heading h1 {
  overflow-wrap: anywhere;
}

.app-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  border-radius: 8px;
}

.club-brand {
  display: block;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

/* Shared action buttons */
.app-button.app-button {
  display: inline-flex;
  min-height: 40px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  color: #3b4a57;
  background: #fff;
  border: 1px solid #ccd6df;
  border-radius: 9px;
  box-shadow: 0 3px 9px rgba(31, 58, 85, 0.08);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.app-button.app-button:hover:not(:disabled) {
  color: #244d78;
  background: #edf4fb;
  border-color: #7897b5;
  box-shadow: 0 5px 12px rgba(31, 54, 76, 0.12);
  transform: translateY(-1px);
}

.app-button.app-button:focus-visible {
  outline: 3px solid rgba(50, 98, 149, 0.26);
  outline-offset: 2px;
}

.app-button.app-button:disabled,
.app-button.app-button[aria-disabled='true'] {
  color: #6f7b86;
  background: #e5e9ed;
  border-color: #d2d8de;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.app-button.app-button--primary {
  color: #fff;
  background: #326295;
  border-color: #326295;
  box-shadow: 0 5px 13px rgba(50, 98, 149, 0.22);
}

.app-button.app-button--primary:hover:not(:disabled) {
  color: #fff;
  background: #28527e;
  border-color: #28527e;
  box-shadow: 0 7px 16px rgba(50, 98, 149, 0.28);
}

.app-button.app-button--success {
  color: #fff;
  background: #2f9b5d;
  border-color: #2f9b5d;
  box-shadow: 0 5px 13px rgba(47, 155, 93, 0.2);
}

.app-button.app-button--success:hover:not(:disabled) {
  color: #fff;
  background: #27834f;
  border-color: #27834f;
  box-shadow: 0 7px 16px rgba(47, 155, 93, 0.25);
}

.app-button.app-button--danger {
  color: #fff;
  background: #c74646;
  border-color: #c74646;
}

.app-button.app-button--danger:hover:not(:disabled) {
  color: #fff;
  background: #a93434;
  border-color: #a93434;
}

.app-button.app-button--compact {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 0.79rem;
}

.app-button.app-button--block {
  width: 100%;
}

.app-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

html.dark-mode .app-button.app-button,
body.dark-mode .app-button.app-button {
  color: #e4e8eb;
  background: #30363c;
  border-color: #4b555f;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.16);
}

html.dark-mode .app-button.app-button:hover:not(:disabled),
body.dark-mode .app-button.app-button:hover:not(:disabled) {
  color: #e8f3ff;
  background: #34495e;
  border-color: #5b96d6;
}

html.dark-mode .app-button.app-button--primary,
body.dark-mode .app-button.app-button--primary {
  color: #fff;
  background: #477fb8;
  border-color: #477fb8;
}

html.dark-mode .app-button.app-button--success,
body.dark-mode .app-button.app-button--success {
  color: #fff;
  background: #2f9b5d;
  border-color: #2f9b5d;
}

html.dark-mode .app-button.app-button--danger,
body.dark-mode .app-button.app-button--danger {
  color: #fff;
  background: #b74343;
  border-color: #b74343;
}

html.dark-mode .app-button.app-button:disabled,
html.dark-mode .app-button.app-button[aria-disabled='true'],
body.dark-mode .app-button.app-button:disabled,
body.dark-mode .app-button.app-button[aria-disabled='true'] {
  color: #9ca6af;
  background: #3b4147;
  border-color: #4b5259;
  box-shadow: none;
}

/* Shared menu buttons */
.app-navigation .controls-table {
  overflow: visible;
  border: 1px solid #dfe6ec;
  border-radius: 14px;
  box-shadow: 0 7px 22px rgba(29, 45, 61, 0.07);
}

.app-navigation__items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.app-navigation .title-button {
  display: inline-flex;
  min-height: 39px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 13px;
  color: #3b4a57;
  background-color: #fff;
  border: 1px solid #ccd6df;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.app-navigation .title-button:hover {
  color: #244d78;
  background-color: #edf4fb;
  border-color: #7897b5;
  box-shadow: 0 4px 10px rgba(31, 54, 76, 0.1);
  transform: translateY(-1px);
}

.app-navigation .title-button:focus-visible {
  outline: 3px solid rgba(50, 98, 149, 0.26);
  outline-offset: 2px;
}

.app-navigation .title-button.active {
  color: #fff;
  background-color: #326295;
  border-color: #326295;
  box-shadow: 0 5px 13px rgba(50, 98, 149, 0.2);
}

.app-navigation .title-button[aria-current='page'] {
  pointer-events: none;
}

html.dark-mode .app-navigation .title-button,
body.dark-mode .app-navigation .title-button {
  color: #e4e8eb;
  background-color: #30363c;
  border-color: #4b555f;
}

html.dark-mode .app-navigation .title-button:hover,
body.dark-mode .app-navigation .title-button:hover {
  color: #e8f3ff;
  background-color: #34495e;
  border-color: #5b96d6;
}

html.dark-mode .app-navigation .title-button.active,
body.dark-mode .app-navigation .title-button.active {
  color: #fff;
  background-color: #477fb8;
  border-color: #477fb8;
}

.header-action.header-action {
  min-height: 36px;
  padding: 7px 11px;
  color: #3b4a57;
  background: #fff;
  border: 1px solid #ccd6df;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 700;
}

.header-action.header-action:hover {
  color: #244d78;
  background: #edf4fb;
  border-color: #7897b5;
}

.header-action.header-action:focus-visible {
  outline: 3px solid rgba(50, 98, 149, 0.26);
  outline-offset: 2px;
}

.header-action--icon.header-action--icon {
  width: 36px;
  padding: 7px;
}

html.dark-mode .header-action.header-action,
body.dark-mode .header-action.header-action {
  color: #e4e8eb;
  background: #30363c;
  border-color: #4b555f;
}

html.dark-mode .header-action.header-action:hover,
body.dark-mode .header-action.header-action:hover {
  color: #e8f3ff;
  background: #34495e;
  border-color: #5b96d6;
}

@media (max-width: 768px) {
  .app-navigation .controls-table tr {
    display: flex;
    flex-wrap: wrap;
  }

  .app-navigation .control-cell {
    padding: 10px;
  }

  .app-navigation__links {
    flex: 1;
    min-width: 0;
  }

  .app-navigation .season-selector-cell {
    box-sizing: border-box;
    width: 100%;
    text-align: left;
  }

  .app-navigation__items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .app-navigation__links .app-navigation__items {
    padding: 0;
  }

  .app-navigation__items .title-button {
    width: 100%;
  }
}
