.has-app-nav {
  --app-nav-height: 62px;
  --app-nav-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(var(--app-nav-height) + var(--app-nav-bottom) + 28px);
}

.app-nav {
  --app-nav-active-ink: #ffe2a8;
  --app-nav-active-paper: #6b442f;
  box-sizing: border-box;
  position: fixed;
  z-index: 85;
  inset-inline: max(10px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  bottom: var(--app-nav-bottom);
  width: auto;
  max-width: 620px;
  min-height: var(--app-nav-height);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid #a26e50;
  border-radius: 30px;
  background: #492c20;
  box-shadow: 0 8px 28px #492c2055;
}

.app-nav a {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 5px 2px;
  border-radius: 12px;
  color: #f5e1cf;
  font-family: var(--samarqand);
  font-weight: 500;
  font-size: clamp(10px, 3.3vw, 13px);
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.app-nav a[aria-current=page] {
  color: var(--app-nav-active-ink);
  background: var(--app-nav-active-paper);
  font-weight: 700;
}

.app-nav a:focus-visible {
  outline: 2px solid var(--app-nav-active-ink);
  outline-offset: -3px;
}

.site-header .header-inner > .brand { grid-column: 2; }
.site-header .header-inner > .header-actions { grid-column: 3; }

.app-nav a.app-nav-home {
  position: relative;
  grid-column: 3;
  align-content: end;
  padding-top: 32px;
  font-weight: 600;
  background: transparent;
}

.app-nav a.app-nav-home[aria-current=page] { font-weight: 700; }

.app-nav-home-mark {
  position: absolute;
  top: -23px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 50px;
  height: 50px;
  border: 1px solid #a26e50;
  border-radius: 50%;
  background: #f3dfc6;
  box-shadow: 0 3px 10px #00000018;
}

.app-nav-home-mark img { display: block; width: 42px; height: auto; }
.app-nav-home[aria-current=page] .app-nav-home-mark { border: 2px solid var(--app-nav-active-ink); }

.has-app-nav .theme-toggle, .has-app-nav .toast {
  bottom: calc(var(--app-nav-height) + var(--app-nav-bottom) + 16px);
}
