/* Foundation for the existing consulting header on legal pages only. */
body.quality-topic-page { padding-top:var(--bc-header-full); }
body.quality-topic-page .ws-header-brand { text-decoration:none; }
body.quality-topic-page .ws-main-header {
  position:fixed !important; inset:0 0 auto; width:100%; z-index:60;
  min-height:0 !important; color:var(--bc-header-link-ink);
  background:rgba(14,20,16,.88); border-bottom:1px solid rgba(185,221,159,.14);
  backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
}
html[data-theme="light"] body.quality-topic-page .ws-main-header {
  background:rgba(244,246,240,.90); border-bottom-color:rgba(49,95,43,.16);
}
body.quality-topic-page .ws-main-header .language {
  display:flex; align-items:center; gap:6px; color:var(--bc-header-link-ink);
}
body.quality-topic-page .ws-main-header .language button {
  border:0; background:none; cursor:pointer; padding:5px;
  color:var(--bc-header-link-ink); opacity:.72;
}
body.quality-topic-page .ws-main-header .language button[aria-pressed="true"] { opacity:1; }
html[data-theme="light"] body.quality-topic-page .ws-main-header .language button:not(.active) { color:#59635b; opacity:1; }
body.quality-topic-page .ws-main-header .detail-contact-link { text-decoration:none; }
@media (max-width:900px) {
  body.quality-topic-page:has(.ws-main-header:not(.ws-menu-ready)) { padding-top:0; }
}
@media (max-width:600px) {
  body.quality-topic-page .ws-main-header { background:rgba(14,20,16,.96); }
  html[data-theme="light"] body.quality-topic-page .ws-main-header { background:rgba(244,246,240,.97); }
}


/* Shared homepage-style navigation, scoped to Workshops & Checks only. */
html:has(body.quality-topic-page) { --bc-header-full:94px; --bc-header-compact:68px; }
body.quality-topic-page .ws-main-header {
  display:flex; align-items:center; justify-content:flex-start; gap:0; height:var(--bc-header-full) !important;
  padding-block:0; padding-inline:max(clamp(24px,5vw,72px),calc((100vw - 1320px)/2)) !important;
}
body.quality-topic-page .ws-main-header.is-compact { height:var(--bc-header-compact) !important; }
body.quality-topic-page .ws-header-brand { display:block; flex:0 0 auto; }
body.quality-topic-page .ws-main-header .detail-logo { display:block; width:clamp(225px,16vw,285px) !important; height:auto; }
body.quality-topic-page .ws-main-header.is-compact .detail-logo { width:195px !important; }
body.quality-topic-page .ws-current-label { display:none; }
body.quality-topic-page .ws-primary-nav {
  display:flex; align-items:center; gap:clamp(26px,2.2vw,38px);
  margin-left:clamp(34px,4vw,68px); flex-shrink:0;
}
body.quality-topic-page .ws-primary-nav a {
  display:inline-flex; align-items:center; min-height:44px;
  font:500 14px/1.4 var(--ui-font); color:var(--bc-header-link-ink);
  text-decoration:none; white-space:nowrap; border-bottom:0;
}
body.quality-topic-page .ws-primary-nav a[aria-current="page"] {
  color:var(--bc-header-link-hover); font-weight:600; box-shadow:inset 0 -2px currentColor;
}
body.quality-topic-page .ws-primary-nav a:hover { color:var(--bc-header-link-hover); }
body.quality-topic-page .ws-main-header :is(a,button):focus-visible { outline:2px solid var(--bc-header-link-hover); outline-offset:5px; }
body.quality-topic-page .ws-primary-nav .ws-mobile-nav-link { display:none; }
body.quality-topic-page .ws-main-header .detail-header-actions {
  display:flex; align-items:center; flex-shrink:0; gap:22px !important; margin-left:auto;
}
body.quality-topic-page .ws-main-header.is-compact .detail-header-actions { gap:17px !important; }
body.quality-topic-page .ws-main-header .language button { min-width:36px; }
body.quality-topic-page .ws-main-header .detail-contact-link { display:block; }
body.quality-topic-page .ws-main-header .detail-contact-link::after { content:none; }
body.quality-topic-page .ws-main-header .detail-contact-link > span { margin-left:20px; }
body.quality-topic-page .ws-main-header.is-compact .detail-contact-link { padding-block:8px !important; }
body.quality-topic-page .ws-menu-button { display:none; }
@media (min-width:901px) and (max-width:1100px) {
  body.quality-topic-page .ws-main-header { padding-inline:28px !important; }
  body.quality-topic-page .ws-primary-nav { margin-inline:20px; gap:18px; }
  body.quality-topic-page .ws-main-header .detail-header-actions,
  body.quality-topic-page .ws-main-header.is-compact .detail-header-actions { gap:14px !important; }
}
@media (max-width:900px) {
  html:has(body.quality-topic-page) { --bc-header-full:84px; --bc-header-compact:76px; }
  body.quality-topic-page .ws-main-header,
  body.quality-topic-page .ws-main-header.is-compact {
    display:flex; flex-wrap:nowrap; gap:10px; padding-block:0; padding-inline:20px !important;
  }
  body.quality-topic-page .ws-main-header .detail-logo,
  body.quality-topic-page .ws-main-header.is-compact .detail-logo { width:164px !important; }
  body.quality-topic-page .ws-current-label {
    display:block; padding-top:5px; padding-left:10px;
    font:600 11px/1.2 var(--ui-font); color:var(--bc-header-link-hover); white-space:nowrap;
  }
  body.quality-topic-page .ws-main-header .detail-header-actions,
  body.quality-topic-page .ws-main-header.is-compact .detail-header-actions { gap:8px !important; margin-left:0; }
  body.quality-topic-page .ws-main-header .detail-contact-link { display:none; }
  body.quality-topic-page .ws-main-header .theme-toggle { margin:0; width:36px; min-width:36px; height:36px; padding:0; justify-content:center; }
  body.quality-topic-page .ws-main-header .theme-toggle-label { display:none; }
  body.quality-topic-page .ws-main-header .language { display:flex; gap:0; margin:0; }
  body.quality-topic-page .ws-main-header .language button { min-width:30px; min-height:44px; font-size:13px; }
  body.quality-topic-page .ws-main-header .language > span { flex:0 0 4px; width:4px; }
  body.quality-topic-page .ws-menu-ready .ws-menu-button {
    display:flex; flex-direction:column; justify-content:center; align-items:center; gap:6px;
    width:44px; min-width:44px; height:44px; margin:0 0 0 auto; padding:8px;
    border:0; background:none; color:var(--bc-header-link-ink); cursor:pointer;
  }
  body.quality-topic-page .ws-menu-button span { display:block; width:22px; height:1.5px; background:currentColor; transition:transform .15s; }
  body.quality-topic-page .ws-menu-button[aria-expanded="true"] span:first-child { transform:translateY(3.75px) rotate(45deg); }
  body.quality-topic-page .ws-menu-button[aria-expanded="true"] span:last-child { transform:translateY(-3.75px) rotate(-45deg); }
  body.quality-topic-page .ws-primary-nav {
    display:grid; align-items:stretch; gap:0; margin:0; padding:12px 24px 20px;
    background:#101a14; border-bottom:1px solid var(--bc-header-link-line);
    max-height:calc(100dvh - var(--bc-header-compact)); overflow-y:auto;
  }
  html[data-theme="light"] body.quality-topic-page .ws-primary-nav { background:#f4f6ef; }
  body.quality-topic-page .ws-primary-nav a { font-size:16px; min-height:48px; width:100%; border-bottom:1px solid var(--bc-header-link-line); }
  body.quality-topic-page .ws-primary-nav a[aria-current="page"] { border-bottom:2px solid currentColor; box-shadow:none; }
  body.quality-topic-page .ws-primary-nav .ws-mobile-nav-link { display:flex; }
  body.quality-topic-page .ws-menu-ready .ws-primary-nav { position:absolute; top:100%; left:0; right:0; display:none; }
  body.quality-topic-page .ws-menu-ready .ws-primary-nav.open { display:grid; }
  /* If scripts fail, links remain usable instead of disappearing behind a dead menu. */
  body.quality-topic-page .ws-main-header:not(.ws-menu-ready) { position:relative !important; height:auto !important; min-height:84px; flex-wrap:wrap; padding-block:14px; }
  body.quality-topic-page .ws-main-header:not(.ws-menu-ready) .ws-primary-nav { order:3; flex-basis:100%; }
  body.quality-topic-page .ws-main-header:not(.ws-menu-ready) .detail-header-actions { margin-left:auto; }
}
@media (max-width:380px) {
  body.quality-topic-page .ws-main-header,
  body.quality-topic-page .ws-main-header.is-compact { padding-inline:14px !important; gap:4px; }
  body.quality-topic-page .ws-main-header .detail-logo,
  body.quality-topic-page .ws-main-header.is-compact .detail-logo { width:130px !important; }
  body.quality-topic-page .ws-main-header .detail-header-actions { gap:4px !important; }
  body.quality-topic-page .ws-current-label { font-size:10px; padding-left:8px; }
}
@media (prefers-reduced-motion:reduce) { body.quality-topic-page .ws-menu-button span { transition:none; } }



/* Shared phone header. Existing menus, theme controls and desktop layout remain. */
@media (max-width:700px) {
  html:has(#root .site-header), html:has(.detail-header), html:has(.legal-header), html:has(body.quality-topic-page) {
    --bc-header-full:108px; --bc-header-compact:108px;
  }
  #root .site-header, #root .site-header.is-compact,
  .detail-header:not(.ws-main-header), .detail-header:not(.ws-main-header).is-compact,
  body.quality-topic-page .ws-main-header.ws-menu-ready, body.quality-topic-page .ws-main-header.ws-menu-ready.is-compact,
  .legal-header, .legal-header.is-compact {
    display:grid !important;
    grid-template-columns:auto auto minmax(0,1fr) auto;
    grid-template-rows:52px 44px;
    align-items:center; gap:2px 12px;
    height:108px !important; min-height:108px !important;
    padding:5px 24px !important; box-sizing:border-box;
  }
  #root .site-header .header-actions,
  .detail-header:not(.ws-main-header) .detail-header-actions,
  body.quality-topic-page .ws-main-header.ws-menu-ready .detail-header-actions,
  .legal-header .legal-header-actions { display:contents !important; }
  #root .site-header > a.brand,
  .detail-header:not(.ws-main-header) > a,
  body.quality-topic-page .ws-main-header.ws-menu-ready .ws-header-brand,
  .legal-header > .legal-header-brand {
    grid-column:1 / 4; grid-row:1; justify-self:start; min-width:0; margin:0;
  }
  #root .site-header .brand-logo, #root .site-header.is-compact .brand-logo,
  .detail-header .detail-logo, .detail-header.is-compact .detail-logo,
  body.quality-topic-page .ws-main-header .detail-logo, body.quality-topic-page .ws-main-header.is-compact .detail-logo,
  .legal-header .legal-header-brand img, .legal-header.is-compact .legal-header-brand img {
    display:block; width:164px !important; height:auto !important; max-width:100%;
  }
  body.quality-topic-page .ws-current-label { display:block; padding:4px 0 0 9px; font-size:11px; line-height:1.2; }
  #root .site-header .theme-toggle, .detail-header .theme-toggle, .legal-header .theme-toggle {
    grid-column:4; grid-row:1; justify-self:end; margin:0 !important; padding:0 !important;
    display:flex; align-items:center; justify-content:center;
    width:44px !important; min-width:44px !important; height:44px !important;
  }
  #root .site-header .theme-toggle-label, .detail-header .theme-toggle-label, .legal-header .theme-toggle-label { display:none !important; }
  #root .site-header .language, .detail-header .language, .legal-header .legal-language {
    grid-column:4; grid-row:2; justify-self:end; display:flex; gap:0 !important; margin:0 !important;
  }
  #root .site-header .language button, .detail-header .language button, .legal-header .language button {
    min-width:32px !important; min-height:44px !important; font-size:14px !important;
  }
  #root .site-header .language > span, .detail-header .language > span, .legal-header .language > span { width:8px; text-align:center; }
  #root .site-header .menu-button, body.quality-topic-page .ws-menu-ready .ws-menu-button {
    grid-column:1; grid-row:2; justify-self:start; margin:0 !important;
    width:44px !important; min-width:44px !important; height:44px !important; padding:10px !important;
  }
  .detail-header:not(.ws-main-header) .back-link { grid-column:1; grid-row:2; }
  .detail-header:not(.ws-main-header) .detail-contact-link { grid-column:2; grid-row:2; }
  .detail-header:not(.ws-main-header) :is(.back-link,.detail-contact-link), .legal-header .legal-nav a {
    display:inline-flex; align-items:center; min-height:44px !important; padding-block:0 !important; font-size:14px !important;
  }
  .legal-header .legal-nav { grid-column:1 / 3; grid-row:2; display:flex; gap:18px; margin:0; }
  #root .site-header nav.open, body.quality-topic-page .ws-menu-ready .ws-primary-nav.open { top:100%; }
  .quality-topic-page .detail-hero h1 { hyphens:manual; overflow-wrap:normal; }
  .ws-choice-title { margin:0; }
  .ws-process-context { font-size:15px; line-height:1.6; }
}

