/* Desktop: use the existing scrolled state; keep the full identity at the page top. */
@media screen and (min-width: 1101px) {
  .wp-site-blocks > header.wp-block-template-part.ecu-fb2-desktop-compact {
    margin-bottom: var(--ecu-fb2-header-gap, 0px) !important;
  }
  .ecu-fb2-desktop-compact .ecu-site-header .ecu-brand-row { display: none; }
  .ecu-fb2-desktop-compact .ecu-site-header .ecu-desktop-navigation .wp-block-navigation {
    margin-top: 0 !important;
  }
  .ecu-fb2-desktop-compact .ecu-site-header .wp-block-navigation__responsive-container-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }
  .ecu-fb2-desktop-compact .ecu-site-header .ecu-desktop-navigation .wp-block-navigation__container {
    flex: 1 1 auto;
    gap: 4px 6px;
  }
  .ecu-fb2-desktop-compact .ecu-site-header .wp-block-search { flex: 0 0 auto; margin-block: 0; }
  .ecu-fb2-desktop-compact .ecu-site-header .wp-block-search__inside-wrapper { width: 210px !important; }
  .ecu-fb2-desktop-compact .ecu-site-header .wp-block-search__input,
  .ecu-fb2-desktop-compact .ecu-site-header .wp-block-search__button { min-height: 44px; box-sizing: border-box; }
  .ecu-fb2-desktop-compact .ecu-site-header .wp-block-search__button { padding: 8px 10px; }
  /* Retain the real search label for assistive technology. */
  .ecu-fb2-desktop-compact .ecu-site-header .ecu-desktop-navigation .wp-block-search__label {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .ecu-fb2-desktop-compact .ecu-site-header .ecu-language-row {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    margin: 0 !important;
  }
  .ecu-fb2-desktop-compact .ecu-language-switcher { gap: 2px; }
  .ecu-fb2-desktop-compact .ecu-language-switcher a { padding-inline: 8px; min-height: 44px; }
}

/* Feedback 8: keep the mobile header to one row, with secondary links in the menu. */
@media screen and (max-width: 1100px) {
  .wp-site-blocks > header.wp-block-template-part > .ecu-site-header.ecu-fb2-mobile-ready {
    padding: 8px 16px !important;
  }
  .ecu-site-header.ecu-fb2-mobile-ready > .alignwide { gap: 12px !important; }
  .ecu-site-header.ecu-fb2-mobile-ready .ecu-brand-logo {
    width: min(220px, calc(100vw - 140px)) !important;
    max-width: 100%;
  }
  .ecu-site-header.ecu-fb2-mobile-ready .ecu-brand-tagline { display: none; }
  .ecu-site-header.ecu-fb2-mobile-ready .ecu-mobile-navigation > summary {
    min-width: 72px;
    min-height: 44px;
    padding: 10px 12px;
    white-space: nowrap;
  }
  .ecu-fb2-mobile-extras {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #d8dfdc;
  }
  .ecu-site-header .ecu-fb2-mobile-extras .ecu-project-mobile-link {
    display: block !important;
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.45;
  }
  .ecu-site-header .ecu-fb2-mobile-extras .ecu-project-mobile-link a {
    min-height: 44px;
    box-sizing: border-box;
    padding: 12px;
  }
  .ecu-fb2-mobile-extras .ecu-language-row {
    display: block;
    width: 100%;
    margin: 0 !important;
  }
  /* Override the generic mobile-menu nav rule for the nested language landmark. */
  .ecu-mobile-navigation .ecu-fb2-mobile-extras .ecu-language-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .ecu-fb2-mobile-extras .ecu-language-switcher a { min-height: 44px; }

  /* The page outline remains accessible, but no longer occupies a second sticky row. */
  body #ecu-toc-nav[data-ecu-toc-version] {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    visibility: visible !important;
    box-shadow: none !important;
  }
  body #ecu-toc-nav[data-ecu-toc-version] .ecu-toc-toc-list {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  body #ecu-toc-nav[data-ecu-toc-version] .ecu-toc-toc-current { display: none !important; }
  body.ecu-toc-toc-ready #main-content section[id] { scroll-margin-top: 0 !important; }
}

/* Feedback 13: two equal entry actions and a separate, clearly underlined calculator link. */
main .wp-block-buttons.ecu-fb2-hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}
main .ecu-fb2-hero-actions > .wp-block-button { width: 100%; min-width: 0; margin: 0; }
main .ecu-fb2-hero-actions > .wp-block-button > a {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 48px;
  height: 100%;
  width: 100%;
  padding: 12px 10px;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}
main .ecu-fb2-hero-actions > .ecu-fb2-calculator-action { grid-column: 1 / -1; }
main .ecu-fb2-hero-actions > .ecu-fb2-calculator-action > a {
  display: inline-flex;
  width: auto;
  height: auto;
  min-height: 44px;
  justify-content: flex-start;
  padding: 8px 2px;
  border: 0 !important;
  border-radius: 2px;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--wp--preset--color--brand-blue, #1858cf) !important;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 650;
  text-align: start;
}
main .ecu-fb2-calculator-action > a:hover { text-decoration-thickness: 2px; }
@media screen and (max-width: 480px) {
  main .wp-block-buttons.ecu-fb2-hero-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Context is visible text and part of the field's existing accessible label. */
.ecu-fb2-label-context { font-weight: inherit; }
