/*
 * Katalon Academy top navigation (Design System 2.0).
 * Spec: design_handoff_academy_navigation_ds2 (README.md + "Academy Navigation - DS2").
 *
 * Walled off from the legacy header styles on purpose:
 * - Markup uses kn-* class names and a custom menu id, so the old #menu-main-menu,
 *   .headerNav, .headerContent and .login-wrap rules in css/dist/main.css never match.
 * - Every rule is prefixed with .kn-header, which beats the theme's bare element rules
 *   (h1-h6 Roboto, p/span/a/button Inter, Bootstrap link colours, button:focus outline:0)
 *   on specificity, and every text element sets its own font, size and line-height,
 *   so nothing is inherited from the theme's px-based body line-height.
 * - Linked from header.php after css/dist/overwrite.css, so it is the last global
 *   stylesheet. No SCSS source and no build step: edit this file directly.
 * - No universal font rule, so icon fonts (Font Awesome, Tutor icons) are untouched.
 *
 * Menu items come from WP Admin > Appearance > Menus (location "primary"). The layout
 * follows the menu's structure: a panel gets one column per item, and the Programs
 * layout (program link + 2-column certification list) applies when a panel holds a
 * single item that has sub-items. Any other structure falls back to plain columns.
 */

header.kn-header {
  --kn-ink: #0c1411;
  --kn-body: #1f2925;
  --kn-text-2: #3c4642;
  --kn-muted: #5b6661;
  --kn-green: #0f8461;
  --kn-green-dark: #0c6a4e;
  --kn-green-press: #094f3a;
  --kn-wash: #f0faf5;
  --kn-avatar-bg: #ecf4f2;
  --kn-hover: #eef2f0;
  --kn-subtle: #f6f8f7;
  --kn-line: #e1e7e4;
  --kn-control: #cdd6d2;
  --kn-control-hover: #aab4af;
  --kn-display: "Inter Tight", Inter, Arial, sans-serif;
  --kn-text: Inter, Arial, sans-serif;
  --kn-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --kn-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --kn-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");

  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid var(--kn-line);
  background: #fff;
  box-shadow: none;
  color: var(--kn-body);
  font-family: var(--kn-text);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  /* Reset inherited text settings a page may set on body or #page. */
  text-align: left;
  text-indent: 0;
  text-transform: none;
  white-space: normal;
  word-spacing: normal;
}

.kn-header *,
.kn-header *::before,
.kn-header *::after {
  box-sizing: border-box;
}

.kn-header a,
.kn-header a:hover,
.kn-header a:focus {
  text-decoration: none;
}

.kn-header a:focus-visible,
.kn-header button:focus-visible {
  outline: 2px solid var(--kn-green);
  outline-offset: 2px;
}

.kn-header svg {
  display: block;
  flex: 0 0 auto;
}

/* ---- Bar ---------------------------------------------------------------- */

