/*
 * Competition Discovery — Direction B remediation
 * Shared discovery route only. The approved Guest Discovery header treatment
 * is route-gated so authenticated and unrelated routes keep their shell.
 */

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 {
  --competition-cream: #fbf6ec;
  --competition-paper: #fffdf8;
  --competition-inset: #f1e4cc;
  --competition-ink: #241d14;
  --competition-copy: #4b4030;
  --competition-muted: #7a6e5c;
  --competition-placeholder: #9a8d79;
  --competition-line: #e7d5b2;
  --competition-accent: #ea580c;
  --competition-accent-deep: #c2410c;
  --competition-accent-tint: #fdf0e4;
  --competition-accent-line: #f6c69b;
  width: min(1180px, calc(100% - 80px)) !important;
  max-width: 1180px !important;
  margin-inline: auto !important;
  padding: 0 0 72px !important;
  color: var(--competition-copy);
  font-family: "DM Sans", "Bai Jamjuree", system-ui, sans-serif;
  overflow: visible;
}

body[data-page="app"].app-shell-guest:has(#competitions.active-view) {
  overflow-x: clip;
  background: var(--w2g-page-bg, #fbf6ec);
}

/* Guest header: reuse the approved Landing Page structure on this route only. */
body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar {
  min-height: 68px !important;
  padding-inline: max(40px, calc((100% - 1180px) / 2)) !important;
  border-bottom: 1px solid rgba(255, 253, 248, 0.14) !important;
  background: #241d14 !important;
  color: #fffdf8 !important;
  box-shadow: none !important;
  transition: none !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand {
  color: #fffdf8 !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand-mark {
  border-color: #ea580c !important;
  background: #ea580c !important;
  color: #fffdf8 !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand strong,
body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand span {
  color: #fffdf8 !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav > button {
  color: #e4d6bc !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav > button:hover,
body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav > button.active {
  background: rgba(255, 253, 248, 0.12) !important;
  color: #fffdf8 !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar #mainNav.main-nav > button.active {
  border-color: rgba(255, 253, 248, 0.08) !important;
  background: rgba(255, 253, 248, 0.12) !important;
  color: #fffdf8 !important;
  box-shadow: none !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .auth-actions .button.ghost {
  border-color: #e4d6bc !important;
  background: transparent !important;
  color: #fffdf8 !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .auth-actions .button.primary {
  border-color: #ea580c !important;
  background: #ea580c !important;
  color: #fffdf8 !important;
}

body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .mobile-menu-button {
  border-color: rgba(255, 253, 248, 0.28) !important;
  background: rgba(255, 253, 248, 0.08) !important;
  color: #fffdf8 !important;
}

/* Compact editorial introduction. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro {
  display: block !important;
  margin: 0 !important;
  padding: 34px 0 28px !important;
  border-bottom: 1px solid var(--competition-line) !important;
  background: transparent !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro > .head-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 340px) !important;
  gap: 48px !important;
  align-items: end !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-intro-copy {
  min-width: 0;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px !important;
  color: var(--competition-accent-deep) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  letter-spacing: 0.13em !important;
  text-transform: uppercase;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro .eyebrow::before {
  width: 20px;
  height: 2px;
  background: var(--competition-accent);
  content: "";
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro h1 {
  max-width: 680px;
  margin: 0 !important;
  color: var(--competition-ink) !important;
  font-family: "Bai Jamjuree", "DM Sans", system-ui, sans-serif !important;
  font-size: clamp(32px, 3vw, 36px) !important;
  font-weight: 700 !important;
  line-height: 1.28 !important;
  letter-spacing: -0.025em !important;
  overflow-wrap: anywhere;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro .muted {
  max-width: 650px;
  margin: 8px 0 0 !important;
  color: var(--competition-muted) !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-intro-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-intro-aside p {
  max-width: 320px;
  margin: 0 !important;
  color: var(--competition-muted) !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-intro-aside .button {
  min-height: 42px;
  border-radius: 8px !important;
}

/* Structured discovery board. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell {
  display: block !important;
  margin: 24px 0 0 !important;
  padding: 16px 16px 0 !important;
  border: 1px solid var(--competition-line) !important;
  border-radius: 12px !important;
  background: var(--competition-paper) !important;
  box-shadow: none !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell .filter-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 148px max-content !important;
  gap: 12px !important;
  align-items: end !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-toolbar > label {
  display: grid !important;
  min-width: 0;
  gap: 7px;
  margin: 0 !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-toolbar > label > span:not(.competition-search-input-wrap),
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filters-panel label > span {
  display: block !important;
  color: var(--competition-muted) !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field {
  grid-column: 1;
  grid-row: 1;
  width: 100% !important;
  max-width: none !important;
  gap: 8px !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-search-input-wrap {
  position: relative;
  display: block !important;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  line-height: 0;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field .reference-search-icon {
  position: absolute !important;
  z-index: 1;
  left: 16px !important;
  top: 50% !important;
  bottom: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--competition-muted) !important;
  background: none !important;
  box-sizing: border-box;
  line-height: 0;
  transform: translateY(-50%) !important;
  pointer-events: none;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field .reference-search-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field input,
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-sort-field select,
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filters-panel select {
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  margin: 0 !important;
  border: 1px solid var(--competition-line) !important;
  border-radius: 9px !important;
  background-color: #fffaf1 !important;
  color: var(--competition-ink) !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 14px !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field input {
  display: block !important;
  max-width: none !important;
  padding: 0 16px 0 47px !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell .filter-toolbar label.filter-search-field {
  width: 100% !important;
  max-width: none !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell .filter-toolbar label.filter-search-field input#competitionSearch {
  width: 100% !important;
  max-width: none !important;
  padding-left: 47px !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field input::placeholder {
  color: var(--competition-placeholder) !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-sort-field {
  grid-column: 3;
  grid-row: 1;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-sort-field select,
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filters-panel select {
  padding: 0 38px 0 13px !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterToggle {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 0 13px !important;
  border: 1px solid var(--competition-ink) !important;
  border-radius: 9px !important;
  background: var(--competition-paper) !important;
  color: var(--competition-ink) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterToggle:hover {
  background: #f8edda !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-button-icon {
  display: inline-flex !important;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  width: 18px !important;
  height: 18px !important;
  opacity: 1;
  background: none !important;
  line-height: 0;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-button-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterCount {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--competition-accent);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterCount.hidden {
  display: none !important;
}

/* Quick filters occupy their own calm rail below primary controls. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionQuickFilters {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-width: 0;
  margin: 2px 0 0 !important;
  padding: 14px 0 12px !important;
  border: 0 !important;
  background: transparent !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter-group + .competition-quick-filter-group {
  padding-left: 16px;
  border-left: 1px solid var(--competition-line);
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter-label {
  margin-right: 2px;
  color: var(--competition-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter {
  min-height: 32px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid var(--competition-line) !important;
  border-radius: 7px !important;
  background: #fffaf1 !important;
  color: var(--competition-copy) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter:hover,
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter.active {
  border-color: var(--competition-accent-line) !important;
  background: var(--competition-accent-tint) !important;
  color: var(--competition-accent-deep) !important;
}

/* Non-default filters get a separate orange-tinted context strip. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionActiveFilters {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  margin: 0 -16px !important;
  padding: 10px 16px !important;
  border-top: 1px solid var(--competition-accent-line) !important;
  background: var(--competition-accent-tint) !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionActiveFilters.hidden {
  display: none !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell > #competitionActiveFilters:not(.hidden) {
  border-top: 1px solid var(--competition-accent-line) !important;
  background: var(--competition-accent-tint) !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .active-filter-label {
  color: var(--competition-accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--competition-accent-line);
  border-radius: 7px;
  background: var(--competition-paper);
  color: var(--competition-accent-deep);
  font-size: 12px;
  font-weight: 700;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .active-filter-chip button,
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .clear-filter-button {
  min-width: 24px;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .clear-filter-button {
  margin-left: auto;
  padding: 0 4px;
  color: var(--competition-accent-deep);
  font-size: 12px;
  font-weight: 800;
}

/* Inline expanded filters on desktop. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterPanel {
  margin: 0 -16px !important;
  padding: 16px !important;
  border: 0 !important;
  border-top: 1px solid var(--competition-line) !important;
  border-radius: 0 0 12px 12px !important;
  background: #f8edda !important;
  box-shadow: none !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterPanel.hidden {
  display: none !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-drawer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 15px;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-drawer-header strong {
  color: var(--competition-ink);
  font-size: 16px;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-drawer-header p {
  max-width: 620px;
  margin: 3px 0 0;
  color: var(--competition-muted);
  font-size: 12px;
  line-height: 1.5;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-close {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--competition-line);
  border-radius: 8px;
  background: var(--competition-paper);
  color: var(--competition-ink);
  font-size: 22px;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filters-panel.compact-filter-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filters-panel label {
  display: grid !important;
  min-width: 0;
  gap: 7px;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-actions .button {
  min-height: 42px;
  border-radius: 8px !important;
}

/* Result context remains secondary to the board. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-results-context {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0 14px !important;
  padding: 0 !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-result-count,
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-sort-context {
  margin: 0 !important;
  color: var(--competition-muted) !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-result-count {
  color: var(--competition-ink) !important;
  font-weight: 750 !important;
}

/* Dense, repeatable competition board cards. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: auto !important;
  align-items: stretch !important;
  gap: 22px !important;
  width: 100% !important;
  margin: 0 !important;
}

@media (min-width: 1200px) {
  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList[data-result-count="1"] {
    grid-template-columns: minmax(0, calc((100% - 44px) / 3)) !important;
    justify-content: start !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList[data-result-count="2"] {
    grid-template-columns: repeat(2, minmax(0, calc((100% - 44px) / 3))) !important;
    justify-content: start !important;
  }
}

body[data-page="app"].app-shell-guest #competitionList .reference-competition-card {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #dfcba6 !important;
  border-radius: 12px !important;
  background: var(--competition-paper, #fffdf8) !important;
  box-shadow: 0 4px 16px rgba(64, 44, 21, 0.055) !important;
  color: var(--competition-copy, #4b4030) !important;
  transform: none !important;
  animation: none !important;
}

body[data-page="app"].app-shell-guest #competitionList .reference-competition-card:hover {
  border-color: #d5b981 !important;
  box-shadow: 0 8px 22px rgba(64, 44, 21, 0.085) !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell {
  position: relative !important;
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  aspect-ratio: 16 / 10 !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 253, 248, 0.12) !important;
  border-radius: 0 !important;
  background: #241d14 !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell::after {
  position: absolute;
  inset: auto 0 0;
  height: 22%;
  background: linear-gradient(to top, rgba(36, 29, 20, 0.24), transparent);
  content: "";
  pointer-events: none;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell img,
body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster,
body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell > picture {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  object-position: center !important;
  background: #241d14 !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell img {
  object-fit: contain !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .poster-fallback,
body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster-fallback {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 24px !important;
  background: #32281d !important;
  color: #f1e4cc !important;
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  font-size: clamp(24px, 4vw, 40px) !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
  text-align: center;
  overflow-wrap: anywhere;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster.poster-empty .poster-placeholder {
  position: static !important;
  inset: auto !important;
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  gap: 5px !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 26px !important;
  border: 0 !important;
  background: #32281d !important;
  color: #e4d6bc !important;
  text-align: center !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster.poster-empty .poster-placeholder > span {
  display: none !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster.poster-empty .poster-placeholder > strong {
  color: #fffdf8 !important;
  font-size: 14px !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster.poster-empty .poster-placeholder > small {
  color: #ad9e88 !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
}

body[data-page="app"].app-shell-guest #competitionList .reference-card-poster-badge {
  position: absolute !important;
  z-index: 2;
  top: 12px !important;
  display: inline-flex !important;
  align-items: center;
  min-height: 27px;
  max-width: calc(50% - 16px);
  margin: 0 !important;
  padding: 0 9px !important;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 248, 0.2) !important;
  border-radius: 7px !important;
  background: rgba(36, 29, 20, 0.9) !important;
  color: #fffdf8 !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: none !important;
  transform: none !important;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList .reference-competition-card .competition-poster-shell > .reference-card-poster-badge {
  top: 12px !important;
  transform: none !important;
}

body[data-page="app"].app-shell-guest #competitionList .reference-card-poster-badge-start {
  left: 12px !important;
}

body[data-page="app"].app-shell-guest #competitionList .reference-card-poster-badge-end {
  right: 12px !important;
  left: auto !important;
  min-height: 0;
  padding: 0 !important;
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-card-body {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 15px !important;
  background: var(--competition-paper, #fffdf8) !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-top,
body[data-page="app"].app-shell-guest #competitionList .reference-card-copy {
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-title {
  display: -webkit-box !important;
  min-width: 0;
  min-height: calc(1.32em * 2);
  max-height: calc(1.32em * 3);
  margin: 0 0 5px !important;
  overflow: hidden !important;
  color: var(--competition-ink, #241d14) !important;
  font-family: "Bai Jamjuree", "DM Sans", system-ui, sans-serif !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.32 !important;
  letter-spacing: -0.012em !important;
  overflow-wrap: anywhere !important;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList .reference-competition-card .lc-title {
  -webkit-line-clamp: 3 !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-meta {
  margin: 0 !important;
  overflow: hidden;
  color: var(--competition-muted, #7a6e5c) !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;
  overflow-wrap: anywhere;
}

body[data-page="app"].app-shell-guest #competitionList .lc-meta + .lc-meta {
  margin-top: 1px !important;
  color: #8c7e69 !important;
  font-size: 11.5px !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-card-facts {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 9px 10px !important;
  border: 1px solid var(--competition-line, #e7d5b2) !important;
  border-radius: 8px !important;
  background: #faf0df !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-card-fact {
  min-width: 0;
  margin: 0 !important;
  padding: 0 9px 0 0 !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-card-fact + .competition-card-fact {
  padding: 0 0 0 9px !important;
  border-left: 1px solid var(--competition-line, #e7d5b2);
}

body[data-page="app"].app-shell-guest #competitionList .competition-card-fact:only-child {
  grid-column: 1 / -1;
  padding: 0 !important;
}

body[data-page="app"].app-shell-guest #competitionList .competition-card-fact dt,
body[data-page="app"].app-shell-guest #competitionList .reference-section-label {
  margin: 0 0 3px !important;
  color: var(--competition-muted, #7a6e5c) !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
}

body[data-page="app"].app-shell-guest #competitionList .competition-card-fact dd {
  margin: 0 !important;
  color: var(--competition-ink, #241d14) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere;
}

/* Guest matching is helper copy, never a disabled-looking field. */
body[data-page="app"].app-shell-guest #competitionList .competition-card-body > .match.match-guest {
  display: block !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="app"].app-shell-guest #competitionList .match-guest .match-head {
  display: block !important;
  margin: 0 !important;
}

body[data-page="app"].app-shell-guest #competitionList .match-guest .match-label {
  color: var(--competition-muted, #7a6e5c) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
}

body[data-page="app"].app-shell-guest #competitionList .match-guest .match-label::before {
  color: var(--competition-accent, #ea580c);
  content: "→ ";
}

body[data-page="app"].app-shell-guest #competitionList .match-guest small {
  display: none !important;
}

/* Existing authenticated match behavior, visually compressed for scanning. */
body[data-page="app"].app-shell-guest #competitionList .competition-card-body > .match:not(.match-guest) {
  margin: 0 !important;
  padding: 8px 9px !important;
  border: 1px solid var(--competition-line, #e7d5b2) !important;
  border-radius: 8px !important;
  background: #fffaf1 !important;
}

body[data-page="app"].app-shell-guest #competitionList .match:not(.match-guest) .match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

body[data-page="app"].app-shell-guest #competitionList .match:not(.match-guest) .match-label,
body[data-page="app"].app-shell-guest #competitionList .match:not(.match-guest) .match-score {
  color: var(--competition-copy, #4b4030) !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
}

body[data-page="app"].app-shell-guest #competitionList .match-bar {
  height: 4px !important;
  overflow: hidden;
  border-radius: 99px;
  background: var(--competition-inset, #f1e4cc) !important;
}

body[data-page="app"].app-shell-guest #competitionList .match-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--competition-accent, #ea580c);
}

body[data-page="app"].app-shell-guest #competitionList .reference-why {
  margin: -3px 0 0 !important;
  font-size: 11px;
}

