/* ==========================================================================
 * Companion landing header — wywo / keyra-regions parity (px-for-px)
 * ========================================================================== */

.companion-site {
  --keyra-header-offset: calc(3.9375rem + env(safe-area-inset-top, 0px));
  --keyra-z-header: 200;
  --keyra-font-sans: "Inter", system-ui, sans-serif;
  --keyra-radius-pill: 9999px;
  --keyra-radius-sheet: 16px;
  --keyra-shadow-hover: 0 14px 44px rgba(0, 0, 0, 0.07);
}

@media (min-width: 640px) {
  .companion-site {
    --keyra-header-offset: calc(4.3125rem + env(safe-area-inset-top, 0px));
  }
}

@media (min-width: 1280px) {
  .companion-site {
    --keyra-header-offset: calc(3.75rem + env(safe-area-inset-top, 0px));
  }
}

.companion-site:not([data-page-type="login"]) {
  padding-top: var(--keyra-header-offset);
  overflow-x: clip;
}

@media (max-width: 639px) {
  .companion-site {
    --keyra-header-offset: calc(4.125rem + env(safe-area-inset-top, 0px));
  }

  .companion-landing-header__inner {
    min-height: 3.25rem;
    padding-bottom: 0.25rem;
  }
}

.tr-landing-header.keyra-site-header-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--keyra-z-header);
  flex-shrink: 0;
  overflow: visible;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  background: var(--color-canvas, #ffffff);
  --keyra-accent: #000000;
  --keyra-accent-2: #1a1a1a;
  --keyra-primary: #000000;
  --keyra-text: #000000;
  --keyra-text-2: rgba(0, 0, 0, 0.55);
  --keyra-border: rgba(0, 0, 0, 0.08);
  --keyra-bg: #ffffff;
}

/* Override legacy companion-shell header rules */
.companion-site .tr-landing-header.keyra-site-header-shell .keyra-header-logo-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  max-width: none;
  height: auto;
  aspect-ratio: auto;
}

.companion-site .tr-landing-header .keyra-header-logo-link__img {
  display: block;
  flex-shrink: 0;
  width: auto;
  max-width: none;
  height: 2.5rem;
  object-fit: contain;
  object-position: left center;
}

.companion-site .tr-landing-header .keyra-header-logo-link__tagline {
  display: block;
}

.tr-landing-header .companion-landing-header__toolbar-main {
  align-items: center;
}

.companion-landing-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 80rem;
  min-width: 0;
  min-height: 3rem;
  margin-inline: auto;
  padding: 0.375rem max(0.75rem, env(safe-area-inset-right, 0px)) 0
    max(0.75rem, env(safe-area-inset-left, 0px));
  overflow: visible;
}

.companion-landing-header__brand {
  position: relative;
  z-index: 0;
  display: inline-flex;
  min-width: 0;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: visible;
  text-decoration: none;
}

.companion-landing-header__brand .keyra-header-logo-link__img {
  height: 2.5rem;
  width: auto;
  max-width: none;
}

.companion-landing-header__spacer {
  display: none;
  min-width: 0;
}

.companion-landing-header__toolbar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  overflow: visible;
}

.companion-landing-header__toolbar-main {
  display: flex;
  align-items: center;
}

