/* Unified F3 / EWS / Course ecosystem navigation */

:root {
  --f3-navy: #1a5276;
  --f3-teal: #1abc9c;
  --f3-light: #e8f4fc;
  --f3-pale: #f5fafd;
  --f3-white: #fff;
  --f3-muted: #555;
  --f3-radius-pill: 999px;
  --f3-max: 1100px;
  --eco-bar-h: 3rem;
  --eco-overlap-text: 4.85rem;
  --eco-overlap-f3: 3.35rem;
  --eco-peek-text: 2.15rem;
  --eco-peek-f3: 2.15rem;
  --eco-shadow: 0 10px 40px rgba(0, 0, 0, 0.14), 0 2px 12px rgba(26, 82, 118, 0.12);
}

/* Prevent horizontal pan / rubber-band on mobile across the platform */
html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  overflow-x: hidden;
  max-width: 100%;
  overscroll-behavior-x: none;
}

#ecosystem-nav {
  position: relative;
  z-index: 1100;
}

.nav-ecosystem-wrap {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--f3-max), calc(100% - 1rem));
  z-index: 1100;
  pointer-events: none;
  transition: transform 0.25s ease;
}

.nav-ecosystem-wrap.is-scroll-hidden {
  transform: translate(-50%, calc(-100% - 1.25rem));
  pointer-events: none;
}

.nav-ecosystem-wrap > * {
  pointer-events: auto;
}

.nav-ecosystem-wrap[data-active-site="ews"] {
  width: min(68rem, calc(100% - 1rem));
}

/* Track: transparent; three pill buttons overlap with z-index stacking */
.nav-ecosystem {
  display: flex;
  align-items: stretch;
  height: var(--eco-bar-h);
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  position: relative;
}

/* Each segment = full-height pill button, fully rounded on all sides */
.nav-ecosystem__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--eco-bar-h);
  margin: 0;
  padding: 0;
  border-radius: var(--f3-radius-pill);
  box-shadow: var(--eco-shadow);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
  transition: flex-basis 0.2s ease, min-width 0.2s ease;
}

.nav-ecosystem__segment--f3 {
  margin-right: calc(var(--eco-overlap-f3) * -1);
}

.nav-ecosystem__segment--ews {
  margin-right: calc(var(--eco-overlap-text) * -1);
}

/* Active segment on top; distance from active sets z-index (1 / 2 / 3) */
.nav-ecosystem[data-active-site="f3"] .nav-ecosystem__segment--f3 { z-index: 3; }
.nav-ecosystem[data-active-site="f3"] .nav-ecosystem__segment--ews { z-index: 2; }
.nav-ecosystem[data-active-site="f3"] .nav-ecosystem__segment--course { z-index: 1; }

.nav-ecosystem[data-active-site="ews"] .nav-ecosystem__segment--f3 { z-index: 1; }
.nav-ecosystem[data-active-site="ews"] .nav-ecosystem__segment--ews { z-index: 3; }
.nav-ecosystem[data-active-site="ews"] .nav-ecosystem__segment--course { z-index: 2; }

.nav-ecosystem[data-active-site="course"] .nav-ecosystem__segment--f3 { z-index: 1; }
.nav-ecosystem[data-active-site="course"] .nav-ecosystem__segment--ews { z-index: 2; }
.nav-ecosystem[data-active-site="course"] .nav-ecosystem__segment--course { z-index: 3; }

.nav-ecosystem__segment.is-expanded {
  flex: 1 1 auto;
  min-width: min(52%, 26rem);
  justify-content: flex-start;
  padding: 0 0.65rem;
  cursor: default;
}

.nav-ecosystem__segment.is-compact {
  flex: 0 0 auto;
  min-width: calc(var(--eco-peek-text) + var(--eco-overlap-text));
  padding: 0 0.65rem;
  cursor: pointer;
  overflow: hidden;
}

.nav-ecosystem__segment--f3.is-compact {
  min-width: calc(var(--eco-peek-f3) + var(--eco-overlap-f3));
}

.nav-ecosystem__segment.is-compact.is-compact-left {
  justify-content: flex-start;
  padding-left: 0.65rem;
  padding-right: calc(var(--eco-overlap-text) + 0.35rem);
  min-width: calc(var(--eco-peek-text) + var(--eco-overlap-text));
}

