/* Single-line mobile & tablet header parity across all 21 languages (keeps English untouched). */
@media (max-width: 1279px) {
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > [data-header-shortcut],
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > [data-header-row-break] {
    display: none !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > [data-testid="desktop-tools-menu"] { order: 0 !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > a[href*="/how-it-works"] { order: 10 !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > a[href*="/pricing"] { order: 20 !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > a[href*="/contact"] { order: 30 !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > button:not([data-testid="desktop-tools-menu"]) { order: 50 !important; }
}

@media (min-width: 768px) and (max-width: 1279px) {
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions > a {
    max-width: none !important;
    min-width: max-content !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 16px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions > a > span {
    white-space: nowrap !important;
    text-wrap: nowrap !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 clamp(10px, 2vw, 22px) !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > .header-link,
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > .header-link > span {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    min-height: 36px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }
}

/* Compact vertical spacing & single-row English/localized geometry on phones (< 768px). */
@media (max-width: 767px) {
  html:root .public-header { padding-block: 0 !important; }
  html:root .public-header .public-header-rail { min-height: 0 !important; padding-block: 0 !important; padding-inline: 8px !important; column-gap: 6px !important; row-gap: 0 !important; }
  html:root .public-header .public-header-brand > div > a > div:first-child { height: 34px !important; }
  html:root .public-header .public-header-actions { gap: 5px !important; }
  html:root .public-header .public-header-actions > button { height: 34px !important; }
  html:root .public-header .public-header-actions > a { height: auto !important; min-height: 34px !important; padding-block: 2px !important; line-height: 1.2 !important; }
  html:root .public-header .public-header-nav { display: flex !important; flex-wrap: wrap !important; justify-content: space-between !important; column-gap: 4px !important; row-gap: 0 !important; padding-block: 0 !important; min-height: 0 !important; }
  html:root .public-header .public-header-nav > .header-link { position: relative; flex: 0 0 auto !important; min-height: 28px !important; padding-block: 2px !important; padding-inline: 1px !important; white-space: nowrap !important; touch-action: manipulation !important; }
  html:root .public-header .public-header-nav > a.header-link:not(:first-child):not(:last-child)::before { content: ""; position: absolute; inset: 0 -7px; }

  /* Non-English phones: strict 1-line CTA pill + strict 1-row 5-item sub-nav matching English */
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-rail {
    grid-template-columns: max-content minmax(0, 1fr) !important;
    padding-inline: 8px !important;
    padding-block: 2px 0 !important;
    column-gap: 5px !important;
    row-gap: 0 !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-brand > div > a {
    gap: 5px !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-brand > div > a > div:first-child {
    width: 28px !important;
    height: 34px !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-brand span.text-lg {
    font-size: clamp(15px, 4.1vw, 17.5px) !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions {
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 5px !important;
    min-width: 0 !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions > button {
    width: 28px !important;
    height: 34px !important;
    padding-inline: 0 !important;
    flex: 0 0 auto !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions > a {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 clamp(9px, 2.7vw, 13px) !important;
    font-size: clamp(10.5px, 2.9vw, 12px) !important;
    line-height: 1 !important;
    letter-spacing: -0.015em !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions > a > span {
    white-space: nowrap !important;
    text-wrap: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    hyphens: none !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0 clamp(2px, 0.85vw, 6px) !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-block: 1px !important;
    padding-inline: 0 !important;
    overflow: hidden !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > .header-link {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    min-height: 30px !important;
    padding: 2px 1px !important;
    gap: 2px !important;
    font-size: clamp(9.8px, 2.65vw, 12px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }
  html:root:is(:lang(uk), :lang(nl), :lang(tr), :lang(es), :lang(fr), :lang(pl)):not([data-header-legacy]) body header.public-header .public-header-nav > .header-link {
    font-size: clamp(9.4px, 2.5vw, 11.5px) !important;
    letter-spacing: -0.025em !important;
  }
  html:root:is(:lang(ja), :lang(ko), :lang(zh), :lang(he), :lang(ar), :lang(id), :lang(it), :lang(th)):not([data-header-legacy]) body header.public-header .public-header-nav > .header-link {
    font-size: clamp(10.8px, 2.95vw, 12px) !important;
    letter-spacing: 0 !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > .header-link > span {
    display: inline !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    hyphens: none !important;
  }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-nav > .header-link svg {
    display: inline-block !important;
    width: 11px !important;
    height: 11px !important;
    flex-shrink: 0 !important;
  }
}

@media (hover: none), (pointer: coarse) {
  html:root .header-link, html:root .header-link:hover, html:root .header-link:active { transform: none !important; transition: color .12s ease !important; }
  html:root .header-link::after, html:root .header-link:hover::after { display: none !important; content: none !important; width: 0 !important; opacity: 0 !important; }
}

@media (max-width: 359px) {
  html:root .public-header .public-header-rail { padding-inline: 6px !important; column-gap: 4px !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-rail { padding-inline: 6px !important; column-gap: 4px !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-brand > div > a > div:first-child { width: 24px !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions { gap: 4px !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions > button { width: 24px !important; }
  html:root:not(:lang(en)):not([data-header-legacy]) body header.public-header .public-header-actions > a { padding-inline: 8px !important; }
}