.kn-header .kn-bar {
  width: min(1180px, calc(100% - 48px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.kn-header .kn-brand {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
}

.kn-header .kn-brand img {
  display: block;
  width: 190px;
  max-width: none;
  height: auto;
}

/* ---- Menu (desktop) ------------------------------------------------------ */

.kn-header .kn-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.kn-header .kn-menu,
.kn-header .kn-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kn-header .kn-menu li {
  margin: 0;
  padding: 0;
}

.kn-header .kn-menu {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Each top-level item fills the bar's height, so the pointer stays over it on the
   way from the trigger down into the panel. */
.kn-header .kn-menu > li {
  height: 72px;
  display: flex;
  align-items: center;
}

.kn-header .kn-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px 0 14px;
  border-radius: 8px;
  color: var(--kn-ink);
  font-family: var(--kn-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s var(--kn-ease), color .15s var(--kn-ease);
}

.kn-header .kn-menu > li > a .menu-title {
  color: inherit;
  font: inherit;
}

.kn-header .kn-menu > li > a .menu-desc {
  display: none;
}

.kn-header .kn-menu > li:not(.menu-item-has-children) > a:hover {
  background: var(--kn-hover);
}

.kn-header .kn-menu > .menu-item-has-children > a::after {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-color: var(--kn-muted);
  -webkit-mask: var(--kn-chevron) center / 16px 16px no-repeat;
  mask: var(--kn-chevron) center / 16px 16px no-repeat;
  transition: transform .15s var(--kn-ease);
}

/* Open: hover, keyboard focus inside, or tapped open (.is-open, set by header.php). */
.kn-header .kn-menu > .menu-item-has-children:focus-within > a,
.kn-header .kn-menu > .menu-item-has-children.is-open > a {
  background: var(--kn-wash);
  color: var(--kn-green-dark);
  font-weight: 600;
}

.kn-header .kn-menu > .menu-item-has-children:focus-within > a::after,
.kn-header .kn-menu > .menu-item-has-children.is-open > a::after {
  transform: rotate(180deg);
  background-color: currentColor;
}

/* ---- Dropdown panels: full width under the bar --------------------------- */

/* The panel is the second-level list itself. It spans the header's full width, and
   its side padding centres a grid of min(1212px, 100% - 16px): the 1180px container
   plus 16px each side, so the item text lines up with the logo. */
.kn-header .kn-menu > li > .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: 24px max(8px, calc((100% - 1212px) / 2)) 32px;
  border-top: 1px solid var(--kn-line);
  border-bottom: 1px solid var(--kn-line);
  background: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  /* Closing: fade out, then hide. Opening (below): visible at once, so keyboard Tab
     can move straight into the links while the panel fades in. */
  transition: opacity .2s var(--kn-ease), transform .2s var(--kn-ease), visibility 0s linear .2s;
}

.kn-header .kn-menu > li:focus-within > .sub-menu,
.kn-header .kn-menu > li.is-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

/* Hover opening only where there is a real pointer. On touch screens a tap leaves a
   "sticky" hover behind, which would stop a second tap from closing the panel, so
   touch uses taps (.is-open, set by header.php) instead. */
@media (hover: hover) {
  .kn-header .kn-menu > .menu-item-has-children:hover > a {
    background: var(--kn-wash);
    color: var(--kn-green-dark);
    font-weight: 600;
  }

  .kn-header .kn-menu > .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
    background-color: currentColor;
  }

  .kn-header .kn-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .kn-header .kn-profile:hover .kn-profile-btn {
    background: var(--kn-wash);
    color: var(--kn-green-dark);
  }

  .kn-header .kn-profile:hover .kn-profile-btn::after {
    transform: rotate(180deg);
    background-color: currentColor;
  }

  .kn-header .kn-profile:hover .kn-profile-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
  }
}

/* Closed with Esc (or Enter) while the keyboard focus is still on the label. */
.kn-header .kn-menu > li.is-dismissed > .sub-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition-delay: 0s, 0s, .2s;
}

.kn-header .kn-menu > .menu-item-has-children.is-dismissed > a {
  background: var(--kn-hover);
  color: var(--kn-ink);
  font-weight: 500;
}

.kn-header .kn-menu > .menu-item-has-children.is-dismissed > a::after {
  transform: none;
  background-color: var(--kn-muted);
}

/* Every section is separated by a vertical line. */
.kn-header .kn-menu > li > .sub-menu > li {
  height: auto;
  padding: 0 12px 0 0;
}

.kn-header .kn-menu > li > .sub-menu > li + li {
  padding: 0 12px;
  border-left: 1px solid var(--kn-line);
}

.kn-header .kn-menu .sub-menu a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 16px;
  border-radius: 12px;
  transition: background-color .15s var(--kn-ease);
}

.kn-header .kn-menu .sub-menu a:hover,
.kn-header .kn-menu .sub-menu a:focus-visible {
  background: var(--kn-wash);
}

