.tkh-header .tkh-header-controls {
  position: relative;
  flex-wrap: nowrap !important;
}

.tkh-header-controls > .tkh-header-mobile-actions,
.tkh-header-controls > .tkh-theme-header-search-desktop {
  display: none;
}

.tkh-theme-header-search,
.tkh-header-mobile-actions {
  flex: 0 0 auto;
}

.tkh-theme-header-search > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--tkh-border);
  border-radius: 100px;
  color: var(--tkh-ink);
  font-size: .8rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.tkh-theme-header-search > summary::-webkit-details-marker { display: none; }
.tkh-theme-header-search > summary svg { flex: none; }

.tkh-theme-header-search[open] > summary,
.tkh-theme-header-search > summary:hover {
  border-color: var(--tkh-teal);
  background: var(--wp--preset--color--mint, #eaf2ed);
}

.tkh-theme-header-search[open] > .tkh-header-search-form {
  position: absolute;
  inset-block-start: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 40;
  width: min(100%, 32rem);
  margin: 0;
  padding: 10px;
  border: 1px solid var(--tkh-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(23 43 39 / 14%);
}

.tkh-header-controls :is(.tkh-header-search-form, .tkh-menu-search) .tkh-search-fields {
  padding: 0;
  border: 0;
  background: transparent;
}

.tkh-header-controls .tkh-header-search-form input {
  min-height: 44px;
  padding: 8px 10px;
}

.tkh-header-controls :is(.tkh-header-search-form, .tkh-menu-search) .tkh-live-panel {
  max-height: min(18rem, 40vh);
  max-height: min(18rem, 40dvh);
}

.tkh-header-controls .tkh-menu-search > .tkh-live-search { display: block; }

.tkh-header-controls .tkh-menu-search .tkh-live-panel {
  position: static;
  margin-block-start: 8px;
  box-shadow: none;
}

/* Linked parents retain separate link and disclosure targets. */
.tkh-header .tkh-header-controls .is-menu-open .has-child.tkh-mobile-group > .wp-block-navigation-item__content {
  display: none;
}

.tkh-header .tkh-header-controls .is-menu-open .has-child.tkh-mobile-group > .tkh-submenu-toggle {
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 13px 10px 0;
  font-size: 1.1rem;
  line-height: 1.5;
  text-align: start;
}

.tkh-header-controls .tkh-mobile-group > button svg { flex: none; }

@media screen and (min-width: 1280px) {
  .tkh-header-controls > .tkh-theme-header-search-desktop { display: block; }
  .tkh-header-controls .has-child:has(> a.wp-block-navigation-item__content:not([href])) {
    position: relative;
  }
  .tkh-header-controls .has-child:has(> a.wp-block-navigation-item__content:not([href])) > button.wp-block-navigation__submenu-icon::before {
    position: absolute;
    inset: 0;
    content: '';
    cursor: pointer;
  }
  .tkh-header-controls .has-child > button.wp-block-navigation__submenu-icon:focus-visible::before {
    outline: 2px solid var(--tkh-teal);
    outline-offset: 2px;
    border-radius: 6px;
  }
}

@media screen and (max-width: 1279px) {
  .tkh-header .tkh-header-controls { gap: 8px !important; }
  .tkh-header-controls > .tkh-header-mobile-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
  }
  .tkh-header-controls > .tkh-header-saved { display: none; }
  .tkh-header .tkh-header-controls > .tkh-mobile-navigation {
    flex: 0 0 auto;
    margin-inline-start: 0;
  }
  .tkh-header-controls .wp-block-navigation__responsive-container-open {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .tkh-header-controls .wp-block-navigation:has(.wp-block-navigation__responsive-container-open) .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none !important;
  }
  .tkh-theme-header-search-mobile > summary {
    width: 44px;
    padding: 0;
  }
  .tkh-header-controls .tkh-header-mobile-actions > .tkh-header-saved { display: none; }
}

@media screen and (min-width: 428px) and (max-width: 1279px) {
  .tkh-header-controls .tkh-header-mobile-actions > .tkh-header-saved { display: inline-flex; }
}

@media screen and (max-width: 599px) {
  .tkh-header .tkh-header-controls .tkh-brand > .wp-block-group { overflow-wrap: anywhere; }
}

@media screen and (max-width: 359px) {
  .tkh-header-controls .tkh-brand-caption { display: none; }
  .tkh-header-controls .tkh-brand .wp-block-site-title { font-size: 1rem; }
}