.companion-landing-header__toolbar-main > [data-keyra-auth],
.companion-landing-header__toolbar-main > [data-keyra-app-link],
.companion-landing-header__toolbar-main > [data-keyra-launcher] {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.companion-landing-header__launcher {
  display: flex;
  align-items: center;
  margin-inline: 0.25rem;
}

@media (min-width: 640px) {
  .companion-landing-header__inner {
    padding-inline: max(1.5rem, env(safe-area-inset-left, 0px))
      max(1.5rem, env(safe-area-inset-right, 0px));
  }

  .companion-site .tr-landing-header .keyra-header-logo-link__img,
  .companion-landing-header__brand .keyra-header-logo-link__img {
    height: 2.75rem;
  }
}

@media (min-width: 1280px) {
  .companion-landing-header__inner {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0;
    min-height: 3.5rem;
    height: 3.5rem;
    padding-top: 0;
    padding-bottom: 0;
  }

  .companion-landing-header__brand {
    grid-column: 1;
    grid-row: 1;
    padding-right: 0.75rem;
  }

  .companion-site .tr-landing-header .keyra-header-logo-link__img,
  .companion-landing-header__brand .keyra-header-logo-link__img {
    height: 2.5rem;
  }

  .companion-landing-header__spacer {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  .companion-landing-header__toolbar {
    grid-column: 3;
    grid-row: 1;
    gap: 0;
    padding-left: 0;
  }
}

.tr-landing-header .companion-landing-header__toolbar {
  align-items: center;
}

.tr-landing-header .companion-landing-header__launcher {
  display: flex;
  align-items: center;
}
.tr-landing-header a.tr-header-nav-link:hover,
.tr-landing-header a.tr-header-nav-link:visited,
.tr-landing-header a.tr-header-nav-link:active,
.tr-landing-header a.tr-header-nav-link:focus-visible {
  text-decoration: none;
  pointer-events: auto;
}

.keyra-header-logo-link {
  gap: 2px;
  text-decoration: none;
}

.keyra-header-logo-link__img {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
}

.keyra-header-logo-link__tagline {
  display: block;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  font-family: var(--keyra-font-sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 15px;
  letter-spacing: 0.025em;
  color: rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .keyra-header-logo-link__tagline {
    font-size: 11px;
    line-height: 16.5px;
  }
}

@media (min-width: 1280px) {
  .keyra-header-logo-link {
    height: 58.5px;
    min-height: 58.5px;
    max-height: 58.5px;
    justify-content: center;
  }

  .companion-site .tr-landing-header.keyra-site-header-shell > div {
    min-height: 3.5rem;
    align-items: center;
  }
}

.keyra-header-action-access {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 9999px;
  white-space: nowrap;
  font-family: var(--keyra-font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  color: #ffffff;
  background: var(--keyra-accent, #000000);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  transition: opacity 200ms ease-out, background-color 150ms ease-out;
}

.keyra-header-action-access:hover {
  opacity: 0.88;
  color: #ffffff;
}

.keyra-header-action-access:active {
  opacity: 0.82;
  color: #ffffff;
}

.keyra-header-action-access:focus-visible {
  outline: 2px solid var(--keyra-primary);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .keyra-header-action-access {
    height: 2.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

.tr-landing-header.keyra-site-header-shell .keyra-header-action-access {
  margin-right: 0.125rem;
}

.keyra-header-download-app {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 0.625rem 0 0.25rem;
  margin-left: 0.375rem;
  border: 1px solid color-mix(in srgb, var(--keyra-border) 90%, transparent);
  border-radius: var(--keyra-radius-pill);
  background: #f8f8f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: var(--keyra-primary);
  font-family: var(--keyra-font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 150ms ease-out,
    background-color 150ms ease-out,
    box-shadow 150ms ease-out;
}

.keyra-header-download-app:hover {
  border-color: rgba(0, 0, 0, 0.14);
  background: var(--keyra-bg);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.keyra-header-download-app:focus-visible {
  outline: 2px solid var(--keyra-primary);
  outline-offset: 3px;
}

.keyra-header-download-app__icon {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 0.4375rem;
  object-fit: cover;
}

.keyra-header-download-app__label {
  color: #171717;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.keyra-header-auth-placeholder {
  display: inline-flex;
  flex-shrink: 0;
  height: 2.5rem;
  min-width: 2.5rem;
}

@media (min-width: 768px) {
  .keyra-header-auth-placeholder {
    min-width: 8rem;
  }
}

.tr-landing-header .companion-landing-header__toolbar {
  align-items: center;
}

.tr-landing-header .companion-landing-header__launcher {
  display: flex;
  align-items: center;
}

@media (max-width: 639px) {
  .companion-site .tr-landing-header.keyra-site-header-shell .keyra-header-download-app__icon {
    width: 1.625rem;
    height: 1.625rem;
  }

  .companion-site .tr-landing-header.keyra-site-header-shell .keyra-account-menu__trigger {
    width: 2.5rem;
    max-width: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    justify-content: center;
  }

  .companion-site .tr-landing-header.keyra-site-header-shell .keyra-account-menu__label,
  .companion-site .tr-landing-header.keyra-site-header-shell .keyra-account-menu__chevron {
    display: none !important;
  }
}

/* Legacy selectors kept for older markup paths */
@media (max-width: 639px) {
  .tr-landing-header .keyra-header-download-app__icon {
    width: 1.625rem;
    height: 1.625rem;
  }

  .tr-landing-header .keyra-account-menu__trigger {
    width: 2.5rem;
    max-width: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    justify-content: center;
  }

  .tr-landing-header .keyra-account-menu__label,
  .tr-landing-header .keyra-account-menu__chevron {
    display: none !important;
  }
}

@media (max-width: 399px) {
  .companion-site .tr-landing-header > div {
    gap: 0.375rem;
    padding-inline: max(0.625rem, env(safe-area-inset-left, 0px))
      max(0.625rem, env(safe-area-inset-right, 0px));
  }

  .companion-site .tr-landing-header .keyra-header-logo-link {
    min-width: 0;
    max-width: min(44vw, 10rem);
  }

  .companion-site .tr-landing-header .keyra-header-logo-link__tagline {
    font-size: 9px;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .companion-site .tr-landing-header .companion-landing-header__toolbar {
    gap: 0.125rem;
    flex-shrink: 0;
  }

  .companion-site .tr-landing-header .companion-landing-header__launcher {
    margin-inline: 0.125rem;
  }

  .companion-site .tr-landing-header .keyra-account-menu {
    margin-right: 0;
  }
}