.nav-ecosystem__segment--f3.is-compact.is-compact-left {
  padding-left: 0.55rem;
  padding-right: calc(var(--eco-overlap-f3) + 0.35rem);
  min-width: calc(var(--eco-peek-f3) + var(--eco-overlap-f3));
}

.nav-ecosystem__segment.is-compact.is-compact-right {
  justify-content: flex-end;
  padding-right: 0.65rem;
  padding-left: calc(var(--eco-overlap-text) + 0.35rem);
  min-width: calc(var(--eco-peek-text) + var(--eco-overlap-text));
}

.nav-ecosystem__segment--f3.is-compact.is-compact-right {
  padding-right: 0.55rem;
  padding-left: calc(var(--eco-overlap-f3) + 0.35rem);
  min-width: calc(var(--eco-peek-f3) + var(--eco-overlap-f3));
}

.nav-ecosystem__segment.is-compact:hover {
  filter: brightness(1.05);
}

.nav-ecosystem__segment--ews.is-expanded {
  min-width: min(72%, 44rem);
  gap: 0.35rem;
  padding-right: 0;
  overflow: visible;
  justify-content: flex-start;
  align-items: stretch;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-brand {
  align-self: center;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-ews-row {
  flex: 1;
  min-width: 0;
  padding: 0;
  align-self: stretch;
  align-items: stretch;
  height: 100%;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-ews-left {
  align-self: center;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-ews-center {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: 100%;
}

.nav-ecosystem__segment--f3 {
  background: var(--f3-white);
  color: var(--f3-navy);
  border: none;
}

.nav-ecosystem__segment--ews {
  background: var(--f3-teal);
  color: var(--f3-white);
  border: 1.5px solid var(--f3-teal);
}

.nav-ecosystem__segment--course {
  background: var(--f3-navy);
  color: var(--f3-white);
  border: 1.5px solid var(--f3-navy);
}

.nav-eco-logo,
.nav-eco-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 0.35rem 0 0.15rem;
  text-decoration: none;
  color: inherit;
}

.nav-eco-logo img,
.nav-eco-logo-img {
  height: 1.65rem;
  width: auto;
  max-width: 5rem;
  display: block;
}

.nav-ecosystem__segment--f3.is-compact .nav-eco-logo-img {
  height: 1.5rem;
  max-width: 4.25rem;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

/* F3 compact tab on EWS / Course - larger logo, more breathing room */
.nav-ecosystem[data-active-site="ews"] .nav-ecosystem__segment--f3.is-compact,
.nav-ecosystem[data-active-site="course"] .nav-ecosystem__segment--f3.is-compact {
  min-width: calc(3.25rem + var(--eco-overlap-f3));
  padding-left: 0.8rem;
  padding-right: calc(var(--eco-overlap-f3) + 0.5rem);
}

.nav-ecosystem[data-active-site="ews"] .nav-ecosystem__segment--f3.is-compact .nav-eco-logo-img,
.nav-ecosystem[data-active-site="course"] .nav-ecosystem__segment--f3.is-compact .nav-eco-logo-img {
  height: 2.15rem;
  max-width: 6rem;
}

/* F3 home: expanded segment logo matches compact tab on EWS / Course */
.nav-ecosystem[data-active-site="f3"] .nav-ecosystem__segment--f3.is-expanded .nav-eco-logo {
  padding-left: 0.8rem;
  padding-right: 0.35rem;
}

.nav-ecosystem[data-active-site="f3"] .nav-ecosystem__segment--f3.is-expanded .nav-eco-logo-img {
  height: 2.15rem;
  max-width: 6rem;
  object-fit: contain;
  object-position: left center;
}

.nav-eco-brand {
  gap: 0.35rem;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-brand .icon,
.nav-ecosystem__segment--course.is-expanded .nav-eco-site-mark .icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  display: block;
}

.nav-eco-brand span {
  font-weight: 700;
}

/* Local sub-navigation â€” plain text; only current page gets a background */
.nav-eco-local {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
  padding: 0.15rem 0.35rem;
}

.nav-eco-local a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--f3-radius-pill);
  white-space: nowrap;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--with-icon .icon,
.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--with-icon .bi:not(.bi-wrench) {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--with-icon .icon.bi:not(.bi-wrench) {
  width: auto;
  height: auto;
  font-size: 1rem;
  line-height: 1;
}

.nav-ecosystem__segment--f3 .nav-eco-local a.is-active.nav-eco-local__link--with-icon .icon {
  color: inherit;
}

/* F3 */
.nav-ecosystem__segment--f3 .nav-eco-local a {
  color: var(--f3-navy);
}

.nav-ecosystem__segment--f3 .nav-eco-local a:hover {
  background: var(--f3-light);
}

.nav-ecosystem__segment--f3 .nav-eco-local a.is-active {
  background: var(--f3-teal);
  color: var(--f3-white);
}

.nav-ecosystem__segment--f3 .nav-eco-local a.is-active.nav-eco-local__link--with-icon {
  background: var(--f3-navy);
  color: var(--f3-white);
}

.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--trainings {
  background: linear-gradient(90deg, #dceefb 0%, #d4f2eb 100%);
  color: var(--f3-navy);
}

.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--trainings:hover {
  background: linear-gradient(90deg, #c8e3f8 0%, #b8ebe3 100%);
  color: var(--f3-navy);
}

.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--trainings.is-active {
  background: linear-gradient(90deg, #72b8e3 0%, #55d0b9 100%);
  color: var(--f3-white);
  box-shadow: none;
}

.nav-ecosystem__segment--f3 .nav-eco-local a.nav-eco-local__link--trainings .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 0.95rem;
  line-height: 1;
  color: inherit;
}

/* EWS */
.nav-ecosystem__segment--ews .nav-eco-local a {
  color: var(--f3-white);
}

.nav-ecosystem__segment--ews .nav-eco-local a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.nav-ecosystem__segment--ews .nav-eco-local a.is-active {
  background: var(--f3-white);
  color: var(--f3-teal);
}

/* Course */
.nav-ecosystem__segment--course .nav-eco-local a {
  color: var(--f3-white);
}

.nav-ecosystem__segment--course .nav-eco-local a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-ecosystem__segment--course .nav-eco-local a.is-active {
  background: var(--f3-white);
  color: var(--f3-navy);
}

/* EWS expanded row: links | centered role toggle | tools (flush right) */
.nav-eco-ews-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: 1;
  min-width: 0;
  width: 100%;
  gap: 0.35rem;
  padding: 0 0.15rem;
}

.nav-eco-ews-left {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
}

.nav-eco-ews-center {
  grid-column: 2;
  justify-self: center;
}

.nav-eco-ews-right {
  grid-column: 3;
  justify-self: end;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-ews-right {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Legacy EWS style.css absolutely centers #globalRoleToggle - keep toggle in grid flow */
.nav-ecosystem-wrap #globalRoleToggle.role-toggle.within-navbar {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: auto !important;
  z-index: auto;
}

@media (min-width: 992px) {
  .nav-ecosystem-wrap #globalRoleToggle.role-toggle.within-navbar {
    position: static !important;
    left: auto !important;
    transform: none !important;
  }
}

.nav-eco-ews-links {
  flex: 0 1 auto;
  padding: 0;
}

.nav-eco-tools--ews {
  gap: 0.35rem;
  margin-left: 0;
}

/* EWS tools cluster: quiz left, lang centred, share right; flush to bar edge */
.nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  column-gap: 0.5rem;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 0.15rem;
  background: rgba(255, 255, 255, 0.16);
  border: none;
  border-radius: var(--f3-radius-pill);
  box-sizing: border-box;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .lang-dropdown,
.nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .ews-lang-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  align-self: stretch;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .lang-dropdown-toggle:hover,
.nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .lang-dropdown.is-open .lang-dropdown-toggle {
  background: rgba(255, 255, 255, 0.12);
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .quiz-main-btn {
  height: 100%;
  min-height: 100%;
  align-self: stretch;
  padding: 0 0.9rem;
  font-size: 0.82rem;
  box-shadow: none;
  border-radius: var(--f3-radius-pill);
}

.nav-ecosystem-wrap .nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .quiz-main-btn {
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  align-self: stretch !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
  box-sizing: border-box;
}

.nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .ews-share-btn {
  aspect-ratio: 1;
  width: auto;
  height: 100%;
  align-self: stretch;
  justify-self: end;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  border-width: 0;
  border-style: none;
  border-color: rgba(255, 255, 255, 0.01);
  border-radius: var(--f3-radius-pill);
}

.nav-ecosystem-wrap .nav-ecosystem__segment--ews.is-expanded .nav-eco-tools--ews .ews-share-btn {
  height: 100% !important;
  min-height: 100% !important;
  max-height: none !important;
  width: auto !important;
  aspect-ratio: 1;
  align-self: stretch !important;
  justify-self: end;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.nav-ecosystem-wrap .ews-share-btn {
  height: 100%;
  width: auto;
  aspect-ratio: 1;
  align-self: stretch;
  padding: 0;
  border-width: 0;
  border-style: none;
  border-color: rgba(255, 255, 255, 0.01);
  border-radius: var(--f3-radius-pill);
  background: rgba(255, 255, 255, 0.22);
  color: var(--f3-white);
}

.nav-ecosystem-wrap .ews-share-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  color: var(--f3-white);
}

.quiz-main-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.75rem;
  padding: 0 1.15rem;
  border-radius: var(--f3-radius-pill);
  border: none;
  background: linear-gradient(135deg, #23ceac 0%, #1a9b85 100%);
  color: var(--f3-white);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(35, 206, 172, 0.25);
  cursor: pointer;
}

.quiz-main-btn:hover {
  background: linear-gradient(135deg, #20c4a8 0%, #1b9e87 100%);
  color: var(--f3-white);
}

/* Quiz button follows student/teacher toggle (matches live EWS) */
.nav-ecosystem-wrap:has(.toggle-pill.state-teachers) .quiz-main-btn {
  background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
  box-shadow: 0 2px 8px rgba(253, 126, 20, 0.25);
}

.nav-ecosystem-wrap:has(.toggle-pill.state-teachers) .quiz-main-btn:hover {
  background: linear-gradient(135deg, #f07812 0%, #f5b800 100%);
  box-shadow: 0 2px 8px rgba(253, 126, 20, 0.2);
}

.ews-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: var(--f3-radius-pill);
  border-width: 0;
  border-style: none;
  border-color: rgba(255, 255, 255, 0.01);
  background: rgba(255, 255, 255, 0.85);
  color: #2c3e50;
  font-size: 1.05rem;
  cursor: pointer;
}

.ews-share-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

/* Student / teacher switcher (from live EWS navbar) */
.role-toggle.within-navbar {
  position: static;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.nav-ecosystem-wrap .role-toggle .toggle-pill {
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.role-toggle.within-navbar .toggle-pill {
  height: 100%;
  box-shadow: none;
}

.role-toggle .toggle-pill {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--f3-radius-pill);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
  transition:
    max-width 0.6s ease-in-out,
    min-width 0.6s ease-in-out,
    width 0.6s ease-in-out,
    border-radius 0.6s ease-in-out,
    padding 0.6s ease-in-out,
    background 0.6s ease-in-out;
  min-width: 17.5rem;
  max-width: 25rem;
  width: auto;
  height: var(--eco-bar-h);
}

.role-toggle.within-navbar .toggle-pill.collapsed {
  height: 100%;
  width: 6.125rem;
  min-width: 6.125rem;
  max-width: 6.125rem;
  padding: 0;
}

.role-toggle .toggle-pill.state-students {
  background: rgba(35, 206, 172, 0.22);
}

.role-toggle .toggle-pill.state-teachers {
  background: rgba(253, 126, 20, 0.22);
}

.role-toggle.within-navbar .toggle-pill .pill-icon {
  display: none;
}

.role-toggle .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc(50% - 6px);
  border-radius: var(--f3-radius-pill);
  background: #23ceac;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 200ms ease, background 200ms ease;
  z-index: 0;
}

.role-toggle .toggle-pill.state-teachers .toggle-thumb {
  transform: translateX(calc(100% + 6px));
  background: #ffd3a5;
}

.role-toggle .toggle-item {
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--f3-white);
  z-index: 1;
  cursor: pointer;
  white-space: nowrap;
}

.role-toggle.within-navbar .toggle-pill.collapsed .toggle-item {
  padding: 0 0.75rem;
  font-size: 0;
  gap: 0;
  height: 100%;
}

.role-toggle.within-navbar .toggle-pill.collapsed .toggle-item i {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1;
}

.role-toggle .toggle-pill.state-students .toggle-item.students {
  color: #1b5e4f;
}

.role-toggle .toggle-pill.state-students .toggle-item.teachers {
  color: var(--f3-white);
}

.role-toggle .toggle-pill.state-teachers .toggle-item.teachers {
  color: #7a3e00;
}

.role-toggle .toggle-pill.state-teachers .toggle-item.students {
  color: var(--f3-white);
}

.role-toggle--mobile-panel .toggle-pill {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}

.role-toggle--mobile-panel .toggle-pill.collapsed .toggle-item {
  font-size: 0.88rem;
  gap: 0.35rem;
}

.nav-eco-ews-mobile-block .role-toggle {
  margin: 0.5rem 0;
  width: 100%;
}

.nav-eco-tools--stacked {
  margin-left: 0 !important;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

/* Language dropdown â€” standardized structure (globe + code + chevron) */
.nav-eco-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.lang-dropdown {
  position: relative;
}

.lang-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  height: 1.875rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--f3-radius-pill);
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.lang-dropdown-toggle .lang-code {
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 0;
  text-align: center;
}

.lang-dropdown-toggle > .icon:not(.icon-chevron) {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

.lang-dropdown-toggle .icon-chevron {
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.lang-dropdown.is-open .lang-dropdown-toggle .icon-chevron {
  transform: rotate(180deg);
}

.lang-dropdown-toggle:focus-visible {
  outline: 2px solid var(--f3-teal);
  outline-offset: 2px;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 4.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--f3-white);
  border: 1px solid rgba(26, 82, 118, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(26, 82, 118, 0.18);
  z-index: 1200;
  display: none;
}

.lang-dropdown.is-open .lang-dropdown-menu {
  display: block;
}

.lang-dropdown-menu button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--f3-navy);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.lang-dropdown-menu button:hover {
  background: var(--f3-pale);
}

.lang-dropdown-menu button.is-active {
  background: rgba(26, 188, 156, 0.15);
  font-weight: 600;
}

.lang-dropdown-menu .lang-code {
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* F3 segment lang colours */
.nav-ecosystem__segment--f3 .lang-dropdown-toggle {
  color: var(--f3-navy);
  background: transparent;
  border: none;
}

.nav-ecosystem__segment--f3 .lang-dropdown-toggle:hover,
.nav-ecosystem__segment--f3 .lang-dropdown.is-open .lang-dropdown-toggle {
  background: var(--f3-light);
}

/* EWS segment lang colours */
.nav-ecosystem__segment--ews .lang-dropdown-toggle {
  color: var(--f3-white);
  background: transparent;
  border: none;
}

.nav-ecosystem__segment--ews .lang-dropdown-toggle:hover,
.nav-ecosystem__segment--ews .lang-dropdown.is-open .lang-dropdown-toggle {
  background: rgba(255, 255, 255, 0.18);
}

.nav-ecosystem__segment--ews .lang-dropdown-toggle .icon-chevron {
  opacity: 0.85;
}

/* Course segment lang colours */
.nav-ecosystem__segment--course .lang-dropdown-toggle {
  color: var(--f3-white);
  background: transparent;
  border: none;
}

.nav-ecosystem__segment--course .lang-dropdown-toggle:hover,
.nav-ecosystem__segment--course .lang-dropdown.is-open .lang-dropdown-toggle {
  background: rgba(255, 255, 255, 0.15);
}

/* Mobile â€” pills on the left; burger fixed on the right, outside the pill stack */
.nav-ecosystem-wrap--mobile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.nav-ecosystem-bar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}

.nav-ecosystem-bar-row .nav-ecosystem {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-ecosystem-wrap--mobile .nav-eco-burger {
  display: inline-flex;
  flex-shrink: 0;
  margin: 0;
}

.nav-ecosystem--mobile {
  height: var(--eco-bar-h);
}

.nav-ecosystem--mobile .nav-ecosystem__segment.is-expanded {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
  padding: 0 0.35rem 0 0.5rem;
}

.nav-eco-site-mark {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 0.35rem;
  text-decoration: none;
  color: inherit;
}

.nav-eco-burger {
  display: none;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0.2rem 0.2rem 0.2rem 0.1rem;
  padding: 0;
  border: 1.5px solid rgba(26, 82, 118, 0.25);
  border-radius: 10px;
  background: var(--f3-white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-eco-burger span {
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--f3-navy);
  position: relative;
}

.nav-eco-burger span::before,
.nav-eco-burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--f3-navy);
}

.nav-eco-burger span::before {
  top: -5px;
}

.nav-eco-burger span::after {
  top: 5px;
}

/* Mobile expanded panel â€” full sub-nav (same as desktop bar content) */
.nav-eco-mobile-panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  padding: 0.65rem;
  background: var(--f3-white);
  border-radius: 16px;
  box-shadow: var(--eco-shadow);
  border: 1px solid rgba(26, 82, 118, 0.12);
  z-index: 110;
}

.nav-eco-mobile-panel.is-open {
  display: block;
}

.nav-eco-mobile-panel .nav-eco-local {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 0.35rem;
}

.nav-eco-mobile-panel .nav-eco-local a {
  width: 100%;
  text-align: left;
  color: var(--f3-navy);
  background: transparent;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.nav-eco-mobile-panel .nav-eco-local a:hover {
  background: var(--f3-light);
}

.nav-eco-mobile-panel .nav-eco-tools {
  margin: 0.5rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--f3-light);
  flex-wrap: wrap;
}

.nav-eco-mobile-panel .nav-eco-local a.is-active {
  background: var(--f3-teal);
  color: var(--f3-white);
}

.nav-eco-mobile-panel .nav-eco-local a.is-active.nav-eco-local__link--with-icon {
  background: var(--f3-navy);
  color: var(--f3-white);
}

.nav-eco-mobile-panel .nav-eco-local a.nav-eco-local__link--trainings {
  background: linear-gradient(90deg, #dceefb 0%, #d4f2eb 100%);
  color: var(--f3-navy);
}

.nav-eco-mobile-panel .nav-eco-local a.nav-eco-local__link--trainings:hover {
  background: linear-gradient(90deg, #c8e3f8 0%, #b8ebe3 100%);
  color: var(--f3-navy);
}

.nav-eco-mobile-panel .nav-eco-local a.nav-eco-local__link--trainings.is-active {
  background: linear-gradient(90deg, #72b8e3 0%, #55d0b9 100%);
  color: var(--f3-white);
  box-shadow: none;
}

.nav-eco-mobile-panel[data-panel-for="ews"] .nav-eco-local a {
  color: var(--f3-navy);
}

.nav-eco-mobile-panel[data-panel-for="ews"] .nav-eco-local a.is-active {
  background: var(--f3-teal);
  color: var(--f3-white);
}

.nav-eco-mobile-panel[data-panel-for="course"] .nav-eco-local a.is-active {
  background: var(--f3-navy);
  color: var(--f3-white);
}

.nav-eco-mobile-panel .lang-dropdown-toggle {
  color: var(--f3-navy);
}

.nav-eco-mobile-panel .lang-dropdown-toggle:hover,
.nav-eco-mobile-panel .lang-dropdown.is-open .lang-dropdown-toggle {
  background: var(--f3-light);
}

.nav-eco-mobile-panel .nav-eco-ews-mobile-block .quiz-main-btn {
  width: 100%;
  justify-content: center;
}

/* Burger only appears in mobile bar row */
.nav-ecosystem-wrap:not(.nav-ecosystem-wrap--mobile) .nav-eco-burger {
  display: none !important;
}

/* --- Mobile / tablet (≤1024px) --- */
@media (max-width: 1024px) {
  .nav-eco-mobile-panel {
    padding: 0.75rem;
  }

  .nav-eco-mobile-panel .nav-eco-local a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
  }

  .nav-eco-burger {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .nav-eco-mobile-panel .nav-eco-tools .quiz-main-btn,
  .nav-eco-mobile-panel .nav-eco-tools .ews-share-btn {
    min-height: 2.75rem;
  }
}

@media (max-width: 480px) {
  .nav-ecosystem__segment.is-compact {
    min-width: 4.5rem;
    padding: 0 0.85rem;
    font-size: 0.8rem;
  }

  .nav-ecosystem__segment--f3.is-compact {
    min-width: 3.75rem;
  }

  .nav-ecosystem[data-active-site="ews"] .nav-ecosystem__segment--f3.is-compact,
  .nav-ecosystem[data-active-site="course"] .nav-ecosystem__segment--f3.is-compact {
    min-width: 4.35rem;
    padding-left: 0.65rem;
    padding-right: calc(var(--eco-overlap-f3) + 0.35rem);
  }

  .nav-ecosystem[data-active-site="ews"] .nav-ecosystem__segment--f3.is-compact .nav-eco-logo-img,
  .nav-ecosystem[data-active-site="course"] .nav-ecosystem__segment--f3.is-compact .nav-eco-logo-img {
    height: 1.85rem;
    max-width: 5rem;
  }

  .nav-ecosystem[data-active-site="f3"] .nav-ecosystem__segment--f3.is-expanded .nav-eco-logo {
    padding-left: 0.65rem;
  }

  .nav-ecosystem[data-active-site="f3"] .nav-ecosystem__segment--f3.is-expanded .nav-eco-logo-img {
    height: 1.85rem;
    max-width: 5rem;
  }

  .role-toggle .toggle-pill {
    min-width: 10rem;
  }

  .quiz-main-btn span.btn-label-full {
    display: none;
  }
}

.nav-ecosystem__segment--ews .ews-lang-switch .dropdown-menu {
  z-index: 1300;
}

/* EWS: Bootstrap language switcher inside ecosystem tools */
.nav-ecosystem__segment--ews .ews-lang-switch .btn-secondary {
  background: transparent;
  border: none;
  color: var(--f3-white);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  box-shadow: none;
}

.nav-ecosystem__segment--ews .ews-lang-switch .btn-secondary:hover,
.nav-ecosystem__segment--ews .ews-lang-switch.show .btn-secondary {
  background: rgba(255, 255, 255, 0.18);
  color: var(--f3-white);
}

.nav-eco-mobile-panel .ews-lang-switch .btn-secondary {
  color: var(--f3-navy);
}

.nav-eco-mobile-panel .ews-lang-switch .btn-secondary:hover {
  background: var(--f3-light);
}

/* Footer EWS / Course chips - compact, nav-matching colours */
.site-footer .footer-tools .nav-btn-mock.nav-btn-tool,
.site-footer a.btn-ews {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 0;
  padding: 0.35rem 0.75rem;
  border-radius: var(--f3-radius-pill);
  border-width: 1px;
  border-style: solid;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(26, 82, 118, 0.12);
  transition: filter 0.15s ease, background 0.15s ease;
}

.site-footer .footer-tools {
  gap: 0.5rem;
}

.site-footer .footer-tools .nav-btn-tool--ews,
.site-footer a.btn-ews {
  background: var(--f3-teal);
  color: var(--f3-white);
  border-color: var(--f3-teal);
}

.site-footer .footer-tools .nav-btn-tool--ews:hover,
.site-footer a.btn-ews:hover {
  filter: brightness(1.05);
  background: var(--f3-teal);
  color: var(--f3-white);
  border-color: var(--f3-teal);
}

.site-footer .footer-tools .nav-btn-tool--course {
  background: var(--f3-navy);
  color: var(--f3-white);
  border-color: var(--f3-navy);
}

.site-footer .footer-tools .nav-btn-tool--course:hover {
  filter: brightness(1.05);
  background: var(--f3-navy);
  color: var(--f3-white);
  border-color: var(--f3-navy);
}

.site-footer .footer-tools .nav-btn-tool .icon,
.site-footer a.btn-ews .icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: currentColor;
}
