body.recipe-shell {
  --recipe-shell-header-height: 4rem;
  --recipe-shell-bottom-nav-height: 4.25rem;
  min-width: 0;
  background: var(--tblr-bg-surface-secondary);
}

.recipe-shell-skip-link {
  position: fixed;
  z-index: 1090;
  top: .5rem;
  left: max(.5rem, env(safe-area-inset-left));
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: .5rem .875rem;
  border-radius: var(--tblr-border-radius);
  color: var(--tblr-body-color);
  background: var(--tblr-bg-surface);
  box-shadow: var(--tblr-box-shadow-dropdown);
  font-weight: var(--tblr-font-weight-semibold);
  transform: translateY(calc(-100% - 1rem));
  transition: transform .15s ease-out;
}

.recipe-shell-skip-link:focus,
.recipe-shell-skip-link:focus-visible {
  outline: .125rem solid var(--tblr-primary);
  outline-offset: .125rem;
  transform: translateY(0);
}

.recipe-shell-header {
  position: sticky;
  z-index: 1020;
  top: 0;
  min-height: var(--recipe-shell-header-height);
  border-bottom: var(--tblr-border-width) solid var(--tblr-border-color);
  background: var(--tblr-bg-surface);
}

.recipe-shell-header-inner {
  display: flex;
  min-width: 0;
  min-height: var(--recipe-shell-header-height);
  flex-wrap: nowrap;
  align-items: center;
  gap: .75rem;
}

.recipe-shell-brand {
  display: flex;
  min-width: 0;
  min-height: 2.75rem;
  flex: 0 1 auto;
  align-items: center;
  margin: 0;
  padding: 0;
}

.recipe-shell-brand > .avatar {
  flex: 0 0 auto;
}

.recipe-shell-brand-copy {
  min-width: 0;
  margin-left: .5rem;
  line-height: 1.2;
  text-align: left;
}

.recipe-shell-brand-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-shell-primary-nav {
  position: fixed;
  z-index: 1030;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  min-height: calc(var(--recipe-shell-bottom-nav-height) + env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: .25rem max(.5rem, env(safe-area-inset-right)) calc(.25rem + env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left));
  border-top: var(--tblr-border-width) solid var(--tblr-border-color);
  background: var(--tblr-bg-surface);
  box-shadow: 0 -.25rem .75rem rgba(24, 36, 51, .06);
}

.recipe-shell-nav-link {
  display: flex;
  min-width: 2.75rem;
  min-height: 3.75rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .125rem;
  padding: .375rem .25rem;
  border-radius: var(--tblr-border-radius);
  color: var(--tblr-secondary-color);
  font-size: .75rem;
  font-weight: var(--tblr-font-weight-medium);
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
}

.recipe-shell-nav-link:hover,
.recipe-shell-nav-link:focus-visible {
  color: var(--tblr-primary);
  background: var(--tblr-bg-surface-secondary);
  text-decoration: none;
}

.recipe-shell-nav-link:focus-visible,
.recipe-shell-account-trigger:focus-visible,
.recipe-shell-account-link:focus-visible,
.recipe-shell-logout:focus-visible,
.recipe-shell-brand:focus-visible {
  outline: .125rem solid var(--tblr-primary);
  outline-offset: .125rem;
}

.recipe-shell-nav-link[aria-current="page"] {
  color: var(--tblr-primary);
  background: var(--tblr-primary-lt);
}

.recipe-shell-nav-icon,
.recipe-shell-nav-icon .icon {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
}

.recipe-shell-account {
  flex: 0 0 auto;
  margin-left: auto;
}

.recipe-shell-account-trigger {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
}

.recipe-shell-account-trigger .avatar {
  width: 2rem;
  height: 2rem;
  pointer-events: none;
}

@media (max-width: 767.98px) {
  .recipe-shell-account-trigger,
  .recipe-shell-account-trigger:hover,
  .recipe-shell-account-trigger:active {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
}

.recipe-shell-account-menu {
  width: min(calc(100vw - 1.5rem), 19rem);
  max-height: calc(100dvh - var(--recipe-shell-header-height) - 1rem);
  inset: calc(var(--recipe-shell-header-height) + .5rem) max(.75rem, env(safe-area-inset-right)) auto auto;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: var(--tblr-border-width) solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius-lg);
  background: var(--tblr-bg-surface);
  box-shadow: var(--tblr-box-shadow-dropdown);
}

.recipe-shell-account-menu:popover-open {
  display: grid;
}

.recipe-shell-account-menu:not(:popover-open) {
  display: none;
}

.recipe-shell-account-menu::backdrop {
  background: transparent;
}

.recipe-shell-account-heading {
  display: flex;
  min-width: 0;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem;
}

.recipe-shell-account-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recipe-shell-account-links {
  display: grid;
  padding: .25rem;
  border-top: var(--tblr-border-width) solid var(--tblr-border-color);
}

.recipe-shell-account-link {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  padding: .625rem .75rem;
  border-radius: var(--tblr-border-radius);
  color: var(--tblr-body-color);
  text-decoration: none;
}

.recipe-shell-account-link:hover,
.recipe-shell-account-link:focus-visible,
.recipe-shell-account-link[aria-current="page"] {
  color: var(--tblr-primary);
  background: var(--tblr-bg-surface-secondary);
  text-decoration: none;
}

.recipe-shell-logout-form {
  padding: .5rem;
  border-top: var(--tblr-border-width) solid var(--tblr-border-color);
}

.recipe-shell-logout {
  min-height: 2.75rem;
  justify-content: flex-start;
  gap: .5rem;
}

.recipe-shell-main {
  min-width: 0;
  padding-top: .5rem;
  padding-bottom: calc(var(--recipe-shell-bottom-nav-height) + env(safe-area-inset-bottom));
  outline: 0;
}

.recipe-shell .recipe-page-header > .row > .col > .btn-link {
  min-height: 2.75rem;
  margin-top: -.125rem;
  margin-bottom: .125rem !important;
}

.recipe-shell .recipe-page-header > .row > .col-auto .btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
}

@media (max-width: 359.98px) {
  .recipe-shell .recipe-page-header > .row {
    --tblr-gutter-x: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: .5rem;
  }

  .recipe-shell .recipe-page-header > .row > .col,
  .recipe-shell .recipe-page-header > .row > .col-auto {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .recipe-shell .recipe-page-header > .row > .col-auto {
    margin-left: 0 !important;
  }

  .recipe-shell .recipe-page-header > .row > .col-auto > .btn-list {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recipe-shell-skip-link {
    transition: none;
  }
}

@media (min-width: 768px) {
  .recipe-shell-main {
    /* The shell is the single owner of the space below the global header.
     * Individual recipe surfaces start flush, avoiding a compounded gap. */
    padding-top: .5rem;
    padding-bottom: 0;
  }

  .recipe-shell-primary-nav {
    position: static;
    display: flex;
    min-height: 2.75rem;
    align-self: stretch;
    align-items: center;
    gap: .25rem;
    margin-left: .75rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .recipe-shell-nav-link {
    min-height: 2.75rem;
    flex-direction: row;
    gap: .375rem;
    padding: .5rem .625rem;
    font-size: var(--tblr-body-font-size);
    white-space: nowrap;
  }

  .recipe-shell-nav-icon,
  .recipe-shell-nav-icon .icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}