/* An explicit route home on every full-navigation subpage. */
.ws-main-header .ws-home-shortcut { display:none; }
@media (min-width:901px) and (max-width:1200px) {
  :is(.workshops-page,body.quality-topic-page) { --bc-header-full:118px; --bc-header-compact:118px; }
  :is(.workshops-page,body.quality-topic-page) .ws-main-header,
  :is(.workshops-page,body.quality-topic-page) .ws-main-header.is-compact {
    display:grid; grid-template-columns:auto minmax(0,1fr) auto;
    grid-template-rows:62px 46px; gap:0;
    height:118px !important; padding:5px 28px !important;
  }
  :is(.workshops-page,body.quality-topic-page) .ws-header-brand { grid-column:1; grid-row:1; }
  :is(.workshops-page,body.quality-topic-page) .ws-main-header .detail-header-actions { grid-column:3; grid-row:1; }
  :is(.workshops-page,body.quality-topic-page) .ws-primary-nav {
    grid-column:1 / -1; grid-row:2; justify-self:start; margin:0; gap:28px;
  }
}
@media (max-width:900px) {
  :is(.workshops-page,body.quality-topic-page) .ws-primary-nav .ws-home-nav { display:none; }
  :is(.workshops-page,body.quality-topic-page) .ws-main-header .ws-home-shortcut {
    display:inline-flex; align-items:center; min-height:44px;
    color:var(--bc-header-link-ink); font:500 14px/1.4 var(--ui-font);
    text-decoration:none; border-bottom:1px solid var(--bc-header-link-line); white-space:nowrap;
  }
  :is(.workshops-page,body.quality-topic-page) .ws-main-header .ws-home-shortcut:hover { color:var(--bc-header-link-hover); }
}
@media (max-width:700px) {
  :is(.workshops-page,body.quality-topic-page) .ws-main-header .ws-home-shortcut {
    grid-column:2 / 4; grid-row:2; justify-self:start;
  }
}

/* Topic hero already accounts for the fixed header. */
body.quality-topic-page{padding-top:0;}
html.bc-context-navigation-ready .quality-topic-page .topic-nav{display:none;}
