/* Build 639 staging-only workflow and shell polish.
   Purpose: reduce cognitive load in Competitions and Selection Room, make PlatMan
   use the available viewport, and quieten global chrome without changing business rules. */

:root {
  --bh-polish-navy:#102c3a;
  --bh-polish-teal:#0f6b5d;
  --bh-polish-gold:#e6b449;
  --bh-polish-line:#d6e0e4;
  --bh-polish-soft:#f4f7f7;
}

/* --------------------------------------------------------------------------
   Global shell: content should win over utility chrome.
   -------------------------------------------------------------------------- */
#main-content > header {
  min-height:64px;
  gap:10px;
  padding-block:8px;
}
#main-content > header > div:first-of-type p {
  margin-bottom:1px;
  font-size:.72rem;
}
#main-content > header > div:first-of-type h1 {
  font-size:clamp(1.25rem,2vw,1.7rem);
  line-height:1.08;
}
#main-content > header .role-badge {
  padding:.36rem .55rem;
  font-size:.68rem;
  border-radius:999px;
}
#main-content > header .notification-bell {
  width:42px;
  min-width:42px;
  height:42px;
  min-height:42px;
  padding:0;
  border-radius:12px;
  font-size:1rem;
}
#main-content > header .notification-bell b {
  min-width:17px;
  height:17px;
  padding:0 4px;
  font-size:.62rem;
}
/* New Match belongs in Match Centre / scoring flows, not every screen header. */
#main-content > header > button.primary {
  display:none !important;
}
.screen-help-launch {
  width:42px !important;
  min-width:42px !important;
  height:42px !important;
  min-height:42px !important;
  padding:0 !important;
  gap:0 !important;
  border-radius:50% !important;
  font-size:0 !important;
  box-shadow:0 6px 16px rgba(16,44,58,.12) !important;
}
.screen-help-launch > span {
  margin:0 !important;
  font-size:1rem !important;
  font-weight:900 !important;
}
.notification-panel {
  border-radius:16px !important;
  box-shadow:0 18px 46px rgba(16,44,58,.16) !important;
}

/* --------------------------------------------------------------------------
   Workflow guidance shared by the two highest-priority operational journeys.
   -------------------------------------------------------------------------- */