.kn-header .kn-menu .sub-menu .menu-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--kn-ink);
  font-family: var(--kn-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.kn-header .kn-menu .sub-menu .menu-desc {
  display: block;
  color: var(--kn-text-2);
  font-family: var(--kn-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-wrap: pretty;
}

/* Panel icons (desktop only): a bare 24px line icon before the title, picked by the
   link's address. A menu item can also choose one with a CSS class in WP Admin
   (kn-icon-book, kn-icon-layers, kn-icon-certificate, kn-icon-lightbulb,
   kn-icon-newspaper, kn-icon-users). Unknown links simply get no icon. */
.kn-header .kn-menu > li > .sub-menu > li > a .menu-title::before {
  content: "";
  display: none;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background-color: var(--kn-green-dark);
  -webkit-mask: var(--kn-icon) center / 24px 24px no-repeat;
  mask: var(--kn-icon) center / 24px 24px no-repeat;
}

.kn-header .kn-menu > li > .sub-menu > li > a[href$="/courses/"],
.kn-header .kn-menu > li > .sub-menu > li.kn-icon-book > a { --kn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3C/svg%3E"); }
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/learning-path/"],
.kn-header .kn-menu > li > .sub-menu > li.kn-icon-layers > a { --kn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.8 2.2a2 2 0 0 0-1.6 0L2.6 6.1a1 1 0 0 0 0 1.8l8.6 3.9a2 2 0 0 0 1.6 0l8.6-3.9a1 1 0 0 0 0-1.8Z'/%3E%3Cpath d='M2 12l8.6 3.9a2 2 0 0 0 1.6 0L21 12M2 17l8.6 3.9a2 2 0 0 0 1.6 0L21 17'/%3E%3C/svg%3E"); }
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/certifications/"],
.kn-header .kn-menu > li > .sub-menu > li.kn-icon-certificate > a { --kn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4'/%3E%3Cpath d='M13.4 12.6a2 2 0 1 1 3 3L8 21l-4 1 1-4Z'/%3E%3C/svg%3E"); }
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/katalon-demo-and-integration/"],
.kn-header .kn-menu > li > .sub-menu > li.kn-icon-lightbulb > a { --kn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4'/%3E%3Cpath d='M15.5 14.5c.3-1 .8-1.8 1.6-2.6A6 6 0 1 0 6.9 11.9c.8.8 1.3 1.6 1.6 2.6'/%3E%3C/svg%3E"); }
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/success-stories/"],
.kn-header .kn-menu > li > .sub-menu > li.kn-icon-newspaper > a { --kn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2'/%3E%3Cpath d='M18 14h-8M15 18h-5'/%3E%3Crect x='10' y='6' width='8' height='4' rx='1'/%3E%3C/svg%3E"); }
.kn-header .kn-menu > li > .sub-menu > li > a[href*="forum.katalon.com"],
.kn-header .kn-menu > li > .sub-menu > li.kn-icon-users > a { --kn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='7.5' r='3.5'/%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M22 21v-2a4 4 0 0 0-3-3.9M16 3.6a3.5 3.5 0 0 1 0 6.8'/%3E%3C/svg%3E"); }

.kn-header .kn-menu > li > .sub-menu > li > a[href$="/courses/"] .menu-title::before,
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/learning-path/"] .menu-title::before,
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/certifications/"] .menu-title::before,
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/katalon-demo-and-integration/"] .menu-title::before,
.kn-header .kn-menu > li > .sub-menu > li > a[href$="/success-stories/"] .menu-title::before,
.kn-header .kn-menu > li > .sub-menu > li > a[href*="forum.katalon.com"] .menu-title::before,
.kn-header .kn-menu > li > .sub-menu > li[class*="kn-icon-"] > a .menu-title::before {
  display: block;
}

/* Fallback for a third level in any other layout: a plain indented list. */
.kn-header .kn-menu > li > .sub-menu > li > .sub-menu {
  margin: 4px 0 0 16px;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--kn-line);
}

.kn-header .kn-menu .sub-menu .sub-menu a {
  gap: 4px;
  padding: 12px 16px;
  border-radius: 8px;
}

.kn-header .kn-menu .sub-menu .sub-menu .menu-title {
  font-size: 16px;
  line-height: 1.4;
}

/* Programs: a panel whose only item has sub-items (Katalon Certification Program and
   its certifications). 4 of 12 columns for the program, 8 for a 2-column list that
   fills top to bottom: the first 3 certifications on the left, the rest on the right. */
.kn-header .kn-menu > li > .sub-menu:has(> li.menu-item-has-children:only-child) {
  display: block;
}

.kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding: 0;
}

.kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child > a {
  grid-column: span 4;
  gap: 8px;
  margin-right: 12px;
}

.kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child > a .menu-title {
  font-size: 20px;
}

.kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child > .sub-menu {
  grid-column: span 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  align-content: start;
  align-items: start;
  gap: 4px 24px;
  margin: 0;
  padding: 8px 0 0 12px;
  border-left: 1px solid var(--kn-line);
}

/* Only shown inside the mobile panel (see the 992px breakpoint). */
.kn-header .kn-panel-search,
.kn-header .kn-panel-actions {
  display: none;
}

/* ---- Right-hand actions -------------------------------------------------- */

.kn-header .kn-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kn-header .kn-icon-btn,
.kn-header .kn-menu-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--kn-ink);
  cursor: pointer;
  transition: background-color .15s var(--kn-ease), border-color .15s var(--kn-ease);
}

.kn-header .kn-icon-btn:hover {
  background: var(--kn-hover);
}

.kn-header .kn-icon-btn svg,
.kn-header .kn-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* DS buttons: neutral (Log in) and primary (Sign up). */
.kn-header .kn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--kn-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  transition: background-color .15s var(--kn-ease), border-color .15s var(--kn-ease);
}

.kn-header .kn-btn-neutral,
.kn-header .kn-btn-neutral:hover,
.kn-header .kn-btn-neutral:focus {
  color: var(--kn-ink);
}

.kn-header .kn-btn-neutral {
  border-color: var(--kn-control);
  background: #fff;
}

.kn-header .kn-btn-neutral:hover {
  border-color: var(--kn-control-hover);
  background: var(--kn-subtle);
}

.kn-header .kn-btn-primary,
.kn-header .kn-btn-primary:hover,
.kn-header .kn-btn-primary:focus {
  color: #fff;
}

.kn-header .kn-btn-primary {
  background: var(--kn-green);
}

.kn-header .kn-btn-primary:hover {
  background: var(--kn-green-dark);
}

.kn-header .kn-btn-primary:active {
  background: var(--kn-green-press);
}

/* Search: the icon button opens the course-search form (jQuery in header.php). The
   form sits over the button and grows to the left, over the menu, so the bar never
   reflows; on narrow desktops it covers the last menu item while it is open. */
.kn-header .kn-search {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.kn-header .kn-search .search_form {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 60;
  width: 280px;
  height: 44px;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s var(--kn-ease), visibility 0s linear .15s;
}

.kn-header .kn-search .search_form.show {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.kn-header .search_form,
.kn-header .kn-panel-search {
  position: relative;
}

.kn-header .kn-field-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--kn-muted);
  line-height: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.kn-header .kn-field-icon svg {
  width: 20px;
  height: 20px;
}

.kn-header .search_form input,
.kn-header .kn-panel-search input {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px 0 42px;
  border: 1px solid var(--kn-control);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  color: var(--kn-ink);
  font-family: var(--kn-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  outline: 0;
}

.kn-header .search_form input::placeholder,
.kn-header .kn-panel-search input::placeholder {
  color: var(--kn-muted);
  opacity: 1;
}

.kn-header .search_form input:focus,
.kn-header .kn-panel-search input:focus {
  border-color: var(--kn-green);
  outline: 2px solid var(--kn-green);
  outline-offset: 2px;
}

/* Logged in: account menu (desktop) and avatar link (mobile). */
.kn-header .kn-avatar-link {
  display: none;
}

/* Fills the bar's height, so the pointer stays over it on the way to the popover. */
.kn-header .kn-profile {
  position: relative;
  height: 72px;
  display: flex;
  align-items: center;
}

.kn-header .kn-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  margin: 0;
  padding: 0 8px 0 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--kn-ink);
  cursor: pointer;
  transition: background-color .15s var(--kn-ease), color .15s var(--kn-ease);
}

.kn-header .kn-profile-btn::after {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-color: var(--kn-muted);
  -webkit-mask: var(--kn-chevron) center / 16px 16px no-repeat;
  mask: var(--kn-chevron) center / 16px 16px no-repeat;
  transition: transform .15s var(--kn-ease);
}

.kn-header .kn-profile:focus-within .kn-profile-btn,
.kn-header .kn-profile.is-open .kn-profile-btn {
  background: var(--kn-wash);
  color: var(--kn-green-dark);
}

.kn-header .kn-profile:focus-within .kn-profile-btn::after,
.kn-header .kn-profile.is-open .kn-profile-btn::after {
  transform: rotate(180deg);
  background-color: currentColor;
}

/* DS Avatar: photo when there is one, otherwise initials. Tutor puts an inline random
   colour on .tutor-text-avatar, so the DS colours need !important to win. */
.kn-header .kn-avatar {
  display: grid;
}

/* No display here: the avatar link is hidden on desktop (above) and shown in the
   mobile bar (992px breakpoint). */
.kn-header .kn-avatar,
.kn-header .kn-avatar-link {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  line-height: 0;
}

.kn-header .kn-avatar .tutor-text-avatar,
.kn-header .kn-avatar-link .tutor-text-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--kn-avatar-bg) !important;
  color: var(--kn-green-press) !important;
  font-family: var(--kn-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.kn-header .kn-avatar img,
.kn-header .kn-avatar-link img {
  display: block;
  width: 32px;
  height: 32px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
}

.kn-header .kn-profile-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 260px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--kn-line);
  border-radius: 12px;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .2s var(--kn-ease), transform .2s var(--kn-ease), visibility 0s linear .2s;
}

/* Keeps the popover open while the pointer crosses the 8px gap below the bar. */
.kn-header .kn-profile-list::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 9px;
}

