:root {
  --casepath-shell-ink: #131b2e;
  --casepath-shell-paper: #fafaf8;
  --casepath-shell-line: #e2e8f0;
}

.stitch-shell {
  position: sticky;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid var(--casepath-shell-line);
  background: rgba(250, 250, 248, 0.97);
  backdrop-filter: blur(14px);
}

.stitch-shell > .stitch-nav {
  width: min(100%, 1600px);
  min-height: 80px;
  margin: 0 auto;
  padding: 0 38px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

.stitch-shell .stitch-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
}

.stitch-shell .stitch-brand-logo {
  display: block;
  width: 164px;
  height: auto;
}

.stitch-shell .stitch-nav-links,
.stitch-shell .stitch-nav-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1.4rem, 3vw, 3rem);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.stitch-shell .stitch-nav-links a,
.stitch-shell .stitch-nav-account a {
  color: var(--casepath-shell-ink);
  text-decoration: none;
}

.stitch-shell .stitch-nav-links a {
  transition: color 160ms ease, border-color 160ms ease;
}

.stitch-shell .stitch-login {
  border-bottom: 2px solid var(--casepath-shell-ink);
}

.stitch-shell :is(.stitch-nav-links, .stitch-nav-account, .stitch-avatar-menu)[hidden] {
  display: none;
}

.stitch-shell .stitch-menu-button {
  display: none;
}

.stitch-shell .stitch-avatar-wrap {
  position: relative;
}

.stitch-shell .stitch-avatar-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--casepath-shell-ink);
  border-radius: 50%;
  background: var(--casepath-shell-ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.stitch-shell .stitch-avatar-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 230px;
  padding: 0.6rem;
  display: grid;
  gap: 0.2rem;
  border: 1px solid var(--casepath-shell-line);
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

.stitch-shell .stitch-avatar-menu :is(a, button) {
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--casepath-shell-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

@media (max-width: 820px) {
  .stitch-shell > .stitch-nav {
    min-height: 64px;
    padding: 0 16px;
  }

  .stitch-shell .stitch-brand-logo {
    width: 138px;
  }

  .stitch-shell .stitch-menu-button {
    justify-self: end;
    width: 44px;
    height: 44px;
    display: grid;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--casepath-shell-line);
    background: transparent;
  }

  .stitch-shell .stitch-menu-button span {
    position: static;
    inset: auto;
    width: 17px;
    height: 1px;
    display: block;
    background: var(--casepath-shell-ink);
    transform: none;
  }

  .stitch-shell .stitch-nav-links,
  .stitch-shell .stitch-nav-account {
    position: fixed;
    inset: 64px 14px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.8rem;
    border: 1px solid var(--casepath-shell-line);
    background: #fff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
  }

  body.menu-open .stitch-shell :is(.stitch-nav-links, .stitch-nav-account):not([hidden]) {
    display: flex;
  }

  .stitch-shell :is(.stitch-nav-links, .stitch-nav-account) > a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stitch-shell *,
  .stitch-shell *::before,
  .stitch-shell *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Shared shell bridge for the remaining generated product pages. */
.casepath-unified-page {
  background: var(--casepath-shell-paper);
  color: var(--casepath-shell-ink);
}

.casepath-unified-page > .flex.pt-20 {
  padding-top: 0;
}

body[data-stitch-direct-source="contact"] main {
  height: auto;
  min-height: calc(100vh - 80px - 140px);
}

body[data-stitch-direct-source="legal"] > main {
  flex-wrap: wrap;
}

body[data-stitch-direct-source="legal"] > main > .product-truth-strip {
  flex-basis: 100%;
  min-width: 0;
}

body[data-stitch-direct-source="legal"] > main > article {
  min-width: 0;
}

.casepath-unified-page > footer,
body[data-stitch-direct-source="contact"] > footer {
  border-color: var(--casepath-shell-line);
  background: #f1f3f5;
}

@media (max-width: 820px) {
  .casepath-unified-page > .flex.pt-20 > main {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-inline: 1rem;
  }

  body[data-stitch-direct-source="contact"] main {
    min-height: calc(100vh - 64px);
    padding: 3rem 1rem;
  }

}
.casepath-primary-link {
  color: #fff !important;
}