.workflow-guidance {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px 18px;
  align-items:center;
  margin:0 0 14px;
  padding:14px 16px;
  border:1px solid color-mix(in srgb,var(--bh-polish-line) 72%,var(--bh-polish-teal) 28%);
  border-left:5px solid var(--bh-polish-teal);
  border-radius:16px;
  background:linear-gradient(135deg,color-mix(in srgb,#fff 94%,var(--bh-polish-teal) 6%),#fff);
  box-shadow:0 8px 24px rgba(16,44,58,.055);
}
.workflow-guidance > div {
  display:grid;
  gap:3px;
  min-width:0;
}
.workflow-guidance span {
  color:#35695f;
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.workflow-guidance h2,
.workflow-guidance h3 {
  margin:0;
  color:var(--bh-polish-navy);
  font-size:1.12rem;
}
.workflow-guidance p {
  margin:0;
  color:#587066;
  line-height:1.4;
}
.workflow-guidance ol {
  grid-column:1/-1;
  display:flex;
  gap:5px;
  margin:2px 0 0;
  padding:0;
  overflow-x:auto;
  list-style:none;
  scrollbar-width:thin;
}
.workflow-guidance li {
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:6px;
  min-height:34px;
  padding:5px 9px;
  border:1px solid #dce5e7;
  border-radius:999px;
  background:#fff;
  color:#536b73;
  font-size:.72rem;
  font-weight:760;
}
.workflow-guidance li::before {
  content:attr(data-step);
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#eaf1f2;
  color:#31545f;
  font-size:.65rem;
  font-weight:900;
}
.workflow-guidance li.current {
  border-color:color-mix(in srgb,var(--bh-polish-teal) 55%,#dce5e7);
  background:#edf6f3;
  color:#174f45;
}
.workflow-guidance li.current::before {
  background:var(--bh-polish-teal);
  color:#fff;
}
.workflow-guidance .workflow-next {
  min-height:42px;
  padding:.62rem .82rem;
  border-color:var(--bh-polish-navy);
  background:var(--bh-polish-navy);
  color:#fff;
  white-space:nowrap;
}

/* --------------------------------------------------------------------------
   Competitions: one clear lifecycle, one focused stage at a time.
   -------------------------------------------------------------------------- */
.activity-competition,
.competitions-page {
  --competition-refine-line:color-mix(in srgb,var(--bh-polish-line) 72%,var(--bh-polish-teal) 28%);
}
.activity-competition .competition-create-link {
  display:inline-flex !important;
  visibility:visible !important;
  opacity:1 !important;
  pointer-events:auto !important;
  border-color:var(--bh-polish-navy) !important;
  background:var(--bh-polish-navy) !important;
  color:#fff !important;
  box-shadow:0 8px 22px rgba(16,44,58,.14) !important;
}
.activity-competition .competition-create-link::before {
  background:rgba(255,255,255,.13) !important;
}
.activity-competition .competition-journey {
  border:1px solid var(--competition-refine-line) !important;
  border-radius:18px !important;
  box-shadow:0 10px 28px rgba(16,44,58,.07) !important;
}
.activity-competition .competition-journey > header {
  display:grid;
  gap:4px;
  padding:16px 18px 10px !important;
}
.activity-competition .competition-journey > header h2 {
  margin:0;
  color:var(--bh-polish-navy);
  font-size:clamp(1.35rem,2.7vw,1.9rem);
}
.activity-competition .competition-journey > nav {
  counter-reset:competition-flow;
  display:flex !important;
  gap:5px !important;
  padding:6px !important;
  overflow-x:auto !important;
  scroll-snap-type:x proximity;
  border:0 !important;
  border-top:1px solid #e0e7e9 !important;
  background:#f3f6f7 !important;
}
.activity-competition .competition-journey > nav button {
  counter-increment:competition-flow;
  flex:0 0 auto;
  min-height:42px !important;
  padding:.55rem .7rem !important;
  border-radius:10px !important;
  scroll-snap-align:start;
  font-size:.78rem;
}
.activity-competition .competition-journey > nav button::before {
  content:counter(competition-flow);
  display:inline-grid;
  place-items:center;
  width:20px;
  height:20px;
  margin-right:6px;
  border-radius:50%;
  background:#e1e9eb;
  color:#526b73;
  font-size:.62rem;
  font-weight:900;
}
.activity-competition .competition-journey > nav button.active {
  border-color:var(--bh-polish-teal) !important;
  background:#fff !important;
  color:#174f45 !important;
  box-shadow:0 2px 8px rgba(16,44,58,.05) !important;
}
.activity-competition .competition-journey > nav button.active::before {
  background:var(--bh-polish-teal);
  color:#fff;
}
/* The large command dashboard is useful for orientation, but becomes noise once a
   user has entered a lifecycle stage. Keep focused stage pages focused. */
.activity-competition .competitions-page:not(.journey-overview) .competition-command-dashboard,
.activity-competition.competitions-page:not(.journey-overview) .competition-command-dashboard {
  display:none !important;
}
.activity-competition .competition-command-dashboard {
  border-radius:16px !important;
  box-shadow:none !important;
}
.activity-competition .competition-command-dashboard > div {
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr)) !important;
  gap:7px !important;
}
.activity-competition .competition-command-dashboard > div > button {
  min-height:64px !important;
  padding:10px 12px !important;
  border-radius:12px !important;
  text-align:left !important;
}
.activity-competition .competition-stage-intro {
  margin-bottom:12px !important;
  border:1px solid var(--competition-refine-line) !important;
  border-radius:16px !important;
  background:#fff !important;
  box-shadow:none !important;
}
.activity-competition .competition-stage-intro > header {
  border-left:5px solid var(--bh-polish-teal) !important;
  border-radius:15px 0 0 15px;
}
.activity-competition .competition-progress-summary {
  gap:6px !important;
}
.activity-competition .competition-progress-summary > span {
  min-height:46px !important;
  border-radius:10px !important;
  box-shadow:none !important;
}
.activity-competition .competition-planning-centre,
.activity-competition .competition-member-register-panel,
.activity-competition .competition-draw-readiness,
.activity-competition .competition-admin-workspace,
.activity-competition .competition-scheduling-intelligence,
.activity-competition .competition-exception-workbench {
  border-radius:16px !important;
  box-shadow:none !important;
}
.activity-competition .competition-planning-centre > header,
.activity-competition .competition-member-register-panel > header,
.activity-competition .competition-draw-readiness > header {
  padding-bottom:12px;
  border-bottom:1px solid #e3e9eb;
}
.activity-competition .competition-plan-round {
  border-radius:12px !important;
  background:#f8faf9 !important;
}
.activity-competition .competition-member-results article {
  border-radius:10px !important;
}
.activity-competition .competition-entry-lock {
  border-left:5px solid #315f70 !important;
  background:#f3f7f8 !important;
}
.activity-competition .competition-draw-readiness.ready {
  border-left-color:var(--bh-polish-teal) !important;
  background:#f3faf7 !important;
}
.activity-competition .competition-draw-readiness.not-ready {
  background:#fff9ec !important;
}
.activity-competition .competition-admin-layout > aside {
  border-radius:12px !important;
  box-shadow:none !important;
}
.activity-competition .competition-admin-editor {
  border-radius:14px !important;
  box-shadow:none !important;
}

/* --------------------------------------------------------------------------
   Selection Room: action queue -> fixture -> availability -> team -> review.
   -------------------------------------------------------------------------- */
.selection-centre {
  gap:12px !important;
}
.selection-centre .selection-season-readiness-helper,
.selection-centre .selector-work-queue-summary,
.selection-centre .selection-fixture-queue,
.selection-centre .selection-switcher,
.selection-centre .selection-detail {
  border-color:color-mix(in srgb,var(--bh-polish-line) 76%,var(--bh-polish-teal) 24%) !important;
  box-shadow:none !important;
}
.selection-centre .selector-work-queue-summary,
.selection-centre .selection-season-overview {
  border-radius:16px !important;
  background:#fff !important;
}
.selection-centre .selector-work-queue-summary > header,
.selection-centre .selection-season-overview > header {
  padding:15px 16px 12px !important;
}
.selection-centre .selection-season-kpis {
  gap:6px !important;
}
.selection-centre .selection-season-kpis > article {
  min-height:78px !important;
  padding:10px !important;
  border-radius:11px !important;
  box-shadow:none !important;
}
.selection-centre .selection-fixture-queue.card {
  border-radius:16px !important;
}
.selection-centre .selection-fixture-queue > header {
  padding:15px 16px 12px !important;
  background:#f5f7f8 !important;
}
.selection-centre .selection-fixture-queue > div > article {
  padding:11px 16px !important;
}
.selection-centre .selection-switcher.card {
  position:sticky;
  top:8px;
  z-index:17;
  grid-template-columns:minmax(250px,1.4fr) minmax(240px,1fr) auto !important;
  gap:10px !important;
  padding:12px !important;
  border:1px solid var(--bh-polish-line) !important;
  border-radius:14px !important;
  background:rgba(255,255,255,.96) !important;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  box-shadow:0 8px 24px rgba(16,44,58,.07) !important;
}
.selection-centre .selection-switcher select {
  min-height:44px !important;
}
.selection-centre .selection-detail.card {
  border-radius:18px !important;
  box-shadow:0 10px 30px rgba(16,44,58,.06) !important;
}
.selection-centre .selection-detail > header {
  padding:18px 20px !important;
  background:linear-gradient(135deg,#f2f6f7,#fff) !important;
}
.selection-centre .selection-detail > header h2 {
  margin:3px 0 !important;
  color:var(--bh-polish-navy);
}
.selection-centre .selection-meta {
  gap:5px !important;
  padding:10px 18px !important;
  background:#fafcfc !important;
}
.selection-centre .selection-meta > span {
  padding:5px 8px !important;
  border-radius:8px !important;
}
.selection-centre .selector-workspace-tabs {
  position:sticky;
  top:78px;
  z-index:16;
  gap:5px !important;
  padding:5px !important;
  border-radius:12px !important;
  background:rgba(245,248,248,.97) !important;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.selection-centre .selector-workspace-tabs button {
  min-height:40px !important;
  border-radius:9px !important;
}
.selection-centre .selection-readiness {
  border-radius:13px !important;
  background:#fff8e8 !important;
}
.selection-centre .selection-readiness.ready {
  border-left-color:var(--bh-polish-teal) !important;
  background:#f1f9f6 !important;
}
.selection-centre .selector-overview {
  gap:6px !important;
}
.selection-centre .selector-overview > article {
  min-height:74px !important;
  padding:10px !important;
  border-radius:11px !important;
}
.selection-centre .response-management,
.selection-centre .reserve-manager.card,
.selection-centre .selection-lifecycle.card,
.selection-centre .selection-fairness.card,
.selection-centre .team-rearrangement-board,
.selection-centre .selector-collapsible {
  border-radius:14px !important;
  box-shadow:none !important;
}
.selection-centre .response-player-grid {
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr)) !important;
  gap:7px !important;
}
.selection-centre .response-player-grid > button {
  min-height:82px !important;
  border-radius:11px !important;
}
.selection-centre .selection-header-actions button,
.selection-centre .selection-lifecycle-actions button,
.selection-centre .readiness-actions button,
.selection-centre .reserve-actions button {
  box-shadow:none !important;
}

/* --------------------------------------------------------------------------
   PlatMan: a dedicated console should use the viewport and not inherit the club
   mobile burger/header when its own management navigation is already present.
   -------------------------------------------------------------------------- */
body:has(.management-platform-shell) #main-content {
  width:100% !important;
  max-width:none !important;
  padding-inline:clamp(8px,1.2vw,20px) !important;
}
body:has(.management-platform-shell) #main-content > header,
body:has(.management-platform-shell) .screen-help-launch {
  display:none !important;
}
.management-platform-shell {
  width:100% !important;
  max-width:none !important;
}
.management-platform-shell .management-platform-bar {
  width:100% !important;
  max-width:none !important;
  margin:0 0 8px !important;
  border-radius:10px !important;
}
.management-platform-shell .platform-centre {
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  grid-template-columns:minmax(0,1fr) !important;
  grid-template-areas:none !important;
  gap:14px !important;
}
.management-platform-shell .platform-centre > .platform-hero,
.management-platform-shell .platform-centre > .platform-section-nav,
.management-platform-shell .platform-centre > .platform-section-guidance,
.management-platform-shell .platform-centre > .platform-context-bar,
.management-platform-shell .platform-centre > :not(.platform-section-nav):not(.platform-context-bar):not(.platform-hero) {
  grid-column:1 !important;
  grid-area:auto !important;
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
}
.management-platform-shell .platform-context-bar {
  width:100% !important;
  max-width:none !important;
}

/* --------------------------------------------------------------------------
   Cross-app consistency: restrained surfaces and controls, without rewriting
   specialist screens that intentionally have their own visual language.
   -------------------------------------------------------------------------- */
#main-content :is(.activity-competition,.selection-centre,.management-platform-shell) .card {
  border-color:var(--bh-polish-line);
}
#main-content :is(.activity-competition,.selection-centre) button:not(.danger):not(.notification-bell),
#main-content :is(.activity-competition,.selection-centre) .button-link {
  border-radius:10px;
}
#main-content :is(.activity-competition,.selection-centre) button.primary:not(.danger) {
  border-color:var(--bh-polish-navy);
  background:var(--bh-polish-navy);
  color:#fff;
}