.kn-header .kn-profile:focus-within .kn-profile-list,
.kn-header .kn-profile.is-open .kn-profile-list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.kn-header .kn-profile.is-dismissed .kn-profile-list {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition-delay: 0s, 0s, .2s;
}

.kn-header .kn-profile.is-dismissed .kn-profile-btn {
  background: var(--kn-hover);
  color: var(--kn-ink);
}

.kn-header .kn-profile.is-dismissed .kn-profile-btn::after {
  transform: none;
  background-color: var(--kn-muted);
}

.kn-header .kn-profile-list li {
  margin: 0;
  padding: 0;
}

.kn-header .kn-profile-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--kn-ink);
  font-family: var(--kn-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transition: background-color .15s var(--kn-ease);
}

.kn-header .kn-profile-list a:hover,
.kn-header .kn-profile-list a:focus-visible {
  background: var(--kn-wash);
  color: var(--kn-ink);
}

.kn-header .kn-menu-btn {
  display: none;
  border-color: var(--kn-control);
  background: #fff;
}

.kn-header .kn-menu-btn:hover {
  border-color: var(--kn-control-hover);
  background: var(--kn-subtle);
}

/* ---- Tablet and phone (<= 992px): the menu moves into a full-width panel ------ */

@media (max-width: 992px) {
  .kn-header .kn-bar {
    width: 100%;
    height: 64px;
    padding: 0 12px 0 16px;
    justify-content: space-between;
    gap: 16px;
  }

  .kn-header .kn-brand img {
    width: 165px;
  }

  .kn-header .kn-nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    max-height: calc(100vh - 65px);
    padding: 20px 16px 24px;
    overflow-y: auto;
    border-bottom: 1px solid var(--kn-line);
    background: #fff;
  }

  .kn-header .kn-nav.is-open {
    display: flex;
  }

  body:has(.kn-header .kn-nav.is-open) {
    overflow: hidden;
  }

  .kn-header .kn-search,
  .kn-header .kn-actions > .kn-btn,
  .kn-header .kn-profile {
    display: none;
  }

  .kn-header .kn-menu-btn,
  .kn-header .kn-avatar-link {
    display: grid;
  }

  .kn-header .kn-panel-search {
    display: block;
  }

  .kn-header .kn-panel-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--kn-line);
  }

  .kn-header .kn-panel-actions .kn-btn {
    flex: 1;
  }

  .kn-header .kn-menu {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  /* Rows in a group sit 2px apart (label, items, certification list). */
  .kn-header .kn-menu > li {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  /* Group labels. */
  .kn-header .kn-menu > li > a,
  .kn-header .kn-menu > .menu-item-has-children:hover > a,
  .kn-header .kn-menu > .menu-item-has-children:focus-within > a,
  .kn-header .kn-menu > .menu-item-has-children.is-open > a {
    display: block;
    height: auto;
    padding: 0 12px 6px;
    border-radius: 0;
    background: none;
    color: var(--kn-muted);
    font-family: var(--kn-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1.5;
    text-transform: uppercase;
    cursor: default;
  }

  .kn-header .kn-menu > .menu-item-has-children > a::after {
    display: none;
  }

  .kn-header .kn-menu > li > .sub-menu,
  .kn-header .kn-menu > li > .sub-menu:has(> li.menu-item-has-children:only-child) {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .kn-header .kn-menu > li > .sub-menu > li,
  .kn-header .kn-menu > li > .sub-menu > li + li,
  .kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border: 0;
  }

  .kn-header .kn-menu .sub-menu a,
  .kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child > a {
    flex-direction: row;
    align-items: center;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
  }

  .kn-header .kn-menu .sub-menu .menu-title,
  .kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child > a .menu-title {
    font-family: var(--kn-display);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
  }

  .kn-header .kn-menu .sub-menu .menu-desc,
  .kn-header .kn-menu > li > .sub-menu > li > a .menu-title::before {
    display: none !important;
  }

  /* Certifications: indented under the program. */
  .kn-header .kn-menu > li > .sub-menu > li > .sub-menu,
  .kn-header .kn-menu > li > .sub-menu > li.menu-item-has-children:only-child > .sub-menu {
    display: block;
    margin: 0 0 0 12px;
    padding: 0 0 0 12px;
    border-left: 1px solid var(--kn-line);
  }

  .kn-header .kn-menu .sub-menu .sub-menu .menu-title {
    font-family: var(--kn-text);
    font-size: 14px;
    font-weight: 500;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kn-header,
  .kn-header *,
  .kn-header *::before,
  .kn-header *::after {
    transition: none !important;
  }
}