body[data-page="app"].app-shell-guest #competitionList .reference-why summary {
  color: var(--competition-muted, #7a6e5c);
  cursor: pointer;
}

body[data-page="app"].app-shell-guest #competitionList .reference-why .why {
  margin-top: 7px;
  padding: 8px;
  border: 1px solid var(--competition-line, #e7d5b2);
  border-radius: 7px;
  background: #fffaf1;
  overflow-wrap: anywhere;
}

body[data-page="app"].app-shell-guest #competitionList .reference-role-block {
  display: grid !important;
  gap: 5px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body[data-page="app"].app-shell-guest #competitionList .reference-role-block .chip-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  min-width: 0;
  margin: 0 !important;
}

body[data-page="app"].app-shell-guest #competitionList .reference-role-block .chip {
  display: inline-flex !important;
  align-items: center;
  min-width: 0;
  min-height: 25px !important;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 8px !important;
  overflow: hidden;
  border: 1px solid var(--competition-line, #e7d5b2) !important;
  border-radius: 7px !important;
  background: #fffaf1 !important;
  color: var(--competition-copy, #4b4030) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="app"].app-shell-guest #competitionList .reference-role-block .chip.need {
  border-color: var(--competition-accent-line, #f6c69b) !important;
  background: var(--competition-accent-tint, #fdf0e4) !important;
  color: var(--competition-accent-deep, #c2410c) !important;
}

body[data-page="app"].app-shell-guest #competitionList .closed-competition-notice {
  margin: 0 !important;
  padding: 7px 8px !important;
  border-radius: 7px !important;
  background: #eee5d7 !important;
  color: var(--competition-muted, #7a6e5c) !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-actions {
  display: flex !important;
  align-items: stretch !important;
  gap: 8px !important;
  min-width: 0;
  margin: auto 0 0 !important;
  padding: 2px 0 0 !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-actions .button {
  flex: 1 1 0;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-actions .button.primary {
  border: 1px solid var(--competition-ink, #241d14) !important;
  background: transparent !important;
  color: var(--competition-ink, #241d14) !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-actions .button.primary:hover {
  background: var(--competition-ink, #241d14) !important;
  color: var(--competition-paper, #fffdf8) !important;
}

body[data-page="app"].app-shell-guest #competitionList .lc-actions .button:disabled {
  border-color: #c6b79c !important;
  background: #eee5d7 !important;
  color: #8c806f !important;
}

/* Existing useful empty/error surfaces, without inventing async states. */
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList > .empty-state,
body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList > .reference-empty-state {
  grid-column: 1 / -1;
  min-height: 260px;
  padding: 42px;
  border: 1px dashed #d9bd8c !important;
  border-radius: 12px !important;
  background: var(--competition-paper) !important;
  color: var(--competition-copy) !important;
  text-align: center;
}

body[data-page="app"].app-shell-guest #competitions.competition-page-v2 :is(button, input, select, summary):focus-visible,
body[data-page="app"].app-shell-guest > #competitionFilterPanel :is(button, select):focus-visible {
  outline: 3px solid rgba(234, 88, 12, 0.28) !important;
  outline-offset: 2px !important;
}

/* Intermediate layout: two cards, restrained gutters. */
@media (max-width: 1199px) {
  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 {
    width: calc(100% - 144px) !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 999px) {
  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 {
    width: calc(100% - 80px) !important;
    padding-bottom: 56px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro > .head-row {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) !important;
    gap: 28px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell .filter-toolbar {
    grid-template-columns: minmax(0, 1fr) 120px max-content !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionQuickFilters {
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filters-panel.compact-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Mobile discovery: visible search, compact quick rail, one-column cards. */
@media (max-width: 759px) {
  body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar {
    min-height: 62px !important;
    padding-inline: 16px !important;
  }

  body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand strong {
    font-size: 15px !important;
  }

  body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav {
    background: #241d14 !important;
    color: #fffdf8 !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 {
    width: 100% !important;
    max-width: none !important;
    padding: 0 16px 48px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro {
    padding: 24px 0 20px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro > .head-row {
    display: block !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro .eyebrow {
    margin-bottom: 7px !important;
    font-size: 10px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro h1 {
    font-size: 27px !important;
    line-height: 1.3 !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro .muted {
    margin-top: 6px !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-intro-aside {
    align-items: flex-start;
    margin-top: 12px;
    text-align: left;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-intro-aside p {
    display: none !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-intro-aside:empty {
    display: none;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell {
    margin-top: 16px !important;
    padding: 10px 10px 0 !important;
    border-radius: 11px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell .filter-toolbar {
    grid-template-columns: minmax(0, 1fr) 50px !important;
    gap: 8px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field {
    grid-column: 1;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field > span:not(.competition-search-input-wrap),
  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-sort-field {
    display: none !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-filter-shell .filter-toolbar > label.filter-search-field > span:not(.competition-search-input-wrap) {
    display: none !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .filter-search-field input {
    height: 48px !important;
    padding-left: 47px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterToggle {
    grid-column: 2;
    width: 50px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterToggle .filter-toggle-label {
    display: none !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterToggle .filter-button-icon {
    display: inline-flex !important;
    width: 18px !important;
    height: 18px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionFilterCount {
    position: absolute;
    top: -6px;
    right: -6px;
    border: 2px solid var(--competition-paper);
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionQuickFilters {
    grid-column: 1 / -1;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: calc(100% + 2px) !important;
    margin: 0 -1px !important;
    padding: 10px 0 11px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionQuickFilters::-webkit-scrollbar {
    display: none;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter-group {
    flex: 0 0 auto;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter-group + .competition-quick-filter-group::before {
    display: none;
    content: none;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-quick-filter-label {
    display: none;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionActiveFilters {
    margin-inline: -10px !important;
    padding-inline: 10px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-results-context {
    align-items: flex-start;
    margin: 18px 0 11px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-sort-context {
    max-width: 52%;
    text-align: right;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
  }

  body[data-page="app"].app-shell-guest #competitionList .competition-card-body {
    padding: 14px !important;
  }

  body[data-page="app"].app-shell-guest #competitionList .lc-title {
    font-size: 16.5px !important;
    line-height: 1.34 !important;
  }

  body[data-page="app"].app-shell-guest #competitionList .lc-actions .button {
    min-height: 44px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList > .empty-state,
  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 #competitionList > .reference-empty-state {
    min-height: 220px;
    padding: 30px 18px;
  }

  /* The existing single filter form becomes an opaque accessible bottom sheet. */
  body[data-page="app"].app-shell-guest > #competitionFilterPanel:not(.hidden) {
    position: fixed !important;
    z-index: 1200 !important;
    inset: auto 8px 8px !important;
    display: block !important;
    max-height: min(84dvh, 720px) !important;
    margin: 0 !important;
    padding: 16px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border: 1px solid #d7bd8f !important;
    border-radius: 16px !important;
    background: #fffdf8 !important;
    box-shadow: 0 18px 60px rgba(36, 29, 20, 0.3) !important;
    color: #4b4030 !important;
    transform: none !important;
    animation: none !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel:not(.hidden)::before {
    display: block;
    width: 42px;
    height: 4px;
    margin: -4px auto 12px;
    border-radius: 99px;
    background: #c6b79c;
    content: "";
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-drawer-header {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-drawer-header strong {
    color: #241d14 !important;
    font-family: "Bai Jamjuree", system-ui, sans-serif;
    font-size: 18px !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-drawer-header p {
    margin: 3px 0 0;
    color: #7a6e5c !important;
    font-size: 11.5px !important;
    line-height: 1.45 !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-close {
    display: inline-grid !important;
    place-items: center;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid #e7d5b2 !important;
    border-radius: 8px !important;
    background: #fffaf1 !important;
    color: #241d14 !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .mobile-competition-primary-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-sort-field {
    display: grid !important;
    gap: 6px;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-sort-field > span,
  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filters-panel label > span {
    color: #7a6e5c !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel select {
    width: 100% !important;
    height: 46px !important;
    min-width: 0 !important;
    padding: 0 36px 0 11px !important;
    border: 1px solid #e7d5b2 !important;
    border-radius: 8px !important;
    background-color: #fffaf1 !important;
    color: #241d14 !important;
    font-size: 13px !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel #competitionActiveFilters {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px !important;
    padding: 10px !important;
    border: 1px solid #f6c69b !important;
    border-radius: 9px !important;
    background: #fdf0e4 !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel #competitionActiveFilters.hidden {
    display: none !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .active-filter-label {
    width: 100%;
    color: #c2410c;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .active-filter-chip {
    min-height: 29px;
    border: 1px solid #f6c69b;
    border-radius: 7px;
    background: #fffdf8;
    color: #c2410c;
    font-size: 11.5px;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filters-panel.compact-filter-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 8px !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filters-panel label {
    display: grid !important;
    min-width: 0;
    gap: 6px;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-actions {
    position: sticky;
    bottom: -16px;
    display: grid !important;
    grid-template-columns: 1fr 1.4fr;
    gap: 8px;
    margin: 15px -16px -16px !important;
    padding: 12px 16px 16px !important;
    border-top: 1px solid #e7d5b2;
    background: #fffdf8;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filter-actions .button {
    min-width: 0 !important;
    min-height: 46px !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 374px) {
  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 {
    padding-inline: 14px !important;
  }

  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 .competition-discovery-intro h1 {
    font-size: 25px !important;
  }

  body[data-page="app"].app-shell-guest #competitionList .competition-card-facts {
    padding-inline: 8px !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel:not(.hidden) {
    inset-inline: 6px !important;
    bottom: 6px !important;
  }

  body[data-page="app"].app-shell-guest > #competitionFilterPanel .filters-panel.compact-filter-grid {
    gap-inline: 7px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="app"].app-shell-guest #competitions.competition-page-v2 *,
  body[data-page="app"].app-shell-guest > #competitionFilterPanel * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Authenticated Competition cards keep the Dashboard grid and information
   hierarchy, while reusing the approved Guest poster renderer as full-width
   card media. This scope intentionally excludes Guest cards. */
body[data-page="app"].app-shell-v2 #competitionList > .authenticated-competition-card {
  gap: 0 !important;
  padding: 0 !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster {
  position: relative !important;
  isolation: isolate;
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  aspect-ratio: 16 / 10 !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-bottom: 1px solid var(--w2g-line, #e5e8ec) !important;
  border-radius: 0 !important;
  background: #241d14 !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster::after {
  position: absolute;
  inset: auto 0 0;
  height: 22%;
  background: linear-gradient(to top, rgba(36, 29, 20, 0.24), transparent);
  content: "";
  pointer-events: none;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster .competition-poster,
body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #241d14 !important;
  object-position: center !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster img {
  object-fit: contain !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster .competition-poster.poster-empty .poster-placeholder {
  position: static !important;
  inset: auto !important;
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  gap: 5px !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 26px !important;
  border: 0 !important;
  background: #32281d !important;
  color: #e4d6bc !important;
  text-align: center !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster .competition-poster.poster-empty .poster-placeholder > span {
  display: none !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster .competition-poster.poster-empty .poster-placeholder > strong {
  color: #fffdf8 !important;
  font-size: 14px !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster .competition-poster.poster-empty .poster-placeholder > small {
  color: #ad9e88 !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster > .reference-card-poster-badge {
  position: absolute !important;
  z-index: 2;
  top: 12px !important;
  display: inline-flex !important;
  align-items: center;
  min-height: 27px;
  max-width: calc(50% - 16px);
  margin: 0 !important;
  overflow: hidden;
  transform: none !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster > .reference-card-poster-badge-start {
  left: 12px !important;
  padding: 0 9px !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 7px !important;
  background: rgba(15, 23, 42, 0.82) !important;
  color: #f8fafc !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-poster > .reference-card-poster-badge-end {
  right: 12px !important;
  left: auto !important;
  min-height: 0;
  padding: 0 !important;
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-card-body {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 16px 18px 18px !important;
  background: var(--w2g-surface, #fff) !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-card-body > .lc-top {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 60px !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: visible !important;
}

body[data-page="app"].app-shell-v2 #competitionList .authenticated-competition-card-body .lc-title {
  margin-top: 0 !important;
}

/* Authenticated Mobile keeps the shared Dashboard filter control after the
   Guest competition layer is isolated to app-shell-guest. */
@media (max-width: 759px) {
  body[data-page="app"].app-shell-v2 #competitions.competition-page-v2 #competitionFilterToggle .filter-button-icon {
    position: relative;
    display: inline-flex !important;
    flex: 0 0 18px;
    width: 18px !important;
    height: 18px !important;
    opacity: 1;
    background: none !important;
    line-height: 0;
  }

  body[data-page="app"].app-shell-v2.filter-sheet-open > #competitionFilterPanel:not(.hidden) {
    isolation: isolate;
    bottom: auto !important;
    height: calc(100dvh - 82px - env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - 82px - env(safe-area-inset-bottom, 0px)) !important;
    border: 1px solid var(--w2g-line-strong, #d6dae1) !important;
    background: var(--w2g-surface, #fff) !important;
    color: var(--w2g-ink, #0c1019) !important;
    box-shadow: 0 8px 24px rgba(12, 16, 25, 0.16) !important;
  }

  body[data-page="app"].app-shell-v2.filter-sheet-open > #competitionFilterPanel .filter-actions {
    background: var(--w2g-surface, #fff) !important;
  }
}

/* ============================================================
   Authenticated Competition Discovery — Color System V2 pilot
   Light theme only. Route-scoped color overrides; no geometry,
   typography, motion, markup, or behavior changes.
   ============================================================ */
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) {
  --w2g-bg: #FFFFFF;
  --w2g-surface: #FFFFFF;
  --w2g-surface-2: #F7F7F7;
  --w2g-surface-3: #F2F3F4;
  --w2g-line: #E5E7EB;
  --w2g-line-strong: #D1D5DB;
  --w2g-ink: #18181B;
  --w2g-ink-2: #18181B;
  --w2g-body: #3F3F46;
  --w2g-muted: #71717A;
  --w2g-faint: #A1A1AA;
  --w2g-orange: #EA580C;
  --w2g-orange-strong: #C2410C;
  --w2g-orange-soft: #FFF4ED;
  --w2g-orange-line: #FED7AA;
  --w2g-orange-ink: #C2410C;
  --w2g-orange-contrast: #FFFFFF;
  --w2g-disabled-surface: #F2F3F4;
  --w2g-disabled-text: #A1A1AA;

  /* Legacy aliases still consumed by parts of the discovery card/filter chain. */
  --bg: #FFFFFF;
  --canvas: #FFFFFF;
  --card: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F7F7F7;
  --surface-3: #F2F3F4;
  --soft: #F7F7F7;
  --ink: #18181B;
  --ink-2: #18181B;
  --body: #3F3F46;
  --muted: #71717A;
  --border: #E5E7EB;
  --line: #E5E7EB;
  --border-soft: #E5E7EB;
  --orange: #EA580C;
  --orange-dark: #C2410C;
  --orange-light: #FFF4ED;
  --orange-soft: #FFF4ED;
  --orange-soft-2: #FED7AA;

  background-color: #FFFFFF !important;
  color: #3F3F46;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .page-shell,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .page-shell > main,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) .app-main,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view {
  background-color: #FFFFFF !important;
  color: #3F3F46;
}

/* Shared authenticated chrome on this route only. The stronger selector is
   required for Personal Discovery's later route-local header declarations. */
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .app-shell-context-bar {
  background-color: #FFFFFF !important;
  border-color: #E5E7EB !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .brand,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .brand strong,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .shell-nav-item,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .notification-button,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .personal-account-trigger {
  color: #3F3F46 !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .brand small,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .app-shell-context-bar .muted {
  color: #71717A !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .shell-nav-item:hover,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .shell-nav-item:focus-visible {
  background-color: #F7F7F7 !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .shell-nav-item.active,
html[data-theme="light"] body[data-page="app"].app-shell-v2:has(#competitions.active-view) > .topbar .shell-nav-item[aria-current="page"] {
  background-color: #FFF4ED !important;
  color: #C2410C !important;
}

/* Quiet neutral media wells let each competition poster carry its own color. */
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster .competition-poster,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster img {
  background-color: #F3F4F6 !important;
  border-color: #E5E7EB !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster::after {
  background: linear-gradient(to top, rgba(24, 24, 27, 0.24), transparent);
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster .competition-poster.poster-empty .poster-placeholder {
  background-color: #F2F3F4 !important;
  color: #71717A !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster .competition-poster.poster-empty .poster-placeholder > strong {
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster .competition-poster.poster-empty .poster-placeholder > small {
  color: #71717A !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-poster > .reference-card-poster-badge-start,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .reference-card-poster-badge-start,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .reference-card-poster-badge-end .pill {
  background-color: rgba(24, 24, 27, 0.78) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  color: #FFFFFF !important;
}

/* Ordinary discovery controls and metadata remain neutral; orange is retained
   for the primary action, active filters, focus, and explicit brand emphasis. */
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .reference-filter-card,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .competition-filter-shell,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList > .reference-card,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList > .authenticated-competition-card,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .authenticated-competition-card-body {
  background-color: #FFFFFF !important;
  border-color: #E5E7EB !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .reference-filter-search,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .filter-search-field,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionSearch,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionSort,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .sort-select,
html[data-theme="light"] body[data-page="app"].app-shell-v2.filter-sheet-open:has(#competitions.active-view) > #competitionFilterPanel,
html[data-theme="light"] body[data-page="app"].app-shell-v2.filter-sheet-open:has(#competitions.active-view) > #competitionFilterPanel .filter-actions {
  background-color: #FFFFFF !important;
  border-color: #E5E7EB !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .reference-search-icon,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .competition-search-icon,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .sort-label,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .active-filter-label,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .lc-meta,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .cv2-meta,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .reference-card-summary,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .cv2-why summary {
  color: #71717A !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .lc-title,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .cv2-title,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view #competitionList .item-title {
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .competition-quick-filter,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .quick-filter,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .filter-button,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .clear-filters,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .clear-filter-button {
  background-color: #FFFFFF !important;
  border-color: #E5E7EB !important;
  color: #3F3F46 !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .competition-quick-filter:hover,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .quick-filter:hover,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .filter-button:hover {
  background-color: #F7F7F7 !important;
  border-color: #D1D5DB !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .competition-quick-filter.active,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .quick-filter.active,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .active-filter-chip,
html[data-theme="light"] body[data-page="app"].app-shell-v2 #competitions.active-view .filter-chip {
  background-color: #FFF4ED !important;
  border-color: #FED7AA !important;
  color: #C2410C !important;
}

/* Final Light-theme Guest discovery shell correction. The original route
   gate above intentionally owns these pages with higher specificity than the
   shared theme layer, so repeat that ownership here with the approved neutral
   palette instead of allowing its legacy brown values to win. */
html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar {
  border-bottom-color: #E5E7EB !important;
  background: #FFFFFF !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand,
html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand span {
  color: #3F3F46 !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand strong {
  color: #EA580C !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .brand-mark {
  border-color: #EA580C !important;
  background: #EA580C !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav > button:not(.active):not([aria-current="page"]) {
  background: transparent !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav > button:hover:not(.active),
html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav > button:focus-visible:not(.active) {
  border-color: #D1D5DB !important;
  background: #F7F7F7 !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar #mainNav.main-nav > button.active,
html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar #mainNav.main-nav > button[aria-current="page"] {
  border-color: #FED7AA !important;
  background: #FFF4ED !important;
  color: #C2410C !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .auth-actions .button.ghost {
  border-color: #D1D5DB !important;
  background: #FFFFFF !important;
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .auth-actions .button.primary {
  border-color: #C2410C !important;
  background: #C2410C !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .mobile-menu-button {
  border-color: #D1D5DB !important;
  background: #FFFFFF !important;
  color: #3F3F46 !important;
}

@media (max-width: 759px) {
  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(:is(#competitions, #teams, #members).active-view) > .topbar .main-nav {
    border-color: #E5E7EB !important;
    background: #FFFFFF !important;
    color: #18181B !important;
  }
}

/* Competition Discovery owns a separate local token family. Normalize that
   family for every Light shell (Guest and authenticated Personal) so the
   route cannot reintroduce cream foundations or brown typography. */
html[data-theme="light"] body[data-page="app"].app-shell-guest #competitions.competition-page-v2 {
  --competition-cream: #FFFFFF;
  --competition-paper: #FFFFFF;
  --competition-inset: #F2F3F4;
  --competition-ink: #18181B;
  --competition-copy: #3F3F46;
  --competition-muted: #71717A;
  --competition-placeholder: #71717A;
  --competition-line: #E5E7EB;
  --competition-accent: #EA580C;
  --competition-accent-deep: #C2410C;
  --competition-accent-tint: #FFF4ED;
  --competition-accent-line: #FED7AA;
  color: #3F3F46 !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) {
  background: #FFFFFF !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .reference-competition-card {
  border-color: #E5E7EB !important;
  background: #FFFFFF !important;
  box-shadow: 0 4px 16px rgba(24, 24, 27, 0.055) !important;
  color: #3F3F46 !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .reference-competition-card:hover {
  border-color: #D1D5DB !important;
  box-shadow: 0 8px 22px rgba(24, 24, 27, 0.085) !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell,
html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell img,
html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster,
html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell > picture {
  border-color: #E5E7EB !important;
  background: #F3F4F6 !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell::after {
  background: linear-gradient(to top, rgba(24, 24, 27, 0.24), transparent);
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell :is(.poster-fallback, .competition-poster-fallback),
html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster.poster-empty .poster-placeholder {
  background: #F2F3F4 !important;
  color: #71717A !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster.poster-empty .poster-placeholder > strong {
  color: #18181B !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-poster-shell .competition-poster.poster-empty .poster-placeholder > small {
  color: #71717A !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .reference-card-poster-badge {
  border-color: rgba(255, 255, 255, 0.24) !important;
  background: rgba(24, 24, 27, 0.78) !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] body[data-page="app"].app-shell-guest #competitionList .competition-card-body {
  background: #FFFFFF !important;
}

@media (max-width: 759px) {
  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel:not(.hidden) {
    border-color: #D1D5DB !important;
    background: #FFFFFF !important;
    box-shadow: 0 18px 60px rgba(24, 24, 27, 0.22) !important;
    color: #3F3F46 !important;
  }

  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel:not(.hidden)::before {
    background: #D1D5DB !important;
  }

  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel .filter-drawer-header strong,
  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel select {
    color: #18181B !important;
  }

  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel :is(.filter-drawer-header p, .filter-sort-field > span, .filters-panel label > span) {
    color: #71717A !important;
  }

  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel :is(.filter-close, select) {
    border-color: #E5E7EB !important;
    background-color: #FFFFFF !important;
    color: #18181B !important;
  }

  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel #competitionActiveFilters {
    border-color: #FED7AA !important;
    background: #FFF4ED !important;
  }

  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel .active-filter-chip {
    border-color: #FED7AA !important;
    background: #FFFFFF !important;
    color: #C2410C !important;
  }

  html[data-theme="light"] body[data-page="app"].app-shell-guest:has(#competitions.active-view) > #competitionFilterPanel .filter-actions {
    border-color: #E5E7EB !important;
    background: #FFFFFF !important;
  }
}

/* NM-01B: lightweight context banner shown over the existing, unchanged
   Competition Discovery when the owner arrived here to choose the next
   competition for a completed Mission's team. Scoped by id only, independent
   of the guest/authenticated shell-class rules above, so it renders
   consistently regardless of which shell classes are active. Uses the
   root theme tokens (style-w2g-theme-system.css) so it tracks light/dark
   without its own overrides. */
#competitionContinuationBanner.hidden { display: none; }
#competitionContinuationBanner { margin: 0 0 16px; }
.competition-continuation-banner {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--orange-soft-2, #fed7aa);
  border-radius: 12px;
  background: var(--orange-soft, #fff4ed);
  color: var(--ink, #18181b);
}
.competition-continuation-banner > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.competition-continuation-banner strong {
  font-size: 12.5px;
  font-weight: 800;
}
.competition-continuation-banner span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 700;
}
.competition-continuation-banner small {
  color: var(--muted, #71717a);
  font-size: 12px;
}
.competition-continuation-banner .button { flex: 0 0 auto; }
@media (max-width: 600px) {
  .competition-continuation-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .competition-continuation-banner .button { width: 100%; min-height: 44px; }
}

/* NM-02: the banner's selected-target sub-row and the shared "confirmed
   selection" visual language for the Card and Detail CTAs. Deliberately
   reuses the app's existing green "confirmed" palette (see the completed-
   Mission summary in style-personal-mission.css) instead of the orange
   primary-action color, so a selected Competition reads as confirmed rather
   than as another actionable button. */
.competition-continuation-target {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--orange-soft-2, #fed7aa);
}
.competition-continuation-target strong {
  color: #166534;
  font-size: 12px;
}
.competition-continuation-target .pw-competition-continuation-target-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  font-weight: 700;
}
.competition-continuation-target .pw-competition-continuation-change {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
@media (max-width: 600px) {
  .competition-continuation-target .pw-competition-continuation-change { width: 100%; min-height: 40px; }
}

article.next-mission-selected-card {
  border-color: #15803d !important;
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.28);
}
.next-mission-selected-action,
.next-mission-selected-action:disabled {
  border-color: #15803d !important;
  background: #eef9f1 !important;
  color: #166534 !important;
  opacity: 1 !important;
}

/* NM-03: the Next Mission setup dialog. It opens from Competition Discovery
   and Competition Detail, so unlike the Mission Center dialogs these rules are
   NOT scoped to body.personal-mission-context - that scope simply does not
   apply on the discovery/detail routes. Reuses the shared modal shell; only
   the dialog's own contents are styled here. */
#modalOverlay.next-mission-setup-modal .modal-card {
  width: min(600px, calc(100vw - 36px)) !important;
}
.next-mission-setup {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.next-mission-setup-summary {
  min-width: 0;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--pw-line, #e5e7eb);
  border-radius: 10px;
  background: var(--pw-line-soft, #f6f7f8);
}
.next-mission-setup-line {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.next-mission-setup-line > span {
  color: var(--muted, #71717a);
  font-size: 12px;
  font-weight: 700;
}
.next-mission-setup-line > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}
.next-mission-setup-line > small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted, #71717a);
  font-size: 12px;
}
.next-mission-setup-arrow {
  color: var(--muted, #71717a);
  font-size: 14px;
  line-height: 1;
}
.next-mission-setup-note {
  margin: 0;
  color: var(--muted, #71717a);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.next-mission-setup-history-note {
  padding: 9px 12px;
  border-radius: 9px;
  background: #eef9f1;
  color: #166534;
  font-weight: 700;
}
.next-mission-setup-form {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-mission-setup-role-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.next-mission-setup-suggestions {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.next-mission-setup-suggestions-label {
  color: var(--muted, #71717a);
  font-size: 12px;
  font-weight: 700;
}
.next-mission-setup-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
/* Selection state is carried by text/pressed state as well as colour: the
   chip gains a leading check glyph, and aria-pressed is kept in sync, so the
   state is never communicated by colour alone. */
.next-mission-suggested-role {
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--pw-line, #e5e7eb);
  border-radius: 999px;
  background: var(--pw-panel, #fff);
  color: var(--pw-ink, #18181b);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.next-mission-suggested-role::before {
  content: "+";
  font-weight: 800;
}
.next-mission-suggested-role.is-selected {
  border-color: #15803d;
  background: #eef9f1;
  color: #166534;
}
.next-mission-suggested-role.is-selected::before { content: "✓"; }
.next-mission-setup-zero-role {
  color: var(--muted, #71717a);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.next-mission-setup-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.next-mission-setup-error[hidden] { display: none; }
@media (max-width: 600px) {
  #modalOverlay.next-mission-setup-modal.modal-overlay:not(.hidden) {
    align-items: end !important;
    padding: 10px !important;
  }
  #modalOverlay.next-mission-setup-modal .modal-card {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 14px !important;
  }
  #modalOverlay.next-mission-setup-modal .modal-body {
    flex: 0 1 auto !important;
    max-height: calc(100dvh - 150px) !important;
    overflow-y: auto !important;
  }
  #modalOverlay.next-mission-setup-modal .modal-footer .button {
    flex: 1 1 auto;
    min-height: 46px;
  }
}
