/* Shared BACTIF page shell: banner header on every route + in-page auth overlay. */
.bactif-page-shell { display: block; min-height: 100vh; }
.bactif-page-shell > .workspace { margin: 0 auto; max-width: 1240px; }
.bactif-page-shell > .workspace { position: relative; }
.bactif-page-shell .topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.bactif-page-hero { margin-top: 0 !important; }
.bactif-page-shell .header-brand { text-decoration: none; }
.bactif-page-shell .top-menu a {
  text-decoration: none;
  cursor: pointer;
}
.bactif-page-hero { min-height: 260px; position: relative; }
.bactif-page-hero .hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  border-radius: 18px;
}
.bactif-page-body {
  position: relative;
  margin: 18px clamp(12px, 2vw, 26px) 14px;
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(6, 22, 44, 0.16);
  color: #10233c;
}
@media (max-width: 900px) {
  .bactif-page-hero { min-height: 150px; }
  .bactif-page-body { margin: 12px 10px 10px; padding: clamp(12px, 3vw, 18px); }
}

/* In-page account overlay */
.bactif-auth-overlay { position: fixed; inset: 0; z-index: 2400; display: grid; place-items: center; padding: 18px; }
.bactif-auth-backdrop { position: absolute; inset: 0; background: rgba(4, 14, 28, 0.68); backdrop-filter: blur(6px); }
.bactif-auth-shell {
  position: relative; width: min(440px, 100%); max-height: 88vh; overflow: auto;
  border-radius: 22px; padding: 22px;
  background: linear-gradient(160deg, #0d2440, #123a58);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5);
  color: #eaf6ff;
}
.bactif-auth-close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%;
  cursor: pointer; background: rgba(255, 255, 255, 0.16); color: #eaf6ff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.bactif-auth-close:hover { background: rgba(255, 255, 255, 0.26); }
.bactif-auth-close:focus-visible { outline: 2px solid #7fe3ff; outline-offset: 2px; }
.bactif-auth-panel h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.bactif-auth-note { margin: 0 0 14px; font-size: 12px; opacity: 0.78; }
.bactif-auth-panel form { display: grid; gap: 12px; }
.bactif-auth-panel label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; }
.bactif-auth-panel input {
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08); color: #fff; padding: 9px 11px; font-size: 14px;
}
.bactif-auth-panel button[type="submit"] {
  margin-top: 4px; border: 0; border-radius: 12px; padding: 11px 14px; cursor: pointer;
  font-weight: 800; color: #05213a;
  background: linear-gradient(180deg, #7fe3ff, #35a9ff);
}
.bactif-auth-error { border-radius: 10px; padding: 8px 10px; font-size: 12px; background: rgba(255, 77, 94, 0.16); color: #ffd3d8; }
.bactif-auth-notice { border-radius: 10px; padding: 8px 10px; font-size: 12px; background: rgba(72, 212, 135, 0.16); color: #d6ffe8; }
.bactif-auth-switch { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.bactif-auth-switch button { background: none; border: 0; color: #9fd8ff; font-size: 12px; text-decoration: underline; cursor: pointer; }

/* Pull the banner to the very top so brand, tagline and menu sit over the image. */
.bactif-page-shell > .workspace { padding-top: 0 !important; }
.bactif-page-shell .bactif-page-hero { margin: 0 !important; border-radius: 0 0 20px 20px; min-height: 470px !important; }
.bactif-page-shell .workspace.home-mode > .visual-hero.bactif-page-hero { min-height: 470px !important; height: 470px !important; }
.bactif-page-shell .bactif-page-hero .hero-slide { border-radius: 0 0 20px 20px; }
.bactif-page-shell .topbar { padding-top: 10px; }
@media (max-width: 900px) {
  .bactif-page-shell .bactif-page-hero,
  .bactif-page-shell .workspace.home-mode > .visual-hero.bactif-page-hero { min-height: 340px !important; height: 340px !important; }
}

/* Hero call-to-action anchors must render exactly like the original hero buttons. */
.bactif-page-shell .hero-copy > div > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}
@media (max-width: 900px) {
  .bactif-page-shell .bactif-page-hero,
  .bactif-page-shell .workspace.home-mode > .visual-hero.bactif-page-hero { min-height: 380px !important; height: 380px !important; }
  .bactif-page-shell .hero-copy { padding-top: 62px !important; max-width: 92% !important; }
  .bactif-page-shell .hero-copy h2 { font-size: 20px !important; line-height: 1.2 !important; }
  .bactif-page-shell .hero-copy p { font-size: 9px !important; }
  .bactif-page-shell .hero-copy > div { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }
  .bactif-page-shell .hero-copy > div > a { font-size: 9px !important; padding: 9px 12px !important; }
  .bactif-page-shell .hero-stats {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 7px !important;
  }
  .bactif-page-shell .hero-stats span {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 3px !important;
    white-space: nowrap !important;
    font-size: 6.5px !important;
  }
  .bactif-page-shell .hero-stats b { font-size: 11px !important; }
  .bactif-page-shell .hero-copy > div > a:last-child { color: #eaf6ff !important; }
  .bactif-page-shell .hero-dots { bottom: 10px !important; z-index: 4 !important; }
}

.bactif-page-shell .topbar {
  position: absolute !important;
  top: 0 !important; left: 0 !important; right: 0 !important;
  z-index: 6 !important;
}

/* Sub-pages must look exactly like home: no header bar, text straight on the banner. */
.bactif-page-shell .workspace > .topbar {
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
  z-index: 30 !important;
}
.bactif-page-shell .workspace > .topbar::before { display: none !important; }
.bactif-page-shell .workspace > .topbar > * { pointer-events: auto; }
.bactif-page-shell .bactif-page-hero { position: relative; z-index: 1; }

/* Menu links on sub-pages are anchors — mirror the home page button styling. */
.bactif-page-shell .topbar .top-menu > a {
  background: transparent !important;
  border: 0 !important;
  padding: 8px clamp(7px, 1vw, 14px) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .035em !important;
  -webkit-text-stroke: .25px rgba(3, 18, 24, .9);
  text-shadow: 0 2px 2px rgba(0,0,0,.95), 0 0 8px rgba(0,0,0,.65) !important;
  transition: color .18s ease, text-shadow .18s ease, transform .18s ease;
}
.bactif-page-shell .topbar .top-menu > a:nth-child(1) { color: #ff4355 !important; -webkit-text-fill-color: #ff4355 !important; }
.bactif-page-shell .topbar .top-menu > a:nth-child(2) { color: #36a9ff !important; -webkit-text-fill-color: #36a9ff !important; }
.bactif-page-shell .topbar .top-menu > a:nth-child(3) { color: #ff9638 !important; -webkit-text-fill-color: #ff9638 !important; }
.bactif-page-shell .topbar .top-menu > a:nth-child(4) { color: #45d487 !important; -webkit-text-fill-color: #45d487 !important; }
.bactif-page-shell .topbar .top-menu > a.auth-text-link { color: #f5cf45 !important; -webkit-text-fill-color: #f5cf45 !important; margin-left: 8px !important; }
.bactif-page-shell .topbar .top-menu > a:hover,
.bactif-page-shell .topbar .top-menu > a.active {
  filter: brightness(1.38);
  text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 0 16px currentColor !important;
  transform: translateY(-1px);
}
@media (max-width: 900px) {
  .bactif-page-shell .topbar .top-menu > a {
    padding: 4px 3px !important;
    font-size: 8.5px !important;
    letter-spacing: 0 !important;
  }
}

/* ============ FINAL: no hovering sidebar links on laptop, no header bar anywhere ============ */
@media (min-width: 901px){
  /* Keep the narrow icon rail docked on the left — fixed, never floating over content. */
  .sidebar{
    display: flex !important;
    width: 76px !important;
    position: fixed !important;
    top: 0 !important; left: 0 !important; bottom: 0 !important;
    z-index: 40 !important;
  }
  .workspace{ margin-left: 76px !important; }
  /* Sub-pages render the same rail as home, so keep the reserved width. */
  .workspace .topbar{ padding-left: clamp(16px, 2.6vw, 34px) !important; }
  .workspace .topbar > .header-brand,
  .workspace.home-mode > .topbar > .header-brand{ margin-left: 0 !important; }
}

/* The header strip must never render as a bar — brand and menu sit on the banner. */
.workspace > .topbar,
.bactif-page-shell .workspace > .topbar{
  position: absolute !important;
  inset: 0 0 auto 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
  z-index: 30 !important;
}
.workspace > .topbar::before,
.workspace > .topbar::after{ display: none !important; content: none !important; }
.workspace > .topbar > *{ pointer-events: auto !important; }
.workspace > .topbar > .header-brand{
  position: absolute !important;
  top: clamp(10px, 1.8vw, 22px) !important;
  left: clamp(12px, 2vw, 26px) !important;
  z-index: 2 !important;
}
.workspace > .topbar > .top-menu{
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  z-index: 2 !important;
}
.workspace > .visual-hero,
.bactif-page-shell .bactif-page-hero{ position: relative !important; z-index: 1 !important; }

/* ============ HEADER LOCKUP: title on the menu line, tagline tucked under ============ */
.workspace > .topbar > .header-brand{
  top: 6px !important;
  align-items: start !important;
}
.workspace > .topbar > .top-menu{ top: 6px !important; }

/* Title stretches with letter-spacing so it spans the tagline width. */
.workspace > .topbar > .header-brand strong{
  letter-spacing: .30em !important;
  padding-right: 0 !important;
  margin-right: -.30em !important;
  font-size: clamp(17px, 2vw, 24px) !important;
}

/* Tagline: crisp, no glow, matched to the title block width. */
.workspace > .topbar > .header-brand .tagline-words{
  margin-top: 0 !important;
  justify-content: space-between !important;
  gap: 4px !important;
}
.workspace > .topbar > .header-brand .tagline-words > span,
.topbar .header-brand .tagline-words > span{
  text-shadow: 0 1px 1.5px rgba(0,0,0,.9) !important;
  -webkit-text-stroke: .3px rgba(2,14,20,.95) !important;
}

/* Menu links: remove the soft glow, keep a tight readable shadow. */
.topbar .top-menu > button,
.topbar .top-menu > a,
.topbar .top-menu > .auth-text-link{
  text-shadow: 0 1px 1.5px rgba(0,0,0,.9) !important;
}
.topbar .top-menu > button:hover,
.topbar .top-menu > a:hover,
.topbar .top-menu > button.active,
.topbar .top-menu > a.active,
.topbar .top-menu > .auth-text-link:hover{
  text-shadow: 0 1px 1.5px rgba(0,0,0,.95) !important;
  filter: brightness(1.35) !important;
}

/* Small iPhones: brand and menu must never collide. */
@media (max-width: 430px){
  .workspace > .topbar > .header-brand{
    top: 6px !important;
    left: 8px !important;
    max-width: 46% !important;
  }
  .workspace > .topbar > .header-brand .header-mark{ width: 28px !important; height: 28px !important; }
  .workspace > .topbar > .header-brand strong{
    font-size: 15px !important;
    letter-spacing: .22em !important;
  }
  .workspace > .topbar > .header-brand .tagline-words > span{ font-size: 7.5px !important; }
  .workspace > .topbar > .top-menu{
    top: 6px !important;
    right: 6px !important;
    max-width: 52% !important;
  }
  .topbar .top-menu > button,
  .topbar .top-menu > a,
  .topbar .top-menu > .auth-text-link{
    font-size: 7.5px !important;
    padding: 3px 2px !important;
  }
}

/* Title sits on the menu line and justifies out to the tagline's right edge. */
.workspace.home-mode > .topbar > .header-brand,
.workspace > .topbar > .header-brand{ top: 8px !important; }
.workspace.home-mode > .topbar > .top-menu,
.workspace > .topbar > .top-menu{ top: 8px !important; }
.workspace > .topbar > .header-brand strong{
  width: 100% !important;
  text-align: justify !important;
  text-align-last: justify !important;
  margin-right: 0 !important;
  letter-spacing: .18em !important;
}

/* Laptop: brand lockup must clear the 76px rail, never sit behind it. */
@media (min-width: 901px){
  .workspace > .topbar > .header-brand,
  .workspace.home-mode > .topbar > .header-brand{
    left: 92px !important;
    z-index: 45 !important;
  }
  .bactif-page-shell .workspace > .topbar > .header-brand{ left: clamp(12px, 2vw, 26px) !important; }
}

/* Department view: keep the source-pathway chooser immediately below the banner,
   before the active secondary branch content. */
.workspace:has(> .body-structure-heading){
  display: flex !important;
  flex-direction: column !important;
}
.workspace:has(> .body-structure-heading) > .topbar{ order: 0 !important; }
.workspace:has(> .body-structure-heading) > .subpage-banner{ order: 1 !important; }
.workspace:has(> .body-structure-heading) > .body-structure-heading{ order: 2 !important; }
.workspace:has(> .body-structure-heading) > .department-grid{ order: 3 !important; }
.workspace:has(> .body-structure-heading) > .mode-intro{ order: 4 !important; }
.workspace:has(> .body-structure-heading) > .disease-workbench{ order: 5 !important; }
.workspace:has(> .body-structure-heading) > .footer-safety{ order: 6 !important; }
.workspace:has(> .body-structure-heading) > .evidence{ order: 7 !important; }
.workspace:has(> .body-structure-heading) > .bactif-footer-ribbon{ order: 8 !important; }

/* Give the source-pathway panel a small breathing space below the banner. */
.workspace:has(> .body-structure-heading) > .body-structure-heading{
  margin-top: 12px !important;
}


/* ===== Shared section rail on sub-pages: anchors must render exactly like the home rail buttons. ===== */
.bactif-page-shell .sidebar nav a{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
@media (min-width: 901px){
  .bactif-page-shell .sidebar nav a,
  .bactif-page-shell .sidebar nav button{
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-size: 16px;
  }
  .bactif-page-shell .sidebar nav a span,
  .bactif-page-shell .sidebar nav button span{ font-size: 8.5px; font-weight: 600; }
}
@media (max-width: 900px){
  .bactif-page-shell .sidebar nav a{
    flex: 1 1 0 !important;
    min-width: 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 6px 2px !important;
    margin: 0 !important;
    font-size: 16px !important;
    text-align: center !important;
  }
  .bactif-page-shell .sidebar nav a span{
    display: block !important;
    font-size: 8.5px !important;
    line-height: 1.15 !important;
    font-weight: 600 !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .bactif-page-shell .sidebar nav a img,
  .bactif-page-shell .sidebar nav a .nav-body-icon{ width: 22px !important; height: 22px !important; font-size: 18px !important; }
  /* Bottom tab bar must not cover the footer ribbon. */
  .bactif-page-shell .workspace{ padding-bottom: 78px !important; }
}

/* ============================================================
   Laptop / desktop only (>=901px): full-page rotating banner
   with a glossy introductory box. Mobile app layout untouched.
   ============================================================ */
@media (min-width: 901px) {
  .bactif-page-shell .bactif-page-hero,
  .bactif-page-shell .workspace.home-mode > .visual-hero.bactif-page-hero,
  .app-shell .workspace > .visual-hero {
    min-height: 100vh !important;
    height: 100vh !important;
    border-radius: 0 !important;
  }
  .bactif-page-shell .bactif-page-hero .hero-slide,
  .app-shell .workspace > .visual-hero .hero-slide {
    border-radius: 0 !important;
    background-size: cover !important;
    background-position: center center !important;
  }

  /* Laptop banner copy sits directly on the photograph — no black card. */
  .app-shell .workspace .visual-hero .hero-copy {
    max-width: 620px !important;
    margin-top: 6vh !important;
    padding: 30px 34px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .app-shell .workspace .visual-hero .hero-copy h2 { font-size: 42px !important; line-height: 1.08 !important; }
  .app-shell .workspace .visual-hero .hero-copy p { font-size: 15px !important; line-height: 1.55 !important; }

  .app-shell .workspace .visual-hero .hero-stats { bottom: 26px !important; }
  .app-shell .workspace .visual-hero .hero-dots { bottom: 78px !important; }
}

@media (min-width: 901px) {
  /* Full-bleed: the rotating banner spans the whole viewport width. */
  .app-shell .workspace > .visual-hero,
  .bactif-page-shell .bactif-page-hero {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    overflow: hidden !important;
  }
  .app-shell .workspace > .visual-hero .hero-slide { inset: 0 !important; }
  .app-shell .workspace > .visual-hero .hero-stats {
    position: absolute !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    z-index: 4 !important;
  }
  .app-shell .workspace > .visual-hero .hero-dots { z-index: 5 !important; }
}

@media (min-width: 901px) {
  /* Stretch the banner past the 1240px reading frame, up to the viewport edge. */
  .app-shell .workspace > .visual-hero,
  .bactif-page-shell .bactif-page-hero {
    width: calc(100vw - 76px) !important;
  }
}

@media (min-width: 901px) {
  /* Workspace goes edge-to-edge so the banner can be full-page; the reading
     frame is re-applied to the content blocks instead. */
  .app-shell .workspace { max-width: none !important; width: auto !important; }
  .app-shell .workspace > .visual-hero,
  .bactif-page-shell .bactif-page-hero { width: 100% !important; }
  .bactif-page-shell .bactif-page-body,
  .app-shell .workspace > .bactif-footer-ribbon {
    max-width: 1240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ---- Content protection: block casual selection/copy of BACTIF content ---- */
html, body {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable="true"], [data-allow-select] {
  -webkit-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}
img, video, canvas, svg {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}