@media (max-width:980px) {
  .management-platform-shell .platform-centre {
    grid-template-columns:minmax(0,1fr) !important;
    grid-template-areas:"nav" "context" "content" !important;
  }
  .management-platform-shell .platform-section-nav {
    position:static !important;
    display:flex !important;
    overflow-x:auto !important;
    overscroll-behavior-inline:contain;
    scroll-snap-type:x proximity;
  }
  .management-platform-shell .platform-section-nav button {
    flex:0 0 auto !important;
    width:auto !important;
    scroll-snap-align:start;
    white-space:nowrap !important;
  }
  .management-platform-shell .platform-context-bar,
  .management-platform-shell .platform-centre > :not(.platform-section-nav):not(.platform-context-bar):not(.platform-hero) {
    grid-column:1 !important;
  }
}

@media (max-width:760px) {
  #main-content > header {
    min-height:58px;
    grid-template-columns:auto minmax(0,1fr) auto !important;
    padding:6px 8px !important;
  }
  #main-content > header .role-badge {
    display:none !important;
  }
  #main-content > header .notification-wrap {
    justify-self:end;
  }
  .screen-help-launch {
    width:40px !important;
    min-width:40px !important;
    height:40px !important;
    min-height:40px !important;
  }
  .workflow-guidance {
    grid-template-columns:minmax(0,1fr);
    gap:8px;
    padding:12px 13px;
    border-radius:13px;
  }
  .workflow-guidance .workflow-next {
    width:100%;
  }
  .workflow-guidance ol {
    grid-column:auto;
    margin-inline:-2px;
    padding:2px 2px 4px;
    scroll-snap-type:x proximity;
  }
  .workflow-guidance li {
    scroll-snap-align:start;
  }

  .activity-competition .competition-create-link {
    width:calc(100% - 2rem) !important;
    min-height:48px !important;
    margin:.35rem 1rem .7rem !important;
    position:relative !important;
    left:auto !important;
    right:auto !important;
    bottom:auto !important;
    z-index:3 !important;
  }
  .activity-competition .competition-journey {
    position:static !important;
    border-radius:14px !important;
  }
  .activity-competition .competition-journey > header {
    padding:13px 14px 8px !important;
  }
  .activity-competition .competition-journey > nav button {
    min-height:44px !important;
  }
  .activity-competition .competition-stage-intro > header {
    padding:14px !important;
  }
  .activity-competition .competition-progress-summary {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .activity-competition .competition-plan-round {
    padding:10px !important;
  }

  .selection-centre .selection-switcher.card {
    position:static !important;
    grid-template-columns:minmax(0,1fr) !important;
    padding:11px !important;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
  }
  .selection-centre .selector-workspace-tabs {
    position:sticky;
    top:4px;
    margin-inline:10px !important;
    border-radius:11px !important;
  }
  .selection-centre .selection-detail > header {
    padding:15px !important;
  }
  .selection-centre .selection-meta {
    padding:9px 13px !important;
  }
  .selection-centre .selector-overview {
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .selection-centre .response-player-grid {
    grid-template-columns:minmax(0,1fr) !important;
  }

  body:has(.management-platform-shell) #main-content {
    padding:6px !important;
  }
  .management-platform-shell .management-platform-bar {
    margin-bottom:6px !important;
  }
  .management-platform-shell .platform-centre {
    gap:7px !important;
  }
  .management-platform-shell .platform-section-nav {
    margin:0 !important;
    padding:5px !important;
    border-radius:9px !important;
  }
  .management-platform-shell .platform-section-nav button {
    min-height:42px !important;
  }
}

@media (max-width:420px) {
  #main-content > header > div:first-of-type p {
    display:none;
  }
  #main-content > header > div:first-of-type h1 {
    font-size:1.18rem;
  }
  .activity-competition .competition-progress-summary {
    grid-template-columns:minmax(0,1fr) !important;
  }
}

@media (prefers-reduced-motion:reduce) {
  .workflow-guidance ol,
  .activity-competition .competition-journey > nav,
  .management-platform-shell .platform-section-nav {
    scroll-behavior:auto !important;
    scroll-snap-type:none !important;
  }
}

@media (forced-colors:active) {
  .workflow-guidance,
  .activity-competition .competition-create-link,
  .selection-centre .selection-readiness,
  .management-platform-shell .platform-section-nav {
    forced-color-adjust:auto;
  }
}
